diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-09-08 09:14:57 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-09-08 09:14:57 +0000 |
commit | 56509d22d601b60bae888224d969dc4148bb9053 (patch) | |
tree | 93cfd9d977e409bc3adbf32e2cc2b739d5dbd140 /app/assets/javascripts | |
parent | 8db9d8ff0a62674d4a8ede126b638d06b43fa3da (diff) | |
parent | 3d9b6bc2b98583a5220870025e942077c9303eaf (diff) | |
download | gitlab-ce-56509d22d601b60bae888224d969dc4148bb9053.tar.gz |
Merge branch 'backport-issues-controller-changes' into 'master'
Move issues index variable setting to a method
See merge request !14048
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/filtered_search/filtered_search_manager.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index 038239bf466..9178fec085a 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -332,7 +332,14 @@ class FilteredSearchManager { const removeElements = []; [].forEach.call(this.tokensContainer.children, (t) => { - if (t.classList.contains('js-visual-token')) { + let canClearToken = t.classList.contains('js-visual-token'); + + if (canClearToken) { + const tokenKey = t.querySelector('.name').textContent.trim(); + canClearToken = this.canEdit && this.canEdit(tokenKey); + } + + if (canClearToken) { removeElements.push(t); } }); @@ -411,8 +418,14 @@ class FilteredSearchManager { }); } + // allows for modifying params array when a param can't be included in the URL (e.g. Service Desk) + getAllParams(urlParams) { + return this.modifyUrlParams ? this.modifyUrlParams(urlParams) : urlParams; + } + loadSearchParamsFromURL() { - const params = gl.utils.getUrlParamsArray(); + const urlParams = gl.utils.getUrlParamsArray(); + const params = this.getAllParams(urlParams); const usernameParams = this.getUsernameParams(); let hasFilteredSearch = false; |