diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-01 18:08:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-01 18:08:56 +0300 |
commit | e92c95bf459ea6237b1fe1cbd3e6fc7d0eca8f85 (patch) | |
tree | 080fec6e5ea63a30f6d1f313d585266e88db2344 /app/assets/javascripts/monitoring | |
parent | 9ecdb93f4e7e85ffc1e7a768780bb1279827a6aa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/monitoring')
14 files changed, 40 insertions, 42 deletions
diff --git a/app/assets/javascripts/monitoring/components/alert_widget.vue b/app/assets/javascripts/monitoring/components/alert_widget.vue index 8408a34cb1e..0ffbf169941 100644 --- a/app/assets/javascripts/monitoring/components/alert_widget.vue +++ b/app/assets/javascripts/monitoring/components/alert_widget.vue @@ -4,10 +4,10 @@ import { values, get } from 'lodash'; import { s__ } from '~/locale'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { BV_SHOW_MODAL, BV_HIDE_MODAL } from '~/lib/utils/constants'; -import AlertWidgetForm from './alert_widget_form.vue'; import AlertsService from '../services/alerts_service'; import { alertsValidator, queriesValidator } from '../validators'; import { OPERATORS } from '../constants'; +import AlertWidgetForm from './alert_widget_form.vue'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/charts/column.vue b/app/assets/javascripts/monitoring/components/charts/column.vue index ba947c2fa9c..bb1882c90af 100644 --- a/app/assets/javascripts/monitoring/components/charts/column.vue +++ b/app/assets/javascripts/monitoring/components/charts/column.vue @@ -2,11 +2,11 @@ import { GlResizeObserverDirective } from '@gitlab/ui'; import { GlColumnChart } from '@gitlab/ui/dist/charts'; import { getSvgIconPathContent } from '~/lib/utils/icon_utils'; -import { chartHeight } from '../../constants'; import { makeDataSeries } from '~/helpers/monitor_helper'; +import { chartHeight } from '../../constants'; import { graphDataValidatorForValues } from '../../utils'; -import { getTimeAxisOptions, getYAxisOptions, getChartGrid } from './options'; import { timezones } from '../../format_date'; +import { getTimeAxisOptions, getYAxisOptions, getChartGrid } from './options'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/charts/gauge.vue b/app/assets/javascripts/monitoring/components/charts/gauge.vue index 63fa60bbdf0..461ff06be72 100644 --- a/app/assets/javascripts/monitoring/components/charts/gauge.vue +++ b/app/assets/javascripts/monitoring/components/charts/gauge.vue @@ -2,9 +2,9 @@ import { GlResizeObserverDirective } from '@gitlab/ui'; import { GlGaugeChart } from '@gitlab/ui/dist/charts'; import { isFinite, isArray, isInteger } from 'lodash'; +import { getFormatter, SUPPORTED_FORMATS } from '~/lib/utils/unit_format'; import { graphDataValidatorForValues } from '../../utils'; import { getValidThresholds } from './options'; -import { getFormatter, SUPPORTED_FORMATS } from '~/lib/utils/unit_format'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/charts/stacked_column.vue b/app/assets/javascripts/monitoring/components/charts/stacked_column.vue index b5ae6bcfd13..bfa0bd5333b 100644 --- a/app/assets/javascripts/monitoring/components/charts/stacked_column.vue +++ b/app/assets/javascripts/monitoring/components/charts/stacked_column.vue @@ -2,11 +2,11 @@ import { GlResizeObserverDirective } from '@gitlab/ui'; import { GlStackedColumnChart } from '@gitlab/ui/dist/charts'; import { getSvgIconPathContent } from '~/lib/utils/icon_utils'; -import { chartHeight, legendLayoutTypes } from '../../constants'; import { s__ } from '~/locale'; +import { chartHeight, legendLayoutTypes } from '../../constants'; import { graphDataValidatorForValues } from '../../utils'; -import { getTimeAxisOptions, axisTypes } from './options'; import { formats, timezones } from '../../format_date'; +import { getTimeAxisOptions, axisTypes } from './options'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/charts/time_series.vue b/app/assets/javascripts/monitoring/components/charts/time_series.vue index e9f7b11c977..b720700d36d 100644 --- a/app/assets/javascripts/monitoring/components/charts/time_series.vue +++ b/app/assets/javascripts/monitoring/components/charts/time_series.vue @@ -4,12 +4,12 @@ import { GlLink, GlTooltip, GlResizeObserverDirective, GlIcon } from '@gitlab/ui import { GlAreaChart, GlLineChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts'; import { s__ } from '~/locale'; import { getSvgIconPathContent } from '~/lib/utils/icon_utils'; -import { panelTypes, chartHeight, lineTypes, lineWidths, legendLayoutTypes } from '../../constants'; -import { getYAxisOptions, getTimeAxisOptions, getChartGrid, getTooltipFormatter } from './options'; -import { annotationsYAxis, generateAnnotationsSeries } from './annotations'; import { makeDataSeries } from '~/helpers/monitor_helper'; +import { panelTypes, chartHeight, lineTypes, lineWidths, legendLayoutTypes } from '../../constants'; import { graphDataValidatorForValues } from '../../utils'; import { formatDate, timezones } from '../../format_date'; +import { getYAxisOptions, getTimeAxisOptions, getChartGrid, getTooltipFormatter } from './options'; +import { annotationsYAxis, generateAnnotationsSeries } from './annotations'; export const timestampToISODate = (timestamp) => new Date(timestamp).toISOString(); diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index 16c2c87a4b7..5ec87332288 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -3,21 +3,13 @@ import { mapActions, mapState, mapGetters } from 'vuex'; import VueDraggable from 'vuedraggable'; import Mousetrap from 'mousetrap'; import { GlButton, GlModalDirective, GlTooltipDirective, GlIcon } from '@gitlab/ui'; -import DashboardHeader from './dashboard_header.vue'; -import DashboardPanel from './dashboard_panel.vue'; import { s__ } from '~/locale'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { ESC_KEY } from '~/lib/utils/keys'; import { mergeUrlParams, updateHistory } from '~/lib/utils/url_utility'; import invalidUrl from '~/lib/utils/invalid_url'; - -import GraphGroup from './graph_group.vue'; -import EmptyState from './empty_state.vue'; -import GroupEmptyState from './group_empty_state.vue'; -import VariablesSection from './variables_section.vue'; -import LinksSection from './links_section.vue'; - import TrackEventDirective from '~/vue_shared/directives/track_event'; +import { defaultTimeRange } from '~/vue_shared/constants'; import { timeRangeFromUrl, panelToUrl, @@ -25,7 +17,14 @@ import { convertVariablesForURL, } from '../utils'; import { metricStates, keyboardShortcutKeys } from '../constants'; -import { defaultTimeRange } from '~/vue_shared/constants'; +import DashboardHeader from './dashboard_header.vue'; +import DashboardPanel from './dashboard_panel.vue'; + +import GraphGroup from './graph_group.vue'; +import EmptyState from './empty_state.vue'; +import GroupEmptyState from './group_empty_state.vue'; +import VariablesSection from './variables_section.vue'; +import LinksSection from './links_section.vue'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/dashboard_actions_menu.vue b/app/assets/javascripts/monitoring/components/dashboard_actions_menu.vue index 9d1926dca54..77d3766d4bc 100644 --- a/app/assets/javascripts/monitoring/components/dashboard_actions_menu.vue +++ b/app/assets/javascripts/monitoring/components/dashboard_actions_menu.vue @@ -11,14 +11,14 @@ import { GlTooltipDirective, } from '@gitlab/ui'; import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue'; -import { PANEL_NEW_PAGE } from '../router/constants'; -import DuplicateDashboardModal from './duplicate_dashboard_modal.vue'; -import CreateDashboardModal from './create_dashboard_modal.vue'; import { s__ } from '~/locale'; import invalidUrl from '~/lib/utils/invalid_url'; import { redirectTo } from '~/lib/utils/url_utility'; import TrackEventDirective from '~/vue_shared/directives/track_event'; +import { PANEL_NEW_PAGE } from '../router/constants'; import { getAddMetricTrackingOptions } from '../utils'; +import CreateDashboardModal from './create_dashboard_modal.vue'; +import DuplicateDashboardModal from './duplicate_dashboard_modal.vue'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/dashboard_header.vue b/app/assets/javascripts/monitoring/components/dashboard_header.vue index 0f6a9ce3814..0303c47203f 100644 --- a/app/assets/javascripts/monitoring/components/dashboard_header.vue +++ b/app/assets/javascripts/monitoring/components/dashboard_header.vue @@ -16,14 +16,13 @@ import { mergeUrlParams, redirectTo } from '~/lib/utils/url_utility'; import invalidUrl from '~/lib/utils/invalid_url'; import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue'; +import { timeRanges } from '~/vue_shared/constants'; +import { timeRangeToUrl } from '../utils'; +import { timezones } from '../format_date'; import DashboardsDropdown from './dashboards_dropdown.vue'; import RefreshButton from './refresh_button.vue'; import ActionsMenu from './dashboard_actions_menu.vue'; -import { timeRangeToUrl } from '../utils'; -import { timeRanges } from '~/vue_shared/constants'; -import { timezones } from '../format_date'; - export default { components: { GlIcon, diff --git a/app/assets/javascripts/monitoring/components/dashboard_panel.vue b/app/assets/javascripts/monitoring/components/dashboard_panel.vue index c046ec060b4..bf4f52bb4b9 100644 --- a/app/assets/javascripts/monitoring/components/dashboard_panel.vue +++ b/app/assets/javascripts/monitoring/components/dashboard_panel.vue @@ -20,8 +20,11 @@ import { convertToFixedRange } from '~/lib/utils/datetime_range'; import { relativePathToAbsolute, getBaseURL, visitUrl, isSafeURL } from '~/lib/utils/url_utility'; import { __, n__ } from '~/locale'; import { BV_SHOW_MODAL } from '~/lib/utils/constants'; +import TrackEventDirective from '~/vue_shared/directives/track_event'; import { panelTypes } from '../constants'; +import { timeRangeToUrl, downloadCSVOptions, generateLinkToChartOptions } from '../utils'; +import { graphDataToCsv } from '../csv_export'; import MonitorEmptyChart from './charts/empty_chart.vue'; import MonitorTimeSeriesChart from './charts/time_series.vue'; import MonitorAnomalyChart from './charts/anomaly.vue'; @@ -32,10 +35,7 @@ import MonitorColumnChart from './charts/column.vue'; import MonitorBarChart from './charts/bar.vue'; import MonitorStackedColumnChart from './charts/stacked_column.vue'; -import TrackEventDirective from '~/vue_shared/directives/track_event'; import AlertWidget from './alert_widget.vue'; -import { timeRangeToUrl, downloadCSVOptions, generateLinkToChartOptions } from '../utils'; -import { graphDataToCsv } from '../csv_export'; const events = { timeRangeZoom: 'timerangezoom', diff --git a/app/assets/javascripts/monitoring/components/variables_section.vue b/app/assets/javascripts/monitoring/components/variables_section.vue index 7c4fb135ec8..a4aa00abbd1 100644 --- a/app/assets/javascripts/monitoring/components/variables_section.vue +++ b/app/assets/javascripts/monitoring/components/variables_section.vue @@ -1,9 +1,9 @@ <script> import { mapState, mapActions } from 'vuex'; -import DropdownField from './variables/dropdown_field.vue'; -import TextField from './variables/text_field.vue'; import { setCustomVariablesFromUrl } from '../utils'; import { VARIABLE_TYPES } from '../constants'; +import DropdownField from './variables/dropdown_field.vue'; +import TextField from './variables/text_field.vue'; export default { components: { diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js index 44c200cdb54..391cb35882c 100644 --- a/app/assets/javascripts/monitoring/stores/actions.js +++ b/app/assets/javascripts/monitoring/stores/actions.js @@ -1,14 +1,7 @@ import * as Sentry from '~/sentry/wrapper'; -import * as types from './mutation_types'; import axios from '~/lib/utils/axios_utils'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { convertToFixedRange } from '~/lib/utils/datetime_range'; -import { - gqClient, - parseEnvironmentsResponse, - parseAnnotationsResponse, - removeLeadingSlash, -} from './utils'; import trackDashboardLoad from '../monitoring_tracking_helper'; import getEnvironments from '../queries/getEnvironments.query.graphql'; import getAnnotations from '../queries/getAnnotations.query.graphql'; @@ -18,6 +11,13 @@ import { s__, sprintf } from '../../locale'; import { getDashboard, getPrometheusQueryData } from '../requests'; import { ENVIRONMENT_AVAILABLE_STATE, OVERVIEW_DASHBOARD_PATH, VARIABLE_TYPES } from '../constants'; +import { + gqClient, + parseEnvironmentsResponse, + parseAnnotationsResponse, + removeLeadingSlash, +} from './utils'; +import * as types from './mutation_types'; const axiosCancelToken = axios.CancelToken; let cancelTokenSource; diff --git a/app/assets/javascripts/monitoring/stores/mutations.js b/app/assets/javascripts/monitoring/stores/mutations.js index 5c5a7d03b97..37febd062ff 100644 --- a/app/assets/javascripts/monitoring/stores/mutations.js +++ b/app/assets/javascripts/monitoring/stores/mutations.js @@ -1,10 +1,10 @@ import Vue from 'vue'; import { pick } from 'lodash'; -import * as types from './mutation_types'; -import { mapToDashboardViewModel, mapPanelToViewModel, normalizeQueryResponseData } from './utils'; import httpStatusCodes from '~/lib/utils/http_status'; import { BACKOFF_TIMEOUT } from '~/lib/utils/common_utils'; import { dashboardEmptyStates, endpointKeys, initialStateKeys, metricStates } from '../constants'; +import { mapToDashboardViewModel, mapPanelToViewModel, normalizeQueryResponseData } from './utils'; +import * as types from './mutation_types'; import { optionsFromSeriesData } from './variable_mapping'; /** diff --git a/app/assets/javascripts/monitoring/stores/state.js b/app/assets/javascripts/monitoring/stores/state.js index ef8b1adb624..b8ecb15a72f 100644 --- a/app/assets/javascripts/monitoring/stores/state.js +++ b/app/assets/javascripts/monitoring/stores/state.js @@ -1,7 +1,7 @@ import invalidUrl from '~/lib/utils/invalid_url'; +import { defaultTimeRange } from '~/vue_shared/constants'; import { timezones } from '../format_date'; import { dashboardEmptyStates } from '../constants'; -import { defaultTimeRange } from '~/vue_shared/constants'; export default () => ({ // API endpoints diff --git a/app/assets/javascripts/monitoring/stores/utils.js b/app/assets/javascripts/monitoring/stores/utils.js index 36e5a135d59..305080cc104 100644 --- a/app/assets/javascripts/monitoring/stores/utils.js +++ b/app/assets/javascripts/monitoring/stores/utils.js @@ -2,11 +2,11 @@ import { slugify } from '~/lib/utils/text_utility'; import createGqClient, { fetchPolicies } from '~/lib/graphql'; import { SUPPORTED_FORMATS } from '~/lib/utils/unit_format'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; -import { mergeURLVariables, parseTemplatingVariables } from './variable_mapping'; import { DATETIME_RANGE_TYPES } from '~/lib/utils/constants'; import { timeRangeToParams, getRangeType } from '~/lib/utils/datetime_range'; import { isSafeURL, mergeUrlParams } from '~/lib/utils/url_utility'; import { NOT_IN_DB_PREFIX, linkTypes, OUT_OF_THE_BOX_DASHBOARDS_PATH_PREFIX } from '../constants'; +import { mergeURLVariables, parseTemplatingVariables } from './variable_mapping'; export const gqClient = createGqClient( {}, |