diff options
Diffstat (limited to 'app/assets/javascripts/monitoring/stores')
-rw-r--r-- | app/assets/javascripts/monitoring/stores/actions.js | 12 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/stores/utils.js | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js index 215b4b7b2d7..5c99dbc0d98 100644 --- a/app/assets/javascripts/monitoring/stores/actions.js +++ b/app/assets/javascripts/monitoring/stores/actions.js @@ -2,13 +2,13 @@ import * as Sentry from '@sentry/browser'; import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { convertToFixedRange } from '~/lib/utils/datetime_range'; -import { convertObjectPropsToCamelCase } from '../../lib/utils/common_utils'; -import { s__, sprintf } from '../../locale'; +import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; +import { s__, sprintf } from '~/locale'; import { ENVIRONMENT_AVAILABLE_STATE, OVERVIEW_DASHBOARD_PATH, VARIABLE_TYPES } from '../constants'; import trackDashboardLoad from '../monitoring_tracking_helper'; -import getAnnotations from '../queries/getAnnotations.query.graphql'; -import getDashboardValidationWarnings from '../queries/getDashboardValidationWarnings.query.graphql'; -import getEnvironments from '../queries/getEnvironments.query.graphql'; +import getAnnotations from '../queries/get_annotations.query.graphql'; +import getDashboardValidationWarnings from '../queries/get_dashboard_validation_warnings.query.graphql'; +import getEnvironments from '../queries/get_environments.query.graphql'; import { getDashboard, getPrometheusQueryData } from '../requests'; import * as types from './mutation_types'; @@ -385,7 +385,7 @@ export const fetchDashboardValidationWarnings = ({ state, dispatch, getters }) = dashboardPath, }, }) - .then((resp) => resp.data?.project?.environments?.nodes?.[0]?.metricsDashboard) + .then((resp) => resp.data?.project?.environments?.nodes?.[0]?.metricsDashboard || undefined) .then(({ schemaValidationWarnings } = {}) => { const hasWarnings = schemaValidationWarnings && schemaValidationWarnings.length !== 0; /** diff --git a/app/assets/javascripts/monitoring/stores/utils.js b/app/assets/javascripts/monitoring/stores/utils.js index 20f7c5cdb60..7f75a501635 100644 --- a/app/assets/javascripts/monitoring/stores/utils.js +++ b/app/assets/javascripts/monitoring/stores/utils.js @@ -29,7 +29,7 @@ export const gqClient = createGqClient( * @param {String} metric.id - User-defined identifier * @returns {Object} - normalized metric with a uniqueID */ -// eslint-disable-next-line babel/camelcase +// eslint-disable-next-line camelcase export const uniqMetricsId = ({ metric_id, id }) => `${metric_id || NOT_IN_DB_PREFIX}_${id}`; /** @@ -45,7 +45,7 @@ export const removeLeadingSlash = (str) => (str || '').replace(/^\/+/, ''); /** * GraphQL environments API returns only id and name. * For the environments dropdown we need metrics_path. - * This method parses the results and add neccessart attrs + * This method parses the results and add necessary attrs * * @param {Array} response Environments API result * @param {String} projectPath Current project path @@ -57,7 +57,7 @@ export const parseEnvironmentsResponse = (response = [], projectPath) => return { ...env, id, - metrics_path: `${projectPath}/environments/${id}/metrics`, + metrics_path: `${projectPath}/-/metrics?environment=${id}`, }; }); @@ -169,10 +169,10 @@ export const mapPanelToViewModel = ({ id = null, title = '', type, - x_axis = {}, + x_axis = {}, // eslint-disable-line camelcase x_label, y_label, - y_axis = {}, + y_axis = {}, // eslint-disable-line camelcase field, metrics = [], links = [], @@ -184,11 +184,11 @@ export const mapPanelToViewModel = ({ }) => { // Both `x_axis.name` and `x_label` are supported for now // https://gitlab.com/gitlab-org/gitlab/issues/210521 - const xAxis = mapXAxisToViewModel({ name: x_label, ...x_axis }); // eslint-disable-line babel/camelcase + const xAxis = mapXAxisToViewModel({ name: x_label, ...x_axis }); // eslint-disable-line camelcase // Both `y_axis.name` and `y_label` are supported for now // https://gitlab.com/gitlab-org/gitlab/issues/208385 - const yAxis = mapYAxisToViewModel({ name: y_label, ...y_axis }); // eslint-disable-line babel/camelcase + const yAxis = mapYAxisToViewModel({ name: y_label, ...y_axis }); // eslint-disable-line camelcase return { id, @@ -295,7 +295,7 @@ export const mapToDashboardViewModel = ({ dashboard = '', templating = {}, links = [], - panel_groups = [], + panel_groups = [], // eslint-disable-line camelcase }) => { return { dashboard, |