diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 21:09:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 21:09:08 +0000 |
commit | 866ca4e49ff74ffadf8e6f6ff663a168489c2aba (patch) | |
tree | cc3135b1bae11dbd1cb3a30cb547473ad89a5551 /app/assets/javascripts/monitoring/stores/mutations.js | |
parent | 26a50872e9da9509c52c70f74dc21698fec906db (diff) | |
download | gitlab-ce-866ca4e49ff74ffadf8e6f6ff663a168489c2aba.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/monitoring/stores/mutations.js')
-rw-r--r-- | app/assets/javascripts/monitoring/stores/mutations.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/app/assets/javascripts/monitoring/stores/mutations.js b/app/assets/javascripts/monitoring/stores/mutations.js index 5f559290ff7..8bd53a24b61 100644 --- a/app/assets/javascripts/monitoring/stores/mutations.js +++ b/app/assets/javascripts/monitoring/stores/mutations.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import pick from 'lodash/pick'; import { slugify } from '~/lib/utils/text_utility'; import * as types from './mutation_types'; import { normalizeMetric, normalizeQueryResult } from './utils'; @@ -174,15 +175,19 @@ export default { state: emptyStateFromError(error), }); }, - - [types.SET_ENDPOINTS](state, endpoints) { - state.metricsEndpoint = endpoints.metricsEndpoint; - state.deploymentsEndpoint = endpoints.deploymentsEndpoint; - state.dashboardEndpoint = endpoints.dashboardEndpoint; - state.dashboardsEndpoint = endpoints.dashboardsEndpoint; - state.currentDashboard = endpoints.currentDashboard; - state.projectPath = endpoints.projectPath; - state.logsPath = endpoints.logsPath || state.logsPath; + [types.SET_ENDPOINTS](state, endpoints = {}) { + const endpointKeys = [ + 'metricsEndpoint', + 'deploymentsEndpoint', + 'dashboardEndpoint', + 'dashboardsEndpoint', + 'currentDashboard', + 'projectPath', + 'logsPath', + ]; + Object.entries(pick(endpoints, endpointKeys)).forEach(([key, value]) => { + state[key] = value; + }); }, [types.SET_TIME_RANGE](state, timeRange) { state.timeRange = timeRange; |