diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/frontend/monitoring/store_utils.js | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/frontend/monitoring/store_utils.js')
-rw-r--r-- | spec/frontend/monitoring/store_utils.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/frontend/monitoring/store_utils.js b/spec/frontend/monitoring/store_utils.js index 338af79dbbe..eb2578aa9db 100644 --- a/spec/frontend/monitoring/store_utils.js +++ b/spec/frontend/monitoring/store_utils.js @@ -16,8 +16,13 @@ const setEnvironmentData = store => { store.commit(`monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, environmentData); }; -export const setupAllDashboards = store => { +export const setupAllDashboards = (store, path) => { store.commit(`monitoringDashboard/${types.SET_ALL_DASHBOARDS}`, dashboardGitResponse); + if (path) { + store.commit(`monitoringDashboard/${types.SET_INITIAL_STATE}`, { + currentDashboard: path, + }); + } }; export const setupStoreWithDashboard = store => { @@ -25,10 +30,6 @@ export const setupStoreWithDashboard = store => { `monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`, metricsDashboardPayload, ); - store.commit( - `monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`, - metricsDashboardPayload, - ); }; export const setupStoreWithVariable = store => { @@ -37,6 +38,18 @@ export const setupStoreWithVariable = store => { }); }; +export const setupStoreWithLinks = store => { + store.commit(`monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`, { + ...metricsDashboardPayload, + links: [ + { + title: 'GitLab Website', + url: `https://gitlab.com/website`, + }, + ], + }); +}; + export const setupStoreWithData = store => { setupAllDashboards(store); setupStoreWithDashboard(store); |