diff --git a/GITLAB_PAGES_VERSION b/GITLAB_PAGES_VERSION index 39893559155..3500250a4b0 100644 --- a/GITLAB_PAGES_VERSION +++ b/GITLAB_PAGES_VERSION @@ -1 +1 @@ -1.20.0 +1.21.0 diff --git a/app/assets/javascripts/filtered_search/constants.js b/app/assets/javascripts/filtered_search/constants.js index 7e7a2588951..0b9fe969da1 100644 --- a/app/assets/javascripts/filtered_search/constants.js +++ b/app/assets/javascripts/filtered_search/constants.js @@ -9,3 +9,5 @@ export const FILTER_TYPE = { none: 'none', any: 'any', }; + +export const MAX_HISTORY_SIZE = 5; diff --git a/app/assets/javascripts/filtered_search/stores/recent_searches_store.js b/app/assets/javascripts/filtered_search/stores/recent_searches_store.js index cdbc9ec84bd..423f123f71c 100644 --- a/app/assets/javascripts/filtered_search/stores/recent_searches_store.js +++ b/app/assets/javascripts/filtered_search/stores/recent_searches_store.js @@ -1,4 +1,6 @@ -import { uniq } from 'lodash'; +import { uniqWith, isEqual } from 'lodash'; + +import { MAX_HISTORY_SIZE } from '../constants'; class RecentSearchesStore { constructor(initialState = {}, allowedKeys) { @@ -17,8 +19,12 @@ class RecentSearchesStore { } setRecentSearches(searches = []) { - const trimmedSearches = searches.map(search => search.trim()); - this.state.recentSearches = uniq(trimmedSearches).slice(0, 5); + const trimmedSearches = searches.map(search => + typeof search === 'string' ? search.trim() : search, + ); + + // Do object equality check to remove duplicates. + this.state.recentSearches = uniqWith(trimmedSearches, isEqual).slice(0, MAX_HISTORY_SIZE); return this.state.recentSearches; } } diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 1ebf14d6eb7..c0cb924e749 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -79,11 +79,13 @@ export const getFileData = ( return service .getFileData(url) .then(({ data }) => { - setPageTitleForFile(state, file); - if (data) commit(types.SET_FILE_DATA, { data, file }); if (openFile) commit(types.TOGGLE_FILE_OPEN, path); - if (makeFileActive) dispatch('setFileActive', path); + + if (makeFileActive) { + setPageTitleForFile(state, file); + dispatch('setFileActive', path); + } }) .catch(() => { dispatch('setErrorMessage', { diff --git a/app/assets/javascripts/registry/settings/components/settings_form.vue b/app/assets/javascripts/registry/settings/components/settings_form.vue index 63dc4430d18..6a41e162af9 100644 --- a/app/assets/javascripts/registry/settings/components/settings_form.vue +++ b/app/assets/javascripts/registry/settings/components/settings_form.vue @@ -1,4 +1,5 @@