Commit eb06a776 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 03a8f65e b9686944
......@@ -36,7 +36,7 @@ class Commit
LINK_EXTENSION_PATTERN = /(patch)/.freeze
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :full_title, pipeline: :single_line
cache_markdown_field :full_title, pipeline: :single_line, limit: 1.kilobyte
cache_markdown_field :description, pipeline: :commit_description, limit: 1.megabyte
class << self
......
......@@ -2,9 +2,8 @@
module AlertManagement
class ProcessPrometheusAlertService
include BaseServiceUtility
include Gitlab::Utils::StrongMemoize
include ::IncidentManagement::Settings
extend ::Gitlab::Utils::Override
include ::AlertManagement::AlertProcessing
def initialize(project, payload)
@project = project
......@@ -14,11 +13,10 @@ module AlertManagement
def execute
return bad_request unless incoming_payload.has_required_attributes?
process_alert_management_alert
process_alert
return bad_request unless alert.persisted?
process_incident_issues if process_issues?
send_alert_email if send_email?
complete_post_processing_tasks
ServiceResponse.success
end
......@@ -27,110 +25,31 @@ module AlertManagement
attr_reader :project, :payload
def process_alert_management_alert
if incoming_payload.resolved?
process_resolved_alert_management_alert
else
process_firing_alert_management_alert
end
end
def process_firing_alert_management_alert
if alert.persisted?
alert.register_new_event!
reset_alert_management_alert_status
else
create_alert_management_alert
end
end
override :process_new_alert
def process_new_alert
return if resolving_alert?
def reset_alert_management_alert_status
return if alert.trigger
logger.warn(
message: 'Unable to update AlertManagement::Alert status to triggered',
project_id: project.id,
alert_id: alert.id
)
super
end
def create_alert_management_alert
if alert.save
alert.execute_services
SystemNoteService.create_new_alert(alert, Gitlab::AlertManagement::Payload::MONITORING_TOOLS[:prometheus])
return
end
override :process_firing_alert
def process_firing_alert
super
logger.warn(
message: 'Unable to create AlertManagement::Alert',
project_id: project.id,
alert_errors: alert.errors.messages
)
reset_alert_status
end
def process_resolved_alert_management_alert
return unless alert.persisted?
return unless auto_close_incident?
if alert.resolve(incoming_payload.ends_at)
close_issue(alert.issue)
return
end
def reset_alert_status
return if alert.trigger
logger.warn(
message: 'Unable to update AlertManagement::Alert status to resolved',
message: 'Unable to update AlertManagement::Alert status to triggered',
project_id: project.id,
alert_id: alert.id
)
end
def close_issue(issue)
return if issue.blank? || issue.closed?
Issues::CloseService
.new(project, User.alert_bot)
.execute(issue, system_note: false)
SystemNoteService.auto_resolve_prometheus_alert(issue, project, User.alert_bot) if issue.reset.closed?
end
def process_incident_issues
return if alert.issue || alert.resolved?
IncidentManagement::ProcessAlertWorker.perform_async(nil, nil, alert.id)
end
def send_alert_email
notification_service
.async
.prometheus_alerts_fired(project, [alert])
end
def logger
@logger ||= Gitlab::AppLogger
end
def alert
strong_memoize(:alert) do
existing_alert || new_alert
end
end
def existing_alert
strong_memoize(:existing_alert) do
AlertManagement::Alert.not_resolved.for_fingerprint(project, incoming_payload.gitlab_fingerprint).first
end
end
def new_alert
strong_memoize(:new_alert) do
AlertManagement::Alert.new(
**incoming_payload.alert_params,
ended_at: nil
)
end
end
override :incoming_payload
def incoming_payload
strong_memoize(:incoming_payload) do
Gitlab::AlertManagement::Payload.parse(
......@@ -141,6 +60,11 @@ module AlertManagement
end
end
override :resolving_alert?
def resolving_alert?
incoming_payload.resolved?
end
def bad_request
ServiceResponse.error(message: 'Bad Request', http_status: :bad_request)
end
......
# frozen_string_literal: true
module AlertManagement
# Module to support the processing of new alert payloads
# from various sources. Payloads may be for new alerts,
# existing alerts, or acting as a resolving alert.
#
# Performs processing-related tasks, such as creating system
# notes, creating or resolving related issues, and notifying
# stakeholders of the alert.
#
# Requires #project [Project] and #payload [Hash] methods
# to be defined.
module AlertProcessing
include BaseServiceUtility
include Gitlab::Utils::StrongMemoize
include ::IncidentManagement::Settings
# Updates or creates alert from payload for project
# including system notes
def process_alert
if alert.persisted?
process_existing_alert
else
process_new_alert
end
end
# Creates or closes issue for alert and notifies stakeholders
def complete_post_processing_tasks
process_incident_issues if process_issues?
send_alert_email if send_email?
end
def process_existing_alert
if resolving_alert?
process_resolved_alert
else
process_firing_alert
end
end
def process_resolved_alert
return unless auto_close_incident?
return close_issue(alert.issue) if alert.resolve(incoming_payload.ends_at)
logger.warn(
message: 'Unable to update AlertManagement::Alert status to resolved',
project_id: project.id,
alert_id: alert.id
)
end
def process_firing_alert
alert.register_new_event!
end
def close_issue(issue)
return if issue.blank? || issue.closed?
::Issues::CloseService
.new(project, User.alert_bot)
.execute(issue, system_note: false)
SystemNoteService.auto_resolve_prometheus_alert(issue, project, User.alert_bot) if issue.reset.closed?
end
def process_new_alert
if alert.save
alert.execute_services
SystemNoteService.create_new_alert(alert, alert_source)
else
logger.warn(
message: "Unable to create AlertManagement::Alert from #{alert_source}",
project_id: project.id,
alert_errors: alert.errors.messages
)
end
end
def process_incident_issues
return if alert.issue || alert.resolved?
::IncidentManagement::ProcessAlertWorker.perform_async(nil, nil, alert.id)
end
def send_alert_email
notification_service
.async
.prometheus_alerts_fired(project, [alert])
end
def incoming_payload
strong_memoize(:incoming_payload) do
Gitlab::AlertManagement::Payload.parse(project, payload.to_h)
end
end
def alert
strong_memoize(:alert) do
find_existing_alert || build_new_alert
end
end
def find_existing_alert
return unless incoming_payload.gitlab_fingerprint
AlertManagement::Alert.not_resolved.for_fingerprint(project, incoming_payload.gitlab_fingerprint).first
end
def build_new_alert
AlertManagement::Alert.new(**incoming_payload.alert_params, ended_at: nil)
end
def resolving_alert?
incoming_payload.ends_at.present?
end
def alert_source
alert.monitoring_tool
end
def logger
@logger ||= Gitlab::AppLogger
end
end
end
......@@ -3,9 +3,8 @@
module Projects
module Alerting
class NotifyService
include BaseServiceUtility
include Gitlab::Utils::StrongMemoize
include ::IncidentManagement::Settings
extend ::Gitlab::Utils::Override
include ::AlertManagement::AlertProcessing
def initialize(project, payload)
@project = project
......@@ -22,8 +21,7 @@ module Projects
process_alert
return bad_request unless alert.persisted?
process_incident_issues if process_issues?
send_alert_email if send_email?
complete_post_processing_tasks
ServiceResponse.success
end
......@@ -32,93 +30,15 @@ module Projects
attr_reader :project, :payload, :integration
def process_alert
if alert.persisted?
process_existing_alert
else
create_alert
end
end
def process_existing_alert
if incoming_payload.ends_at.present?
process_resolved_alert
else
alert.register_new_event!
end
alert
end
def process_resolved_alert
return unless auto_close_incident?
if alert.resolve(incoming_payload.ends_at)
close_issue(alert.issue)
end
alert
end
def close_issue(issue)
return if issue.blank? || issue.closed?
::Issues::CloseService
.new(project, User.alert_bot)
.execute(issue, system_note: false)
SystemNoteService.auto_resolve_prometheus_alert(issue, project, User.alert_bot) if issue.reset.closed?
end
def create_alert
return unless alert.save
alert.execute_services
SystemNoteService.create_new_alert(alert, notification_source)
end
def process_incident_issues
return if alert.issue || alert.resolved?
::IncidentManagement::ProcessAlertWorker.perform_async(nil, nil, alert.id)
end
def send_alert_email
notification_service
.async
.prometheus_alerts_fired(project, [alert])
end
def alert
strong_memoize(:alert) do
existing_alert || new_alert
end
end
def existing_alert
return unless incoming_payload.gitlab_fingerprint
AlertManagement::Alert.not_resolved.for_fingerprint(project, incoming_payload.gitlab_fingerprint).first
end
def new_alert
AlertManagement::Alert.new(**incoming_payload.alert_params, ended_at: nil)
end
def incoming_payload
strong_memoize(:incoming_payload) do
Gitlab::AlertManagement::Payload.parse(project, payload.to_h)
end
def valid_payload_size?
Gitlab::Utils::DeepSize.new(payload).valid?
end
def notification_source
override :alert_source
def alert_source
alert.monitoring_tool || integration&.name || 'Generic Alert Endpoint'
end
def valid_payload_size?
Gitlab::Utils::DeepSize.new(payload).valid?
end
def active_integration?
integration&.active?
end
......
---
title: Allow dots in label names through REST API
merge_request: 52591
author:
type: fixed
---
title: Introduce a rendering limit for commit titles
merge_request: 52904
author:
type: performance
......@@ -127,6 +127,15 @@ It's possible that this limit will be changed to a lower number in the future.
- **Max size:** ~1 million characters / ~1 MB
## Size of commit titles and descriptions
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/292039) in GitLab 13.9
Commits with arbitrarily large messages may be pushed to GitLab, but when
displaying commits, titles (the first line of the commit message) will be
limited to 1KiB, and descriptions (the rest of the message) will be limited to
1MiB.
## Number of issues in the milestone overview
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/39453) in GitLab 12.10.
......
......@@ -11,9 +11,6 @@ import {
import * as Sentry from '~/sentry/wrapper';
import getGroupsQuery from '../graphql/queries/get_groups.query.graphql';
import devopsAdoptionSegmentsQuery from '../graphql/queries/devops_adoption_segments.query.graphql';
import DevopsAdoptionEmptyState from './devops_adoption_empty_state.vue';
import DevopsAdoptionSegmentModal from './devops_adoption_segment_modal.vue';
import DevopsAdoptionTable from './devops_adoption_table.vue';
import {
DEVOPS_ADOPTION_STRINGS,
DEVOPS_ADOPTION_ERROR_KEYS,
......@@ -22,6 +19,9 @@ import {
DATE_TIME_FORMAT,
DEVOPS_ADOPTION_SEGMENT_MODAL_ID,
} from '../constants';
import DevopsAdoptionEmptyState from './devops_adoption_empty_state.vue';
import DevopsAdoptionSegmentModal from './devops_adoption_segment_modal.vue';
import DevopsAdoptionTable from './devops_adoption_table.vue';
export default {
name: 'DevopsAdoptionApp',
......
......@@ -8,8 +8,6 @@ import {
GlIcon,
} from '@gitlab/ui';
import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import DevopsAdoptionTableCellFlag from './devops_adoption_table_cell_flag.vue';
import DevopsAdoptionDeleteModal from './devops_adoption_delete_modal.vue';
import {
DEVOPS_ADOPTION_TABLE_TEST_IDS,
DEVOPS_ADOPTION_STRINGS,
......@@ -18,6 +16,8 @@ import {
DEVOPS_ADOPTION_SEGMENTS_TABLE_SORT_BY_STORAGE_KEY,
DEVOPS_ADOPTION_SEGMENTS_TABLE_SORT_DESC_STORAGE_KEY,
} from '../constants';
import DevopsAdoptionTableCellFlag from './devops_adoption_table_cell_flag.vue';
import DevopsAdoptionDeleteModal from './devops_adoption_delete_modal.vue';
const NAME_HEADER = 'name';
......
import FilteredSearchManager from 'ee_else_ce/filtered_search/filtered_search_manager';
import CodeReviewAnalyticsFilteredSearchTokenKeys from './code_review_analytics_filtered_search_token_keys';
import { urlParamsToObject } from '~/lib/utils/common_utils';
import { __ } from '~/locale';
import CodeReviewAnalyticsFilteredSearchTokenKeys from './code_review_analytics_filtered_search_token_keys';
import store from './store';
import transformFilters from './utils';
......
import API from 'ee/api';
import * as types from './mutation_types';
import { __ } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { normalizeHeaders, parseIntPagination } from '~/lib/utils/common_utils';
import { filterToQueryObject } from '~/vue_shared/components/filtered_search_bar/filtered_search_utils';
import * as types from './mutation_types';
export const setProjectId = ({ commit }, projectId) => commit(types.SET_PROJECT_ID, projectId);
......
import Vue from 'vue';
import { sortBy } from 'lodash';
import ColumnChart from './components/column_chart.vue';
import { __ } from '~/locale';
import ColumnChart from './components/column_chart.vue';
const sortByValue = (data) => sortBy(data, (item) => item[1]).reverse();
......
<script>
import { GlEmptyState } from '@gitlab/ui';
import { mapActions, mapState, mapGetters } from 'vuex';
import UrlSync from '~/vue_shared/components/url_sync.vue';
import { PROJECTS_PER_PAGE } from '../constants';
import ProjectsDropdownFilter from '../../shared/components/projects_dropdown_filter.vue';
import { DATE_RANGE_LIMIT } from '../../shared/constants';
import DateRange from '../../shared/components/daterange.vue';
import { toYmd } from '../../shared/utils';
import StageTable from './stage_table.vue';
import DurationChart from './duration_chart.vue';
import TypeOfWorkCharts from './type_of_work_charts.vue';
import UrlSync from '~/vue_shared/components/url_sync.vue';
import { toYmd } from '../../shared/utils';
import StageTableNav from './stage_table_nav.vue';
import CustomStageForm from './custom_stage_form.vue';
import PathNavigation from './path_navigation.vue';
......
<script>
import { GlFormGroup, GlFormInput, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import StageFieldActions from './stage_field_actions.vue';
import LabelsSelector from '../labels_selector.vue';
import { isLabelEvent, getLabelEventsIdentifiers } from '../../utils';
import StageFieldActions from './stage_field_actions.vue';
import { I18N } from './constants';
import { startEventOptions, endEventOptions } from './utils';
import { isLabelEvent, getLabelEventsIdentifiers } from '../../utils';
export default {
name: 'CustomStageFormFields',
......
import { isStartEvent, getAllowedEndEvents, eventToOption, eventsByIdentifier } from '../../utils';
import { I18N, ERRORS, defaultErrors, defaultFields, NAME_MAX_LENGTH } from './constants';
import { DEFAULT_STAGE_NAMES } from '../../constants';
import { I18N, ERRORS, defaultErrors, defaultFields, NAME_MAX_LENGTH } from './constants';
/**
* @typedef {Object} CustomStageEvents
......
......@@ -10,11 +10,11 @@ import {
GlButton,
} from '@gitlab/ui';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import { STAGE_ACTIONS } from '../constants';
import { getAllowedEndEvents, getLabelEventsIdentifiers, isLabelEvent } from '../utils';
import CustomStageFormFields from './create_value_stream_form/custom_stage_fields.vue';
import { validateStage, initializeFormData } from './create_value_stream_form/utils';
import { defaultFields, ERRORS, I18N } from './create_value_stream_form/constants';
import { STAGE_ACTIONS } from '../constants';
import { getAllowedEndEvents, getLabelEventsIdentifiers, isLabelEvent } from '../utils';
export default {
components: {
......
<script>
import Api from 'ee/api';
import { debounce } from 'lodash';
import {
GlDropdown,
......@@ -10,6 +9,7 @@ import {
GlSearchBoxByType,
} from '@gitlab/ui';
import { mapGetters } from 'vuex';
import Api from 'ee/api';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '~/locale';
import { removeFlash } from '../utils';
......
<script>
import MetricCard from '~/analytics/shared/components/metric_card.vue';
import { OVERVIEW_METRICS } from '../constants';
import TimeMetricsCard from './time_metrics_card.vue';
import MetricCard from '~/analytics/shared/components/metric_card.vue';
export default {
name: 'OverviewActivity',
......
<script>
import Sortable from 'sortablejs';
import StageNavItem from './stage_nav_item.vue';
import AddStageButton from './add_stage_button.vue';
import { STAGE_ACTIONS } from '../constants';
import { NO_DRAG_CLASS } from '../../shared/constants';
import sortableDefaultOptions from '../../shared/mixins/sortable_default_options';
import AddStageButton from './add_stage_button.vue';
import StageNavItem from './stage_nav_item.vue';
export default {
name: 'StageTableNav',
......
......@@ -2,11 +2,11 @@
import { mapActions, mapGetters, mapState } from 'vuex';
import { GlAlert } from '@gitlab/ui';
import ChartSkeletonLoader from '~/vue_shared/components/resizable_chart/skeleton_loader.vue';
import TasksByTypeChart from './tasks_by_type/tasks_by_type_chart.vue';
import TasksByTypeFilters from './tasks_by_type/tasks_by_type_filters.vue';
import { s__, sprintf, __ } from '~/locale';
import { formattedDate } from '../../shared/utils';
import { TASKS_BY_TYPE_SUBJECT_ISSUE } from '../constants';
import TasksByTypeFilters from './tasks_by_type/tasks_by_type_filters.vue';
import TasksByTypeChart from './tasks_by_type/tasks_by_type_chart.vue';
export default {
name: 'TypeOfWorkCharts',
......
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { GlToast } from '@gitlab/ui';
import CycleAnalytics from './components/base.vue';
import createStore from './store';
import { buildCycleAnalyticsInitialData } from '../shared/utils';
import createDefaultClient from '~/lib/graphql';
import { urlQueryToFilter } from '~/vue_shared/components/filtered_search_bar/filtered_search_utils';
import { buildCycleAnalyticsInitialData } from '../shared/utils';
import CycleAnalytics from './components/base.vue';
import createStore from './store';
Vue.use(GlToast);
Vue.use(VueApollo);
......
......@@ -2,7 +2,6 @@ import Api from 'ee/api';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __, sprintf } from '~/locale';
import httpStatus from '~/lib/utils/http_status';
import * as types from './mutation_types';
import { FETCH_VALUE_STREAM_DATA } from '../constants';
import {
removeFlash,
......@@ -11,6 +10,7 @@ import {
checkForDataError,
flashErrorIfStatusNotOk,
} from '../utils';
import * as types from './mutation_types';
const appendExtension = (path) => (path.indexOf('.') > -1 ? path : `${path}.json`);
......
......@@ -2,8 +2,8 @@ import Api from 'ee/api';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __, sprintf } from '~/locale';
import httpStatusCodes from '~/lib/utils/http_status';
import * as types from './mutation_types';
import { removeFlash, isStageNameExistsError } from '../../../utils';
import * as types from './mutation_types';
export const setStageEvents = ({ commit }, data) => commit(types.SET_STAGE_EVENTS, data);
export const setStageFormErrors = ({ commit }, errors) =>
......
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
import { transformRawStages } from '../../../utils';
import * as types from './mutation_types';
const extractFormFields = (rawStage = {}) => {
const [
......
import Api from 'ee/api';
import { __ } from '~/locale';
import * as types from './mutation_types';
import { checkForDataError, flashErrorIfStatusNotOk } from '../../../utils';
import * as types from './mutation_types';
export const setLoading = ({ commit }, loading) => commit(types.SET_LOADING, loading);
......
import Api from 'ee/api';
import { __ } from '~/locale';
import * as types from './mutation_types';
import { throwIfUserForbidden, checkForDataError, flashErrorIfStatusNotOk } from '../../../utils';
import * as types from './mutation_types';
export const setLoading = ({ commit }, loading) => commit(types.SET_LOADING, loading);
......
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
import { transformRawTasksByTypeData, toggleSelectedLabel } from '../../../utils';
import { TASKS_BY_TYPE_FILTERS } from '../../../constants';
import * as types from './mutation_types';
export default {
[types.SET_LOADING](state, loading) {
......
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
import { transformRawStages } from '../utils';
import * as types from './mutation_types';
export default {
[types.SET_FEATURE_FLAGS](state, featureFlags) {
......
......@@ -14,12 +14,12 @@ import dateFormat from 'dateformat';
import { GlColumnChart } from '@gitlab/ui/dist/charts';
import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { beginOfDayTime, endOfDayTime } from '~/lib/utils/datetime_utility';
import MetricChart from './metric_chart.vue';
import Scatterplot from '../../shared/components/scatterplot.vue';
import MergeRequestTable from './mr_table.vue';
import { chartKeys } from '../constants';
import { dateFormats } from '../../shared/constants';
import urlSyncMixin from '../../shared/mixins/url_sync_mixin';
import MergeRequestTable from './mr_table.vue';
import MetricChart from './metric_chart.vue';
export default {
components: {
......
<script>
import { mapState, mapActions } from 'vuex';
import GroupsDropdownFilter from '../../shared/components/groups_dropdown_filter.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import GroupsDropdownFilter from '../../shared/components/groups_dropdown_filter.vue';
import ProjectsDropdownFilter from '../../shared/components/projects_dropdown_filter.vue';
import { accessLevelReporter, projectsPerPage } from '../constants';
......
<script>
import { GlDropdown, GlDropdownItem, GlIcon } from '@gitlab/ui';
import MergeRequestTableRow from './mr_table_row.vue';
import Pagination from '~/vue_shared/components/pagination_links.vue';
import MergeRequestTableRow from './mr_table_row.vue';
export default {
components: {
......
import FilteredSearchManager from 'ee_else_ce/filtered_search/filtered_search_manager';
import ProductivityAnalyticsFilteredSearchTokenKeys from './productivity_analytics_filtered_search_token_keys';
import { urlParamsToObject } from '~/lib/utils/common_utils';
import { __ } from '~/locale';
import ProductivityAnalyticsFilteredSearchTokenKeys from './productivity_analytics_filtered_search_token_keys';
import store from './store';
export default class FilteredSearchProductivityAnalytics extends FilteredSearchManager {
......
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { mapState, mapActions } from 'vuex';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import DateRange from '../shared/components/daterange.vue';
import { buildGroupFromDataset, buildProjectFromDataset } from '../shared/utils';
import store from './store';
import FilterDropdowns from './components/filter_dropdowns.vue';
import DateRange from '../shared/components/daterange.vue';
import ProductivityAnalyticsApp from './components/app.vue';
import FilteredSearchProductivityAnalytics from './filtered_search_productivity_analytics';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { getLabelsEndpoint, getMilestonesEndpoint } from './utils';
import { buildGroupFromDataset, buildProjectFromDataset } from '../shared/utils';
Vue.use(VueApollo);
......
import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';
import { getDateInPast } from '~/lib/utils/datetime_utility';
import { chartKeys, scatterPlotAddonQueryDays } from '../../../constants';
import { transformScatterData } from '../../../utils';
import * as types from './mutation_types';
/**
* Fetches data for all charts except for the main chart
......
import * as types from './mutation_types';
import { chartKeys } from '../../../constants';
import * as types from './mutation_types';
export default {
[types.RESET_CHART_DATA](state, chartKey) {
......
import * as types from './mutation_types';
import { chartKeys } from '../../../constants';
import * as types from './mutation_types';
export const setInitialData = ({ commit, dispatch }, { skipFetch = false, data }) => {
commit(types.SET_INITIAL_DATA, data);
......
import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import { daysToMergeMetric } from '../../../constants';
import * as types from './mutation_types';
export const fetchMergeRequests = ({ dispatch, state, rootState, rootGetters }) => {
dispatch('requestMergeRequests');
......
import * as types from './mutation_types';
import { tableSortOrder } from '../../../constants';
import * as types from './mutation_types';
export default {
[types.REQUEST_MERGE_REQUESTS](state) {
......
......@@ -7,8 +7,8 @@ import { __, s__ } from '~/locale';
import { joinPaths } from '~/lib/utils/url_utility';
import { SUPPORTED_FORMATS, getFormatter } from '~/lib/utils/unit_format';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import SelectProjectsDropdown from './select_projects_dropdown.vue';
import getProjectsTestCoverage from '../graphql/queries/get_projects_test_coverage.query.graphql';
import SelectProjectsDropdown from './select_projects_dropdown.vue';
export default {
name: 'TestCoverageTable',
......
<script>
import ApprovalCheckPopover from './approval_check_popover.vue';
import { VULNERABILITY_CHECK_NAME, LICENSE_CHECK_NAME, APPROVAL_RULE_CONFIGS } from '../constants';
import ApprovalCheckPopover from './approval_check_popover.vue';
export default {
name: 'ApprovalCheckRulePopover',
......
<script>
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import Avatar from '~/vue_shared/components/project_avatar/default.vue';
import HiddenGroupsItem from './hidden_groups_item.vue';
import { TYPE_USER, TYPE_GROUP, TYPE_HIDDEN_GROUPS } from '../constants';
import HiddenGroupsItem from './hidden_groups_item.vue';
const types = [TYPE_USER, TYPE_GROUP, TYPE_HIDDEN_GROUPS];
......
......@@ -3,9 +3,9 @@ import $ from 'jquery';
import { escape, debounce } from 'lodash';
import Api from 'ee/api';
import { __ } from '~/locale';
import { TYPE_USER, TYPE_GROUP } from '../constants';
import { renderAvatar } from '~/helpers/avatar_helper';
import { loadCSSFile } from '~/lib/utils/css_utils';
import { TYPE_USER, TYPE_GROUP } from '../constants';
function addType(type) {
return (items) => items.map((obj) => Object.assign(obj, { type }));
......
......@@ -8,8 +8,8 @@ import {
GlSprintf,
} from '@gitlab/ui';
import { APPROVALS, APPROVALS_MODAL } from 'ee/approvals/stores/modules/license_compliance';
import ModalLicenseCompliance from './modal.vue';
import { s__ } from '~/locale';
import ModalLicenseCompliance from './modal.vue';
export default {
components: {
......
<script>
import { mapState, mapActions } from 'vuex';
import { __ } from '~/locale';
import { RULE_TYPE_ANY_APPROVER, RULE_TYPE_REGULAR, RULE_NAME_ANY_APPROVER } from '../../constants';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
import { RULE_TYPE_ANY_APPROVER, RULE_TYPE_REGULAR, RULE_NAME_ANY_APPROVER } from '../../constants';
import Rules from '../rules.vue';
import RuleControls from '../rule_controls.vue';
import EmptyRule from '../empty_rule.vue';
......
......@@ -3,9 +3,9 @@ import { mapState, mapActions } from 'vuex';
import RuleName from 'ee/approvals/components/rule_name.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { n__, sprintf } from '~/locale';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
import { RULE_TYPE_ANY_APPROVER, RULE_TYPE_REGULAR } from '../../constants';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
import Rules from '../rules.vue';
import RuleControls from '../rule_controls.vue';
import EmptyRule from '../empty_rule.vue';
......
......@@ -3,10 +3,10 @@ import { mapState, mapActions } from 'vuex';
import { groupBy, isNumber } from 'lodash';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { sprintf, __ } from '~/locale';
import { TYPE_USER, TYPE_GROUP, TYPE_HIDDEN_GROUPS } from '../constants';
import ApproversList from './approvers_list.vue';
import ApproversSelect from './approvers_select.vue';
import BranchesSelect from './branches_select.vue';
import { TYPE_USER, TYPE_GROUP, TYPE_HIDDEN_GROUPS } from '../constants';
const DEFAULT_NAME = 'Default';
const DEFAULT_NAME_FOR_LICENSE_REPORT = 'License-Check';
......
import Vue from 'vue';
import Vuex from 'vuex';
import { parseBoolean } from '~/lib/utils/common_utils';
import createStore from './stores';
import projectSettingsModule from './stores/modules/project_settings';
import ProjectSettingsApp from './components/project_settings/app.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
Vue.use(Vuex);
......
import * as types from './mutation_types';
import { RULE_TYPE_ANY_APPROVER } from '../../../constants';
import * as types from './mutation_types';
export default {
[types.SET_LOADING](state, isLoading) {
......
......@@ -3,9 +3,9 @@ import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '~/locale';
import Api from '~/api';
import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';
import { RULE_TYPE_ANY_APPROVER } from '../../../constants';
import { mapMRApprovalSettingsResponse } from '../../../mappers';
import * as types from './mutation_types';
const fetchGroupMembers = memoize((id) => Api.groupMembers(id).then((response) => response.data));
......
import base from '../base/mutations';
import * as types from './mutation_types';
import { RULE_TYPE_ANY_APPROVER } from '../../../constants';
import * as types from './mutation_types';
export default {
...base,
......
import Api from '~/api';
import * as types from './mutation_types';
import createFlash from '~/flash';
import { s__ } from '~/locale';
import * as types from './mutation_types';
export const fetchBillableMembersList = ({ dispatch, state }, { page, search } = {}) => {
dispatch('requestBillableMembersList');
......
......@@ -4,8 +4,8 @@ import { mapActions, mapState, mapGetters } from 'vuex';
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import { TABLE_TYPE_DEFAULT, TABLE_TYPE_FREE, TABLE_TYPE_TRIAL } from 'ee/billings/constants';
import { s__ } from '~/locale';
import SubscriptionTableRow from './subscription_table_row.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import SubscriptionTableRow from './subscription_table_row.vue';
const createButtonProps = (text, href, testId) => ({ text, href, testId });
......
import ApiEe from 'ee/api';
import Api from '~/api';
import * as types from './mutation_types';
import createFlash from '~/flash';
import { s__ } from '~/locale';
import * as types from './mutation_types';
export const setNamespaceId = ({ commit }, namespaceId) => {
commit(types.SET_NAMESPACE_ID, namespaceId);
......
......@@ -6,8 +6,8 @@ import {
TABLE_TYPE_TRIAL,
HEADER_TOTAL_ENTRIES,
} from 'ee/billings/constants';
import * as types from './mutation_types';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
export default {
[types.SET_NAMESPACE_ID](state, payload) {
......
import { urlParamsToObject } from '~/lib/utils/common_utils';
import { objectToQuery } from '~/lib/utils/url_utility';
import {
IterationFilterType,
IterationIDs,
......@@ -6,8 +8,6 @@ import {
WeightFilterType,
WeightIDs,
} from './constants';
import { urlParamsToObject } from '~/lib/utils/common_utils';
import { objectToQuery } from '~/lib/utils/url_utility';
export function getMilestone({ milestone }) {
return milestone || null;
......
......@@ -4,15 +4,15 @@ import { GlDrawer } from '@gitlab/ui';
import { ISSUABLE } from '~/boards/constants';
import { contentTop } from '~/lib/utils/common_utils';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import BoardSidebarEpicSelect from './sidebar/board_sidebar_epic_select.vue';
import BoardAssigneeDropdown from '~/boards/components/board_assignee_dropdown.vue';
import BoardSidebarTimeTracker from './sidebar/board_sidebar_time_tracker.vue';
import BoardSidebarWeightInput from './sidebar/board_sidebar_weight_input.vue';
import BoardSidebarLabelsSelect from '~/boards/components/sidebar/board_sidebar_labels_select.vue';
import BoardSidebarIssueTitle from '~/boards/components/sidebar/board_sidebar_issue_title.vue';
import BoardSidebarDueDate from '~/boards/components/sidebar/board_sidebar_due_date.vue';
import BoardSidebarSubscription from '~/boards/components/sidebar/board_sidebar_subscription.vue';
import BoardSidebarMilestoneSelect from '~/boards/components/sidebar/board_sidebar_milestone_select.vue';
import BoardSidebarWeightInput from './sidebar/board_sidebar_weight_input.vue';
import BoardSidebarTimeTracker from './sidebar/board_sidebar_time_tracker.vue';
import BoardSidebarEpicSelect from './sidebar/board_sidebar_epic_select.vue';
export default {
headerHeight: `${contentTop()}px`,
......
import Vue from 'vue';
import boardsStore from '~/boards/stores/boards_store';
import vuexStore from '~/boards/stores';
import ListContainer from './list_container.vue';
import { fullMilestoneId, fullUserId } from '../../boards_util';
import ListContainer from './list_container.vue';
export default Vue.extend({
components: {
......
......@@ -3,12 +3,12 @@ import { mapActions, mapGetters, mapState } from 'vuex';
import { GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import Draggable from 'vuedraggable';
import BoardListHeader from 'ee_else_ce/boards/components/board_list_header.vue';
import { DRAGGABLE_TAG } from '../constants';
import defaultSortableConfig from '~/sortable/sortable_config';
import { n__ } from '~/locale';
import { isListDraggable } from '~/boards/boards_util';
import { DRAGGABLE_TAG } from '../constants';
import EpicLane from './epic_lane.vue';
import IssuesLaneList from './issues_lane_list.vue';
import { isListDraggable } from '~/boards/boards_util';
export default {
components: {
......
......@@ -2,10 +2,10 @@
import { mapState, mapGetters, mapActions } from 'vuex';
import EpicsSelect from 'ee/vue_shared/components/sidebar/epics_select/base.vue';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { fullEpicId } from '../../boards_util';
import BoardEditableItem from '~/boards/components/sidebar/board_editable_item.vue';
import createFlash from '~/flash';
import { __, s__ } from '~/locale';
import { fullEpicId } from '../../boards_util';
export default {
components: {
......
......@@ -9,11 +9,7 @@ import {
import { mergeUrlParams, removeParams } from '~/lib/utils/url_utility';
import actionsCE from '~/boards/stores/actions';
import { BoardType } from '~/boards/constants';
import { EpicFilterType, IterationFilterType, GroupByParamType } from '../constants';
import boardsStoreEE from './boards_store_ee';
import * as types from './mutation_types';
import * as typesCE from '~/boards/stores/mutation_types';
import { fullEpicId } from '../boards_util';
import {
formatBoardLists,
formatListIssues,
......@@ -22,16 +18,20 @@ import {
} from '~/boards/boards_util';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import eventHub from '~/boards/eventhub';
import createGqClient, { fetchPolicies } from '~/lib/graphql';
import listsIssuesQuery from '~/boards/graphql/lists_issues.query.graphql';
import { fullEpicId } from '../boards_util';
import epicQuery from '../graphql/epic.query.graphql';
import epicsSwimlanesQuery from '../graphql/epics_swimlanes.query.graphql';
import issueSetEpicMutation from '../graphql/issue_set_epic.mutation.graphql';
import issueSetWeightMutation from '../graphql/issue_set_weight.mutation.graphql';
import listsIssuesQuery from '~/boards/graphql/lists_issues.query.graphql';
import { EpicFilterType, IterationFilterType, GroupByParamType } from '../constants';
import issueMoveListMutation from '../graphql/issue_move_list.mutation.graphql';
import listUpdateLimitMetricsMutation from '../graphql/list_update_limit_metrics.mutation.graphql';
import updateBoardEpicUserPreferencesMutation from '../graphql/updateBoardEpicUserPreferences.mutation.graphql';
import * as types from './mutation_types';
import boardsStoreEE from './boards_store_ee';
const notImplemented = () => {
/* eslint-disable-next-line @gitlab/require-i18n-strings */
......
import Vue from 'vue';
import ToggleEpicsSwimlanes from './components/toggle_epics_swimlanes.vue';
import store from '~/boards/stores';
import ToggleEpicsSwimlanes from './components/toggle_epics_swimlanes.vue';
export default () => {
const el = document.getElementById('js-board-epics-swimlanes-toggle');
......
......@@ -4,15 +4,15 @@ import dateFormat from 'dateformat';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __ } from '~/locale';
import { getDayDifference, nDaysAfter, newDateAsLocaleTime } from '~/lib/utils/datetime_utility';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { Namespace } from '../constants';
import BurnupQuery from '../graphql/burnup.query.graphql';
import BurndownChartData from '../burn_chart_data';
import BurndownChart from './burndown_chart.vue';
import BurnupChart from './burnup_chart.vue';
import TimeboxSummaryCards from './timebox_summary_cards.vue';
import OpenTimeboxSummary from './open_timebox_summary.vue';
import { Namespace } from '../constants';
import BurnupQuery from '../graphql/burnup.query.graphql';
import BurndownChartData from '../burn_chart_data';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import axios from '~/lib/utils/axios_utils';
export default {
components: {
......
<script>
import { GlAlert, GlKeysetPagination, GlLoadingIcon } from '@gitlab/ui';
import AgentEmptyState from './agent_empty_state.vue';
import AgentTable from './agent_table.vue';
import getAgentsQuery from '../graphql/queries/get_agents.query.graphql';
import { MAX_LIST_COUNT } from '../constants';
import AgentEmptyState from './agent_empty_state.vue';
import AgentTable from './agent_table.vue';
export default {
apollo: {
......
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import loadAgents from './load_agents';
import loadClusters from '~/clusters_list/load_clusters';
import loadAgents from './load_agents';
Vue.use(VueApollo);
......
import Agents from './components/agents.vue';
import createDefaultClient from '~/lib/graphql';
import Agents from './components/agents.vue';
export default (Vue, VueApollo) => {
const el = document.querySelector('#js-cluster-agents-list');
......
import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { s__ } from '~/locale';
import { VIEW_EVENT_FEATURE_FLAG, VIEW_EVENT_NAME } from './constants';
import Api from '~/api';
import { parseCodeclimateMetrics } from '~/reports/codequality_report/store/utils/codequality_comparison';
import { VIEW_EVENT_FEATURE_FLAG, VIEW_EVENT_NAME } from './constants';
import * as types from './mutation_types';
export const setPage = ({ commit }, page) => commit(types.SET_PAGE, page);
......
import Vue from 'vue';
import ComplianceDashboard from './components/dashboard.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import ComplianceDashboard from './components/dashboard.vue';
export default () => {
const el = document.getElementById('js-compliance-dashboard');
......
......@@ -2,10 +2,10 @@
import Cookies from 'js-cookie';
import { GlTabs, GlTab } from '@gitlab/ui';
import { __ } from '~/locale';
import { COMPLIANCE_TAB_COOKIE_KEY } from '../constants';
import MergeRequestsGrid from './merge_requests/grid.vue';
import EmptyState from './empty_state.vue';
import MergeCommitsExportButton from './merge_requests/merge_commits_export_button.vue';
import { COMPLIANCE_TAB_COOKIE_KEY } from '../constants';
export default {
name: 'ComplianceDashboard',
......
......@@ -4,11 +4,11 @@ import { GlSprintf } from '@gitlab/ui';
import { __ } from '~/locale';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import GridColumnHeading from '../shared/grid_column_heading.vue';
import Pagination from '../shared/pagination.vue';
import Approvers from './approvers.vue';
import BranchDetails from './branch_details.vue';
import GridColumnHeading from '../shared/grid_column_heading.vue';
import MergeRequest from './merge_request.vue';
import Pagination from '../shared/pagination.vue';
import Status from './status.vue';
export default {
......
......@@ -2,12 +2,12 @@
import { mapActions, mapGetters, mapState } from 'vuex';
import { GlEmptyState, GlIcon, GlLoadingIcon, GlSprintf, GlLink, GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
import { DEPENDENCY_LIST_TYPES } from '../store/constants';
import { REPORT_STATUS } from '../store/modules/list/constants';
import DependenciesActions from './dependencies_actions.vue';
import DependencyListIncompleteAlert from './dependency_list_incomplete_alert.vue';
import DependencyListJobFailedAlert from './dependency_list_job_failed_alert.vue';
import PaginatedDependenciesTable from './paginated_dependencies_table.vue';
import { DEPENDENCY_LIST_TYPES } from '../store/constants';
import { REPORT_STATUS } from '../store/modules/list/constants';
export default {
name: 'DependenciesApp',
......
<script>
import { mapActions, mapState } from 'vuex';
import Pagination from '~/vue_shared/components/pagination_links.vue';
import DependenciesTable from './dependencies_table.vue';
import { DEPENDENCY_LIST_TYPES } from '../store/constants';
import DependenciesTable from './dependencies_table.vue';
export default {
name: 'PaginatedDependenciesTable',
......
import { normalizeHeaders, parseIntPagination } from '~/lib/utils/common_utils';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { __ } from '~/locale';
import { FETCH_ERROR_MESSAGE } from './constants';
import { isValidResponse } from './utils';
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';
import { __ } from '~/locale';
export const setDependenciesEndpoint = ({ commit }, endpoint) =>
commit(types.SET_DEPENDENCIES_ENDPOINT, endpoint);
......
import { REPORT_STATUS } from './constants';
import { getTimeago } from '~/lib/utils/datetime_utility';
import { REPORT_STATUS } from './constants';
export const generatedAtTimeAgo = ({ reportInfo: { generatedAt } }) =>
generatedAt ? getTimeago().format(generatedAt) : '';
......
......@@ -3,21 +3,19 @@ import { mapState, mapGetters, mapActions } from 'vuex';
import AncestorsTree from 'ee/sidebar/components/ancestors_tree/ancestors_tree.vue';
import epicUtils from '../utils/epic_utils';
import SidebarHeader from './sidebar_items/sidebar_header.vue';
import SidebarTodo from './sidebar_items/sidebar_todo.vue';
import SidebarDatePicker from './sidebar_items/sidebar_date_picker.vue';
import SidebarDatePickerCollapsed from '~/vue_shared/components/sidebar/collapsed_grouped_date_picker.vue';
import SidebarLabels from './sidebar_items/sidebar_labels.vue';
import SidebarParticipants from '~/sidebar/components/participants/participants.vue';
import SidebarSubscription from './sidebar_items/sidebar_subscription.vue';
import ConfidentialIssueSidebar from '~/sidebar/components/confidential/confidential_issue_sidebar.vue';
import notesEventHub from '~/notes/event_hub';
import sidebarEventHub from '~/sidebar/event_hub';
import epicUtils from '../utils/epic_utils';
import { dateTypes } from '../constants';
import SidebarHeader from './sidebar_items/sidebar_header.vue';
import SidebarTodo from './sidebar_items/sidebar_todo.vue';
import SidebarDatePicker from './sidebar_items/sidebar_date_picker.vue';
import SidebarLabels from './sidebar_items/sidebar_labels.vue';
import SidebarSubscription from './sidebar_items/sidebar_subscription.vue';
export default {
dateTypes,
......
......@@ -2,9 +2,8 @@
import { mapState, mapActions } from 'vuex';
import { debounce } from 'lodash';
import ListLabel from '../../models/label';
import LabelsSelectVue from '~/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue';
import ListLabel from '../../models/label';
export default {
components: {
......
import DropdownUser from '~/filtered_search/dropdown_user';
import DropdownNonUser from '~/filtered_search/dropdown_non_user';
import DropdownWeight from './dropdown_weight';
import DropdownAjaxFilter from '~/filtered_search/dropdown_ajax_filter';
import AvailableDropdownMappingsCE from '~/filtered_search/available_dropdown_mappings';
import DropdownWeight from './dropdown_weight';
export default class AvailableDropdownMappings {
constructor({
......
<script>
import { GlFormGroup, GlFormSelect, GlFormCheckbox, GlSprintf, GlLink } from '@gitlab/ui';
import { SELECTIVE_SYNC_MORE_INFO, OBJECT_STORAGE_MORE_INFO } from '../constants';
import GeoNodeFormNamespaces from './geo_node_form_namespaces.vue';
import GeoNodeFormShards from './geo_node_form_shards.vue';
import { SELECTIVE_SYNC_MORE_INFO, OBJECT_STORAGE_MORE_INFO } from '../constants';
export default {
name: 'GeoNodeFormSelectiveSync',
......
import Api from 'ee/api';
import { flatten } from 'lodash';
import Api from 'ee/api';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { visitUrl } from '~/lib/utils/url_utility';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
......
<script>
import { GlIcon } from '@gitlab/ui';
import GeoNodeLastUpdated from './geo_node_last_updated.vue';
import { HEALTH_STATUS_ICON, HEALTH_STATUS_CLASS } from '../constants';
import GeoNodeLastUpdated from './geo_node_last_updated.vue';
export default {
components: {
......
......@@ -9,8 +9,8 @@ import {
} from '~/lib/utils/common_utils';
import buildReplicableTypeQuery from '../graphql/replicable_type_query_builder';
import { gqClient } from '../utils';
import * as types from './mutation_types';
import { FILTER_STATES, PREV, NEXT, DEFAULT_PAGE_SIZE } from '../constants';
import * as types from './mutation_types';
// Fetch Replicable Items
export const requestReplicableItems = ({ commit }) => commit(types.REQUEST_REPLICABLE_ITEMS);
......
import * as types from './mutation_types';
import { DEFAULT_TIMEOUT, DEFAULT_ALLOWED_IP } from '../constants';
import * as types from './mutation_types';
export default {
[types.REQUEST_GEO_SETTINGS](state) {
......
......@@ -2,9 +2,8 @@
import { visitUrl } from '~/lib/utils/url_utility';
import { s__ } from '~/locale';
import * as Sentry from '~/sentry/wrapper';
import SharedForm from './shared_form.vue';
import createComplianceFrameworkMutation from '../graphql/queries/create_compliance_framework.mutation.graphql';
import SharedForm from './shared_form.vue';
export default {
components: {
......
......@@ -3,10 +3,10 @@ import { visitUrl } from '~/lib/utils/url_utility';
import { s__ } from '~/locale';
import * as Sentry from '~/sentry/wrapper';
import { convertToGraphQLId } from '~/graphql_shared/utils';
import SharedForm from './shared_form.vue';
import getComplianceFrameworkQuery from '../graphql/queries/get_compliance_framework.query.graphql';
import updateComplianceFrameworkMutation from '../graphql/queries/update_compliance_framework.mutation.graphql';
import SharedForm from './shared_form.vue';
export default {
components: {
......
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import CreateForm from './components/create_form.vue';
import EditForm from './components/edit_form.vue';
import createDefaultClient from '~/lib/graphql';
Vue.use(VueApollo);
......
......@@ -5,8 +5,8 @@ import { getSvgIconPathContent } from '~/lib/utils/icon_utils';
import ResizableChartContainer from '~/vue_shared/components/resizable_chart/resizable_chart_container.vue';
import ChartSkeletonLoader from '~/vue_shared/components/resizable_chart/skeleton_loader.vue';
import InsightsChartError from './insights_chart_error.vue';
import { CHART_TYPES } from '../constants';
import InsightsChartError from './insights_chart_error.vue';
const CHART_HEIGHT = 300;
......
......@@ -3,8 +3,8 @@ import { GlEmptyState } from '@gitlab/ui';
import { isUndefined } from 'lodash';
import { mapActions, mapState } from 'vuex';
import InsightsChart from './insights_chart.vue';
import { __ } from '~/locale';
import InsightsChart from './insights_chart.vue';
export default {
components: {
......
......@@ -9,14 +9,13 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import IssuableList from '~/issuable_list/components/issuable_list_root.vue';
import JiraIssuesListEmptyState from './jira_issues_list_empty_state.vue';
import {
IssuableStates,
IssuableListTabs,
AvailableSortOptions,
DEFAULT_PAGE_SIZE,
} from '~/issuable_list/constants';
import JiraIssuesListEmptyState from './jira_issues_list_empty_state.vue';
export default {
name: 'JiraIssuesList',
......
import { s__ } from '~/locale';
import createFlash from '~/flash';
import * as types from './mutation_types';
import { deleteMetricImage, getMetricImages, uploadMetricImage } from '../service';
import * as types from './mutation_types';
export const fetchMetricImages = async ({ state, commit }) => {
commit(types.REQUEST_METRIC_IMAGES);
......
......@@ -7,9 +7,9 @@ import { s__ } from '~/locale';
import { getMonthNames } from '~/lib/utils/datetime_utility';
import { getSvgIconPathContent } from '~/lib/utils/icon_utils';
import { mergeUrlParams } from '~/lib/utils/url_utility';
import IssuesAnalyticsTable from './issues_analytics_table.vue';
import FilteredSearchIssueAnalytics from '../filtered_search_issues_analytics';
import { transformFilters } from '../utils';
import IssuesAnalyticsTable from './issues_analytics_table.vue';
export default {
components: {
......
import Vue from 'vue';
import { urlParamsToObject } from '~/lib/utils/common_utils';
import IssuesAnalytics from './components/issues_analytics.vue';
import store from './stores';
import { urlParamsToObject } from '~/lib/utils/common_utils';
export default () => {
const el = document.querySelector('#js-issues-analytics');
......
......@@ -4,9 +4,9 @@ import { deprecatedCreateFlash as createFlash } from '~/flash';
import { visitUrl } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
import MarkdownField from '~/vue_shared/components/markdown/field.vue';
import DueDateSelectors from '~/due_date_select';
import createIteration from '../queries/create_iteration.mutation.graphql';
import updateIteration from '../queries/update_iteration.mutation.graphql';
import DueDateSelectors from '~/due_date_select';
export default {
components: {
......
......@@ -13,10 +13,10 @@ import BurnCharts from 'ee/burndown_chart/components/burn_charts.vue';
import { formatDate } from '~/lib/utils/datetime_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __ } from '~/locale';
import IterationForm from './iteration_form.vue';
import IterationReportTabs from './iteration_report_tabs.vue';
import query from '../queries/iteration.query.graphql';
import { Namespace } from '../constants';
import IterationForm from './iteration_form.vue';
import IterationReportTabs from './iteration_report_tabs.vue';
const iterationStates = {
closed: 'closed',
......
......@@ -2,10 +2,10 @@
import { GlBadge, GlFormSelect, GlTab, GlTabs } from '@gitlab/ui';
import { differenceBy, unionBy } from 'lodash';
import LabelsSelect from '~/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue';
import { GroupBy, Namespace } from '../constants';
import { DropdownVariant } from '~/vue_shared/components/sidebar/labels_select_vue/constants';
import IterationReportIssues from './iteration_report_issues.vue';
import { __ } from '~/locale';
import { GroupBy, Namespace } from '../constants';
import IterationReportIssues from './iteration_report_issues.vue';
export default {
selectOptions: [
......
<script>
import { GlAlert, GlButton, GlLoadingIcon, GlPagination, GlTab, GlTabs } from '@gitlab/ui';
import { __ } from '~/locale';
import IterationsList from './iterations_list.vue';
import IterationsQuery from '../queries/iterations.query.graphql';
import { Namespace } from '../constants';
import IterationsList from './iterations_list.vue';
const pageSize = 20;
......
......@@ -12,11 +12,11 @@ import {
} from '@gitlab/ui';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import LicenseManagement from 'ee/vue_shared/license_compliance/license_management.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { getLocationHash } from '~/lib/utils/url_utility';
import { LICENSE_LIST } from '../store/constants';
import DetectedLicensesTable from './detected_licenses_table.vue';
import PipelineInfo from './pipeline_info.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { getLocationHash } from '~/lib/utils/url_utility';
export default {
name: 'LicenseComplianceApp',
......
<script>
import { mapActions, mapState } from 'vuex';
import Pagination from '~/vue_shared/components/pagination_links.vue';
import LicensesTable from './licenses_table.vue';
import { LICENSE_LIST } from '../store/constants';
import LicensesTable from './licenses_table.vue';
export default {
name: 'DetectedLicensesTable',
......
......@@ -7,9 +7,8 @@ import approvalsModule, {
} from 'ee/approvals/stores/modules/license_compliance';
import { licenseManagementModule } from 'ee/vue_shared/license_compliance/store/index';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import createState from './state';
import modalModule from '~/vuex_shared/modules/modal';
import createState from './state';
import mediator from './plugins/mediator';
......
import * as types from './mutation_types';
import { toLicenseObject } from '../../../utils/mappers';
import * as types from './mutation_types';
export default {
[types.SET_LICENSES_ENDPOINT](state, payload) {
......
import * as types from './mutation_types';
import { DEFAULT_MAINTENANCE_ENABLED, DEFAULT_BANNER_MESSAGE } from '../constants';
import * as types from './mutation_types';
export default {
[types.REQUEST_UPDATE_MAINTENANCE_MODE_SETTINGS](state) {
......
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';
export * from '~/members/store/actions';
......
import Vue from 'vue';
import * as types from './mutation_types';
import CEMutations from '~/members/store/mutations';
import { s__ } from '~/locale';
import { findMember } from '~/members/store/utils';
import * as types from './mutation_types';
export default {
...CEMutations,
......
<script>
import { SCAN_TYPE_LABEL } from 'ee/security_configuration/dast_scanner_profiles/constants';
import ProfileSelector from './profile_selector.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ProfileSelector from './profile_selector.vue';
export default {
name: 'OnDemandScansScannerProfileSelector',
......
<script>
import { DAST_SITE_VALIDATION_STATUS } from 'ee/security_configuration/dast_site_validation/constants';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ProfileSelector from './profile_selector.vue';
import { s__ } from '~/locale';
import ProfileSelector from './profile_selector.vue';
export default {
name: 'OnDemandScansSiteProfileSelector',
......
......@@ -5,9 +5,9 @@ import { s__, __ } from '~/locale';
import getOncallSchedulesQuery from '../graphql/queries/get_oncall_schedules.query.graphql';
import createOncallScheduleMutation from '../graphql/mutations/create_oncall_schedule.mutation.graphql';
import updateOncallScheduleMutation from '../graphql/mutations/update_oncall_schedule.mutation.graphql';
import AddEditScheduleForm from './add_edit_schedule_form.vue';
import { updateStoreOnScheduleCreate, updateStoreAfterScheduleEdit } from '../utils/cache_updates';
import { isNameFieldValid } from '../utils/common_utils';
import AddEditScheduleForm from './add_edit_schedule_form.vue';
export const i18n = {
cancel: __('Cancel'),
......
<script>
import { GlSprintf, GlModal, GlAlert } from '@gitlab/ui';
import { s__, __ } from '~/locale';
import destroyOncallScheduleMutation from '../graphql/mutations/destroy_oncall_schedule.mutation.graphql';
import getOncallSchedulesQuery from '../graphql/queries/get_oncall_schedules.query.graphql';
import { updateStoreAfterScheduleDelete } from '../utils/cache_updates';
import { s__, __ } from '~/locale';
export const i18n = {
deleteSchedule: s__('OnCallSchedules|Delete schedule'),
......
......@@ -12,13 +12,13 @@ import {
import { capitalize } from 'lodash';
import { formatDate } from '~/lib/utils/datetime_utility';
import { s__, __ } from '~/locale';
import { addRotationModalId, editRotationModalId, PRESET_TYPES } from '../constants';
import ScheduleTimelineSection from './schedule/components/schedule_timeline_section.vue';
import DeleteScheduleModal from './delete_schedule_modal.vue';
import EditScheduleModal from './add_edit_schedule_modal.vue';
import AddEditRotationModal from './rotations/components/add_edit_rotation_modal.vue';
import RotationsListSection from './schedule/components/rotations_list_section.vue';
import { getTimeframeForWeeksView } from './schedule/utils';
import { addRotationModalId, editRotationModalId, PRESET_TYPES } from '../constants';
export const i18n = {
scheduleForTz: s__('OnCallSchedules|On-call schedule for the %{timezone}'),
......
<script>
import { GlAlert, GlButton, GlEmptyState, GlLoadingIcon, GlModalDirective } from '@gitlab/ui';
import mockRotations from '../../../../../spec/frontend/oncall_schedule/mocks/mock_rotation.json';
import * as Sentry from '~/sentry/wrapper';
import AddScheduleModal from './add_edit_schedule_modal.vue';
import OncallSchedule from './oncall_schedule.vue';
import { s__ } from '~/locale';
import getOncallSchedulesQuery from '../graphql/queries/get_oncall_schedules.query.graphql';
import { fetchPolicies } from '~/lib/graphql';
import mockRotations from '../../../../../spec/frontend/oncall_schedule/mocks/mock_rotation.json';
import getOncallSchedulesQuery from '../graphql/queries/get_oncall_schedules.query.graphql';
import AddScheduleModal from './add_edit_schedule_modal.vue';
import OncallSchedule from './oncall_schedule.vue';
export const addScheduleModalId = 'addScheduleModal';
......
......@@ -13,8 +13,8 @@ import { isNameFieldValid } from 'ee/oncall_schedules/utils/common_utils';
import { s__, __ } from '~/locale';
import createFlash, { FLASH_TYPES } from '~/flash';
import usersSearchQuery from '~/graphql_shared/queries/users_search.query.graphql';
import AddEditRotationForm from './add_edit_rotation_form.vue';
import { format24HourTimeStringFromInt } from '~/lib/utils/datetime_utility';
import AddEditRotationForm from './add_edit_rotation_form.vue';
export const i18n = {
rotationCreated: s__('OnCallSchedules|Successfully created a new rotation'),
......
<script>
import { GlResizeObserverDirective } from '@gitlab/ui';
import { PRESET_TYPES, HOURS_IN_DAY } from 'ee/oncall_schedules/constants';
import updateShiftTimeUnitWidthMutation from 'ee/oncall_schedules/graphql/mutations/update_shift_time_unit_width.mutation.graphql';
import CommonMixin from 'ee/oncall_schedules/mixins/common_mixin';
import { GlResizeObserverDirective } from '@gitlab/ui';
export default {
PRESET_TYPES,
......
<script>
import { GlResizeObserverDirective } from '@gitlab/ui';
import { PRESET_TYPES } from 'ee/oncall_schedules/constants';
import updateShiftTimeUnitWidthMutation from 'ee/oncall_schedules/graphql/mutations/update_shift_time_unit_width.mutation.graphql';
import CommonMixin from 'ee/oncall_schedules/mixins/common_mixin';
import { GlResizeObserverDirective } from '@gitlab/ui';
export default {
PRESET_TYPES,
......
......@@ -4,8 +4,8 @@ import axios from '~/lib/utils/axios_utils';
import AccessorUtilities from '~/lib/utils/accessor';
import { deprecatedCreateFlash as Flash } from '~/flash';
import CreateItemDropdown from '~/create_item_dropdown';
import { ACCESS_LEVELS, LEVEL_TYPES } from './constants';
import { __ } from '~/locale';
import { ACCESS_LEVELS, LEVEL_TYPES } from './constants';
const PROTECTED_ENVIRONMENT_INPUT = 'input[name="protected_environment[name]"]';
......
......@@ -3,8 +3,8 @@ import { find } from 'lodash';
import AccessDropdown from '~/projects/settings/access_dropdown';
import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as Flash } from '~/flash';
import { ACCESS_LEVELS, LEVEL_TYPES } from './constants';
import { __ } from '~/locale';
import { ACCESS_LEVELS, LEVEL_TYPES } from './constants';
export default class ProtectedEnvironmentEdit {
constructor(options) {
......
......@@ -10,9 +10,8 @@ import {
GlDropdownItem,
GlLoadingIcon,
} from '@gitlab/ui';
import { SEARCH_DEBOUNCE } from '../constants';
import { __ } from '~/locale';
import { SEARCH_DEBOUNCE } from '../constants';
export default {
components: {
......
......@@ -5,6 +5,7 @@ import { GlLoadingIcon, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
import AddItemForm from '~/related_issues/components/add_issuable_form.vue';
import SlotSwitch from '~/vue_shared/components/slot_switch.vue';
import { OVERFLOW_AFTER } from '../constants';
import CreateEpicForm from './create_epic_form.vue';
import CreateIssueForm from './create_issue_form.vue';
import TreeItemRemoveModal from './tree_item_remove_modal.vue';
......@@ -12,8 +13,6 @@ import TreeItemRemoveModal from './tree_item_remove_modal.vue';
import RelatedItemsTreeHeader from './related_items_tree_header.vue';
import RelatedItemsTreeBody from './related_items_tree_body.vue';
import { OVERFLOW_AFTER } from '../constants';
const FORM_SLOTS = {
addItem: 'addItem',
createEpic: 'createEpic',
......
......@@ -5,9 +5,8 @@ import { GlTooltipDirective, GlLoadingIcon, GlButton, GlIcon } from '@gitlab/ui'
import { __ } from '~/locale';
import TreeItemBody from './tree_item_body.vue';
import { ChildType } from '../constants';
import TreeItemBody from './tree_item_body.vue';
export default {
ChildType,
......
......@@ -17,13 +17,12 @@ import ItemMilestone from '~/vue_shared/components/issue/issue_milestone.vue';
import ItemAssignees from '~/vue_shared/components/issue/issue_assignees.vue';
import ItemDueDate from '~/boards/components/issue_due_date.vue';
import { ChildType, ChildState, itemRemoveModalId } from '../constants';
import EpicHealthStatus from './epic_health_status.vue';
import IssueHealthStatus from './issue_health_status.vue';
import StateTooltip from './state_tooltip.vue';
import { ChildType, ChildState, itemRemoveModalId } from '../constants';
export default {
itemRemoveModalId,
components: {
......
<script>
import { VULNERABILITY_MODAL_ID } from 'ee/vue_shared/security_reports/components/constants';
import { GlTooltipDirective, GlResizeObserverDirective } from '@gitlab/ui';
import { mapActions } from 'vuex';
import { VULNERABILITY_MODAL_ID } from 'ee/vue_shared/security_reports/components/constants';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
export default {
......
......@@ -14,10 +14,9 @@ import ZenMode from '~/zen_mode';
import { TAB_KEY_CODE } from '~/lib/utils/keycodes';
import IssuableBody from '~/issuable_show/components/issuable_body.vue';
import RequirementStatusBadge from './requirement_status_badge.vue';
import RequirementMeta from '../mixins/requirement_meta';
import { MAX_TITLE_LENGTH, TestReportStatus } from '../constants';
import RequirementStatusBadge from './requirement_status_badge.vue';
export default {
maxTitleLength: MAX_TITLE_LENGTH,
......
......@@ -2,10 +2,9 @@
import { GlPopover, GlLink, GlAvatar, GlButton, GlTooltipDirective } from '@gitlab/ui';
import timeagoMixin from '~/vue_shared/mixins/timeago';
import RequirementStatusBadge from './requirement_status_badge.vue';
import RequirementMeta from '../mixins/requirement_meta';
import { FilterState } from '../constants';
import RequirementStatusBadge from './requirement_status_badge.vue';
export default {
components: {
......
......@@ -13,26 +13,24 @@ import AuthorToken from '~/vue_shared/components/filtered_search_bar/tokens/auth
import { DEFAULT_LABEL_ANY } from '~/vue_shared/components/filtered_search_bar/constants';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import RequirementsTabs from './requirements_tabs.vue';
import RequirementsLoading from './requirements_loading.vue';
import RequirementsEmptyState from './requirements_empty_state.vue';
import RequirementItem from './requirement_item.vue';
import RequirementForm from './requirement_form.vue';
import ImportRequirementsModal from './import_requirements_modal.vue';
import ExportRequirementsModal from './export_requirements_modal.vue';
import projectRequirements from '../queries/projectRequirements.query.graphql';
import projectRequirementsCount from '../queries/projectRequirementsCount.query.graphql';
import createRequirement from '../queries/createRequirement.mutation.graphql';
import updateRequirement from '../queries/updateRequirement.mutation.graphql';
import exportRequirement from '../queries/exportRequirements.mutation.graphql';
import {
FilterState,
AvailableSortOptions,
TestReportStatus,
DEFAULT_PAGE_SIZE,
} from '../constants';
import RequirementsTabs from './requirements_tabs.vue';
import RequirementsLoading from './requirements_loading.vue';
import RequirementsEmptyState from './requirements_empty_state.vue';
import RequirementItem from './requirement_item.vue';
import RequirementForm from './requirement_form.vue';
import ImportRequirementsModal from './import_requirements_modal.vue';
import ExportRequirementsModal from './export_requirements_modal.vue';
export default {
DEFAULT_PAGE_SIZE,
......
<script>
import { delay } from 'lodash';
import EpicItemDetails from './epic_item_details.vue';
import EpicItemTimeline from './epic_item_timeline.vue';
import CommonMixin from '../mixins/common_mixin';
import QuartersPresetMixin from '../mixins/quarters_preset_mixin';
import MonthsPresetMixin from '../mixins/months_preset_mixin';
import WeeksPresetMixin from '../mixins/weeks_preset_mixin';
import { EPIC_HIGHLIGHT_REMOVE_AFTER } from '../constants';
import CurrentDayIndicator from './current_day_indicator.vue';
import { EPIC_HIGHLIGHT_REMOVE_AFTER } from '../constants';
import EpicItemTimeline from './epic_item_timeline.vue';
import EpicItemDetails from './epic_item_details.vue';
export default {
components: {
......
<script>
import { mapState, mapActions } from 'vuex';
import { GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import eventHub from '../event_hub';
import { __, n__ } from '~/locale';
import eventHub from '../event_hub';
import { EPIC_DETAILS_CELL_WIDTH, EPIC_ITEM_HEIGHT, TIMELINE_CELL_MIN_WIDTH } from '../constants';
import MilestoneTimeline from './milestone_timeline.vue';
......
......@@ -5,16 +5,15 @@ import { mapState, mapActions } from 'vuex';
import { __, s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import EpicsListEmpty from './epics_list_empty.vue';
import RoadmapFilters from './roadmap_filters.vue';
import RoadmapShell from './roadmap_shell.vue';
import eventHub from '../event_hub';
import {
EXTEND_AS,
EPICS_LIMIT_DISMISSED_COOKIE_NAME,
EPICS_LIMIT_DISMISSED_COOKIE_TIMEOUT,
} from '../constants';
import EpicsListEmpty from './epics_list_empty.vue';
import RoadmapFilters from './roadmap_filters.vue';
import RoadmapShell from './roadmap_shell.vue';
export default {
i18n: {
......
......@@ -3,15 +3,14 @@ import { mapActions } from 'vuex';
import Translate from '~/vue_shared/translate';
import EpicItem from './components/epic_item.vue';
import EpicItemContainer from './components/epic_item_container.vue';
import {
parseBoolean,
urlParamsToObject,
convertObjectPropsToCamelCase,
} from '~/lib/utils/common_utils';
import { visitUrl, mergeUrlParams } from '~/lib/utils/url_utility';
import EpicItem from './components/epic_item.vue';
import EpicItemContainer from './components/epic_item_container.vue';
import { PRESET_TYPES, EPIC_DETAILS_CELL_WIDTH } from './constants';
......
import $ from 'jquery';
import { __ } from '~/locale';
import DirtyFormChecker from './dirty_form_checker';
import setupToggleButtons from '~/toggle_buttons';
import { parseBoolean } from '~/lib/utils/common_utils';
import { fixTitle } from '~/tooltips';
import DirtyFormChecker from './dirty_form_checker';
const CALLOUT_SELECTOR = '.js-callout';
const HELPER_SELECTOR = '.js-helper-text';
......
......@@ -4,9 +4,9 @@ import { camelCase, kebabCase } from 'lodash';
import * as Sentry from '~/sentry/wrapper';
import { __, s__ } from '~/locale';
import { getLocationHash } from '~/lib/utils/url_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import * as cacheUtils from '../graphql/cache_utils';
import { getProfileSettings } from '../settings/profiles';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default {
components: {
......
......@@ -7,11 +7,11 @@ import {
} from 'ee/security_configuration/dast_site_validation/constants';
import DastSiteValidationModal from 'ee/security_configuration/dast_site_validation/components/dast_site_validation_modal.vue';
import dastSiteValidationsQuery from 'ee/security_configuration/dast_site_validation/graphql/dast_site_validations.query.graphql';
import { updateSiteProfilesStatuses } from '../graphql/cache_utils';
import ProfilesList from './dast_profiles_list.vue';
import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { fetchPolicies } from '~/lib/graphql';
import { updateSiteProfilesStatuses } from '../graphql/cache_utils';
import ProfilesList from './dast_profiles_list.vue';
const { NONE, PENDING, INPROGRESS, FAILED } = DAST_SITE_VALIDATION_STATUS;
......
......@@ -19,8 +19,8 @@ import { __, s__ } from '~/locale';
import { serializeFormObject, isEmptyValue } from '~/lib/utils/forms';
import dastScannerProfileCreateMutation from '../graphql/dast_scanner_profile_create.mutation.graphql';
import dastScannerProfileUpdateMutation from '../graphql/dast_scanner_profile_update.mutation.graphql';
import tooltipIcon from './tooltip_icon.vue';
import { SCAN_TYPE, SCAN_TYPE_OPTIONS } from '../constants';
import tooltipIcon from './tooltip_icon.vue';
const SPIDER_TIMEOUT_MIN = 0;
const SPIDER_TIMEOUT_MAX = 2880;
......
......@@ -16,9 +16,9 @@ import { __, s__ } from '~/locale';
import { serializeFormObject } from '~/lib/utils/forms';
import validation from '~/vue_shared/directives/validation';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import DastSiteAuthSection from './dast_site_auth_section.vue';
import dastSiteProfileCreateMutation from '../graphql/dast_site_profile_create.mutation.graphql';
import dastSiteProfileUpdateMutation from '../graphql/dast_site_profile_update.mutation.graphql';
import DastSiteAuthSection from './dast_site_auth_section.vue';
export default {
name: 'DastSiteProfileForm',
......
......@@ -4,10 +4,10 @@ import { cloneDeep } from 'lodash';
import * as Sentry from '~/sentry/wrapper';
import { __, s__ } from '~/locale';
import { redirectTo } from '~/lib/utils/url_utility';
import configureSastMutation from '../graphql/configure_sast.mutation.graphql';
import AnalyzerConfiguration from './analyzer_configuration.vue';
import DynamicFields from './dynamic_fields.vue';
import ExpandableSection from './expandable_section.vue';
import configureSastMutation from '../graphql/configure_sast.mutation.graphql';
import {
toSastCiConfigurationEntityInput,
toSastCiConfigurationAnalyzerEntityInput,
......
<script>
import { mapState, mapActions } from 'vuex';
import { severityFilter, scannerFilter } from 'ee/security_dashboard/helpers';
import { GlToggle } from '@gitlab/ui';
import StandardFilter from './filters/standard_filter.vue';
import { severityFilter, scannerFilter } from 'ee/security_dashboard/helpers';
import { DISMISSAL_STATES } from '../store/modules/filters/constants';
import StandardFilter from './filters/standard_filter.vue';
export default {
components: {
......
......@@ -3,11 +3,11 @@ import { GlLoadingIcon } from '@gitlab/ui';
import SecurityDashboardLayout from 'ee/security_dashboard/components/security_dashboard_layout.vue';
import GroupSecurityVulnerabilities from 'ee/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue';
import Filters from 'ee/security_dashboard/components/first_class_vulnerability_filters.vue';
import CsvExportButton from './csv_export_button.vue';
import vulnerableProjectsQuery from '../graphql/queries/vulnerable_projects.query.graphql';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
import CsvExportButton from './csv_export_button.vue';
import DashboardNotConfigured from './empty_states/group_dashboard_not_configured.vue';
import VulnerabilitiesCountList from './vulnerability_count_list.vue';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
export default {
components: {
......
<script>
import produce from 'immer';
import { GlAlert, GlLoadingIcon, GlIntersectionObserver } from '@gitlab/ui';
import VulnerabilityList from './vulnerability_list.vue';
import vulnerabilitiesQuery from '../graphql/queries/group_vulnerabilities.query.graphql';
import { VULNERABILITIES_PER_PAGE } from '../store/constants';
import { preparePageInfo } from '../helpers';
import VulnerabilityList from './vulnerability_list.vue';
export default {
components: {
......
......@@ -4,11 +4,11 @@ import Filters from 'ee/security_dashboard/components/first_class_vulnerability_
import projectsQuery from 'ee/security_dashboard/graphql/queries/get_instance_security_dashboard_projects.query.graphql';
import createFlash from '~/flash';
import { createProjectLoadingError } from '../helpers';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
import InstanceSecurityVulnerabilities from './first_class_instance_security_dashboard_vulnerabilities.vue';
import CsvExportButton from './csv_export_button.vue';
import DashboardNotConfigured from './empty_states/instance_dashboard_not_configured.vue';
import VulnerabilitiesCountList from './vulnerability_count_list.vue';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
export default {
components: {
......
......@@ -2,10 +2,10 @@
import produce from 'immer';
import { GlAlert, GlIntersectionObserver, GlLoadingIcon } from '@gitlab/ui';
import { fetchPolicies } from '~/lib/graphql';
import VulnerabilityList from './vulnerability_list.vue';
import vulnerabilitiesQuery from '../graphql/queries/instance_vulnerabilities.query.graphql';
import { VULNERABILITIES_PER_PAGE } from '../store/constants';
import { preparePageInfo } from '../helpers';
import VulnerabilityList from './vulnerability_list.vue';
export default {
components: {
......
......@@ -6,10 +6,10 @@ import projectsQuery from 'ee/security_dashboard/graphql/queries/get_instance_se
import addProjectToSecurityDashboard from 'ee/security_dashboard/graphql/mutations/add_project_to_security_dashboard.mutation.graphql';
import deleteProjectFromSecurityDashboard from 'ee/security_dashboard/graphql/mutations/delete_project_from_security_dashboard.mutation.graphql';
import { createInvalidProjectMessage } from 'ee/security_dashboard/utils/first_class_project_manager_utils';
import ProjectList from './project_list.vue';
import ProjectSelector from '~/vue_shared/components/project_selector/project_selector.vue';
import { __, s__, sprintf } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import ProjectList from './project_list.vue';
export default {
MINIMUM_QUERY_LENGTH: 3,
......
<script>
import Cookies from 'js-cookie';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
import AutoFixUserCallout from './auto_fix_user_callout.vue';
import ProjectPipelineStatus from './project_pipeline_status.vue';
import ProjectVulnerabilitiesApp from './project_vulnerabilities.vue';
......@@ -9,7 +10,6 @@ import SecurityDashboardLayout from './security_dashboard_layout.vue';
import VulnerabilitiesCountList from './vulnerability_count_list.vue';
import Filters from './first_class_vulnerability_filters.vue';
import CsvExportButton from './csv_export_button.vue';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
export default {
components: {
......
......@@ -10,8 +10,8 @@ import {
millisecondsPerDay,
} from '~/lib/utils/datetime_utility';
import { formattedChangeInPercent } from '~/lib/utils/number_utils';
import ChartButtons from './vulnerability_chart_buttons.vue';
import { SEVERITY_LEVELS, DAYS } from '../store/constants';
import ChartButtons from './vulnerability_chart_buttons.vue';
const ISO_DATE = 'isoDate';
......
......@@ -2,13 +2,13 @@
import { GlLoadingIcon } from '@gitlab/ui';
import createFlash from '~/flash';
import { createProjectLoadingError } from '../helpers';
import vulnerabilityHistoryQuery from '../graphql/queries/group_vulnerability_history.query.graphql';
import vulnerabilityGradesQuery from '../graphql/queries/group_vulnerability_grades.query.graphql';
import vulnerableProjectsQuery from '../graphql/queries/vulnerable_projects.query.graphql';
import DashboardNotConfigured from './empty_states/group_dashboard_not_configured.vue';
import SecurityChartsLayout from './security_charts_layout.vue';
import VulnerabilityChart from './first_class_vulnerability_chart.vue';
import VulnerabilitySeverities from './first_class_vulnerability_severities.vue';
import vulnerabilityHistoryQuery from '../graphql/queries/group_vulnerability_history.query.graphql';
import vulnerabilityGradesQuery from '../graphql/queries/group_vulnerability_grades.query.graphql';
import vulnerableProjectsQuery from '../graphql/queries/vulnerable_projects.query.graphql';
export default {
components: {
......
......@@ -2,13 +2,13 @@
import { GlLoadingIcon } from '@gitlab/ui';
import createFlash from '~/flash';
import { createProjectLoadingError } from '../helpers';
import projectsQuery from '../graphql/queries/get_instance_security_dashboard_projects.query.graphql';
import vulnerabilityHistoryQuery from '../graphql/queries/instance_vulnerability_history.query.graphql';
import vulnerabilityGradesQuery from '../graphql/queries/instance_vulnerability_grades.query.graphql';
import DashboardNotConfigured from './empty_states/instance_dashboard_not_configured.vue';
import SecurityChartsLayout from './security_charts_layout.vue';
import VulnerabilityChart from './first_class_vulnerability_chart.vue';
import VulnerabilitySeverities from './first_class_vulnerability_severities.vue';
import projectsQuery from '../graphql/queries/get_instance_security_dashboard_projects.query.graphql';
import vulnerabilityHistoryQuery from '../graphql/queries/instance_vulnerability_history.query.graphql';
import vulnerabilityGradesQuery from '../graphql/queries/instance_vulnerability_grades.query.graphql';
export default {
components: {
......
......@@ -2,11 +2,11 @@
import { mapActions } from 'vuex';
import { GlEmptyState } from '@gitlab/ui';
import { s__ } from '~/locale';
import SecurityReportsSummary from './security_reports_summary.vue';
import SecurityDashboard from './security_dashboard_vuex.vue';
import { fetchPolicies } from '~/lib/graphql';
import pipelineSecurityReportSummaryQuery from '../graphql/queries/pipeline_security_report_summary.query.graphql';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import pipelineSecurityReportSummaryQuery from '../graphql/queries/pipeline_security_report_summary.query.graphql';
import SecurityReportsSummary from './security_reports_summary.vue';
import SecurityDashboard from './security_dashboard_vuex.vue';
export default {
name: 'PipelineSecurityDashboard',
......
......@@ -2,9 +2,9 @@
import { GlLink } from '@gitlab/ui';
import { __, s__ } from '~/locale';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import PipelineStatusBadge from './pipeline_status_badge.vue';
import projectAutoFixMrsCountQuery from '../graphql/queries/project_auto_fix_mrs_count.query.graphql';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import projectAutoFixMrsCountQuery from '../graphql/queries/project_auto_fix_mrs_count.query.graphql';
import PipelineStatusBadge from './pipeline_status_badge.vue';
export default {
components: {
......
......@@ -5,9 +5,9 @@ import { s__, __ } from '~/locale';
import createFlash from '~/flash';
import { formatDate, getDateInPast } from '~/lib/utils/datetime_utility';
import { createProjectLoadingError } from '../helpers';
import projectsHistoryQuery from '../graphql/queries/project_vulnerabilities_by_day_and_count.query.graphql';
import DashboardNotConfigured from './empty_states/reports_not_configured.vue';
import SecurityChartsLayout from './security_charts_layout.vue';
import projectsHistoryQuery from '../graphql/queries/project_vulnerabilities_by_day_and_count.query.graphql';
const MAX_DAYS = 100;
const ISO_DATE = 'isoDate';
......
......@@ -12,9 +12,9 @@ import convertReportType from 'ee/vue_shared/security_reports/store/utils/conver
import getPrimaryIdentifier from 'ee/vue_shared/security_reports/store/utils/get_primary_identifier';
import { VULNERABILITY_MODAL_ID } from 'ee/vue_shared/security_reports/components/constants';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import { DASHBOARD_TYPES } from '../store/constants';
import VulnerabilityActionButtons from './vulnerability_action_buttons.vue';
import VulnerabilityIssueLink from './vulnerability_issue_link.vue';
import { DASHBOARD_TYPES } from '../store/constants';
export default {
name: 'SecurityDashboardTableRow',
......
<script>
import vulnerabilitySeveritiesCountQuery from '../graphql/queries/vulnerability_severities_count.query.graphql';
import VulnerabilityCountListLayout from './vulnerability_count_list_layout.vue';
import { vulnerabilitiesSeverityCountScopes } from '../constants';
import VulnerabilityCountListLayout from './vulnerability_count_list_layout.vue';
export default {
components: {
......
......@@ -18,14 +18,14 @@ import VulnerabilityCommentIcon from 'ee/security_dashboard/components/vulnerabi
import convertReportType from 'ee/vue_shared/security_reports/store/utils/convert_report_type';
import getPrimaryIdentifier from 'ee/vue_shared/security_reports/store/utils/get_primary_identifier';
import { VULNERABILITY_STATES } from 'ee/vulnerabilities/constants';
import SecurityScannerAlert from './security_scanner_alert.vue';
import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import { formatDate } from '~/lib/utils/datetime_utility';
import { s__, __, sprintf } from '~/locale';
import SelectionSummary from './selection_summary.vue';
import IssuesBadge from './issues_badge.vue';
import { convertToSnakeCase } from '~/lib/utils/text_utility';
import { VULNERABILITIES_PER_PAGE } from '../store/constants';
import SelectionSummary from './selection_summary.vue';
import IssuesBadge from './issues_badge.vue';
import SecurityScannerAlert from './security_scanner_alert.vue';
export const SCANNER_ALERT_DISMISSED_LOCAL_STORAGE_KEY =
'vulnerability_list_scanner_alert_dismissed';
......
import Vue from 'vue';
import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants';
import { parseBoolean } from '~/lib/utils/common_utils';
import FirstClassProjectSecurityDashboard from './components/first_class_project_security_dashboard.vue';
import FirstClassGroupSecurityDashboard from './components/first_class_group_security_dashboard.vue';
import FirstClassInstanceSecurityDashboard from './components/first_class_instance_security_dashboard.vue';
......@@ -7,7 +8,6 @@ import UnavailableState from './components/unavailable_state.vue';
import createStore from './store';
import createRouter from './router';
import apolloProvider from './graphql/provider';
import { parseBoolean } from '~/lib/utils/common_utils';
export default (el, dashboardType) => {
if (!el) {
......
import { mapValues } from 'lodash';
import Tracking from '~/tracking';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import { SET_FILTER, SET_HIDE_DISMISSED } from './mutation_types';
import { DISMISSAL_STATES } from './constants';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
export const setFilter = ({ commit }, filter) => {
// Convert the filter key to snake case and the selected option IDs to lower case. The API
......
import { groupByDateRanges } from './utils';
import { UNSCANNED_PROJECTS_DATE_RANGES } from '../../constants';
import { groupByDateRanges } from './utils';
export const untestedProjects = ({ projects }) =>
projects.filter(({ securityTestsUnconfigured }) => securityTestsUnconfigured === true);
......
......@@ -9,11 +9,11 @@ import {
GlIcon,
GlTooltipDirective,
} from '@gitlab/ui';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import groupIterationsQuery from '../queries/group_iterations.query.graphql';
import currentIterationQuery from '../queries/issue_iteration.query.graphql';
import setIssueIterationMutation from '../queries/set_iteration_on_issue.mutation.graphql';
import { iterationSelectTextMap, iterationDisplayState } from '../constants';
import { deprecatedCreateFlash as createFlash } from '~/flash';
export default {
noIteration: iterationSelectTextMap.noIteration,
......
......@@ -2,8 +2,8 @@
import { mapGetters } from 'vuex';
import { deprecatedCreateFlash as Flash } from '~/flash';
import { __ } from '~/locale';
import Status from './status.vue';
import { OPENED, REOPENED } from '~/notes/constants';
import Status from './status.vue';
export default {
components: {
......
......@@ -2,13 +2,13 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { parseBoolean } from '~/lib/utils/common_utils';
import * as CEMountSidebar from '~/sidebar/mount_sidebar';
import createDefaultClient from '~/lib/graphql';
import { store } from '~/notes/stores';
import SidebarItemEpicsSelect from './components/sidebar_item_epics_select.vue';
import SidebarStatus from './components/status/sidebar_status.vue';
import SidebarWeight from './components/weight/sidebar_weight.vue';
import IterationSelect from './components/iteration_select.vue';
import SidebarStore from './stores/sidebar_store';
import createDefaultClient from '~/lib/graphql';
import { store } from '~/notes/stores';
Vue.use(VueApollo);
......
......@@ -8,15 +8,15 @@ import {
GlKeysetPagination,
} from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { parseBoolean } from '~/lib/utils/common_utils';
import query from '../queries/storage.query.graphql';
import { formatUsageSize, parseGetStorageResults } from '../utils';
import { PROJECTS_PER_PAGE } from '../constants';
import ProjectsTable from './projects_table.vue';
import UsageGraph from './usage_graph.vue';
import UsageStatistics from './usage_statistics.vue';
import StorageInlineAlert from './storage_inline_alert.vue';
import query from '../queries/storage.query.graphql';
import TemporaryStorageIncreaseModal from './temporary_storage_increase_modal.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import { formatUsageSize, parseGetStorageResults } from '../utils';
import { PROJECTS_PER_PAGE } from '../constants';
export default {
name: 'StorageCounterApp',
......
<script>
import { GlSearchBoxByType } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { SEARCH_DEBOUNCE_MS } from '~/ref/constants';
import Project from './project.vue';
import ProjectWithExcessStorage from './project_with_excess_storage.vue';
import ProjectsSkeletonLoader from './projects_skeleton_loader.vue';
import { SEARCH_DEBOUNCE_MS } from '~/ref/constants';
export default {
components: {
......
<script>
import { GlButton, GlSprintf } from '@gitlab/ui';
import UsageStatisticsCard from './usage_statistics_card.vue';
import { s__ } from '~/locale';
import { formatUsageSize } from '../utils';
import UsageStatisticsCard from './usage_statistics_card.vue';
export default {
components: {
......
<script>
import { STEPS, SUBSCRIPTON_FLOW_STEPS } from 'ee/registrations/constants';
import { mapState } from 'vuex';
import { STEPS, SUBSCRIPTON_FLOW_STEPS } from 'ee/registrations/constants';
import ProgressBar from 'ee/registrations/components/progress_bar.vue';
import { s__ } from '~/locale';
import SubscriptionDetails from './checkout/subscription_details.vue';
......
<script>
import { isEmpty } from 'lodash';
import { mapState, mapGetters, mapActions } from 'vuex';
import { NEW_GROUP } from 'ee/subscriptions/new/constants';
import { GlFormGroup, GlFormSelect, GlFormInput, GlSprintf, GlLink } from '@gitlab/ui';
import { NEW_GROUP } from 'ee/subscriptions/new/constants';
import autofocusonshow from '~/vue_shared/directives/autofocusonshow';
import { sprintf, s__ } from '~/locale';
import Step from './step.vue';
......
import Api from 'ee/api';
import * as types from './mutation_types';
import { sprintf, s__ } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { redirectTo } from '~/lib/utils/url_utility';
import { STEPS, PAYMENT_FORM_ID } from '../constants';
import * as types from './mutation_types';
export const activateStep = ({ commit }, currentStep) => {
if (STEPS.includes(currentStep)) {
......
import { STEPS, NEW_GROUP } from '../constants';
import { s__ } from '~/locale';
import { STEPS, NEW_GROUP } from '../constants';
export const currentStep = (state) => state.currentStep;
......
......@@ -12,12 +12,11 @@ import IssuableList from '~/issuable_list/components/issuable_list_root.vue';
import AuthorToken from '~/vue_shared/components/filtered_search_bar/tokens/author_token.vue';
import LabelToken from '~/vue_shared/components/filtered_search_bar/tokens/label_token.vue';
import TestCaseListEmptyState from './test_case_list_empty_state.vue';
import projectTestCases from '../queries/project_test_cases.query.graphql';
import projectTestCasesCount from '../queries/project_test_cases_count.query.graphql';
import { TestCaseTabs, AvailableSortOptions, DEFAULT_PAGE_SIZE } from '../constants';
import TestCaseListEmptyState from './test_case_list_empty_state.vue';
export default {
name: 'TestCaseList',
......
......@@ -14,8 +14,8 @@ import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import IssuableShow from '~/issuable_show/components/issuable_show_root.vue';
import IssuableEventHub from '~/issuable_show/event_hub';
import TestCaseSidebar from './test_case_sidebar.vue';
import TestCaseGraphQL from '../mixins/test_case_graphql';
import TestCaseSidebar from './test_case_sidebar.vue';
const stateEvent = {
Close: 'CLOSE',
......
import { safeLoad } from 'js-yaml';
import { buildRule } from './rules';
import {
DisabledByLabel,
EndpointMatchModeAny,
......@@ -13,6 +12,7 @@ import {
RuleTypeCIDR,
RuleTypeFQDN,
} from '../constants';
import { buildRule } from './rules';
/*
Convert list of matchLabel selectors used by the endpoint rule to an
......
import { safeDump } from 'js-yaml';
import { EndpointMatchModeAny, DisabledByLabel, CiliumNetworkPolicyKind } from '../constants';
import { ruleSpec } from './rules';
import { labelSelector } from './utils';
import { EndpointMatchModeAny, DisabledByLabel, CiliumNetworkPolicyKind } from '../constants';
/*
Return kubernetes resource specification object for a policy.
......
<script>
import { GlAlert, GlButton, GlLink, GlSprintf } from '@gitlab/ui';
import getAgentCount from '../../graphql/queries/get_agent_count.query.graphql';
import { s__ } from '~/locale';
import getAgentCount from '../../graphql/queries/get_agent_count.query.graphql';
export default {
i18n: {
......
import * as types from './mutation_types';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
const setPolicies = (state, policies) => {
state.policies = policies.map((policy) => convertObjectPropsToCamelCase(policy));
......
......@@ -2,8 +2,8 @@ import { s__ } from '~/locale';
import pollUntilComplete from '~/lib/utils/poll_until_complete';
import httpStatusCodes from '~/lib/utils/http_status';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import * as types from './mutation_types';
import { getTimeWindowParams } from '../../utils';
import * as types from './mutation_types';
export const requestStatistics = ({ commit }, timeWindowParams) => {
commit(types.REQUEST_STATISTICS, timeWindowParams);
......
......@@ -3,8 +3,8 @@ import { deprecatedCreateFlash as createFlash } from '~/flash';
import Approvals from '~/vue_merge_request_widget/components/approvals/approvals.vue';
import approvalsMixin from '~/vue_merge_request_widget/mixins/approvals';
import { BV_HIDE_MODAL } from '~/lib/utils/constants';
import ApprovalsAuth from './approvals_auth.vue';
import { FETCH_ERROR } from '~/vue_merge_request_widget/components/approvals/messages';
import ApprovalsAuth from './approvals_auth.vue';
import ApprovalsFooter from './approvals_footer.vue';
export default {
......
......@@ -5,8 +5,8 @@ import EmptyRuleName from 'ee/approvals/components/empty_rule_name.vue';
import { RULE_TYPE_CODE_OWNER, RULE_TYPE_ANY_APPROVER } from 'ee/approvals/constants';
import { sprintf, __, s__ } from '~/locale';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
import ApprovedIcon from './approved_icon.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ApprovedIcon from './approved_icon.vue';
export default {
components: {
......
<script>
import { componentNames } from 'ee/reports/components/issue_body';
import { GlSprintf } from '@gitlab/ui';
import { componentNames } from 'ee/reports/components/issue_body';
import ReportSection from '~/reports/components/report_section.vue';
import { status as reportStatus } from '~/reports/constants';
import { n__, sprintf } from '~/locale';
......
import CEMergeRequestStore from '~/vue_merge_request_widget/stores/mr_widget_store';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mapApprovalsResponse, mapApprovalRulesResponse } from '../mappers';
import { s__ } from '~/locale';
import { mapApprovalsResponse, mapApprovalRulesResponse } from '../mappers';
export default class MergeRequestStore extends CEMergeRequestStore {
constructor(data) {
......
......@@ -6,9 +6,8 @@ import { s__, __ } from '~/locale';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { formatDate, timeFor } from '~/lib/utils/datetime_utility';
import * as types from './mutation_types';
import boardsStore from '~/boards/stores/boards_store';
import * as types from './mutation_types';
export const setInitialData = ({ commit }, data) => commit(types.SET_INITIAL_DATA, data);
export const setIssueId = ({ commit }, issueId) => commit(types.SET_ISSUE_ID, issueId);
......
......@@ -2,8 +2,8 @@ import Vue from 'vue';
import AccessorUtilities from '~/lib/utils/accessor';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '~/locale';
import * as types from './mutation_types';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
export const updatePageInfo = (state, headers) => {
const pageInfo = parseIntPagination(normalizeHeaders(headers));
......
<script>
import { GlButton, GlFormRadioGroup, GlFormRadio } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { s__ } from '~/locale';
import { LICENSE_APPROVAL_STATUS } from '../constants';
import AddLicenseFormDropdown from './add_license_form_dropdown.vue';
import { s__ } from '~/locale';
export default {
name: 'AddLicenseForm',
......
<script>
import { mapActions, mapState } from 'vuex';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import { GlModal, GlSprintf } from '@gitlab/ui';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import { s__, __ } from '~/locale';
export default {
......
......@@ -4,12 +4,12 @@ import { GlButton, GlLoadingIcon, GlIcon, GlPopover } from '@gitlab/ui';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import PaginatedList from '~/vue_shared/components/paginated_list.vue';
import LicenseApprovals from '../../approvals/components/license_compliance/index.vue';
import AddLicenseForm from './components/add_license_form.vue';
import AdminLicenseManagementRow from './components/admin_license_management_row.vue';
import LicenseManagementRow from './components/license_management_row.vue';
import DeleteConfirmationModal from './components/delete_confirmation_modal.vue';
import PaginatedList from '~/vue_shared/components/paginated_list.vue';
import LicenseApprovals from '../../approvals/components/license_compliance/index.vue';
export default {
name: 'LicenseManagement',
......
import { LICENSE_CHECK_NAME } from 'ee/approvals/constants';
import axios from '~/lib/utils/axios_utils';
import pollUntilComplete from '~/lib/utils/poll_until_complete';
import * as types from './mutation_types';
import { LICENSE_APPROVAL_STATUS } from '../constants';
import * as types from './mutation_types';
import { convertToOldReportFormat } from './utils';
export const setAPISettings = ({ commit }, data) => {
......
import { n__, s__, sprintf } from '~/locale';
import { addLicensesMatchingReportGroupStatus, reportGroupHasAtLeastOneLicense } from './utils';
import { LICENSE_APPROVAL_STATUS, REPORT_GROUPS } from '../constants';
import { addLicensesMatchingReportGroupStatus, reportGroupHasAtLeastOneLicense } from './utils';
export const isLoading = (state) =>
state.isLoadingManagedLicenses ||
......
<script>
import EventItem from 'ee/vue_shared/security_reports/components/event_item.vue';
import { GlButton, GlSprintf, GlLink } from '@gitlab/ui';
import EventItem from 'ee/vue_shared/security_reports/components/event_item.vue';
import { __ } from '~/locale';
export default {
......
<script>
import { GlModal } from '@gitlab/ui';
import DismissalNote from 'ee/vue_shared/security_reports/components/dismissal_note.vue';
import DismissalCommentBoxToggle from 'ee/vue_shared/security_reports/components/dismissal_comment_box_toggle.vue';
import DismissalCommentModalFooter from 'ee/vue_shared/security_reports/components/dismissal_comment_modal_footer.vue';
......@@ -7,7 +8,6 @@ import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_re
import ModalFooter from 'ee/vue_shared/security_reports/components/modal_footer.vue';
import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card_vuex.vue';
import VulnerabilityDetails from 'ee/vue_shared/security_reports/components/vulnerability_details.vue';
import { GlModal } from '@gitlab/ui';
import { __ } from '~/locale';
import { VULNERABILITY_MODAL_ID } from './constants';
......
<script>
import { SEVERITY_LEVELS } from 'ee/security_dashboard/store/constants';
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { SEVERITY_LEVELS } from 'ee/security_dashboard/store/constants';
import { SEVERITY_CLASS_NAME_MAP, SEVERITY_TOOLTIP_TITLE_MAP } from './constants';
export default {
......
......@@ -3,11 +3,11 @@ import { GlFriendlyWrap, GlLink, GlBadge } from '@gitlab/ui';
import { SUPPORTING_MESSAGE_TYPES } from 'ee/vulnerabilities/constants';
import { REPORT_TYPES } from 'ee/security_dashboard/store/constants';
import CodeBlock from '~/vue_shared/components/code_block.vue';
import SeverityBadge from './severity_badge.vue';
import getFileLocation from '../store/utils/get_file_location';
import VulnerabilityDetail from './vulnerability_detail.vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { s__, sprintf } from '~/locale';
import getFileLocation from '../store/utils/get_file_location';
import SeverityBadge from './severity_badge.vue';
import VulnerabilityDetail from './vulnerability_detail.vue';
import { bodyWithFallBack } from './helpers';
export default {
......
<script>
import { mapActions, mapState, mapGetters } from 'vuex';
import { once } from 'lodash';
import { componentNames } from 'ee/reports/components/issue_body';
import { GlButton, GlSprintf, GlLink, GlModalDirective } from '@gitlab/ui';
import { componentNames } from 'ee/reports/components/issue_body';
import FuzzingArtifactsDownload from 'ee/security_dashboard/components/fuzzing_artifacts_download.vue';
import ArtifactDownload from './components/artifact_download.vue';
import { LOADING } from '~/reports/constants';
import { securityReportTypeEnumToReportType } from './constants';
import { vulnerabilityModalMixin } from './mixins/vulnerability_modal_mixin';
import ReportSection from '~/reports/components/report_section.vue';
import SummaryRow from '~/reports/components/summary_row.vue';
import Tracking from '~/tracking';
import GroupedIssuesList from '~/reports/components/grouped_issues_list.vue';
import SecuritySummary from '~/vue_shared/security_reports/components/security_summary.vue';
import { mrStates } from '~/mr_popover/constants';
import { fetchPolicies } from '~/lib/graphql';
import IssueModal from './components/modal.vue';
import DastModal from './components/dast_modal.vue';
import securityReportsMixin from './mixins/security_report_mixin';
import createStore from './store';
import { mrStates } from '~/mr_popover/constants';
import { fetchPolicies } from '~/lib/graphql';
import { vulnerabilityModalMixin } from './mixins/vulnerability_modal_mixin';
import { securityReportTypeEnumToReportType } from './constants';
import ArtifactDownload from './components/artifact_download.vue';
import securityReportSummaryQuery from './graphql/mr_security_report_summary.graphql';
import {
MODULE_CONTAINER_SCANNING,
......
<script>
import Visibility from 'visibilityjs';
import { GlIcon } from '@gitlab/ui';
import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue';
import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue';
import Api from 'ee/api';
import { VULNERABILITY_STATE_OBJECTS } from 'ee/vulnerabilities/constants';
import { GlIcon } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import Poll from '~/lib/utils/poll';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { s__, __ } from '~/locale';
import initUserPopovers from '~/user_popovers';
import RelatedIssues from './related_issues.vue';
import HistoryEntry from './history_entry.vue';
import StatusDescription from './status_description.vue';
import initUserPopovers from '~/user_popovers';
export default {
name: 'VulnerabilityFooter',
......
......@@ -10,9 +10,6 @@ import { redirectTo } from '~/lib/utils/url_utility';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { s__ } from '~/locale';
import UsersCache from '~/lib/utils/users_cache';
import ResolutionAlert from './resolution_alert.vue';
import VulnerabilityStateDropdown from './vulnerability_state_dropdown.vue';
import StatusDescription from './status_description.vue';
import { normalizeGraphQLVulnerability } from '../helpers';
import {
VULNERABILITY_STATE_OBJECTS,
......@@ -20,6 +17,9 @@ import {
HEADER_ACTION_BUTTONS,
gidPrefix,
} from '../constants';
import ResolutionAlert from './resolution_alert.vue';
import VulnerabilityStateDropdown from './vulnerability_state_dropdown.vue';
import StatusDescription from './status_description.vue';
export default {
name: 'VulnerabilityHeader',
......
......@@ -6,8 +6,8 @@ import RelatedIssuesBlock from '~/related_issues/components/related_issues_block
import { issuableTypesMap, PathIdSeparator } from '~/related_issues/constants';
import { sprintf, __, s__ } from '~/locale';
import { joinPaths, redirectTo } from '~/lib/utils/url_utility';
import { RELATED_ISSUES_ERRORS } from '../constants';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { RELATED_ISSUES_ERRORS } from '../constants';
import { getFormattedIssue, getAddRelatedIssueRequestParams } from '../helpers';
export default {
......
# frozen_string_literal: true
class Groups::EpicBoardsController < Groups::BoardsController
include BoardsActions
before_action :authorize_read_board!, only: [:index]
def authorize_read_board!
access_denied! unless Feature.enabled?(:epic_boards, group) && can?(current_user, :read_epic_board, group)
end
end
......@@ -3,7 +3,8 @@
module AlertManagement
# Create alerts coming K8 through gitlab-agent
class NetworkAlertService
include Gitlab::Utils::StrongMemoize
extend ::Gitlab::Utils::Override
include ::AlertManagement::AlertProcessing
MONITORING_TOOL = Gitlab::AlertManagement::Payload::MONITORING_TOOLS.fetch(:cilium)
......@@ -12,12 +13,10 @@ module AlertManagement
@payload = payload
end
# Users of this service need to check the agent token before calling `execute`.
# https://gitlab.com/gitlab-org/gitlab/-/issues/292707 will handle token within the service.
def execute
return bad_request unless valid_payload_size?
process_request
process_alert
return bad_request unless alert.persisted?
......@@ -32,57 +31,27 @@ module AlertManagement
Gitlab::Utils::DeepSize.new(payload).valid?
end
def process_request
if alert.persisted?
alert.register_new_event!
else
create_alert
end
end
def create_alert
if alert.save
alert.execute_services
SystemNoteService.create_new_alert(
alert,
MONITORING_TOOL
)
return
end
logger.warn(
message:
"Unable to create AlertManagement::Alert from #{MONITORING_TOOL}",
project_id: project.id,
alert_errors: alert.errors.messages
)
end
def logger
@logger ||= Gitlab::AppLogger
end
def alert
strong_memoize(:alert) { find_existing_alert || build_new_alert }
end
def find_existing_alert
AlertManagement::Alert.not_resolved.for_fingerprint(
project,
incoming_payload.gitlab_fingerprint
).first
end
override :build_new_alert
def build_new_alert
AlertManagement::Alert.new(**incoming_payload.alert_params, domain: :threat_monitoring, ended_at: nil)
AlertManagement::Alert.new(
**incoming_payload.alert_params,
domain: :threat_monitoring,
ended_at: nil
)
end
override :incoming_payload
def incoming_payload
strong_memoize(:incoming_payload) do
Gitlab::AlertManagement::Payload.parse(project, payload, monitoring_tool: MONITORING_TOOL)
end
end
override :resolving_alert?
def resolving_alert?
false
end
def bad_request
ServiceResponse.error(message: 'Bad Request', http_status: :bad_request)
end
......
- return unless group_sidebar_link?(:epics)
- epics_count = group_epics_count(state: 'opened')
- epics_items = ['epics#show', 'epics#index', 'roadmap#show']
- epics_items = ['epics#show', 'epics#index', 'epic_boards#index', 'epic_boards#show', 'roadmap#show']
= nav_link(path: epics_items) do
= link_to group_epics_path(group), class: 'qa-group-epics-link' do
......@@ -20,6 +20,11 @@
= link_to group_epics_path(group), title: 'List' do
%span= _('List')
- if Feature.enabled?(:epic_boards, @group)
= nav_link(path: ['epic_boards#index', 'epic_boards#show'], html_options: { class: "home" }) do
= link_to group_epic_boards_path(group), title: 'Boards' do
%span= _('Boards')
= nav_link(path: 'roadmap#show', html_options: { class: 'home' }) do
= link_to group_roadmap_path(group), title: 'Roadmap' do
%span= _('Roadmap')
......@@ -138,6 +138,8 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
end
end
resources :epic_boards, only: [:index]
namespace :security do
resource :dashboard, only: [:show], controller: :dashboard
resources :vulnerabilities, only: [:index]
......
......@@ -66,6 +66,7 @@ RSpec.describe 'Group navbar' do
context 'when epics are available' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: false)
insert_after_nav_item(
_('Group overview'),
......@@ -84,6 +85,28 @@ RSpec.describe 'Group navbar' do
it_behaves_like 'verified navigation bar'
end
context 'when epics and epic boards are available' do
before do
stub_licensed_features(epics: true)
insert_after_nav_item(
_('Group overview'),
new_nav_item: {
nav_item: _('Epics'),
nav_sub_items: [
_('List'),
_('Boards'),
_('Roadmap')
]
}
)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
context 'when the logged in user is the owner' do
before do
group.add_owner(user)
......
......@@ -12,7 +12,7 @@ module API
params do
requires :id, type: String, desc: 'The ID of a group'
end
resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
resource :groups, requirements: ::API::Labels::LABEL_ENDPOINT_REQUIREMENTS do
desc 'Get all labels of the group' do
detail 'This feature was added in GitLab 11.8'
success Entities::GroupLabel
......
......@@ -9,10 +9,14 @@ module API
feature_category :issue_tracking
LABEL_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(
name: API::NO_SLASH_URL_PART_REGEX,
label_id: API::NO_SLASH_URL_PART_REGEX)
params do
requires :id, type: String, desc: 'The ID of a project'
end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
resource :projects, requirements: LABEL_ENDPOINT_REQUIREMENTS do
desc 'Get all labels of the project' do
success Entities::ProjectLabel
end
......
......@@ -6,6 +6,9 @@ module API
before { authenticate! }
SUBSCRIBE_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(
subscribable_id: API::NO_SLASH_URL_PART_REGEX)
subscribables = [
{
type: 'merge_requests',
......@@ -44,7 +47,7 @@ module API
requires :id, type: String, desc: "The #{source_type} ID"
requires :subscribable_id, type: String, desc: 'The ID of a resource'
end
resource source_type.pluralize, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
resource source_type.pluralize, requirements: SUBSCRIBE_ENDPOINT_REQUIREMENTS do
desc 'Subscribe to a resource' do
success subscribable[:entity]
end
......
......@@ -6,7 +6,9 @@ module Banzai
def call
return text unless context.key?(:limit)
text.truncate_bytes(context[:limit])
# Use three dots instead of the ellipsis Unicode character because
# some clients show the raw Unicode value in the merge commit.
text.truncate_bytes(context[:limit], omission: '...')
end
end
end
......
......@@ -22,7 +22,7 @@ RSpec.describe Banzai::Filter::TruncateSourceFilter do
it 'truncates UTF-8 text by bytes, on a character boundary' do
utf8_text = '日本語の文字が大きい'
truncated = '日'
truncated = '日...'
expect(filter(utf8_text, limit: truncated.bytesize)).to eq(truncated)
expect(filter(utf8_text, limit: utf8_text.bytesize)).to eq(utf8_text)
......
......@@ -30,6 +30,6 @@ RSpec.describe Banzai::Pipeline::PreProcessPipeline do
result = described_class.call(text, limit: 12)
expect(result[:output]).to eq('foo foo f')
expect(result[:output]).to eq('foo foo f...')
end
end
......@@ -400,6 +400,19 @@ eos
allow(commit).to receive(:safe_message).and_return(message + "\n" + message)
expect(commit.full_title).to eq(message)
end
it 'truncates html representation if more than 1KiB' do
# Commit title is over 2KiB on a single line
huge_commit_title = ('panic ' * 350) + 'trailing text'
allow(commit).to receive(:safe_message).and_return(huge_commit_title)
commit.refresh_markdown_cache
full_title_html = commit.full_title_html
expect(full_title_html.bytesize).to be < 2.kilobytes
expect(full_title_html).not_to include('trailing text')
end
end
describe 'description' do
......
......@@ -3,13 +3,19 @@
require 'spec_helper'
RSpec.describe API::GroupLabels do
let_it_be(:valid_group_label_title_1) { 'Label foo & bar:subgroup::v.1' }
let_it_be(:valid_group_label_title_1_esc) { ERB::Util.url_encode(valid_group_label_title_1) }
let_it_be(:valid_group_label_title_2) { 'Bar & foo:subgroup::v.2' }
let_it_be(:valid_subgroup_label_title_1) { 'Support label foobar:sub::v.1' }
let_it_be(:valid_new_label_title) { 'New & foo:feature::v.3' }
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:subgroup) { create(:group, parent: group) }
let!(:group_member) { create(:group_member, group: group, user: user) }
let!(:group_label1) { create(:group_label, title: 'feature-label', group: group) }
let!(:group_label2) { create(:group_label, title: 'bug', group: group) }
let!(:subgroup_label) { create(:group_label, title: 'support-label', group: subgroup) }
let!(:group_label1) { create(:group_label, title: valid_group_label_title_1, group: group) }
let!(:group_label2) { create(:group_label, title: valid_group_label_title_2, group: group) }
let!(:subgroup_label) { create(:group_label, title: valid_subgroup_label_title_1, group: subgroup) }
describe 'GET :id/labels' do
context 'get current group labels' do
......@@ -104,7 +110,7 @@ RSpec.describe API::GroupLabels do
describe 'GET :id/labels/:label_id' do
it 'returns a single label for the group' do
get api("/groups/#{group.id}/labels/#{group_label1.name}", user)
get api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}", user)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['name']).to eq(group_label1.name)
......@@ -117,13 +123,13 @@ RSpec.describe API::GroupLabels do
it 'returns created label when all params are given' do
post api("/groups/#{group.id}/labels", user),
params: {
name: 'Foo',
name: valid_new_label_title,
color: '#FFAABB',
description: 'test'
}
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq('Foo')
expect(json_response['name']).to eq(valid_new_label_title)
expect(json_response['color']).to eq('#FFAABB')
expect(json_response['description']).to eq('test')
end
......@@ -131,12 +137,12 @@ RSpec.describe API::GroupLabels do
it 'returns created label when only required params are given' do
post api("/groups/#{group.id}/labels", user),
params: {
name: 'Foo & Bar',
name: valid_new_label_title,
color: '#FFAABB'
}
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq('Foo & Bar')
expect(json_response['name']).to eq(valid_new_label_title)
expect(json_response['color']).to eq('#FFAABB')
expect(json_response['description']).to be_nil
end
......@@ -204,7 +210,7 @@ RSpec.describe API::GroupLabels do
describe 'DELETE /groups/:id/labels/:label_id' do
it 'returns 204 for existing label' do
delete api("/groups/#{group.id}/labels/#{group_label1.name}", user)
delete api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}", user)
expect(response).to have_gitlab_http_status(:no_content)
end
......@@ -228,7 +234,7 @@ RSpec.describe API::GroupLabels do
end
it_behaves_like '412 response' do
let(:request) { api("/groups/#{group.id}/labels/#{group_label1.name}", user) }
let(:request) { api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}", user) }
end
end
......@@ -237,13 +243,13 @@ RSpec.describe API::GroupLabels do
put api("/groups/#{group.id}/labels", user),
params: {
name: group_label1.name,
new_name: 'New Label',
new_name: valid_new_label_title,
color: '#FFFFFF',
description: 'test'
}
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['name']).to eq('New Label')
expect(json_response['name']).to eq(valid_new_label_title)
expect(json_response['color']).to eq('#FFFFFF')
expect(json_response['description']).to eq('test')
end
......@@ -255,11 +261,11 @@ RSpec.describe API::GroupLabels do
put api("/groups/#{subgroup.id}/labels", user),
params: {
name: subgroup_label.name,
new_name: 'New Label'
new_name: valid_new_label_title
}
expect(response).to have_gitlab_http_status(:ok)
expect(subgroup.labels[0].name).to eq('New Label')
expect(subgroup.labels[0].name).to eq(valid_new_label_title)
expect(group_label1.name).to eq(group_label1.title)
end
......@@ -267,7 +273,7 @@ RSpec.describe API::GroupLabels do
put api("/groups/#{group.id}/labels", user),
params: {
name: 'not_exists',
new_name: 'label3'
new_name: valid_new_label_title
}
expect(response).to have_gitlab_http_status(:not_found)
......@@ -291,15 +297,15 @@ RSpec.describe API::GroupLabels do
describe 'PUT /groups/:id/labels/:label_id' do
it 'returns 200 if name and colors and description are changed' do
put api("/groups/#{group.id}/labels/#{group_label1.name}", user),
put api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}", user),
params: {
new_name: 'New Label',
new_name: valid_new_label_title,
color: '#FFFFFF',
description: 'test'
}
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['name']).to eq('New Label')
expect(json_response['name']).to eq(valid_new_label_title)
expect(json_response['color']).to eq('#FFFFFF')
expect(json_response['description']).to eq('test')
end
......@@ -310,25 +316,25 @@ RSpec.describe API::GroupLabels do
put api("/groups/#{subgroup.id}/labels/#{subgroup_label.name}", user),
params: {
new_name: 'New Label'
new_name: valid_new_label_title
}
expect(response).to have_gitlab_http_status(:ok)
expect(subgroup.labels[0].name).to eq('New Label')
expect(subgroup.labels[0].name).to eq(valid_new_label_title)
expect(group_label1.name).to eq(group_label1.title)
end
it 'returns 404 if label does not exist' do
put api("/groups/#{group.id}/labels/not_exists", user),
params: {
new_name: 'label3'
new_name: valid_new_label_title
}
expect(response).to have_gitlab_http_status(:not_found)
end
it 'returns 400 if no new parameters given' do
put api("/groups/#{group.id}/labels/#{group_label1.name}", user)
put api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}", user)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error']).to eq('new_name, color, description are missing, '\
......@@ -339,7 +345,7 @@ RSpec.describe API::GroupLabels do
describe 'POST /groups/:id/labels/:label_id/subscribe' do
context 'when label_id is a label title' do
it 'subscribes to the label' do
post api("/groups/#{group.id}/labels/#{group_label1.title}/subscribe", user)
post api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}/subscribe", user)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq(group_label1.title)
......@@ -385,7 +391,7 @@ RSpec.describe API::GroupLabels do
context 'when label_id is a label title' do
it 'unsubscribes from the label' do
post api("/groups/#{group.id}/labels/#{group_label1.title}/unsubscribe", user)
post api("/groups/#{group.id}/labels/#{valid_group_label_title_1_esc}/unsubscribe", user)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq(group_label1.title)
......
......@@ -10,14 +10,19 @@ RSpec.describe API::Labels do
else
label_id = spec_params[:name] || spec_params[:label_id]
put api("/projects/#{project.id}/labels/#{label_id}", user),
put api("/projects/#{project.id}/labels/#{ERB::Util.url_encode(label_id)}", user),
params: request_params.merge(spec_params.except(:name, :id))
end
end
let_it_be(:valid_label_title_1) { 'Label foo & bar:subgroup::v.1' }
let_it_be(:valid_label_title_1_esc) { ERB::Util.url_encode(valid_label_title_1) }
let_it_be(:valid_label_title_2) { 'Label bar & foo:subgroup::v.2' }
let_it_be(:valid_group_label_title_1) { 'Group label foobar:sub::v.1' }
let(:user) { create(:user) }
let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
let!(:label1) { create(:label, description: 'the best label', title: 'label1', project: project) }
let!(:label1) { create(:label, description: 'the best label v.1', title: valid_label_title_1, project: project) }
let!(:priority_label) { create(:label, title: 'bug', project: project, priority: 3) }
route_types = [:deprecated, :rest]
......@@ -25,10 +30,10 @@ RSpec.describe API::Labels do
shared_examples 'label update API' do
route_types.each do |route_type|
it "returns 200 if name is changed (#{route_type} route)" do
put_labels_api(route_type, user, spec_params, new_name: 'New Label')
put_labels_api(route_type, user, spec_params, new_name: valid_label_title_2)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['name']).to eq('New Label')
expect(json_response['name']).to eq(valid_label_title_2)
expect(json_response['color']).to eq(label1.color)
end
......@@ -77,10 +82,10 @@ RSpec.describe API::Labels do
end
it "returns 200 if name and colors and description are changed (#{route_type} route)" do
put_labels_api(route_type, user, spec_params, new_name: 'New Label', color: '#FFFFFF', description: 'test')
put_labels_api(route_type, user, spec_params, new_name: valid_label_title_2, color: '#FFFFFF', description: 'test')
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['name']).to eq('New Label')
expect(json_response['name']).to eq(valid_label_title_2)
expect(json_response['color']).to eq('#FFFFFF')
expect(json_response['description']).to eq('test')
end
......@@ -141,7 +146,7 @@ RSpec.describe API::Labels do
priority: nil
}.merge(spec_params.except(:name, :id))
put api("/projects/#{project.id}/labels/#{label_id}", user),
put api("/projects/#{project.id}/labels/#{ERB::Util.url_encode(label_id)}", user),
params: request_params
expect(response).to have_gitlab_http_status(:ok)
......@@ -167,7 +172,7 @@ RSpec.describe API::Labels do
it 'returns 204 for existing label (rest route)' do
label_id = spec_params[:name] || spec_params[:label_id]
delete api("/projects/#{project.id}/labels/#{label_id}", user), params: spec_params.except(:name, :label_id)
delete api("/projects/#{project.id}/labels/#{ERB::Util.url_encode(label_id)}", user), params: spec_params.except(:name, :label_id)
expect(response).to have_gitlab_http_status(:no_content)
end
......@@ -179,7 +184,7 @@ RSpec.describe API::Labels do
describe 'GET /projects/:id/labels' do
let_it_be(:group) { create(:group) }
let_it_be(:group_label) { create(:group_label, title: 'feature label', group: group) }
let_it_be(:group_label) { create(:group_label, title: valid_group_label_title_1, group: group) }
before do
project.update!(group: group)
......@@ -219,7 +224,7 @@ RSpec.describe API::Labels do
'closed_issues_count' => 1,
'open_merge_requests_count' => 0,
'name' => label1.name,
'description' => 'the best label',
'description' => label1.description,
'color' => a_string_matching(/^#\h{6}$/),
'text_color' => a_string_matching(/^#\h{6}$/),
'priority' => nil,
......@@ -293,14 +298,14 @@ RSpec.describe API::Labels do
it 'returns created label when all params' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'Foo',
name: valid_label_title_2,
color: '#FFAABB',
description: 'test',
priority: 2
}
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq('Foo')
expect(json_response['name']).to eq(valid_label_title_2)
expect(json_response['color']).to eq('#FFAABB')
expect(json_response['description']).to eq('test')
expect(json_response['priority']).to eq(2)
......@@ -309,12 +314,12 @@ RSpec.describe API::Labels do
it 'returns created label when only required params' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'Foo & Bar',
name: valid_label_title_2,
color: '#FFAABB'
}
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq('Foo & Bar')
expect(json_response['name']).to eq(valid_label_title_2)
expect(json_response['color']).to eq('#FFAABB')
expect(json_response['description']).to be_nil
expect(json_response['priority']).to be_nil
......@@ -323,13 +328,13 @@ RSpec.describe API::Labels do
it 'creates a prioritized label' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'Foo & Bar',
name: valid_label_title_2,
color: '#FFAABB',
priority: 3
}
expect(response).to have_gitlab_http_status(:created)
expect(json_response['name']).to eq('Foo & Bar')
expect(json_response['name']).to eq(valid_label_title_2)
expect(json_response['color']).to eq('#FFAABB')
expect(json_response['description']).to be_nil
expect(json_response['priority']).to eq(3)
......@@ -348,7 +353,7 @@ RSpec.describe API::Labels do
it 'returns 400 for invalid color' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'Foo',
name: valid_label_title_2,
color: '#FFAA'
}
expect(response).to have_gitlab_http_status(:bad_request)
......@@ -358,7 +363,7 @@ RSpec.describe API::Labels do
it 'returns 400 for too long color code' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'Foo',
name: valid_label_title_2,
color: '#FFAAFFFF'
}
expect(response).to have_gitlab_http_status(:bad_request)
......@@ -393,7 +398,7 @@ RSpec.describe API::Labels do
it 'returns 400 for invalid priority' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'Foo',
name: valid_label_title_2,
color: '#FFAAFFFF',
priority: 'foo'
}
......@@ -404,7 +409,7 @@ RSpec.describe API::Labels do
it 'returns 409 if label already exists in project' do
post api("/projects/#{project.id}/labels", user),
params: {
name: 'label1',
name: valid_label_title_1,
color: '#FFAABB'
}
expect(response).to have_gitlab_http_status(:conflict)
......@@ -414,7 +419,7 @@ RSpec.describe API::Labels do
describe 'DELETE /projects/:id/labels' do
it_behaves_like 'label delete API' do
let(:spec_params) { { name: 'label1' } }
let(:spec_params) { { name: valid_label_title_1 } }
end
it_behaves_like 'label delete API' do
......@@ -422,7 +427,7 @@ RSpec.describe API::Labels do
end
it 'returns 404 for non existing label' do
delete api("/projects/#{project.id}/labels", user), params: { name: 'label2' }
delete api("/projects/#{project.id}/labels", user), params: { name: 'unknown' }
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Label Not Found')
......@@ -446,14 +451,14 @@ RSpec.describe API::Labels do
it_behaves_like '412 response' do
let(:request) { api("/projects/#{project.id}/labels", user) }
let(:params) { { name: 'label1' } }
let(:params) { { name: valid_label_title_1 } }
end
end
describe 'PUT /projects/:id/labels' do
context 'when using name' do
it_behaves_like 'label update API' do
let(:spec_params) { { name: 'label1' } }
let(:spec_params) { { name: valid_label_title_1 } }
let(:expected_response_label_id) { label1.id }
end
end
......@@ -468,7 +473,7 @@ RSpec.describe API::Labels do
it 'returns 404 if label does not exist' do
put api("/projects/#{project.id}/labels", user),
params: {
name: 'label2',
name: valid_label_title_2,
new_name: 'label3'
}
......@@ -571,7 +576,7 @@ RSpec.describe API::Labels do
describe "POST /projects/:id/labels/:label_id/subscribe" do
context "when label_id is a label title" do
it "subscribes to the label" do
post api("/projects/#{project.id}/labels/#{label1.title}/subscribe", user)
post api("/projects/#{project.id}/labels/#{valid_label_title_1_esc}/subscribe", user)
expect(response).to have_gitlab_http_status(:created)
expect(json_response["name"]).to eq(label1.title)
......@@ -617,7 +622,7 @@ RSpec.describe API::Labels do
context "when label_id is a label title" do
it "unsubscribes from the label" do
post api("/projects/#{project.id}/labels/#{label1.title}/unsubscribe", user)
post api("/projects/#{project.id}/labels/#{valid_label_title_1_esc}/unsubscribe", user)
expect(response).to have_gitlab_http_status(:created)
expect(json_response["name"]).to eq(label1.title)
......
......@@ -158,7 +158,7 @@ RSpec.describe AlertManagement::ProcessPrometheusAlertService do
it 'writes a warning to the log' do
expect(Gitlab::AppLogger).to receive(:warn).with(
message: 'Unable to create AlertManagement::Alert',
message: 'Unable to create AlertManagement::Alert from Prometheus',
project_id: project.id,
alert_errors: { hosts: ['hosts array is over 255 chars'] }
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment