Skip to content

Commit

Permalink
Prevent duplicate issues in patchinfo
Browse files Browse the repository at this point in the history
Closes #8798
  • Loading branch information
Dany Marcoux committed Dec 10, 2019
1 parent be2f95e commit 96387bb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/app/assets/javascripts/webui/patchinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ function addIssuesAjaxBefore() {

issues = $.unique(issues.replace(/ /g, '').split(','));

var currentIssues = $('[name="patchinfo[issueid][]"]').map(function(_, element) {
var issueId = element.id;
if (issueId.startsWith('issueid_cve')) {
return issueId.replace('issueid_cve_', '');
} else {
return issueId.replace('issueid_', '').replace('_', '#');
}
}).toArray();

issues = issues.filter(function(issue) {
return currentIssues.indexOf(issue) === -1;
});

element.data('params', { issues: issues, project: element.data('project') });
});
}
Expand Down

0 comments on commit 96387bb

Please sign in to comment.