Commit 6f7be97e authored by Nick Thomas's avatar Nick Thomas

Fix "Fix conflicts in filtered search"

parent 6080ff90
...@@ -108,6 +108,9 @@ class FilteredSearchDropdown { ...@@ -108,6 +108,9 @@ class FilteredSearchDropdown {
if (hook) { if (hook) {
const data = hook.list.data || []; const data = hook.list.data || [];
if (!data) return;
const results = data.map((o) => { const results = data.map((o) => {
const updated = o; const updated = o;
updated.droplab_hidden = false; updated.droplab_hidden = false;
......
...@@ -137,6 +137,8 @@ class FilteredSearchManager { ...@@ -137,6 +137,8 @@ class FilteredSearchManager {
const { lastVisualToken } = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); const { lastVisualToken } = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();
if (this.filteredSearchInput.value === '' && lastVisualToken) { if (this.filteredSearchInput.value === '' && lastVisualToken) {
if (this.canEdit && !this.canEdit(lastVisualToken)) return;
this.filteredSearchInput.value = gl.FilteredSearchVisualTokens.getLastTokenPartial(); this.filteredSearchInput.value = gl.FilteredSearchVisualTokens.getLastTokenPartial();
gl.FilteredSearchVisualTokens.removeLastTokenPartial(); gl.FilteredSearchVisualTokens.removeLastTokenPartial();
} }
...@@ -222,6 +224,8 @@ class FilteredSearchManager { ...@@ -222,6 +224,8 @@ class FilteredSearchManager {
editToken(e) { editToken(e) {
const token = e.target.closest('.js-visual-token'); const token = e.target.closest('.js-visual-token');
if (this.canEdit && !this.canEdit(token)) return;
if (token) { if (token) {
gl.FilteredSearchVisualTokens.editToken(token); gl.FilteredSearchVisualTokens.editToken(token);
this.tokenChange(); this.tokenChange();
......
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