From a52720b5b4da3e324034312f7fe1e29fd22686cc Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Sun, 9 Feb 2025 00:13:41 +0800 Subject: [PATCH 01/41] Add "No data available" display when list is empty (#33517) Add a "No data available" message to be displayed when the list has no data. This improves the user experience by providing clear feedback in an empty state. --------- Co-authored-by: wxiaoguang --- templates/admin/auth/list.tmpl | 2 ++ templates/admin/emails/list.tmpl | 2 ++ templates/admin/notice.tmpl | 2 ++ templates/admin/org/list.tmpl | 2 ++ templates/admin/packages/list.tmpl | 2 ++ templates/admin/repo/list.tmpl | 2 ++ templates/admin/user/list.tmpl | 2 ++ tests/integration/auth_ldap_test.go | 2 +- 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index 7931014b1a..a1e72b742f 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -30,6 +30,8 @@ {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-pencil"}} + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 0dc1fb9d03..b4335aeeec 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -67,6 +67,8 @@ >{{svg "octicon-trash"}} + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index fd475d7157..a4c9dc53fb 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -24,6 +24,8 @@ {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-note" 16}} + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} {{if .Notices}} diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index d5e09939c5..137c42b45d 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -66,6 +66,8 @@ {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-pencil"}} + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 08c11442bc..0c6889b599 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -74,6 +74,8 @@ {{DateUtils.AbsoluteShort .Version.CreatedUnix}} {{svg "octicon-trash"}} + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 08fd893e76..762013af47 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -86,6 +86,8 @@ {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-trash"}} + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 7e4c8854f5..eb3f6cd720 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -109,6 +109,8 @@ + {{else}} + {{ctx.Locale.Tr "no_results_found"}} {{end}} diff --git a/tests/integration/auth_ldap_test.go b/tests/integration/auth_ldap_test.go index 5c50fd0288..0599c43805 100644 --- a/tests/integration/auth_ldap_test.go +++ b/tests/integration/auth_ldap_test.go @@ -279,7 +279,7 @@ func TestLDAPUserSyncWithEmptyUsernameAttribute(t *testing.T) { htmlDoc := NewHTMLParser(t, resp.Body) - tr := htmlDoc.doc.Find("table.table tbody tr") + tr := htmlDoc.doc.Find("table.table tbody tr:not(.no-results-row)") assert.Equal(t, 0, tr.Length()) } From 06088ec672a053b11a20ca6dd21588380d67f396 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 10 Feb 2025 04:39:54 +0800 Subject: [PATCH 02/41] Remove "class-name" from svg icon (#33540) Only use "class" attribute --- web_src/js/components/ActionRunStatus.vue | 12 ++++++------ web_src/js/components/DashboardRepoList.vue | 18 +++++++++--------- .../js/components/RepoBranchTagSelector.vue | 6 +++--- web_src/js/svg.test.ts | 3 +-- web_src/js/svg.ts | 11 +---------- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/web_src/js/components/ActionRunStatus.vue b/web_src/js/components/ActionRunStatus.vue index 96c6c441be..487d2460cc 100644 --- a/web_src/js/components/ActionRunStatus.vue +++ b/web_src/js/components/ActionRunStatus.vue @@ -19,12 +19,12 @@ withDefaults(defineProps<{ diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index 876292fc94..14b7f0dec8 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -367,7 +367,7 @@ export default defineComponent({ otherwise if the "input" handles click event for intermediate status, it breaks the internal state--> @@ -376,7 +376,7 @@ export default defineComponent({
@@ -413,7 +413,7 @@ export default defineComponent({ @@ -432,7 +432,7 @@ export default defineComponent({ class="item navigation tw-py-1" :class="{'disabled': page === 1}" @click="changePage(1)" :title="textFirstPage" > - + - + - + @@ -471,7 +471,7 @@ export default defineComponent({ diff --git a/web_src/js/components/RepoBranchTagSelector.vue b/web_src/js/components/RepoBranchTagSelector.vue index fa5c75af99..820e69d9ab 100644 --- a/web_src/js/components/RepoBranchTagSelector.vue +++ b/web_src/js/components/RepoBranchTagSelector.vue @@ -226,7 +226,7 @@ export default defineComponent({ {{ currentRefShortName }} - +