File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2810,21 +2810,27 @@ function deleteDependencyModal(id, type) {
2810
2810
2811
2811
function initIssueList ( ) {
2812
2812
var repolink = $ ( '#repolink' ) . val ( ) ;
2813
- $ ( '. new-dependency-drop-list' )
2813
+ $ ( '# new-dependency-drop-list' )
2814
2814
. dropdown ( {
2815
2815
apiSettings : {
2816
2816
url : suburl + '/api/v1/repos/' + repolink + '/issues?q={query}' ,
2817
2817
onResponse : function ( response ) {
2818
2818
var filteredResponse = { 'success' : true , 'results' : [ ] } ;
2819
+ var currIssueId = $ ( '#new-dependency-drop-list' ) . data ( 'issue-id' ) ;
2819
2820
// Parse the response from the api to work with our dropdown
2820
2821
$ . each ( response , function ( index , issue ) {
2822
+ // Don't list current issue in the dependency list.
2823
+ if ( issue . id === currIssueId ) {
2824
+ return ;
2825
+ }
2821
2826
filteredResponse . results . push ( {
2822
2827
'name' : '#' + issue . number + ' ' + htmlEncode ( issue . title ) ,
2823
2828
'value' : issue . id
2824
2829
} ) ;
2825
2830
} ) ;
2826
2831
return filteredResponse ;
2827
2832
} ,
2833
+ cache : false ,
2828
2834
} ,
2829
2835
2830
2836
fullTextSearch : true
Original file line number Diff line number Diff line change 321
321
<form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/dependency/add" id="addDependencyForm">
322
322
{{$.CsrfTokenHtml}}
323
323
<div class="ui fluid action input">
324
- <div class="ui search selection dropdown new-dependency-drop-list" style="min-width: 13.9rem;border-radius: 4px 0 0 4px;border-right: 0;white-space: nowrap;">
324
+ <div class="ui search selection dropdown" id=" new-dependency-drop-list" data-issue-id="{{.Issue.ID}} " style="min-width: 13.9rem;border-radius: 4px 0 0 4px;border-right: 0;white-space: nowrap;">
325
325
<input name="newDependency" type="hidden">
326
326
<i class="dropdown icon"></i>
327
327
<input type="text" class="search">
You can’t perform that action at this time.
0 commit comments