diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 15:42:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 15:42:17 +0000 |
commit | 44fdf983bd35328dd577d3d3650d14163ef3e2b6 (patch) | |
tree | 84ff300d056cfbabb5a0fe2a9cbaa80aaeab1cc5 /app/assets/javascripts/registry/settings/store/mutations.js | |
parent | bc9fa07b26184b5c94808f704db6ea1ac81bf4de (diff) | |
download | gitlab-ce-44fdf983bd35328dd577d3d3650d14163ef3e2b6.tar.gz |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'app/assets/javascripts/registry/settings/store/mutations.js')
-rw-r--r-- | app/assets/javascripts/registry/settings/store/mutations.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/registry/settings/store/mutations.js b/app/assets/javascripts/registry/settings/store/mutations.js index f562137db1a..bb7071b020b 100644 --- a/app/assets/javascripts/registry/settings/store/mutations.js +++ b/app/assets/javascripts/registry/settings/store/mutations.js @@ -1,3 +1,4 @@ +import { parseBoolean } from '~/lib/utils/common_utils'; import * as types from './mutation_types'; export default { @@ -8,19 +9,19 @@ export default { keepN: JSON.parse(initialState.keepNOptions), olderThan: JSON.parse(initialState.olderThanOptions), }; + state.enableHistoricEntries = parseBoolean(initialState.enableHistoricEntries); + state.isAdmin = parseBoolean(initialState.isAdmin); + state.adminSettingsPath = initialState.adminSettingsPath; }, [types.UPDATE_SETTINGS](state, data) { state.settings = { ...state.settings, ...data.settings }; }, [types.SET_SETTINGS](state, settings) { - state.settings = settings; + state.settings = settings ?? state.settings; state.original = Object.freeze(settings); }, - [types.SET_IS_DISABLED](state, isDisabled) { - state.isDisabled = isDisabled; - }, [types.RESET_SETTINGS](state) { - state.settings = { ...state.original }; + state.settings = Object.assign({}, state.original); }, [types.TOGGLE_LOADING](state) { state.isLoading = !state.isLoading; |