From c5834ce0979577383821c1c6e02dd3f211cb1eb3 Mon Sep 17 00:00:00 2001
From: a1012112796 <1012112796@qq.com>
Date: Tue, 9 Jul 2024 11:01:09 +0800
Subject: [PATCH 1/2] Add scroll to issue sidebar dropdowns
as title, fix #31589
Signed-off-by: a1012112796 <1012112796@qq.com>
---
.../repo/issue/assignees/select_menu.tmpl | 24 +++++
.../issue/labels/labels_selector_field.tmpl | 54 +++++-----
.../repo/issue/milestone/select_menu.tmpl | 3 +
templates/repo/issue/new_form.tmpl | 50 +--------
.../repo/issue/projects/select_menu.tmpl | 31 ++++++
.../repo/issue/view_content/sidebar.tmpl | 100 +++++-------------
web_src/js/features/repo-legacy.ts | 2 +-
web_src/js/features/user-auth-webauthn.ts | 4 +
8 files changed, 120 insertions(+), 148 deletions(-)
create mode 100644 templates/repo/issue/assignees/select_menu.tmpl
create mode 100644 templates/repo/issue/projects/select_menu.tmpl
diff --git a/templates/repo/issue/assignees/select_menu.tmpl b/templates/repo/issue/assignees/select_menu.tmpl
new file mode 100644
index 0000000000000..1dfa4eb763476
--- /dev/null
+++ b/templates/repo/issue/assignees/select_menu.tmpl
@@ -0,0 +1,24 @@
+
+ {{svg "octicon-search" 16}}
+
+
+{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}
+
+
diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl
index 3d65a7d8cd542..fc106df4ac07d 100644
--- a/templates/repo/issue/labels/labels_selector_field.tmpl
+++ b/templates/repo/issue/labels/labels_selector_field.tmpl
@@ -13,34 +13,36 @@
{{end}}
{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}
- {{if or .Labels .OrgLabels}}
- {{$previousExclusiveScope := "_no_scope"}}
- {{range .Labels}}
- {{$exclusiveScope := .ExclusiveScope}}
- {{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
-
+
diff --git a/templates/repo/issue/milestone/select_menu.tmpl b/templates/repo/issue/milestone/select_menu.tmpl
index 9b0492ce52480..d53c64d302692 100644
--- a/templates/repo/issue/milestone/select_menu.tmpl
+++ b/templates/repo/issue/milestone/select_menu.tmpl
@@ -6,6 +6,8 @@
{{end}}
{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}
+
+
@@ -149,19 +115,7 @@
{{end}}
{{end}}
- {{if .Reviewers}}
- {{range .Reviewers}}
- {{if .User}}
-
- {{svg "octicon-check"}}
-
- {{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}{{template "repo/search_name" .User}}
-
-
- {{end}}
- {{end}}
- {{end}}
- {{if .TeamReviewers}}
+
@@ -162,35 +164,7 @@
{{end}}
@@ -216,27 +190,7 @@
{{end}}
diff --git a/web_src/js/features/repo-legacy.ts b/web_src/js/features/repo-legacy.ts
index b26803c76dce3..732db01bf2569 100644
--- a/web_src/js/features/repo-legacy.ts
+++ b/web_src/js/features/repo-legacy.ts
@@ -240,7 +240,7 @@ export function initRepoCommentForm() {
initListSubmits('select-reviewers-modify', 'assignees');
function selectItem(select_id, input_id) {
- const $menu = $(`${select_id} .menu`);
+ const $menu = $(`${select_id} .menu:not(.no-select)`);
const $list = $(`.ui${select_id}.list`);
const hasUpdateAction = $menu.data('action') === 'update';
diff --git a/web_src/js/features/user-auth-webauthn.ts b/web_src/js/features/user-auth-webauthn.ts
index 7b7508c4f1461..6279c5fa86ce2 100644
--- a/web_src/js/features/user-auth-webauthn.ts
+++ b/web_src/js/features/user-auth-webauthn.ts
@@ -174,6 +174,10 @@ async function webauthnRegistered(newCredential) {
function webAuthnError(errorType, message) {
const elErrorMsg = document.querySelector(`#webauthn-error-msg`);
+ if (!elErrorMsg) {
+ return;
+ }
+
if (errorType === 'general') {
elErrorMsg.textContent = message || 'unknown error';
} else {
From 6c6f252083ec8105bc68550fdda083bb2649498c Mon Sep 17 00:00:00 2001
From: a1012112796 <1012112796@qq.com>
Date: Tue, 9 Jul 2024 18:33:57 +0800
Subject: [PATCH 2/2] fix lint
Signed-off-by: a1012112796 <1012112796@qq.com>
---
templates/repo/issue/labels/labels_selector_field.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl
index fc106df4ac07d..695c82faf05a6 100644
--- a/templates/repo/issue/labels/labels_selector_field.tmpl
+++ b/templates/repo/issue/labels/labels_selector_field.tmpl
@@ -43,6 +43,6 @@
{{else}}
{{ctx.Locale.Tr "repo.issues.new.no_items"}}
{{end}}
-
+