From e25b7fce75d0a03db1f65a34b447c619b5b401aa Mon Sep 17 00:00:00 2001 From: puni9869 Date: Thu, 5 Oct 2023 06:16:07 +0530 Subject: [PATCH 01/12] Adding archive label functionality for label selector in issue detail page --- .../issue/labels/labels_selector_field.tmpl | 32 ++++++++++++-- web_src/css/repo/issue-label.css | 5 +++ web_src/js/features/repo-issue.js | 44 +++++++++++++------ web_src/js/index.js | 3 +- 4 files changed, 66 insertions(+), 18 deletions(-) diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl index 1599f2deb62b..72ce7225670c 100644 --- a/templates/repo/issue/labels/labels_selector_field.tmpl +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -11,6 +11,18 @@ {{svg "octicon-search" 16}} +
+ + +
{{end}} {{ctx.Locale.Tr "repo.issues.new.clear_labels"}} {{if or .Labels .OrgLabels}} @@ -21,8 +33,14 @@
{{end}} {{$previousExclusiveScope = $exclusiveScope}} - {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} - {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}}
+ {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} + {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}} + {{if .IsArchived}} + + {{svg "octicon-info"}} + + {{end}} +
{{end}}
{{$previousExclusiveScope = "_no_scope"}} @@ -32,8 +50,14 @@
{{end}} {{$previousExclusiveScope = $exclusiveScope}} - {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} - {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}}
+ {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} + {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}} + {{if .IsArchived}} + + {{svg "octicon-info"}} + + {{end}} +
{{end}} {{else}}
{{ctx.Locale.Tr "repo.issues.new.no_items"}}
diff --git a/web_src/css/repo/issue-label.css b/web_src/css/repo/issue-label.css index 1f83e81d964e..29035ece0e23 100644 --- a/web_src/css/repo/issue-label.css +++ b/web_src/css/repo/issue-label.css @@ -45,3 +45,8 @@ .label-operation .label { height: fit-content; } + +.archived-label-hint { + float: right; + margin-left: 1rem; +} diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 4f4103bb2135..172e5c225384 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -230,7 +230,7 @@ export function initRepoPullRequestUpdate() { const redirect = $this.data('redirect'); $this.addClass('loading'); $.post($this.data('do'), { - _csrf: csrfToken + _csrf: csrfToken, }).done((data) => { if (data.redirect) { window.location.href = data.redirect; @@ -249,7 +249,7 @@ export function initRepoPullRequestUpdate() { $pullUpdateButton.find('.button-text').text($choice.text()); $pullUpdateButton.data('do', $url); } - } + }, }); } @@ -270,7 +270,8 @@ export function initRepoPullRequestAllowMaintainerEdit() { let url = $checkbox.attr('data-url'); url += '/set_allow_maintainer_edit'; $checkbox.checkbox('set disabled'); - $.ajax({url, type: 'POST', + $.ajax({ + url, type: 'POST', data: {_csrf: csrfToken, allow_maintainer_edit: checked}, error: () => { showTemporaryTooltip($checkbox[0], promptError); @@ -293,7 +294,7 @@ export function initRepoIssueReferenceRepositorySearch() { $.each(response.data, (_r, repo) => { filteredResponse.results.push({ name: htmlEscape(repo.repository.full_name), - value: repo.repository.full_name + value: repo.repository.full_name, }); }); return filteredResponse; @@ -304,7 +305,7 @@ export function initRepoIssueReferenceRepositorySearch() { const $form = $choice.closest('form'); $form.attr('action', `${appSubUrl}/${_text}/issues/new`); }, - fullTextSearch: true + fullTextSearch: true, }); } @@ -422,7 +423,7 @@ export function initRepoPullRequestReview() { } window.scrollTo({ top: commentDiv.offset().top - offset, - behavior: 'instant' + behavior: 'instant', }); } } @@ -511,9 +512,9 @@ export function initRepoPullRequestReview() { if (commentCloud.length === 0 && !ntr.find('button[name="pending_review"]').length) { const html = await $.get($(this).closest('[data-new-comment-url]').attr('data-new-comment-url')); td.html(html); - td.find("input[name='line']").val(idx); - td.find("input[name='side']").val(side === 'left' ? 'previous' : 'proposed'); - td.find("input[name='path']").val(path); + td.find('input[name=\'line\']').val(idx); + td.find('input[name=\'side\']').val(side === 'left' ? 'previous' : 'proposed'); + td.find('input[name=\'path\']').val(path); const editor = await initComboMarkdownEditor(td.find('.combo-markdown-editor')); editor.focus(); @@ -584,7 +585,7 @@ export function initRepoIssueTitleEdit() { } $.post(update_url, { _csrf: csrfToken, - target_branch: targetBranch + target_branch: targetBranch, }).always(() => { window.location.reload(); }); @@ -597,7 +598,7 @@ export function initRepoIssueTitleEdit() { } else { $.post($(this).attr('data-update-url'), { _csrf: csrfToken, - title: $editInput.val() + title: $editInput.val(), }, (data) => { $editInput.val(data.title); $issueTitle.text(data.title); @@ -623,7 +624,7 @@ export function initRepoIssueBranchSelect() { // Replace branch name to keep translation from HTML template selectionTextField.html(selectionTextField.html().replace( `${baseName}:${branchNameOld}`, - `${baseName}:${branchNameNew}` + `${baseName}:${branchNameNew}`, )); selectionTextField.data('branch', branchNameNew); // update branch name in setting }; @@ -657,7 +658,7 @@ export function initIssueTemplateCommentEditors($commentForm) { const editor = await initComboMarkdownEditor($markdownEditor, { onContentChanged: (editor) => { $formField.val(editor.value()); - } + }, }); $formField.on('focus', async () => { @@ -680,3 +681,20 @@ export function initIssueTemplateCommentEditors($commentForm) { initCombo($(el)); } } + +export function initArchivedLabelHandler() { + const archivedLabelEl = document.querySelector('#archived-filter-checkbox-issue-page'); + if (!archivedLabelEl) { + return; + } + const archivedLabels = document.querySelectorAll('[data-is-archived]'); + const archivedElToggle = () => { + for (const label of archivedLabels) { + toggleElem(label, archivedLabelEl.checked || label.classList.contains('checked')); + } + }; + archivedElToggle(); + archivedLabelEl.addEventListener('change', () => { + archivedElToggle(); + }); +} diff --git a/web_src/js/index.js b/web_src/js/index.js index 7ae4b0c0c7ac..4713618506b0 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -31,7 +31,7 @@ import { initRepoIssueWipTitle, initRepoPullRequestMergeInstruction, initRepoPullRequestAllowMaintainerEdit, - initRepoPullRequestReview, initRepoIssueSidebarList + initRepoPullRequestReview, initRepoIssueSidebarList, initArchivedLabelHandler, } from './features/repo-issue.js'; import { initRepoEllipsisButton, @@ -152,6 +152,7 @@ onDomReady(() => { initRepoIssueDue(); initRepoIssueList(); initRepoIssueSidebarList(); + initArchivedLabelHandler(); initRepoIssueReferenceRepositorySearch(); initRepoIssueTimeTracking(); initRepoIssueWipTitle(); From 8db7e068ecd0e8381b0e3a64cf1fa36eef737563 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Thu, 5 Oct 2023 06:27:06 +0530 Subject: [PATCH 02/12] Reverting the linted code --- web_src/js/features/repo-issue.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 172e5c225384..0b5f7e8e6182 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -230,7 +230,7 @@ export function initRepoPullRequestUpdate() { const redirect = $this.data('redirect'); $this.addClass('loading'); $.post($this.data('do'), { - _csrf: csrfToken, + _csrf: csrfToken }).done((data) => { if (data.redirect) { window.location.href = data.redirect; @@ -249,7 +249,7 @@ export function initRepoPullRequestUpdate() { $pullUpdateButton.find('.button-text').text($choice.text()); $pullUpdateButton.data('do', $url); } - }, + } }); } @@ -270,8 +270,7 @@ export function initRepoPullRequestAllowMaintainerEdit() { let url = $checkbox.attr('data-url'); url += '/set_allow_maintainer_edit'; $checkbox.checkbox('set disabled'); - $.ajax({ - url, type: 'POST', + $.ajax({url, type: 'POST', data: {_csrf: csrfToken, allow_maintainer_edit: checked}, error: () => { showTemporaryTooltip($checkbox[0], promptError); @@ -294,7 +293,7 @@ export function initRepoIssueReferenceRepositorySearch() { $.each(response.data, (_r, repo) => { filteredResponse.results.push({ name: htmlEscape(repo.repository.full_name), - value: repo.repository.full_name, + value: repo.repository.full_name }); }); return filteredResponse; @@ -305,7 +304,7 @@ export function initRepoIssueReferenceRepositorySearch() { const $form = $choice.closest('form'); $form.attr('action', `${appSubUrl}/${_text}/issues/new`); }, - fullTextSearch: true, + fullTextSearch: true }); } @@ -423,7 +422,7 @@ export function initRepoPullRequestReview() { } window.scrollTo({ top: commentDiv.offset().top - offset, - behavior: 'instant', + behavior: 'instant' }); } } @@ -512,9 +511,9 @@ export function initRepoPullRequestReview() { if (commentCloud.length === 0 && !ntr.find('button[name="pending_review"]').length) { const html = await $.get($(this).closest('[data-new-comment-url]').attr('data-new-comment-url')); td.html(html); - td.find('input[name=\'line\']').val(idx); - td.find('input[name=\'side\']').val(side === 'left' ? 'previous' : 'proposed'); - td.find('input[name=\'path\']').val(path); + td.find("input[name='line']").val(idx); + td.find("input[name='side']").val(side === 'left' ? 'previous' : 'proposed'); + td.find("input[name='path']").val(path); const editor = await initComboMarkdownEditor(td.find('.combo-markdown-editor')); editor.focus(); @@ -585,7 +584,7 @@ export function initRepoIssueTitleEdit() { } $.post(update_url, { _csrf: csrfToken, - target_branch: targetBranch, + target_branch: targetBranch }).always(() => { window.location.reload(); }); @@ -598,7 +597,7 @@ export function initRepoIssueTitleEdit() { } else { $.post($(this).attr('data-update-url'), { _csrf: csrfToken, - title: $editInput.val(), + title: $editInput.val() }, (data) => { $editInput.val(data.title); $issueTitle.text(data.title); @@ -624,7 +623,7 @@ export function initRepoIssueBranchSelect() { // Replace branch name to keep translation from HTML template selectionTextField.html(selectionTextField.html().replace( `${baseName}:${branchNameOld}`, - `${baseName}:${branchNameNew}`, + `${baseName}:${branchNameNew}` )); selectionTextField.data('branch', branchNameNew); // update branch name in setting }; @@ -658,7 +657,7 @@ export function initIssueTemplateCommentEditors($commentForm) { const editor = await initComboMarkdownEditor($markdownEditor, { onContentChanged: (editor) => { $formField.val(editor.value()); - }, + } }); $formField.on('focus', async () => { From 90116d88a52d6293a8c5a8b741557cb013b0efd1 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Thu, 5 Oct 2023 23:50:53 +0530 Subject: [PATCH 03/12] Hiding the labels when there is no archived label is tagged in issue and pr detail page label drop down --- .../repo/issue/labels/labels_selector_field.tmpl | 12 ------------ web_src/js/features/repo-issue-list.js | 6 +++++- web_src/js/features/repo-issue.js | 14 ++++---------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl index 72ce7225670c..d5a0cfaa7130 100644 --- a/templates/repo/issue/labels/labels_selector_field.tmpl +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -11,18 +11,6 @@ {{svg "octicon-search" 16}} -
- - -
{{end}} {{ctx.Locale.Tr "repo.issues.new.clear_labels"}} {{if or .Labels .OrgLabels}} diff --git a/web_src/js/features/repo-issue-list.js b/web_src/js/features/repo-issue-list.js index a9a8628ba77d..db5355454117 100644 --- a/web_src/js/features/repo-issue-list.js +++ b/web_src/js/features/repo-issue-list.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import {updateIssuesMeta} from './repo-issue.js'; -import {toggleElem} from '../utils/dom.js'; +import {toggleElem, hideElem} from '../utils/dom.js'; import {htmlEscape} from 'escape-goat'; import {confirmModal} from './comp/ConfirmModal.js'; import {showErrorToast} from '../modules/toast.js'; @@ -194,6 +194,10 @@ function initArchivedLabelFilter() { const url = new URL(window.location.href); const archivedLabels = document.querySelectorAll('[data-is-archived]'); + if (!archivedLabels.length) { + hideElem($('.archived-label-filter')); + return; + } const selectedLabels = (url.searchParams.get('labels') || '') .split(',') .map((id) => id < 0 ? `${~id + 1}` : id); // selectedLabels contains -ve ids, which are excluded so convert any -ve value id to +ve diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 0b5f7e8e6182..5bea723a8a54 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -682,18 +682,12 @@ export function initIssueTemplateCommentEditors($commentForm) { } export function initArchivedLabelHandler() { - const archivedLabelEl = document.querySelector('#archived-filter-checkbox-issue-page'); + const archivedLabelEl = document.querySelector('.archived-label-hint'); if (!archivedLabelEl) { return; } const archivedLabels = document.querySelectorAll('[data-is-archived]'); - const archivedElToggle = () => { - for (const label of archivedLabels) { - toggleElem(label, archivedLabelEl.checked || label.classList.contains('checked')); - } - }; - archivedElToggle(); - archivedLabelEl.addEventListener('change', () => { - archivedElToggle(); - }); + for (const label of archivedLabels) { + toggleElem(label, label.classList.contains('checked')); + } } From 1a55eae8838edfb64505ab8ebdff21bf35f5705e Mon Sep 17 00:00:00 2001 From: puni9869 Date: Fri, 6 Oct 2023 00:00:18 +0530 Subject: [PATCH 04/12] using archived label template --- .../repo/issue/labels/labels_selector_field.tmpl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl index d5a0cfaa7130..33a5cf2d3e4a 100644 --- a/templates/repo/issue/labels/labels_selector_field.tmpl +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -23,11 +23,7 @@ {{$previousExclusiveScope = $exclusiveScope}} {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}} - {{if .IsArchived}} - - {{svg "octicon-info"}} - - {{end}} +

{{template "repo/issue/labels/label_archived" .}}

{{end}}
@@ -40,11 +36,7 @@ {{$previousExclusiveScope = $exclusiveScope}} {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}} - {{if .IsArchived}} - - {{svg "octicon-info"}} - - {{end}} +

{{template "repo/issue/labels/label_archived" .}}

{{end}} {{else}} From 107accbae2d58341c95ad2df07f5a1a1e9cee90c Mon Sep 17 00:00:00 2001 From: puni9869 Date: Sat, 7 Oct 2023 14:16:35 +0530 Subject: [PATCH 05/12] Style correction Signed-off-by: puni9869 --- web_src/css/repo/issue-label.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo/issue-label.css b/web_src/css/repo/issue-label.css index 29035ece0e23..9b4b144a0090 100644 --- a/web_src/css/repo/issue-label.css +++ b/web_src/css/repo/issue-label.css @@ -48,5 +48,5 @@ .archived-label-hint { float: right; - margin-left: 1rem; + margin: -12px; } From 2da88f7fed368e96f94358cb4e245fe33697eb44 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Mon, 9 Oct 2023 11:44:38 +0530 Subject: [PATCH 06/12] Indentation for anchor tag --- 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 33a5cf2d3e4a..d24dac46eb3f 100644 --- a/templates/repo/issue/labels/labels_selector_field.tmpl +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -37,7 +37,7 @@ {{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}  {{RenderLabel $.Context .}} {{if .Description}}
{{.Description | RenderEmoji $.Context}}{{end}}

{{template "repo/issue/labels/label_archived" .}}

-
+ {{end}} {{else}}
{{ctx.Locale.Tr "repo.issues.new.no_items"}}
From a3758011bd88e53264025608e66ea282cf355998 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Mon, 9 Oct 2023 11:46:25 +0530 Subject: [PATCH 07/12] Typo --- web_src/js/features/repo-issue-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue-list.js b/web_src/js/features/repo-issue-list.js index db5355454117..ca20cfbe387d 100644 --- a/web_src/js/features/repo-issue-list.js +++ b/web_src/js/features/repo-issue-list.js @@ -195,7 +195,7 @@ function initArchivedLabelFilter() { const archivedLabels = document.querySelectorAll('[data-is-archived]'); if (!archivedLabels.length) { - hideElem($('.archived-label-filter')); + hideElem('.archived-label-filter'); return; } const selectedLabels = (url.searchParams.get('labels') || '') From a43dd0086d19c32b20c83b5fa67acf0b5fcd5700 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Mon, 9 Oct 2023 13:23:27 +0530 Subject: [PATCH 08/12] Similar ui for archived hint. --- templates/repo/issue/filter_actions.tmpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/repo/issue/filter_actions.tmpl b/templates/repo/issue/filter_actions.tmpl index f84a99ff7f9c..a2296f6597bd 100644 --- a/templates/repo/issue/filter_actions.tmpl +++ b/templates/repo/issue/filter_actions.tmpl @@ -29,11 +29,9 @@
{{end}} {{$previousExclusiveScope = $exclusiveScope}} -
+
{{if SliceUtils.Contains $.SelLabelIDs .ID}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}} {{RenderLabel $.Context .}} - {{if .IsArchived}} - {{svg "octicon-info"}} - {{end}} + {{template "repo/issue/labels/label_archived" .}}
{{end}}
From e3bffa71c550de72a7a8bb7e0baaa3009e4d8544 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 13 Oct 2023 18:23:01 +0200 Subject: [PATCH 09/12] Update web_src/js/features/repo-issue.js --- web_src/js/features/repo-issue.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 5bea723a8a54..fbcefab7ca72 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -683,9 +683,7 @@ export function initIssueTemplateCommentEditors($commentForm) { export function initArchivedLabelHandler() { const archivedLabelEl = document.querySelector('.archived-label-hint'); - if (!archivedLabelEl) { - return; - } + if (!archivedLabelEl) return; const archivedLabels = document.querySelectorAll('[data-is-archived]'); for (const label of archivedLabels) { toggleElem(label, label.classList.contains('checked')); From b17d36a89835aa0ebaf92aed1f3b3f1e5ffa0ea8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 13 Oct 2023 18:23:47 +0200 Subject: [PATCH 10/12] Update web_src/js/features/repo-issue.js --- web_src/js/features/repo-issue.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index fbcefab7ca72..24e1e07734ec 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -684,8 +684,7 @@ export function initIssueTemplateCommentEditors($commentForm) { export function initArchivedLabelHandler() { const archivedLabelEl = document.querySelector('.archived-label-hint'); if (!archivedLabelEl) return; - const archivedLabels = document.querySelectorAll('[data-is-archived]'); - for (const label of archivedLabels) { + for (const label of document.querySelectorAll('[data-is-archived]')) { toggleElem(label, label.classList.contains('checked')); } } From 013008e8dd6df742bf0f64994a296f841c253ee0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 13 Oct 2023 18:24:26 +0200 Subject: [PATCH 11/12] Update web_src/js/features/repo-issue.js --- web_src/js/features/repo-issue.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 24e1e07734ec..e57c14f1d651 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -682,8 +682,7 @@ export function initIssueTemplateCommentEditors($commentForm) { } export function initArchivedLabelHandler() { - const archivedLabelEl = document.querySelector('.archived-label-hint'); - if (!archivedLabelEl) return; + if (!document.querySelector('.archived-label-hint')) return; for (const label of document.querySelectorAll('[data-is-archived]')) { toggleElem(label, label.classList.contains('checked')); } From f7813decb5222f5aeb9dd330e957f7af3fc4f6f0 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Sun, 15 Oct 2023 15:12:36 +0530 Subject: [PATCH 12/12] Adding comments --- web_src/js/features/repo-issue.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index e57c14f1d651..2cc0730af646 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -681,6 +681,12 @@ export function initIssueTemplateCommentEditors($commentForm) { } } +// This function used to show and hide archived label on issue/pr +// page in the sidebar where we select the labels +// If we have any archived label tagged to issue and pr. We will show that +// archived label with checked classed otherwise we will hide it +// with the help of this function. +// This function runs globally. export function initArchivedLabelHandler() { if (!document.querySelector('.archived-label-hint')) return; for (const label of document.querySelectorAll('[data-is-archived]')) {