diff options
author | Simon Knox <psimyn@gmail.com> | 2017-10-24 16:48:41 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-10-31 12:58:35 +0100 |
commit | b04b3d1de783ea70ca81c5f80c86d656ee6d82ea (patch) | |
tree | 10bfe64f496eee2fdd7fdddf1b277ea4c4bf6b97 /app/assets/javascripts/boards/filtered_search_boards.js | |
parent | 18db15244813c4ff1286e1297c9da42798b61b99 (diff) | |
download | gitlab-ce-b04b3d1de783ea70ca81c5f80c86d656ee6d82ea.tar.gz |
apply changes for JS and CSS from gitlab-ee!2912
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2912/
Diffstat (limited to 'app/assets/javascripts/boards/filtered_search_boards.js')
-rw-r--r-- | app/assets/javascripts/boards/filtered_search_boards.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/boards/filtered_search_boards.js b/app/assets/javascripts/boards/filtered_search_boards.js index 3f083655f95..184665f395c 100644 --- a/app/assets/javascripts/boards/filtered_search_boards.js +++ b/app/assets/javascripts/boards/filtered_search_boards.js @@ -11,7 +11,8 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager { // Issue boards is slightly different, we handle all the requests async // instead or reloading the page, we just re-fire the list ajax requests this.isHandledAsync = true; - this.cantEdit = cantEdit; + this.cantEdit = cantEdit.filter(i => typeof i === 'string'); + this.cantEditWithValue = cantEdit.filter(i => typeof i === 'object'); } updateObject(path) { @@ -42,7 +43,9 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager { this.filteredSearchInput.dispatchEvent(new Event('input')); } - canEdit(tokenName) { - return this.cantEdit.indexOf(tokenName) === -1; + canEdit(tokenName, tokenValue) { + if (this.cantEdit.includes(tokenName)) return false; + return this.cantEditWithValue.findIndex(token => token.name === tokenName && + token.value === tokenValue) === -1; } } |