diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-10-30 12:10:09 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-30 12:10:09 +0300 |
commit | cd784a80d7c779edc468d6255ffdeb8ea692661a (patch) | |
tree | db32f323b5aa0af3fcba743e1b871991d41b97d2 /app/assets/javascripts/boards/filtered_search_boards.js | |
parent | 192049a61039220bb62e88d1d173d0aeaa555297 (diff) |
[CE backport] Saved configuration for issue board
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; } } |