Commit d84a42bd authored by Simon Knox's avatar Simon Knox Committed by Oswaldo Ferreira

only hide board config labels

parent cb61fd1d
...@@ -87,7 +87,10 @@ $(() => { ...@@ -87,7 +87,10 @@ $(() => {
Store.filter.path = [querystring].concat( Store.filter.path = [querystring].concat(
Store.filter.path.split('&').filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null) Store.filter.path.split('&').filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null)
).join('&'); ).join('&');
this.cantEdit.push(tokenName); this.cantEdit.push({
tokenName,
value,
});
}; };
updateFilterPath('milestone_title', this.milestoneTitle, 'milestone'); updateFilterPath('milestone_title', this.milestoneTitle, 'milestone');
...@@ -104,7 +107,10 @@ $(() => { ...@@ -104,7 +107,10 @@ $(() => {
filterPath.push(param); filterPath.push(param);
} }
this.cantEdit.push('label'); this.cantEdit.push({
tokenName: 'label',
value: label.title,
});
}); });
Store.filter.path = filterPath.join('&'); Store.filter.path = filterPath.join('&');
......
...@@ -12,6 +12,7 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager { ...@@ -12,6 +12,7 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager {
// instead or reloading the page, we just re-fire the list ajax requests // instead or reloading the page, we just re-fire the list ajax requests
this.isHandledAsync = true; this.isHandledAsync = true;
this.cantEdit = cantEdit; this.cantEdit = cantEdit;
this.hiddenTokenNames = cantEdit.map(i => i.tokenName);
} }
updateObject(path) { updateObject(path) {
...@@ -42,7 +43,10 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager { ...@@ -42,7 +43,10 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager {
this.filteredSearchInput.dispatchEvent(new Event('input')); this.filteredSearchInput.dispatchEvent(new Event('input'));
} }
canEdit(tokenName) { canEdit(tokenName, tokenValue) {
return this.cantEdit.indexOf(tokenName) === -1; if (tokenValue && this.hiddenTokenNames.includes(tokenName)) {
return this.cantEdit.findIndex(i => i.tokenName === tokenName && i.value === tokenValue) === -1;
}
return this.hiddenTokenNames.indexOf(tokenName) === -1;
} }
} }
...@@ -481,7 +481,7 @@ class FilteredSearchManager { ...@@ -481,7 +481,7 @@ class FilteredSearchManager {
} }
hasFilteredSearch = true; hasFilteredSearch = true;
const canEdit = this.canEdit && this.canEdit(sanitizedKey); const canEdit = this.canEdit && this.canEdit(sanitizedKey, sanitizedValue);
gl.FilteredSearchVisualTokens.addFilterVisualToken( gl.FilteredSearchVisualTokens.addFilterVisualToken(
sanitizedKey, sanitizedKey,
`${symbol}${quotationsToUse}${sanitizedValue}${quotationsToUse}`, `${symbol}${quotationsToUse}${sanitizedValue}${quotationsToUse}`,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment