Commit ac332957 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'leipert-prettier-arrow-parens-8' into 'master'

Format files with prettier arrowParens [8/15]

See merge request gitlab-org/gitlab!50534
parents 8675dcbc 06329078
...@@ -531,173 +531,6 @@ app/assets/javascripts/snippets/components/snippet_blob_view.vue ...@@ -531,173 +531,6 @@ app/assets/javascripts/snippets/components/snippet_blob_view.vue
app/assets/javascripts/snippets/components/snippet_header.vue app/assets/javascripts/snippets/components/snippet_header.vue
app/assets/javascripts/snippets/mixins/snippets.js app/assets/javascripts/snippets/mixins/snippets.js
## frosty-sammet
ee/app/assets/javascripts/analytics/group_ci_cd_analytics/index.js
ee/app/assets/javascripts/analytics/merge_request_analytics/components/filter_bar.vue
ee/app/assets/javascripts/analytics/merge_request_analytics/components/throughput_chart.vue
ee/app/assets/javascripts/analytics/merge_request_analytics/components/throughput_table.vue
ee/app/assets/javascripts/analytics/merge_request_analytics/graphql/throughput_chart_query_builder.js
ee/app/assets/javascripts/analytics/merge_request_analytics/index.js
ee/app/assets/javascripts/analytics/merge_request_analytics/utils.js
ee/app/assets/javascripts/analytics/productivity_analytics/components/app.vue
ee/app/assets/javascripts/analytics/productivity_analytics/components/metric_chart.vue
ee/app/assets/javascripts/analytics/productivity_analytics/components/mr_table.vue
ee/app/assets/javascripts/analytics/productivity_analytics/filtered_search_productivity_analytics.js
ee/app/assets/javascripts/analytics/productivity_analytics/store/getters.js
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/charts/actions.js
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/charts/getters.js
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/filters/getters.js
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/table/actions.js
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/table/getters.js
ee/app/assets/javascripts/analytics/productivity_analytics/utils.js
ee/app/assets/javascripts/analytics/repository_analytics/components/download_test_coverage.vue
ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_table.vue
ee/app/assets/javascripts/analytics/shared/components/groups_dropdown_filter.vue
ee/app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue
ee/app/assets/javascripts/analytics/shared/components/scatterplot.vue
ee/app/assets/javascripts/analytics/shared/utils.js
ee/app/assets/javascripts/approvals/components/app.vue
ee/app/assets/javascripts/approvals/components/approvers_select.vue
ee/app/assets/javascripts/approvals/components/branches_select.vue
ee/app/assets/javascripts/approvals/components/license_compliance/index.vue
ee/app/assets/javascripts/approvals/components/mr_edit/app.vue
ee/app/assets/javascripts/approvals/components/mr_edit/mr_rules.vue
ee/app/assets/javascripts/approvals/components/mr_edit/mr_rules_hidden_inputs.vue
ee/app/assets/javascripts/approvals/components/mr_edit/rule_input.vue
## strange-shirley
ee/app/assets/javascripts/approvals/components/project_settings/project_rules.vue
ee/app/assets/javascripts/approvals/components/rule_form.vue
ee/app/assets/javascripts/approvals/components/security_configuration/unconfigured_security_rules.vue
ee/app/assets/javascripts/approvals/mappers.js
ee/app/assets/javascripts/approvals/stores/modules/base/getters.js
ee/app/assets/javascripts/approvals/stores/modules/license_compliance/actions.js
ee/app/assets/javascripts/approvals/stores/modules/mr_edit/actions.js
ee/app/assets/javascripts/approvals/stores/modules/mr_edit/mutations.js
ee/app/assets/javascripts/approvals/stores/modules/project_settings/actions.js
ee/app/assets/javascripts/audit_events/components/audit_events_filter.vue
ee/app/assets/javascripts/audit_events/components/sorting_field.vue
ee/app/assets/javascripts/audit_events/components/tokens/member_token.vue
ee/app/assets/javascripts/audit_events/components/tokens/project_token.vue
ee/app/assets/javascripts/audit_events/components/tokens/shared/audit_filter_token.vue
ee/app/assets/javascripts/audit_events/components/tokens/user_token.vue
ee/app/assets/javascripts/audit_events/constants.js
ee/app/assets/javascripts/audit_events/init_audit_events.js
ee/app/assets/javascripts/audit_events/store/getters.js
ee/app/assets/javascripts/audit_events/utils.js
ee/app/assets/javascripts/audit_events/validators.js
ee/app/assets/javascripts/billings/seat_usage/store/actions.js
ee/app/assets/javascripts/billings/seat_usage/store/getters.js
ee/app/assets/javascripts/billings/subscriptions/store/actions.js
ee/app/assets/javascripts/billings/subscriptions/store/getters.js
ee/app/assets/javascripts/billings/subscriptions/store/mutations.js
ee/app/assets/javascripts/boards/boards_util.js
ee/app/assets/javascripts/boards/components/board_scope.vue
ee/app/assets/javascripts/boards/components/boards_list_selector/index.js
ee/app/assets/javascripts/boards/components/boards_list_selector/list_container.vue
ee/app/assets/javascripts/boards/components/epics_swimlanes.vue
ee/app/assets/javascripts/boards/components/new_list_dropdown.js
## great-keldysh
ee/app/assets/javascripts/boards/components/sidebar/remove_issue.js
ee/app/assets/javascripts/boards/config_toggle.js
ee/app/assets/javascripts/boards/ee_functions.js
ee/app/assets/javascripts/boards/mixins/modal_footer.js
ee/app/assets/javascripts/boards/models/list.js
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
ee/app/assets/javascripts/boards/stores/mutations.js
ee/app/assets/javascripts/boards/toggle_labels.js
ee/app/assets/javascripts/burndown_chart/burn_chart_data.js
ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue
ee/app/assets/javascripts/burndown_chart/components/burnup_chart.vue
ee/app/assets/javascripts/burndown_chart/components/open_timebox_summary.vue
ee/app/assets/javascripts/clusters/components/environments.vue
ee/app/assets/javascripts/clusters/mixins/track_uninstall_button_click.js
ee/app/assets/javascripts/clusters_list/components/agents.vue
ee/app/assets/javascripts/codequality_report/store/actions.js
ee/app/assets/javascripts/codequality_report/store/getters.js
ee/app/assets/javascripts/compliance_dashboard/compliance_dashboard_bundle.js
ee/app/assets/javascripts/dependencies/components/dependencies_actions.vue
ee/app/assets/javascripts/dependencies/components/paginated_dependencies_table.vue
ee/app/assets/javascripts/dependencies/store/getters.js
ee/app/assets/javascripts/dependencies/store/modules/list/actions.js
ee/app/assets/javascripts/diffs/mixins/image_diff.js
ee/app/assets/javascripts/droplab/plugins/custom_number.js
ee/app/assets/javascripts/ee_trial_banner/ee_trial_banner.js
ee/app/assets/javascripts/environments/stores/environments_store.js
ee/app/assets/javascripts/epic/components/epic_form.vue
ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_labels.vue
ee/app/assets/javascripts/epic/epic_bundle.js
ee/app/assets/javascripts/epic/epic_tabs.js
## stoic-einstein
ee/app/assets/javascripts/epic/store/actions.js
ee/app/assets/javascripts/epic/store/mutations.js
ee/app/assets/javascripts/epic/utils/epic_utils.js
ee/app/assets/javascripts/event_tracking/navbar.js
ee/app/assets/javascripts/filtered_search/dropdown_weight.js
ee/app/assets/javascripts/filtered_search/filtered_search_manager.js
ee/app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js
ee/app/assets/javascripts/geo_node_form/components/geo_node_form_capacities.vue
ee/app/assets/javascripts/geo_node_form/components/geo_node_form_namespaces.vue
ee/app/assets/javascripts/geo_node_form/components/geo_node_form_shards.vue
ee/app/assets/javascripts/geo_node_form/store/actions.js
ee/app/assets/javascripts/geo_node_form/store/getters.js
ee/app/assets/javascripts/geo_node_form/validations.js
ee/app/assets/javascripts/geo_nodes/components/app.vue
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_main.vue
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
ee/app/assets/javascripts/geo_replicable/graphql/replicable_type_query_builder.js
ee/app/assets/javascripts/geo_replicable/store/actions.js
ee/app/assets/javascripts/geo_replicable/store/getters.js
ee/app/assets/javascripts/geo_replicable/store/index.js
ee/app/assets/javascripts/geo_settings/store/getters.js
ee/app/assets/javascripts/geo_settings/store/state.js
ee/app/assets/javascripts/geo_settings/validations.js
ee/app/assets/javascripts/gfm_auto_complete.js
ee/app/assets/javascripts/group_member_contributions/store/group_member_store.js
ee/app/assets/javascripts/groups/members/utils.js
ee/app/assets/javascripts/groups/settings/access_restriction_field/validate_ip_address.js
ee/app/assets/javascripts/groups/settings/compliance_frameworks/components/list.vue
ee/app/assets/javascripts/groups/settings/compliance_frameworks/init_list.js
ee/app/assets/javascripts/groups/settings/components/comma_separated_list_token_selector.vue
ee/app/assets/javascripts/insights/components/insights.vue
ee/app/assets/javascripts/insights/components/insights_chart.vue
## pedantic-noether
ee/app/assets/javascripts/insights/stores/modules/insights/actions.js
ee/app/assets/javascripts/insights/stores/modules/insights/helpers.js
ee/app/assets/javascripts/insights/stores/modules/insights/mutations.js
ee/app/assets/javascripts/integrations/jira/issues_list/components/jira_issues_list_root.vue
ee/app/assets/javascripts/integrations/jira/issues_list/jira_issues_list_bundle.js
ee/app/assets/javascripts/issues_analytics/components/issues_analytics.vue
ee/app/assets/javascripts/issues_analytics/filtered_search_issues_analytics.js
ee/app/assets/javascripts/issues_analytics/stores/modules/issue_analytics/actions.js
ee/app/assets/javascripts/issues_analytics/stores/modules/issue_analytics/getters.js
ee/app/assets/javascripts/iterations/components/iteration_report.vue
ee/app/assets/javascripts/iterations/components/iteration_report_tabs.vue
ee/app/assets/javascripts/iterations/components/iterations.vue
ee/app/assets/javascripts/iterations/components/iterations_list.vue
ee/app/assets/javascripts/ldap_groups_select.js
ee/app/assets/javascripts/license_compliance/store/modules/list/actions.js
ee/app/assets/javascripts/license_compliance/store/modules/list/getters.js
ee/app/assets/javascripts/license_compliance/store/plugins/mediator.js
ee/app/assets/javascripts/license_compliance/utils/mappers.js
ee/app/assets/javascripts/maintenance_mode_settings/store/index.js
ee/app/assets/javascripts/members.js
ee/app/assets/javascripts/members/components/table/members_table_cell.vue
ee/app/assets/javascripts/members/store/state.js
ee/app/assets/javascripts/members/utils.js
ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans_form.vue
ee/app/assets/javascripts/on_demand_scans/components/profile_selector/scanner_profile_selector.vue
ee/app/assets/javascripts/on_demand_scans/components/profile_selector/site_profile_selector.vue
ee/app/assets/javascripts/oncall_schedules/components/add_edit_schedule_form.vue
ee/app/assets/javascripts/oncall_schedules/components/add_edit_schedule_modal.vue
ee/app/assets/javascripts/oncall_schedules/components/delete_schedule_modal.vue
ee/app/assets/javascripts/oncall_schedules/components/oncall_schedule.vue
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_rotation_modal.vue
## gifted-dewdney ## gifted-dewdney
ee/app/assets/javascripts/oncall_schedules/utils/cache_updates.js ee/app/assets/javascripts/oncall_schedules/utils/cache_updates.js
ee/app/assets/javascripts/oncall_schedules/utils/common_utils.js ee/app/assets/javascripts/oncall_schedules/utils/common_utils.js
......
...@@ -8,6 +8,6 @@ export default () => { ...@@ -8,6 +8,6 @@ export default () => {
return new Vue({ return new Vue({
el, el,
render: createElement => createElement(CiCdAnalyticsApp), render: (createElement) => createElement(CiCdAnalyticsApp),
}); });
}; };
...@@ -26,17 +26,17 @@ export default { ...@@ -26,17 +26,17 @@ export default {
inject: ['fullPath', 'type'], inject: ['fullPath', 'type'],
computed: { computed: {
...mapState('filters', { ...mapState('filters', {
selectedSourceBranch: state => state.branches.source.selected, selectedSourceBranch: (state) => state.branches.source.selected,
selectedTargetBranch: state => state.branches.target.selected, selectedTargetBranch: (state) => state.branches.target.selected,
selectedMilestone: state => state.milestones.selected, selectedMilestone: (state) => state.milestones.selected,
selectedAuthor: state => state.authors.selected, selectedAuthor: (state) => state.authors.selected,
selectedAssignee: state => state.assignees.selected, selectedAssignee: (state) => state.assignees.selected,
selectedLabelList: state => state.labels.selectedList, selectedLabelList: (state) => state.labels.selectedList,
milestonesData: state => state.milestones.data, milestonesData: (state) => state.milestones.data,
labelsData: state => state.labels.data, labelsData: (state) => state.labels.data,
assigneesData: state => state.assignees.data, assigneesData: (state) => state.assignees.data,
authorsData: state => state.authors.data, authorsData: (state) => state.authors.data,
branchesData: state => state.branches.data, branchesData: (state) => state.branches.data,
}), }),
tokens() { tokens() {
return [ return [
......
...@@ -62,12 +62,12 @@ export default { ...@@ -62,12 +62,12 @@ export default {
}, },
computed: { computed: {
...mapState('filters', { ...mapState('filters', {
selectedSourceBranch: state => state.branches.source.selected, selectedSourceBranch: (state) => state.branches.source.selected,
selectedTargetBranch: state => state.branches.target.selected, selectedTargetBranch: (state) => state.branches.target.selected,
selectedMilestone: state => state.milestones.selected, selectedMilestone: (state) => state.milestones.selected,
selectedAuthor: state => state.authors.selected, selectedAuthor: (state) => state.authors.selected,
selectedAssignee: state => state.assignees.selected, selectedAssignee: (state) => state.assignees.selected,
selectedLabelList: state => state.labels.selectedList, selectedLabelList: (state) => state.labels.selectedList,
}), }),
chartOptions() { chartOptions() {
return { return {
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
name: THROUGHPUT_CHART_STRINGS.X_AXIS_TITLE, name: THROUGHPUT_CHART_STRINGS.X_AXIS_TITLE,
type: 'category', type: 'category',
axisLabel: { axisLabel: {
formatter: value => { formatter: (value) => {
return value.split(' ')[0]; // Aug 2020 => Aug return value.split(' ')[0]; // Aug 2020 => Aug
}, },
}, },
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
return !this.hasError && this.$apollo.queries.throughputChartData.loading; return !this.hasError && this.$apollo.queries.throughputChartData.loading;
}, },
chartDataAvailable() { chartDataAvailable() {
return this.formattedThroughputChartData[0]?.data?.some(entry => Boolean(entry[1])); return this.formattedThroughputChartData[0]?.data?.some((entry) => Boolean(entry[1]));
}, },
alertDetails() { alertDetails() {
return { return {
......
...@@ -155,12 +155,12 @@ export default { ...@@ -155,12 +155,12 @@ export default {
}, },
computed: { computed: {
...mapState('filters', { ...mapState('filters', {
selectedSourceBranch: state => state.branches.source.selected, selectedSourceBranch: (state) => state.branches.source.selected,
selectedTargetBranch: state => state.branches.target.selected, selectedTargetBranch: (state) => state.branches.target.selected,
selectedMilestone: state => state.milestones.selected, selectedMilestone: (state) => state.milestones.selected,
selectedAuthor: state => state.authors.selected, selectedAuthor: (state) => state.authors.selected,
selectedAssignee: state => state.assignees.selected, selectedAssignee: (state) => state.assignees.selected,
selectedLabelList: state => state.labels.selectedList, selectedLabelList: (state) => state.labels.selectedList,
}), }),
options() { options() {
return filterToQueryObject({ return filterToQueryObject({
......
...@@ -16,7 +16,7 @@ export default (startDate = null, endDate = null) => { ...@@ -16,7 +16,7 @@ export default (startDate = null, endDate = null) => {
if (!monthData.length) return ''; if (!monthData.length) return '';
const computedMonthData = monthData.map(value => { const computedMonthData = monthData.map((value) => {
const { year, month, mergedAfter, mergedBefore } = value; const { year, month, mergedAfter, mergedBefore } = value;
// first: 0 is an optimization which makes sure we don't load merge request objects into memory (backend). // first: 0 is an optimization which makes sure we don't load merge request objects into memory (backend).
......
...@@ -58,7 +58,7 @@ export default () => { ...@@ -58,7 +58,7 @@ export default () => {
fullPath, fullPath,
type, type,
}, },
render: createElement => render: (createElement) =>
createElement(MergeRequestAnalyticsApp, { createElement(MergeRequestAnalyticsApp, {
props: { props: {
startDate: startDateParam.length startDate: startDateParam.length
......
...@@ -53,12 +53,12 @@ export const computeMonthRangeData = (startDate, endDate, format = dateFormats.i ...@@ -53,12 +53,12 @@ export const computeMonthRangeData = (startDate, endDate, format = dateFormats.i
* *
* @return {Array} the formatted chart data * @return {Array} the formatted chart data
*/ */
export const formatThroughputChartData = chartData => { export const formatThroughputChartData = (chartData) => {
if (!chartData) return []; if (!chartData) return [];
const data = Object.keys(chartData) const data = Object.keys(chartData)
.slice(0, -1) // Remove the __typeName key .slice(0, -1) // Remove the __typeName key
.map(value => [value.split('_').join(' '), chartData[value].count]); // key: Aug_2020 => Aug 2020 .map((value) => [value.split('_').join(' '), chartData[value].count]); // key: Aug_2020 => Aug 2020
return [ return [
{ {
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
return { return {
yAxis: { yAxis: {
axisLabel: { axisLabel: {
formatter: value => value, formatter: (value) => value,
}, },
minInterval: 1, minInterval: 1,
}, },
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
:chart-data="getScatterPlotMainData" :chart-data="getScatterPlotMainData"
:selected-metric="getSelectedMetric(chartKeys.scatterplot)" :selected-metric="getSelectedMetric(chartKeys.scatterplot)"
@metricTypeChange=" @metricTypeChange="
metric => setMetricType({ metricType: metric, chartKey: chartKeys.scatterplot }) (metric) => setMetricType({ metricType: metric, chartKey: chartKeys.scatterplot })
" "
> >
<scatterplot <scatterplot
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
:selected-metric="getSelectedMetric(chartKeys.timeBasedHistogram)" :selected-metric="getSelectedMetric(chartKeys.timeBasedHistogram)"
:chart-data="getColumnChartData(chartKeys.timeBasedHistogram)" :chart-data="getColumnChartData(chartKeys.timeBasedHistogram)"
@metricTypeChange=" @metricTypeChange="
metric => (metric) =>
setMetricType({ metricType: metric, chartKey: chartKeys.timeBasedHistogram }) setMetricType({ metricType: metric, chartKey: chartKeys.timeBasedHistogram })
" "
> >
...@@ -278,7 +278,7 @@ export default { ...@@ -278,7 +278,7 @@ export default {
:selected-metric="getSelectedMetric(chartKeys.commitBasedHistogram)" :selected-metric="getSelectedMetric(chartKeys.commitBasedHistogram)"
:chart-data="getColumnChartData(chartKeys.commitBasedHistogram)" :chart-data="getColumnChartData(chartKeys.commitBasedHistogram)"
@metricTypeChange=" @metricTypeChange="
metric => (metric) =>
setMetricType({ metricType: metric, chartKey: chartKeys.commitBasedHistogram }) setMetricType({ metricType: metric, chartKey: chartKeys.commitBasedHistogram })
" "
> >
......
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
return this.metricTypes.length; return this.metricTypes.length;
}, },
metricDropdownLabel() { metricDropdownLabel() {
const foundMetric = this.metricTypes.find(m => m.key === this.selectedMetric); const foundMetric = this.metricTypes.find((m) => m.key === this.selectedMetric);
return foundMetric ? foundMetric.label : s__('MetricChart|Please select a metric'); return foundMetric ? foundMetric.label : s__('MetricChart|Please select a metric');
}, },
isServerError() { isServerError() {
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
computed: { computed: {
metricDropdownLabel() { metricDropdownLabel() {
return this.columnOptions.find(option => option.key === this.metricType).label; return this.columnOptions.find((option) => option.key === this.metricType).label;
}, },
showPagination() { showPagination() {
return this.pageInfo && this.pageInfo.total; return this.pageInfo && this.pageInfo.total;
......
...@@ -22,7 +22,7 @@ export default class FilteredSearchProductivityAnalytics extends FilteredSearchM ...@@ -22,7 +22,7 @@ export default class FilteredSearchProductivityAnalytics extends FilteredSearchM
/** /**
* Updates filters in productivity analytics store * Updates filters in productivity analytics store
*/ */
updateObject = path => { updateObject = (path) => {
const filters = urlParamsToObject(path); const filters = urlParamsToObject(path);
store.dispatch('filters/setFilters', filters); store.dispatch('filters/setFilters', filters);
}; };
......
export const getMetricTypes = state => chartKey => export const getMetricTypes = (state) => (chartKey) =>
state.metricTypes.filter(m => m.charts.indexOf(chartKey) !== -1); state.metricTypes.filter((m) => m.charts.indexOf(chartKey) !== -1);
...@@ -8,7 +8,7 @@ import { transformScatterData } from '../../../utils'; ...@@ -8,7 +8,7 @@ import { transformScatterData } from '../../../utils';
* Fetches data for all charts except for the main chart * Fetches data for all charts except for the main chart
*/ */
export const fetchSecondaryChartData = ({ state, dispatch }) => { export const fetchSecondaryChartData = ({ state, dispatch }) => {
Object.keys(state.charts).forEach(chartKey => { Object.keys(state.charts).forEach((chartKey) => {
if (chartKey !== chartKeys.main) { if (chartKey !== chartKeys.main) {
dispatch('fetchChartData', chartKey); dispatch('fetchChartData', chartKey);
} }
...@@ -27,7 +27,7 @@ export const fetchChartData = ({ dispatch, getters, state, rootState }, chartKey ...@@ -27,7 +27,7 @@ export const fetchChartData = ({ dispatch, getters, state, rootState }, chartKey
axios axios
.get(rootState.endpoint, { params }) .get(rootState.endpoint, { params })
.then(response => { .then((response) => {
const { data } = response; const { data } = response;
if (chartKey === chartKeys.scatterplot) { if (chartKey === chartKeys.scatterplot) {
...@@ -42,7 +42,7 @@ export const fetchChartData = ({ dispatch, getters, state, rootState }, chartKey ...@@ -42,7 +42,7 @@ export const fetchChartData = ({ dispatch, getters, state, rootState }, chartKey
dispatch('receiveChartDataSuccess', { chartKey, data }); dispatch('receiveChartDataSuccess', { chartKey, data });
} }
}) })
.catch(error => dispatch('receiveChartDataError', { chartKey, error })); .catch((error) => dispatch('receiveChartDataError', { chartKey, error }));
} }
}; };
......
...@@ -13,9 +13,9 @@ import { ...@@ -13,9 +13,9 @@ import {
} from '../../../constants'; } from '../../../constants';
import { getScatterPlotData, getMedianLineData } from '../../../utils'; import { getScatterPlotData, getMedianLineData } from '../../../utils';
export const chartLoading = state => chartKey => state.charts[chartKey].isLoading; export const chartLoading = (state) => (chartKey) => state.charts[chartKey].isLoading;
export const chartErrorCode = state => chartKey => state.charts[chartKey].errorCode; export const chartErrorCode = (state) => (chartKey) => state.charts[chartKey].errorCode;
/** /**
* Creates a series object for the column chart with the given chartKey. * Creates a series object for the column chart with the given chartKey.
...@@ -36,8 +36,8 @@ export const chartErrorCode = state => chartKey => state.charts[chartKey].errorC ...@@ -36,8 +36,8 @@ export const chartErrorCode = state => chartKey => state.charts[chartKey].errorC
* the itemStyle will be set accordingly in order to highlight the relevant bar. * the itemStyle will be set accordingly in order to highlight the relevant bar.
* *
*/ */
export const getColumnChartData = state => chartKey => { export const getColumnChartData = (state) => (chartKey) => {
const dataWithSelected = Object.keys(state.charts[chartKey].data).map(key => { const dataWithSelected = Object.keys(state.charts[chartKey].data).map((key) => {
const dataArr = [key, state.charts[chartKey].data[key]]; const dataArr = [key, state.charts[chartKey].data[key]];
let itemStyle = {}; let itemStyle = {};
...@@ -54,7 +54,7 @@ export const getColumnChartData = state => chartKey => { ...@@ -54,7 +54,7 @@ export const getColumnChartData = state => chartKey => {
return dataWithSelected; return dataWithSelected;
}; };
export const chartHasData = state => chartKey => !isEmpty(state.charts[chartKey].data); export const chartHasData = (state) => (chartKey) => !isEmpty(state.charts[chartKey].data);
export const getScatterPlotMainData = (state, getters, rootState) => export const getScatterPlotMainData = (state, getters, rootState) =>
getScatterPlotData( getScatterPlotData(
...@@ -77,10 +77,10 @@ export const getScatterPlotMedianData = (state, getters, rootState) => ...@@ -77,10 +77,10 @@ export const getScatterPlotMedianData = (state, getters, rootState) =>
scatterPlotAddonQueryDays, scatterPlotAddonQueryDays,
); );
export const getMetricLabel = state => chartKey => export const getMetricLabel = (state) => (chartKey) =>
metricTypes.find(m => m.key === state.charts[chartKey].params.metricType).label; metricTypes.find((m) => m.key === state.charts[chartKey].params.metricType).label;
export const getFilterParams = (state, getters, rootState, rootGetters) => chartKey => { export const getFilterParams = (state, getters, rootState, rootGetters) => (chartKey) => {
const { params: chartParams = {} } = state.charts[chartKey]; const { params: chartParams = {} } = state.charts[chartKey];
// common filter params // common filter params
...@@ -109,7 +109,7 @@ export const getFilterParams = (state, getters, rootState, rootGetters) => chart ...@@ -109,7 +109,7 @@ export const getFilterParams = (state, getters, rootState, rootGetters) => chart
* it will return an empty dataZoom property. * it will return an empty dataZoom property.
* *
*/ */
export const getColumnChartDatazoomOption = state => chartKey => { export const getColumnChartDatazoomOption = (state) => (chartKey) => {
const { data } = state.charts[chartKey]; const { data } = state.charts[chartKey];
const totalItems = Object.keys(data).length; const totalItems = Object.keys(data).length;
const MAX_ITEMS_PER_PAGE = maxColumnChartItemsPerPage[chartKey] const MAX_ITEMS_PER_PAGE = maxColumnChartItemsPerPage[chartKey]
...@@ -123,7 +123,7 @@ export const getColumnChartDatazoomOption = state => chartKey => { ...@@ -123,7 +123,7 @@ export const getColumnChartDatazoomOption = state => chartKey => {
const intervalEnd = Math.ceil((MAX_ITEMS_PER_PAGE / totalItems) * 100); const intervalEnd = Math.ceil((MAX_ITEMS_PER_PAGE / totalItems) * 100);
return { return {
dataZoom: dataZoomOptions.map(item => { dataZoom: dataZoomOptions.map((item) => {
const result = { const result = {
...item, ...item,
end: intervalEnd, end: intervalEnd,
...@@ -134,7 +134,7 @@ export const getColumnChartDatazoomOption = state => chartKey => { ...@@ -134,7 +134,7 @@ export const getColumnChartDatazoomOption = state => chartKey => {
}; };
}; };
export const getSelectedMetric = state => chartKey => state.charts[chartKey].params.metricType; export const getSelectedMetric = (state) => (chartKey) => state.charts[chartKey].params.metricType;
/** /**
* Returns the y axis label for the scatterplot. * Returns the y axis label for the scatterplot.
...@@ -143,16 +143,16 @@ export const getSelectedMetric = state => chartKey => state.charts[chartKey].par ...@@ -143,16 +143,16 @@ export const getSelectedMetric = state => chartKey => state.charts[chartKey].par
export const scatterplotYaxisLabel = (_state, getters, rootState) => { export const scatterplotYaxisLabel = (_state, getters, rootState) => {
const selectedMetric = getters.getSelectedMetric(chartKeys.scatterplot); const selectedMetric = getters.getSelectedMetric(chartKeys.scatterplot);
const metricTypesInHours = rootState.metricTypes const metricTypesInHours = rootState.metricTypes
.filter(metric => metric.charts.indexOf(chartKeys.timeBasedHistogram) !== -1) .filter((metric) => metric.charts.indexOf(chartKeys.timeBasedHistogram) !== -1)
.map(metric => metric.key); .map((metric) => metric.key);
if (selectedMetric === daysToMergeMetric.key) return s__('ProductivityAnalytics|Days'); if (selectedMetric === daysToMergeMetric.key) return s__('ProductivityAnalytics|Days');
if (metricTypesInHours.indexOf(selectedMetric) !== -1) return s__('ProductivityAnalytics|Hours'); if (metricTypesInHours.indexOf(selectedMetric) !== -1) return s__('ProductivityAnalytics|Hours');
return getters.getMetricLabel(chartKeys.scatterplot); return getters.getMetricLabel(chartKeys.scatterplot);
}; };
export const hasNoAccessError = state => export const hasNoAccessError = (state) =>
state.charts[chartKeys.main].errorCode === httpStatus.FORBIDDEN; state.charts[chartKeys.main].errorCode === httpStatus.FORBIDDEN;
export const isChartEnabled = state => chartKey => state.charts[chartKey].enabled; export const isChartEnabled = (state) => (chartKey) => state.charts[chartKey].enabled;
export const isFilteringByDaysToMerge = state => state.charts[chartKeys.main].selected.length > 0; export const isFilteringByDaysToMerge = (state) => state.charts[chartKeys.main].selected.length > 0;
...@@ -19,7 +19,7 @@ import { dateFormats } from '../../../../shared/constants'; ...@@ -19,7 +19,7 @@ import { dateFormats } from '../../../../shared/constants';
* } * }
* *
*/ */
export const getCommonFilterParams = (state, getters) => chartKey => { export const getCommonFilterParams = (state, getters) => (chartKey) => {
const { const {
groupNamespace, groupNamespace,
projectPath, projectPath,
...@@ -55,7 +55,7 @@ export const getCommonFilterParams = (state, getters) => chartKey => { ...@@ -55,7 +55,7 @@ export const getCommonFilterParams = (state, getters) => chartKey => {
* When a minDate exists and the minDate is after the computed dateInPast, * When a minDate exists and the minDate is after the computed dateInPast,
* the minDate is returned. Otherwise the computed dateInPast is returned. * the minDate is returned. Otherwise the computed dateInPast is returned.
*/ */
export const scatterplotStartDate = state => { export const scatterplotStartDate = (state) => {
const { startDate, minDate } = state; const { startDate, minDate } = state;
const dateInPast = getDateInPast(startDate, scatterPlotAddonQueryDays); const dateInPast = getDateInPast(startDate, scatterPlotAddonQueryDays);
......
...@@ -17,11 +17,11 @@ export const fetchMergeRequests = ({ dispatch, state, rootState, rootGetters }) ...@@ -17,11 +17,11 @@ export const fetchMergeRequests = ({ dispatch, state, rootState, rootGetters })
return axios return axios
.get(rootState.endpoint, { params }) .get(rootState.endpoint, { params })
.then(response => { .then((response) => {
const { headers, data } = response; const { headers, data } = response;
dispatch('receiveMergeRequestsSuccess', { headers, data }); dispatch('receiveMergeRequestsSuccess', { headers, data });
}) })
.catch(err => dispatch('receiveMergeRequestsError', err)); .catch((err) => dispatch('receiveMergeRequestsError', err));
}; };
export const requestMergeRequests = ({ commit }) => commit(types.REQUEST_MERGE_REQUESTS); export const requestMergeRequests = ({ commit }) => commit(types.REQUEST_MERGE_REQUESTS);
......
import { chartKeys, tableSortOrder, daysToMergeMetric } from '../../../constants'; import { chartKeys, tableSortOrder, daysToMergeMetric } from '../../../constants';
export const sortIcon = state => tableSortOrder[state.sortOrder].icon; export const sortIcon = (state) => tableSortOrder[state.sortOrder].icon;
export const sortTooltipTitle = state => tableSortOrder[state.sortOrder].title; export const sortTooltipTitle = (state) => tableSortOrder[state.sortOrder].title;
export const sortFieldDropdownLabel = (state, _, rootState) => export const sortFieldDropdownLabel = (state, _, rootState) =>
rootState.metricTypes.find(metric => metric.key === state.sortField).label; rootState.metricTypes.find((metric) => metric.key === state.sortField).label;
export const tableSortOptions = (_state, _getters, _rootState, rootGetters) => [ export const tableSortOptions = (_state, _getters, _rootState, rootGetters) => [
daysToMergeMetric, daysToMergeMetric,
...@@ -15,6 +15,6 @@ export const tableSortOptions = (_state, _getters, _rootState, rootGetters) => [ ...@@ -15,6 +15,6 @@ export const tableSortOptions = (_state, _getters, _rootState, rootGetters) => [
export const columnMetricLabel = (state, _getters, _rootState, rootGetters) => export const columnMetricLabel = (state, _getters, _rootState, rootGetters) =>
rootGetters rootGetters
.getMetricTypes(chartKeys.timeBasedHistogram) .getMetricTypes(chartKeys.timeBasedHistogram)
.find(metric => metric.key === state.columnMetric).label; .find((metric) => metric.key === state.columnMetric).label;
export const isSelectedSortField = state => sortField => state.sortField === sortField; export const isSelectedSortField = (state) => (sortField) => state.sortField === sortField;
...@@ -91,7 +91,7 @@ export const transformScatterData = (data, startDate, endDate) => { ...@@ -91,7 +91,7 @@ export const transformScatterData = (data, startDate, endDate) => {
const result = initDateArray(startDate, endDate); const result = initDateArray(startDate, endDate);
const totalItems = result.length; const totalItems = result.length;
Object.keys(data).forEach(id => { Object.keys(data).forEach((id) => {
const mergedAtDate = new Date(data[id].merged_at); const mergedAtDate = new Date(data[id].merged_at);
const dayDiff = getDayDifference(mergedAtDate, endDate); const dayDiff = getDayDifference(mergedAtDate, endDate);
...@@ -134,7 +134,7 @@ export const getScatterPlotData = (data, startDate, endDate) => { ...@@ -134,7 +134,7 @@ export const getScatterPlotData = (data, startDate, endDate) => {
const visibleData = data.slice(startIndex); const visibleData = data.slice(startIndex);
// group by date // group by date
const result = flatten(visibleData).map(item => [ const result = flatten(visibleData).map((item) => [
dateFormat(item.merged_at, dateFormats.isoDate), dateFormat(item.merged_at, dateFormats.isoDate),
item.metric, item.metric,
item.merged_at, item.merged_at,
...@@ -162,7 +162,7 @@ export const getScatterPlotData = (data, startDate, endDate) => { ...@@ -162,7 +162,7 @@ export const getScatterPlotData = (data, startDate, endDate) => {
export const getMedianLineData = (data, startDate, endDate, daysOffset) => { export const getMedianLineData = (data, startDate, endDate, daysOffset) => {
const result = []; const result = [];
const dayDiff = getDayDifference(startDate, endDate); const dayDiff = getDayDifference(startDate, endDate);
const transformedData = data.map(arr => arr.map(x => x.metric)); const transformedData = data.map((arr) => arr.map((x) => x.metric));
const len = data.length; const len = data.length;
let i = len - dayDiff; let i = len - dayDiff;
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
// not including a project_ids param is the same as selecting all the projects // not including a project_ids param is the same as selecting all the projects
if (!this.allProjectsSelected) { if (!this.allProjectsSelected) {
this.selectedProjectIds.forEach(id => queryParams.append('project_ids[]', id)); this.selectedProjectIds.forEach((id) => queryParams.append('project_ids[]', id));
} }
return `${this.groupAnalyticsCoverageReportsPath}&${queryParams.toString()}`; return `${this.groupAnalyticsCoverageReportsPath}&${queryParams.toString()}`;
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
// Remove the projects that don't have any code coverage // Remove the projects that don't have any code coverage
...data.projects.nodes ...data.projects.nodes
.filter(({ codeCoverageSummary }) => Boolean(codeCoverageSummary)) .filter(({ codeCoverageSummary }) => Boolean(codeCoverageSummary))
.map(project => ({ .map((project) => ({
...project, ...project,
codeCoveragePath: joinPaths( codeCoveragePath: joinPaths(
gon.relative_url_root || '', gon.relative_url_root || '',
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
selectedProjectIds() { selectedProjectIds() {
// Get the IDs of the projects that we haven't requested yet // Get the IDs of the projects that we haven't requested yet
return Object.keys(this.projectIds).filter( return Object.keys(this.projectIds).filter(
id => !this.allCoverageData.some(project => project.id === id), (id) => !this.allCoverageData.some((project) => project.id === id),
); );
}, },
selectedCoverageData() { selectedCoverageData() {
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
}, },
fetchData() { fetchData() {
this.loading = true; this.loading = true;
return Api.groups(this.searchTerm, this.queryParams).then(groups => { return Api.groups(this.searchTerm, this.queryParams).then((groups) => {
this.loading = false; this.loading = false;
this.groups = groups; this.groups = groups;
}); });
......
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
return this.selectedProjects.length === 1; return this.selectedProjects.length === 1;
}, },
selectedProjectIds() { selectedProjectIds() {
return this.selectedProjects.map(p => p.id); return this.selectedProjects.map((p) => p.id);
}, },
availableProjects() { availableProjects() {
return filterBySearchTerm(this.projects, this.searchTerm); return filterBySearchTerm(this.projects, this.searchTerm);
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
getSelectedProjects(selectedProject, isMarking) { getSelectedProjects(selectedProject, isMarking) {
return isMarking return isMarking
? this.selectedProjects.concat([selectedProject]) ? this.selectedProjects.concat([selectedProject])
: this.selectedProjects.filter(project => project.id !== selectedProject.id); : this.selectedProjects.filter((project) => project.id !== selectedProject.id);
}, },
singleSelectedProject(selectedObj, isMarking) { singleSelectedProject(selectedObj, isMarking) {
return isMarking ? [selectedObj] : []; return isMarking ? [selectedObj] : [];
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
...this.queryParams, ...this.queryParams,
}, },
}) })
.then(response => { .then((response) => {
const { const {
data: { data: {
group: { group: {
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
xAxis: { xAxis: {
type: 'time', type: 'time',
axisLabel: { axisLabel: {
formatter: date => dateFormat(date, dateFormats.defaultDate), formatter: (date) => dateFormat(date, dateFormats.defaultDate),
}, },
}, },
dataZoom: [ dataZoom: [
......
...@@ -2,13 +2,13 @@ import dateFormat from 'dateformat'; ...@@ -2,13 +2,13 @@ import dateFormat from 'dateformat';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { dateFormats } from './constants'; import { dateFormats } from './constants';
export const toYmd = date => dateFormat(date, dateFormats.isoDate); export const toYmd = (date) => dateFormat(date, dateFormats.isoDate);
export default { export default {
toYmd, toYmd,
}; };
export const formattedDate = d => dateFormat(d, dateFormats.defaultDate); export const formattedDate = (d) => dateFormat(d, dateFormats.defaultDate);
/** /**
* Creates a value stream object from a dataset. Returns null if no valueStreamId is present. * Creates a value stream object from a dataset. Returns null if no valueStreamId is present.
...@@ -16,7 +16,7 @@ export const formattedDate = d => dateFormat(d, dateFormats.defaultDate); ...@@ -16,7 +16,7 @@ export const formattedDate = d => dateFormat(d, dateFormats.defaultDate);
* @param {Object} dataset - The raw value stream object * @param {Object} dataset - The raw value stream object
* @returns {Object} - A value stream object * @returns {Object} - A value stream object
*/ */
export const buildValueStreamFromJson = valueStream => { export const buildValueStreamFromJson = (valueStream) => {
const { id, name, is_custom: isCustom } = valueStream ? JSON.parse(valueStream) : {}; const { id, name, is_custom: isCustom } = valueStream ? JSON.parse(valueStream) : {};
return id ? { id, name, isCustom } : null; return id ? { id, name, isCustom } : null;
}; };
...@@ -27,7 +27,7 @@ export const buildValueStreamFromJson = valueStream => { ...@@ -27,7 +27,7 @@ export const buildValueStreamFromJson = valueStream => {
* @param {Object} dataset - The container's dataset * @param {Object} dataset - The container's dataset
* @returns {Object} - A group object * @returns {Object} - A group object
*/ */
export const buildGroupFromDataset = dataset => { export const buildGroupFromDataset = (dataset) => {
const { groupId, groupName, groupFullPath, groupAvatarUrl, groupParentId } = dataset; const { groupId, groupName, groupFullPath, groupAvatarUrl, groupParentId } = dataset;
if (groupId) { if (groupId) {
...@@ -49,7 +49,7 @@ export const buildGroupFromDataset = dataset => { ...@@ -49,7 +49,7 @@ export const buildGroupFromDataset = dataset => {
* @param {Object} dataset - The container's dataset * @param {Object} dataset - The container's dataset
* @returns {Object} - A project object * @returns {Object} - A project object
*/ */
export const buildProjectFromDataset = dataset => { export const buildProjectFromDataset = (dataset) => {
const { projectGid, projectName, projectPathWithNamespace, projectAvatarUrl } = dataset; const { projectGid, projectName, projectPathWithNamespace, projectAvatarUrl } = dataset;
if (projectGid) { if (projectGid) {
...@@ -117,5 +117,5 @@ export const buildCycleAnalyticsInitialData = ({ ...@@ -117,5 +117,5 @@ export const buildCycleAnalyticsInitialData = ({
export const filterBySearchTerm = (data = [], searchTerm = '', filterByKey = 'name') => { export const filterBySearchTerm = (data = [], searchTerm = '', filterByKey = 'name') => {
if (!searchTerm?.length) return data; if (!searchTerm?.length) return data;
return data.filter(item => item[filterByKey].toLowerCase().includes(searchTerm.toLowerCase())); return data.filter((item) => item[filterByKey].toLowerCase().includes(searchTerm.toLowerCase()));
}; };
...@@ -23,9 +23,9 @@ export default { ...@@ -23,9 +23,9 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
settings: 'settings', settings: 'settings',
isLoading: state => state.approvals.isLoading, isLoading: (state) => state.approvals.isLoading,
hasLoaded: state => state.approvals.hasLoaded, hasLoaded: (state) => state.approvals.hasLoaded,
targetBranch: state => state.approvals.targetBranch, targetBranch: (state) => state.approvals.targetBranch,
}), }),
createModalId() { createModalId() {
return `${this.settings.prefix}-approvals-create-modal`; return `${this.settings.prefix}-approvals-create-modal`;
......
...@@ -8,7 +8,7 @@ import { renderAvatar } from '~/helpers/avatar_helper'; ...@@ -8,7 +8,7 @@ import { renderAvatar } from '~/helpers/avatar_helper';
import { loadCSSFile } from '~/lib/utils/css_utils'; import { loadCSSFile } from '~/lib/utils/css_utils';
function addType(type) { function addType(type) {
return items => items.map(obj => Object.assign(obj, { type })); return (items) => items.map((obj) => Object.assign(obj, { type }));
} }
function formatSelection(group) { function formatSelection(group) {
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
}, 250), }, 250),
id: ({ type, id }) => `${type}${id}`, id: ({ type, id }) => `${type}${id}`,
}) })
.on('change', e => this.onChange(e)); .on('change', (e) => this.onChange(e));
}) })
.catch(() => {}); .catch(() => {});
}) })
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
return Promise.all([groupsAsync, usersAsync]) return Promise.all([groupsAsync, usersAsync])
.then(([groups, users]) => groups.concat(users)) .then(([groups, users]) => groups.concat(users))
.then(results => ({ results })); .then((results) => ({ results }));
}, },
fetchGroups(term) { fetchGroups(term) {
// Don't includeAll when search is empty. Otherwise, the user could get a lot of garbage choices. // Don't includeAll when search is empty. Otherwise, the user could get a lot of garbage choices.
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
}, 250), }, 250),
id: ({ type, id }) => `${type}${id}`, id: ({ type, id }) => `${type}${id}`,
}) })
.on('change', e => this.onChange(e)) .on('change', (e) => this.onChange(e))
.on('select2-open', () => { .on('select2-open', () => {
// https://stackoverflow.com/questions/18487056/select2-doesnt-work-when-embedded-in-a-bootstrap-modal // https://stackoverflow.com/questions/18487056/select2-doesnt-work-when-embedded-in-a-bootstrap-modal
// Ensure search feature works in modal // Ensure search feature works in modal
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
methods: { methods: {
fetchBranches(term) { fetchBranches(term) {
const excludeAnyBranch = term && !term.toLowerCase().includes('any'); const excludeAnyBranch = term && !term.toLowerCase().includes('any');
return Api.projectProtectedBranches(this.projectId, term).then(results => ({ return Api.projectProtectedBranches(this.projectId, term).then((results) => ({
results: excludeAnyBranch ? results : [anyBranch, ...results], results: excludeAnyBranch ? results : [anyBranch, ...results],
})); }));
}, },
......
...@@ -22,8 +22,8 @@ export default { ...@@ -22,8 +22,8 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
isLoading: state => state[APPROVALS].isLoading, isLoading: (state) => state[APPROVALS].isLoading,
rules: state => state[APPROVALS].rules, rules: (state) => state[APPROVALS].rules,
documentationPath: ({ settings }) => settings.approvalsDocumentationPath, documentationPath: ({ settings }) => settings.approvalsDocumentationPath,
licenseCheckRuleName: ({ settings }) => settings.lockedApprovalsRuleName, licenseCheckRuleName: ({ settings }) => settings.lockedApprovalsRuleName,
}), }),
......
...@@ -36,8 +36,8 @@ export default { ...@@ -36,8 +36,8 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
rules: state => state.approvals.rules, rules: (state) => state.approvals.rules,
canOverride: state => state.settings.canOverride, canOverride: (state) => state.settings.canOverride,
}), }),
toggleIcon() { toggleIcon() {
return this.isCollapsed ? 'chevron-down' : 'chevron-right'; return this.isCollapsed ? 'chevron-down' : 'chevron-right';
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
return this.glFeatures.mergeRequestReviewers && this.glFeatures.mrCollapsedApprovalRules; return this.glFeatures.mergeRequestReviewers && this.glFeatures.mrCollapsedApprovalRules;
}, },
hasOptionalRules() { hasOptionalRules() {
return this.rules.every(r => r.approvalsRequired === 0); return this.rules.every((r) => r.approvalsRequired === 0);
}, },
requiredRules() { requiredRules() {
return this.rules.reduce((acc, rule) => { return this.rules.reduce((acc, rule) => {
......
...@@ -21,12 +21,12 @@ export default { ...@@ -21,12 +21,12 @@ export default {
computed: { computed: {
...mapState(['settings']), ...mapState(['settings']),
...mapState({ ...mapState({
rules: state => state.approvals.rules, rules: (state) => state.approvals.rules,
targetBranch: state => state.approvals.targetBranch, targetBranch: (state) => state.approvals.targetBranch,
}), }),
hasNamedRule() { hasNamedRule() {
if (this.settings.allowMultiRule) { if (this.settings.allowMultiRule) {
return this.rules.some(rule => rule.ruleType !== RULE_TYPE_ANY_APPROVER); return this.rules.some((rule) => rule.ruleType !== RULE_TYPE_ANY_APPROVER);
} }
const [rule] = this.rules; const [rule] = this.rules;
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
} }
if ( if (
this.settings.allowMultiRule && this.settings.allowMultiRule &&
!newValue.some(rule => rule.ruleType === RULE_TYPE_ANY_APPROVER) !newValue.some((rule) => rule.ruleType === RULE_TYPE_ANY_APPROVER)
) { ) {
this.addEmptyRule(); this.addEmptyRule();
} }
......
...@@ -17,10 +17,10 @@ export default { ...@@ -17,10 +17,10 @@ export default {
computed: { computed: {
...mapState(['settings']), ...mapState(['settings']),
...mapState({ ...mapState({
resetToDefault: state => state.approvals.resetToDefault, resetToDefault: (state) => state.approvals.resetToDefault,
rules: state => state.approvals.rules, rules: (state) => state.approvals.rules,
rulesToDelete: state => state.approvals.rulesToDelete, rulesToDelete: (state) => state.approvals.rulesToDelete,
fallbackApprovalsRequired: state => state.approvals.fallbackApprovalsRequired, fallbackApprovalsRequired: (state) => state.approvals.fallbackApprovalsRequired,
}), }),
}, },
INPUT_ID, INPUT_ID,
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
...mapState(['settings']), ...mapState(['settings']),
}, },
created() { created() {
this.onInputChangeDebounced = debounce(event => { this.onInputChangeDebounced = debounce((event) => {
this.onInputChange(event); this.onInputChange(event);
}, 1000); }, 1000);
}, },
......
...@@ -29,15 +29,15 @@ export default { ...@@ -29,15 +29,15 @@ export default {
computed: { computed: {
...mapState(['settings']), ...mapState(['settings']),
...mapState({ ...mapState({
rules: state => state.approvals.rules, rules: (state) => state.approvals.rules,
}), }),
hasNamedRule() { hasNamedRule() {
return this.rules.some(rule => rule.ruleType === RULE_TYPE_REGULAR); return this.rules.some((rule) => rule.ruleType === RULE_TYPE_REGULAR);
}, },
hasAnyRule() { hasAnyRule() {
return ( return (
this.settings.allowMultiRule && this.settings.allowMultiRule &&
!this.rules.some(rule => rule.ruleType === RULE_TYPE_ANY_APPROVER) !this.rules.some((rule) => rule.ruleType === RULE_TYPE_ANY_APPROVER)
); );
}, },
}, },
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
handler(newValue) { handler(newValue) {
if ( if (
this.settings.allowMultiRule && this.settings.allowMultiRule &&
!newValue.some(rule => rule.ruleType === RULE_TYPE_ANY_APPROVER) !newValue.some((rule) => rule.ruleType === RULE_TYPE_ANY_APPROVER)
) { ) {
this.addEmptyRule(); this.addEmptyRule();
} }
......
...@@ -14,7 +14,7 @@ const DEFAULT_NAME_FOR_VULNERABILITY_CHECK = 'Vulnerability-Check'; ...@@ -14,7 +14,7 @@ const DEFAULT_NAME_FOR_VULNERABILITY_CHECK = 'Vulnerability-Check';
const READONLY_NAMES = [DEFAULT_NAME_FOR_LICENSE_REPORT, DEFAULT_NAME_FOR_VULNERABILITY_CHECK]; const READONLY_NAMES = [DEFAULT_NAME_FOR_LICENSE_REPORT, DEFAULT_NAME_FOR_VULNERABILITY_CHECK];
function mapServerResponseToValidationErrors(messages) { function mapServerResponseToValidationErrors(messages) {
return Object.entries(messages).flatMap(([key, msgs]) => msgs.map(msg => `${key} ${msg}`)); return Object.entries(messages).flatMap(([key, msgs]) => msgs.map((msg) => `${key} ${msg}`));
} }
export default { export default {
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
return this.defaultRuleName ? null : this.initRule; return this.defaultRuleName ? null : this.initRule;
}, },
approversByType() { approversByType() {
return groupBy(this.approvers, x => x.type); return groupBy(this.approvers, (x) => x.type);
}, },
users() { users() {
return this.approversByType[TYPE_USER] || []; return this.approversByType[TYPE_USER] || [];
...@@ -80,10 +80,10 @@ export default { ...@@ -80,10 +80,10 @@ export default {
return this.approversByType[TYPE_GROUP] || []; return this.approversByType[TYPE_GROUP] || [];
}, },
userIds() { userIds() {
return this.users.map(x => x.id); return this.users.map((x) => x.id);
}, },
groupIds() { groupIds() {
return this.groups.map(x => x.id); return this.groups.map((x) => x.id);
}, },
validation() { validation() {
if (!this.showValidation) { if (!this.showValidation) {
...@@ -140,12 +140,12 @@ export default { ...@@ -140,12 +140,12 @@ export default {
invalidBranches() { invalidBranches() {
if (this.isMrEdit) return ''; if (this.isMrEdit) return '';
const invalidTypes = this.branches.filter(id => typeof id !== 'number'); const invalidTypes = this.branches.filter((id) => typeof id !== 'number');
return invalidTypes.length ? __('Please select a valid target branch') : ''; return invalidTypes.length ? __('Please select a valid target branch') : '';
}, },
isValid() { isValid() {
return Object.keys(this.validation).every(key => !this.validation[key]); return Object.keys(this.validation).every((key) => !this.validation[key]);
}, },
isMultiSubmission() { isMultiSubmission() {
return this.settings.allowMultiRule && !this.isFallbackSubmission; return this.settings.allowMultiRule && !this.isFallbackSubmission;
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
submission = this.submitRule(); submission = this.submitRule();
} }
submission.catch(failureResponse => { submission.catch((failureResponse) => {
this.serverValidationErrors = mapServerResponseToValidationErrors( this.serverValidationErrors = mapServerResponseToValidationErrors(
failureResponse?.response?.data?.message || {}, failureResponse?.response?.data?.message || {},
); );
...@@ -293,9 +293,9 @@ export default { ...@@ -293,9 +293,9 @@ export default {
const { containsHiddenGroups = false, removeHiddenGroups = false } = this.initRule; const { containsHiddenGroups = false, removeHiddenGroups = false } = this.initRule;
const users = this.initRule.users.map(x => ({ ...x, type: TYPE_USER })); const users = this.initRule.users.map((x) => ({ ...x, type: TYPE_USER }));
const groups = this.initRule.groups.map(x => ({ ...x, type: TYPE_GROUP })); const groups = this.initRule.groups.map((x) => ({ ...x, type: TYPE_GROUP }));
const branches = this.initRule.protectedBranches?.map(x => x.id) || []; const branches = this.initRule.protectedBranches?.map((x) => x.id) || [];
return { return {
name: this.initRule.name || '', name: this.initRule.name || '',
......
...@@ -34,9 +34,9 @@ export default { ...@@ -34,9 +34,9 @@ export default {
computed: { computed: {
...mapState('securityConfiguration', ['configuration']), ...mapState('securityConfiguration', ['configuration']),
...mapState({ ...mapState({
rules: state => state.approvals.rules, rules: (state) => state.approvals.rules,
isApprovalsLoading: state => state.approvals.isLoading, isApprovalsLoading: (state) => state.approvals.isLoading,
isSecurityConfigurationLoading: state => state.securityConfiguration.isLoading, isSecurityConfigurationLoading: (state) => state.securityConfiguration.isLoading,
}), }),
isRulesLoading() { isRulesLoading() {
return this.isApprovalsLoading || this.isSecurityConfigurationLoading; return this.isApprovalsLoading || this.isSecurityConfigurationLoading;
...@@ -84,14 +84,14 @@ export default { ...@@ -84,14 +84,14 @@ export default {
...mapActions('securityConfiguration', ['fetchSecurityConfiguration']), ...mapActions('securityConfiguration', ['fetchSecurityConfiguration']),
...mapActions({ openCreateModal: 'createModal/open' }), ...mapActions({ openCreateModal: 'createModal/open' }),
hasApprovalRuleDefined(matchRule) { hasApprovalRuleDefined(matchRule) {
return this.rules.some(rule => { return this.rules.some((rule) => {
return matchRule.name === rule.name; return matchRule.name === rule.name;
}); });
}, },
hasConfiguredJob(matchRule) { hasConfiguredJob(matchRule) {
const { features = [] } = this.configuration; const { features = [] } = this.configuration;
return this.$options.featureTypes[camelCase(matchRule.name)].some(featureType => { return this.$options.featureTypes[camelCase(matchRule.name)].some((featureType) => {
return features.some(feature => { return features.some((feature) => {
return feature.type === featureType && feature.configured; return feature.type === featureType && feature.configured;
}); });
}); });
......
...@@ -24,7 +24,7 @@ function withDefaultEmptyRule(rules = []) { ...@@ -24,7 +24,7 @@ function withDefaultEmptyRule(rules = []) {
]; ];
} }
export const mapApprovalRuleRequest = req => ({ export const mapApprovalRuleRequest = (req) => ({
name: req.name, name: req.name,
approvals_required: req.approvalsRequired, approvals_required: req.approvalsRequired,
users: req.users, users: req.users,
...@@ -33,11 +33,11 @@ export const mapApprovalRuleRequest = req => ({ ...@@ -33,11 +33,11 @@ export const mapApprovalRuleRequest = req => ({
protected_branch_ids: req.protectedBranchIds, protected_branch_ids: req.protectedBranchIds,
}); });
export const mapApprovalFallbackRuleRequest = req => ({ export const mapApprovalFallbackRuleRequest = (req) => ({
fallback_approvals_required: req.approvalsRequired, fallback_approvals_required: req.approvalsRequired,
}); });
export const mapApprovalRuleResponse = res => ({ export const mapApprovalRuleResponse = (res) => ({
id: res.id, id: res.id,
hasSource: Boolean(res.source_rule), hasSource: Boolean(res.source_rule),
name: res.name, name: res.name,
...@@ -52,7 +52,7 @@ export const mapApprovalRuleResponse = res => ({ ...@@ -52,7 +52,7 @@ export const mapApprovalRuleResponse = res => ({
overridden: res.overridden, overridden: res.overridden,
}); });
export const mapApprovalSettingsResponse = res => ({ export const mapApprovalSettingsResponse = (res) => ({
rules: withDefaultEmptyRule(res.rules.map(mapApprovalRuleResponse)), rules: withDefaultEmptyRule(res.rules.map(mapApprovalRuleResponse)),
fallbackApprovalsRequired: res.fallback_approvals_required, fallbackApprovalsRequired: res.fallback_approvals_required,
}); });
...@@ -78,7 +78,7 @@ export const mapMRSourceRule = ({ id, ...rule }) => ({ ...@@ -78,7 +78,7 @@ export const mapMRSourceRule = ({ id, ...rule }) => ({
* - If needed, extract the fallback approvals required * - If needed, extract the fallback approvals required
* from the fallback rule. * from the fallback rule.
*/ */
export const mapMRApprovalSettingsResponse = res => { export const mapMRApprovalSettingsResponse = (res) => {
const rules = res.rules.filter(({ rule_type }) => visibleTypes.has(rule_type)); const rules = res.rules.filter(({ rule_type }) => visibleTypes.has(rule_type));
const fallbackApprovalsRequired = res.fallback_approvals_required || 0; const fallbackApprovalsRequired = res.fallback_approvals_required || 0;
...@@ -87,7 +87,7 @@ export const mapMRApprovalSettingsResponse = res => { ...@@ -87,7 +87,7 @@ export const mapMRApprovalSettingsResponse = res => {
rules: withDefaultEmptyRule( rules: withDefaultEmptyRule(
rules rules
.map(mapApprovalRuleResponse) .map(mapApprovalRuleResponse)
.map(res.approval_rules_overwritten ? x => x : mapMRSourceRule), .map(res.approval_rules_overwritten ? (x) => x : mapMRSourceRule),
), ),
fallbackApprovalsRequired, fallbackApprovalsRequired,
minFallbackApprovalsRequired: 0, minFallbackApprovalsRequired: 0,
......
export const isEmpty = state => !state.rules || !state.rules.length; export const isEmpty = (state) => !state.rules || !state.rules.length;
...@@ -20,7 +20,7 @@ export const fetchRules = ({ rootState, dispatch, commit }) => { ...@@ -20,7 +20,7 @@ export const fetchRules = ({ rootState, dispatch, commit }) => {
return axios return axios
.get(settingsPath) .get(settingsPath)
.then(response => dispatch('receiveRulesSuccess', mapApprovalSettingsResponse(response.data))) .then((response) => dispatch('receiveRulesSuccess', mapApprovalSettingsResponse(response.data)))
.catch(() => createFlash(__('An error occurred fetching the approval rules.'))); .catch(() => createFlash(__('An error occurred fetching the approval rules.')));
}; };
......
...@@ -7,20 +7,20 @@ import * as types from './mutation_types'; ...@@ -7,20 +7,20 @@ import * as types from './mutation_types';
import { RULE_TYPE_ANY_APPROVER } from '../../../constants'; import { RULE_TYPE_ANY_APPROVER } from '../../../constants';
import { mapMRApprovalSettingsResponse } from '../../../mappers'; import { mapMRApprovalSettingsResponse } from '../../../mappers';
const fetchGroupMembers = memoize(id => Api.groupMembers(id).then(response => response.data)); const fetchGroupMembers = memoize((id) => Api.groupMembers(id).then((response) => response.data));
const fetchApprovers = ({ userRecords, groups }) => { const fetchApprovers = ({ userRecords, groups }) => {
const groupUsersAsync = Promise.all(groups.map(fetchGroupMembers)); const groupUsersAsync = Promise.all(groups.map(fetchGroupMembers));
return groupUsersAsync return groupUsersAsync
.then(flatten) .then(flatten)
.then(groupUsers => groupUsers.concat(userRecords)) .then((groupUsers) => groupUsers.concat(userRecords))
.then(users => uniqBy(users, x => x.id)); .then((users) => uniqBy(users, (x) => x.id));
}; };
const seedApprovers = rule => const seedApprovers = (rule) =>
rule.groups || rule.userRecords rule.groups || rule.userRecords
? fetchApprovers(rule).then(approvers => ({ ? fetchApprovers(rule).then((approvers) => ({
...rule, ...rule,
approvers, approvers,
})) }))
...@@ -32,9 +32,9 @@ const seedUsers = ({ userRecords, ...rule }) => ...@@ -32,9 +32,9 @@ const seedUsers = ({ userRecords, ...rule }) =>
const seedGroups = ({ groupRecords, ...rule }) => const seedGroups = ({ groupRecords, ...rule }) =>
groupRecords ? { ...rule, groups: groupRecords } : rule; groupRecords ? { ...rule, groups: groupRecords } : rule;
const seedLocalRule = rule => seedApprovers(rule).then(seedUsers).then(seedGroups); const seedLocalRule = (rule) => seedApprovers(rule).then(seedUsers).then(seedGroups);
const seedNewRule = rule => { const seedNewRule = (rule) => {
const name = rule.ruleType === RULE_TYPE_ANY_APPROVER ? '' : rule.name; const name = rule.ruleType === RULE_TYPE_ANY_APPROVER ? '' : rule.name;
return { return {
...@@ -78,34 +78,34 @@ export const fetchRules = ( ...@@ -78,34 +78,34 @@ export const fetchRules = (
return axios return axios
.get(path, params) .get(path, params)
.then(response => mapMRApprovalSettingsResponse(response.data)) .then((response) => mapMRApprovalSettingsResponse(response.data))
.then(settings => ({ .then((settings) => ({
...settings, ...settings,
rules: settings.rules.map(x => (x.id ? x : seedNewRule(x))), rules: settings.rules.map((x) => (x.id ? x : seedNewRule(x))),
})) }))
.then(settings => dispatch('receiveRulesSuccess', { settings, resetToDefault })) .then((settings) => dispatch('receiveRulesSuccess', { settings, resetToDefault }))
.catch(() => dispatch('receiveRulesError')); .catch(() => dispatch('receiveRulesError'));
}; };
export const postRule = ({ commit, dispatch }, rule) => export const postRule = ({ commit, dispatch }, rule) =>
seedLocalRule(rule) seedLocalRule(rule)
.then(seedNewRule) .then(seedNewRule)
.then(newRule => { .then((newRule) => {
commit(types.POST_RULE, newRule); commit(types.POST_RULE, newRule);
dispatch('createModal/close'); dispatch('createModal/close');
}) })
.catch(e => { .catch((e) => {
createFlash(__('An error occurred fetching the approvers for the new rule.')); createFlash(__('An error occurred fetching the approvers for the new rule.'));
throw e; throw e;
}); });
export const putRule = ({ commit, dispatch }, rule) => export const putRule = ({ commit, dispatch }, rule) =>
seedLocalRule(rule) seedLocalRule(rule)
.then(newRule => { .then((newRule) => {
commit(types.PUT_RULE, newRule); commit(types.PUT_RULE, newRule);
dispatch('createModal/close'); dispatch('createModal/close');
}) })
.catch(e => { .catch((e) => {
createFlash(__('An error occurred fetching the approvers for the new rule.')); createFlash(__('An error occurred fetching the approvers for the new rule.'));
throw e; throw e;
}); });
...@@ -131,12 +131,12 @@ export const requestDeleteRule = ({ dispatch }, rule) => { ...@@ -131,12 +131,12 @@ export const requestDeleteRule = ({ dispatch }, rule) => {
export const postRegularRule = ({ commit, dispatch }, rule) => export const postRegularRule = ({ commit, dispatch }, rule) =>
seedLocalRule(rule) seedLocalRule(rule)
.then(seedNewRule) .then(seedNewRule)
.then(newRule => { .then((newRule) => {
commit(types.POST_REGULAR_RULE, newRule); commit(types.POST_REGULAR_RULE, newRule);
commit(types.DELETE_ANY_RULE); commit(types.DELETE_ANY_RULE);
dispatch('createModal/close'); dispatch('createModal/close');
}) })
.catch(e => { .catch((e) => {
createFlash(__('An error occurred fetching the approvers for the new rule.')); createFlash(__('An error occurred fetching the approvers for the new rule.'));
throw e; throw e;
}); });
......
...@@ -5,7 +5,7 @@ import { RULE_TYPE_ANY_APPROVER } from '../../../constants'; ...@@ -5,7 +5,7 @@ import { RULE_TYPE_ANY_APPROVER } from '../../../constants';
export default { export default {
...base, ...base,
[types.DELETE_RULE](state, id) { [types.DELETE_RULE](state, id) {
const idx = state.rules.findIndex(x => x.id === id); const idx = state.rules.findIndex((x) => x.id === id);
if (idx < 0) { if (idx < 0) {
return; return;
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
state.rules = [newRule]; state.rules = [newRule];
}, },
[types.PUT_RULE](state, { id, ...newRule }) { [types.PUT_RULE](state, { id, ...newRule }) {
const idx = state.rules.findIndex(x => x.id === id); const idx = state.rules.findIndex((x) => x.id === id);
if (idx < 0) { if (idx < 0) {
return; return;
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
state.fallbackApprovalsRequired = fallback.approvalsRequired; state.fallbackApprovalsRequired = fallback.approvalsRequired;
}, },
[types.SET_EMPTY_RULE](state) { [types.SET_EMPTY_RULE](state) {
const anyRule = state.initialRules.find(rule => rule.ruleType === RULE_TYPE_ANY_APPROVER); const anyRule = state.initialRules.find((rule) => rule.ruleType === RULE_TYPE_ANY_APPROVER);
if (anyRule) { if (anyRule) {
state.rules = [anyRule]; state.rules = [anyRule];
......
...@@ -28,7 +28,7 @@ export const fetchRules = ({ rootState, dispatch }) => { ...@@ -28,7 +28,7 @@ export const fetchRules = ({ rootState, dispatch }) => {
return axios return axios
.get(settingsPath) .get(settingsPath)
.then(response => dispatch('receiveRulesSuccess', mapApprovalSettingsResponse(response.data))) .then((response) => dispatch('receiveRulesSuccess', mapApprovalSettingsResponse(response.data)))
.catch(() => dispatch('receiveRulesError')); .catch(() => dispatch('receiveRulesError'));
}; };
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
}, },
data() { data() {
return { return {
filterTokens: this.filterTokenOptions.map(option => ({ filterTokens: this.filterTokenOptions.map((option) => ({
...AUDIT_FILTER_CONFIGS.find(({ type }) => type === option.type), ...AUDIT_FILTER_CONFIGS.find(({ type }) => type === option.type),
...option, ...option,
})), })),
...@@ -30,14 +30,14 @@ export default { ...@@ -30,14 +30,14 @@ export default {
}, },
computed: { computed: {
tokenSearchTerm() { tokenSearchTerm() {
return this.value.find(term => this.filterTokens.find(token => token.type === term.type)); return this.value.find((term) => this.filterTokens.find((token) => token.type === term.type));
}, },
enabledTokens() { enabledTokens() {
const { tokenSearchTerm } = this; const { tokenSearchTerm } = this;
// If a user has searched for a term within a token, limit the user to that one token // If a user has searched for a term within a token, limit the user to that one token
if (tokenSearchTerm) { if (tokenSearchTerm) {
return this.filterTokens.map(token => ({ return this.filterTokens.map((token) => ({
...token, ...token,
disabled: tokenSearchTerm.type !== token.type, disabled: tokenSearchTerm.type !== token.type,
})); }));
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
}, },
computed: { computed: {
selectedOption() { selectedOption() {
return SORTING_OPTIONS.find(option => option.key === this.sortBy) || SORTING_OPTIONS[0]; return SORTING_OPTIONS.find((option) => option.key === this.sortBy) || SORTING_OPTIONS[0];
}, },
}, },
methods: { methods: {
......
...@@ -10,13 +10,13 @@ export default { ...@@ -10,13 +10,13 @@ export default {
inheritAttrs: false, inheritAttrs: false,
tokenMethods: { tokenMethods: {
fetchItem(id) { fetchItem(id) {
return Api.user(id).then(res => res.data); return Api.user(id).then((res) => res.data);
}, },
fetchSuggestions(term) { fetchSuggestions(term) {
const { groupId, projectPath } = this.config; const { groupId, projectPath } = this.config;
if (groupId) { if (groupId) {
return Api.groupMembers(groupId, { search: term }).then(res => res.data); return Api.groupMembers(groupId, { search: term }).then((res) => res.data);
} }
if (projectPath) { if (projectPath) {
......
...@@ -9,10 +9,10 @@ export default { ...@@ -9,10 +9,10 @@ export default {
inheritAttrs: false, inheritAttrs: false,
tokenMethods: { tokenMethods: {
fetchItem(id) { fetchItem(id) {
return Api.project(id).then(res => res.data); return Api.project(id).then((res) => res.data);
}, },
fetchSuggestions(term) { fetchSuggestions(term) {
return Api.projects(term, { membership: false }).then(res => res.data); return Api.projects(term, { membership: false }).then((res) => res.data);
}, },
getItemName({ name }) { getItemName({ name }) {
return name; return name;
......
...@@ -105,12 +105,12 @@ export default { ...@@ -105,12 +105,12 @@ export default {
createFlash(sprintf(message, { type })); createFlash(sprintf(message, { type }));
}, },
selectActiveItem(id) { selectActiveItem(id) {
this.activeItem = this.suggestions.find(u => u.id === id); this.activeItem = this.suggestions.find((u) => u.id === id);
}, },
loadView(id) { loadView(id) {
this.viewLoading = true; this.viewLoading = true;
return this.fetchItem(id) return this.fetchItem(id)
.then(data => { .then((data) => {
this.activeItem = data; this.activeItem = data;
}) })
.catch(this.onApiError) .catch(this.onApiError)
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
loadSuggestions(term) { loadSuggestions(term) {
this.suggestionsLoading = true; this.suggestionsLoading = true;
return this.fetchSuggestions(term) return this.fetchSuggestions(term)
.then(data => { .then((data) => {
this.suggestions = data; this.suggestions = data;
}) })
.catch(this.onApiError) .catch(this.onApiError)
......
...@@ -9,10 +9,10 @@ export default { ...@@ -9,10 +9,10 @@ export default {
inheritAttrs: false, inheritAttrs: false,
tokenMethods: { tokenMethods: {
fetchItem(id) { fetchItem(id) {
return Api.user(id).then(res => res.data); return Api.user(id).then((res) => res.data);
}, },
fetchSuggestions(term) { fetchSuggestions(term) {
return Api.users(term).then(res => res.data); return Api.users(term).then((res) => res.data);
}, },
getItemName({ name }) { getItemName({ name }) {
return name; return name;
......
...@@ -55,7 +55,7 @@ export const AUDIT_FILTER_CONFIGS = [ ...@@ -55,7 +55,7 @@ export const AUDIT_FILTER_CONFIGS = [
}, },
]; ];
export const AVAILABLE_TOKEN_TYPES = AUDIT_FILTER_CONFIGS.map(token => token.type); export const AVAILABLE_TOKEN_TYPES = AUDIT_FILTER_CONFIGS.map((token) => token.type);
export const MAX_DATE_RANGE = 31; export const MAX_DATE_RANGE = 31;
......
...@@ -5,7 +5,7 @@ import { convertObjectPropsToCamelCase, parseBoolean } from '~/lib/utils/common_ ...@@ -5,7 +5,7 @@ import { convertObjectPropsToCamelCase, parseBoolean } from '~/lib/utils/common_
import AuditEventsApp from './components/audit_events_app.vue'; import AuditEventsApp from './components/audit_events_app.vue';
import createStore from './store'; import createStore from './store';
export default selector => { export default (selector) => {
const el = document.querySelector(selector); const el = document.querySelector(selector);
const { events, isLastPage, filterTokenOptions, exportUrl, showFilter = true } = el.dataset; const { events, isLastPage, filterTokenOptions, exportUrl, showFilter = true } = el.dataset;
...@@ -15,12 +15,12 @@ export default selector => { ...@@ -15,12 +15,12 @@ export default selector => {
return new Vue({ return new Vue({
el, el,
store, store,
render: createElement => render: (createElement) =>
createElement(AuditEventsApp, { createElement(AuditEventsApp, {
props: { props: {
events: JSON.parse(events), events: JSON.parse(events),
isLastPage: parseBoolean(isLastPage), isLastPage: parseBoolean(isLastPage),
filterTokenOptions: JSON.parse(filterTokenOptions).map(filterTokenOption => filterTokenOptions: JSON.parse(filterTokenOptions).map((filterTokenOption) =>
convertObjectPropsToCamelCase(filterTokenOption), convertObjectPropsToCamelCase(filterTokenOption),
), ),
exportUrl, exportUrl,
......
...@@ -6,7 +6,7 @@ import { createAuditEventSearchQuery } from '../utils'; ...@@ -6,7 +6,7 @@ import { createAuditEventSearchQuery } from '../utils';
* @param {string} exportUrl * @param {string} exportUrl
* @returns {string} * @returns {string}
*/ */
export const buildExportHref = state => exportUrl => { export const buildExportHref = (state) => (exportUrl) => {
return setUrlParams( return setUrlParams(
createAuditEventSearchQuery({ createAuditEventSearchQuery({
filterValue: state.filterValue, filterValue: state.filterValue,
......
import { parsePikadayDate, pikadayToString } from '~/lib/utils/datetime_utility'; import { parsePikadayDate, pikadayToString } from '~/lib/utils/datetime_utility';
import { AVAILABLE_TOKEN_TYPES, AUDIT_FILTER_CONFIGS } from './constants'; import { AVAILABLE_TOKEN_TYPES, AUDIT_FILTER_CONFIGS } from './constants';
export const isNumeric = str => { export const isNumeric = (str) => {
return !Number.isNaN(parseInt(str, 10)); return !Number.isNaN(parseInt(str, 10));
}; };
export const getTypeFromEntityType = entityType => { export const getTypeFromEntityType = (entityType) => {
return AUDIT_FILTER_CONFIGS.find( return AUDIT_FILTER_CONFIGS.find(
({ entityType: configEntityType }) => configEntityType === entityType, ({ entityType: configEntityType }) => configEntityType === entityType,
)?.type; )?.type;
}; };
export const getEntityTypeFromType = type => { export const getEntityTypeFromType = (type) => {
return AUDIT_FILTER_CONFIGS.find(({ type: configType }) => configType === type)?.entityType; return AUDIT_FILTER_CONFIGS.find(({ type: configType }) => configType === type)?.entityType;
}; };
...@@ -28,7 +28,7 @@ export const parseAuditEventSearchQuery = ({ ...@@ -28,7 +28,7 @@ export const parseAuditEventSearchQuery = ({
}); });
export const createAuditEventSearchQuery = ({ filterValue, startDate, endDate, sortBy }) => { export const createAuditEventSearchQuery = ({ filterValue, startDate, endDate, sortBy }) => {
const entityValue = filterValue.find(value => AVAILABLE_TOKEN_TYPES.includes(value.type)); const entityValue = filterValue.find((value) => AVAILABLE_TOKEN_TYPES.includes(value.type));
return { return {
created_after: startDate ? pikadayToString(startDate) : null, created_after: startDate ? pikadayToString(startDate) : null,
......
...@@ -3,5 +3,5 @@ import { AVAILABLE_TOKEN_TYPES } from './constants'; ...@@ -3,5 +3,5 @@ import { AVAILABLE_TOKEN_TYPES } from './constants';
export function filterTokenOptionsValidator(filterTokenOptions) { export function filterTokenOptionsValidator(filterTokenOptions) {
return filterTokenOptions return filterTokenOptions
.map(({ type }) => type) .map(({ type }) => type)
.every(type => AVAILABLE_TOKEN_TYPES.includes(type)); .every((type) => AVAILABLE_TOKEN_TYPES.includes(type));
} }
...@@ -7,7 +7,7 @@ export const fetchBillableMembersList = ({ dispatch, state }, page) => { ...@@ -7,7 +7,7 @@ export const fetchBillableMembersList = ({ dispatch, state }, page) => {
dispatch('requestBillableMembersList'); dispatch('requestBillableMembersList');
return Api.fetchBillableGroupMembersList(state.namespaceId, { page }) return Api.fetchBillableGroupMembersList(state.namespaceId, { page })
.then(data => dispatch('receiveBillableMembersListSuccess', data)) .then((data) => dispatch('receiveBillableMembersListSuccess', data))
.catch(() => dispatch('receiveBillableMembersListError')); .catch(() => dispatch('receiveBillableMembersListError'));
}; };
......
export const tableItems = state => { export const tableItems = (state) => {
if (state.members.length) { if (state.members.length) {
return state.members.map(({ name, username, avatar_url, web_url, email }) => { return state.members.map(({ name, username, avatar_url, web_url, email }) => {
const formattedUserName = `@${username}`; const formattedUserName = `@${username}`;
......
...@@ -38,7 +38,7 @@ export const fetchHasBillableGroupMembers = ({ dispatch, state }) => { ...@@ -38,7 +38,7 @@ export const fetchHasBillableGroupMembers = ({ dispatch, state }) => {
dispatch('requestHasBillableGroupMembers'); dispatch('requestHasBillableGroupMembers');
return Api.fetchBillableGroupMembersList(state.namespaceId, { per_page: 1, page: 1 }) return Api.fetchBillableGroupMembersList(state.namespaceId, { per_page: 1, page: 1 })
.then(data => dispatch('receiveHasBillableGroupMembersSuccess', data)) .then((data) => dispatch('receiveHasBillableGroupMembersSuccess', data))
.catch(() => dispatch('receiveHasBillableGroupMembersError')); .catch(() => dispatch('receiveHasBillableGroupMembersError'));
}; };
......
export const isFreePlan = state => ['free', null].includes(state.plan.code); export const isFreePlan = (state) => ['free', null].includes(state.plan.code);
...@@ -32,8 +32,8 @@ export default { ...@@ -32,8 +32,8 @@ export default {
tableKey = TABLE_TYPE_TRIAL; tableKey = TABLE_TYPE_TRIAL;
} }
state.tables[tableKey].rows.forEach(row => { state.tables[tableKey].rows.forEach((row) => {
row.columns.forEach(col => { row.columns.forEach((col) => {
if (Object.prototype.hasOwnProperty.call(usage, col.id)) { if (Object.prototype.hasOwnProperty.call(usage, col.id)) {
Vue.set(col, 'value', usage[col.id]); Vue.set(col, 'value', usage[col.id]);
} else if (Object.prototype.hasOwnProperty.call(billing, col.id)) { } else if (Object.prototype.hasOwnProperty.call(billing, col.id)) {
......
...@@ -67,7 +67,7 @@ export function transformBoardConfig(boardConfig) { ...@@ -67,7 +67,7 @@ export function transformBoardConfig(boardConfig) {
let updatedFilterPath = objectToQuery(updatedBoardConfig); let updatedFilterPath = objectToQuery(updatedBoardConfig);
const filterPath = updatedFilterPath ? updatedFilterPath.split('&') : []; const filterPath = updatedFilterPath ? updatedFilterPath.split('&') : [];
boardConfig.labels.forEach(label => { boardConfig.labels.forEach((label) => {
const labelTitle = encodeURIComponent(label.title); const labelTitle = encodeURIComponent(label.title);
const param = `label_name[]=${labelTitle}`; const param = `label_name[]=${labelTitle}`;
const labelIndex = passedFilterParams.label_name?.indexOf(labelTitle); const labelIndex = passedFilterParams.label_name?.indexOf(labelTitle);
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
handleLabelClick(label) { handleLabelClick(label) {
if (label.isAny) { if (label.isAny) {
this.board.labels = []; this.board.labels = [];
} else if (!this.board.labels.find(l => l.id === label.id)) { } else if (!this.board.labels.find((l) => l.id === label.id)) {
this.board.labels.push( this.board.labels.push(
new ListLabel({ new ListLabel({
id: label.id, id: label.id,
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
); );
} else { } else {
let { labels } = this.board; let { labels } = this.board;
labels = labels.filter(selected => selected.id !== label.id); labels = labels.filter((selected) => selected.id !== label.id);
this.board.labels = labels; this.board.labels = labels;
} }
}, },
......
...@@ -37,7 +37,7 @@ export default Vue.extend({ ...@@ -37,7 +37,7 @@ export default Vue.extend({
filterItems(term, items) { filterItems(term, items) {
const query = term.toLowerCase(); const query = term.toLowerCase();
return items.filter(item => { return items.filter((item) => {
const name = item.name ? item.name.toLowerCase() : item.title.toLowerCase(); const name = item.name ? item.name.toLowerCase() : item.title.toLowerCase();
const foundName = name.indexOf(query) > -1; const foundName = name.indexOf(query) > -1;
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
if (!this.query) return this.items; if (!this.query) return this.items;
const query = this.query.toLowerCase(); const query = this.query.toLowerCase();
return this.items.filter(item => { return this.items.filter((item) => {
const name = item.name ? item.name.toLowerCase() : item.title.toLowerCase(); const name = item.name ? item.name.toLowerCase() : item.title.toLowerCase();
if (this.listType === 'milestones') { if (this.listType === 'milestones') {
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
...mapState(['epics', 'pageInfoByListId', 'listsFlags']), ...mapState(['epics', 'pageInfoByListId', 'listsFlags']),
...mapGetters(['getUnassignedIssues']), ...mapGetters(['getUnassignedIssues']),
unassignedIssues() { unassignedIssues() {
return listId => this.getUnassignedIssues(listId); return (listId) => this.getUnassignedIssues(listId);
}, },
unassignedIssuesCount() { unassignedIssuesCount() {
return this.lists.reduce( return this.lists.reduce(
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
hasMoreUnassignedIssues() { hasMoreUnassignedIssues() {
return ( return (
this.unassignedIssuesCount > 0 && this.unassignedIssuesCount > 0 &&
this.lists.some(list => this.pageInfoByListId[list.id]?.hasNextPage) this.lists.some((list) => this.pageInfoByListId[list.id]?.hasNextPage)
); );
}, },
}, },
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
}); });
}, },
fetchMoreUnassignedIssues() { fetchMoreUnassignedIssues() {
this.lists.forEach(list => { this.lists.forEach((list) => {
if (this.pageInfoByListId[list.id]?.hasNextPage) { if (this.pageInfoByListId[list.id]?.hasNextPage) {
this.fetchIssuesForList({ listId: list.id, fetchNext: true, noEpicIssues: true }); this.fetchIssuesForList({ listId: list.id, fetchNext: true, noEpicIssues: true });
} }
......
...@@ -3,7 +3,7 @@ import initNewListDropdown from '~/boards/components/new_list_dropdown'; ...@@ -3,7 +3,7 @@ import initNewListDropdown from '~/boards/components/new_list_dropdown';
import AssigneeList from './assignees_list_selector'; import AssigneeList from './assignees_list_selector';
import MilestoneList from './milestone_list_selector'; import MilestoneList from './milestone_list_selector';
const handleDropdownHide = e => { const handleDropdownHide = (e) => {
const $currTarget = $(e.currentTarget); const $currTarget = $(e.currentTarget);
if ($currTarget.data('preventClose')) { if ($currTarget.data('preventClose')) {
e.preventDefault(); e.preventDefault();
...@@ -14,7 +14,7 @@ const handleDropdownHide = e => { ...@@ -14,7 +14,7 @@ const handleDropdownHide = e => {
let assigneeList; let assigneeList;
let milestoneList; let milestoneList;
const handleDropdownTabClick = e => { const handleDropdownTabClick = (e) => {
const $addListEl = $('#js-add-list'); const $addListEl = $('#js-add-list');
$addListEl.data('preventClose', true); $addListEl.data('preventClose', true);
if (e.target.dataset.action === 'tab-assignees' && !assigneeList) { if (e.target.dataset.action === 'tab-assignees' && !assigneeList) {
......
...@@ -7,9 +7,9 @@ export default { ...@@ -7,9 +7,9 @@ export default {
seedPatchRequest(issue, req) { seedPatchRequest(issue, req) {
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
const board = boardsStore.state.currentBoard; const board = boardsStore.state.currentBoard;
const boardLabelIds = board.labels.map(label => label.id); const boardLabelIds = board.labels.map((label) => label.id);
req.label_ids = req.label_ids.filter(id => !boardLabelIds.includes(id)); req.label_ids = req.label_ids.filter((id) => !boardLabelIds.includes(id));
if (board.milestone_id) { if (board.milestone_id) {
req.milestone_id = -1; req.milestone_id = -1;
...@@ -21,8 +21,8 @@ export default { ...@@ -21,8 +21,8 @@ export default {
const boardAssignee = board.assignee ? board.assignee.id : null; const boardAssignee = board.assignee ? board.assignee.id : null;
const assigneeIds = issue.assignees const assigneeIds = issue.assignees
.map(assignee => assignee.id) .map((assignee) => assignee.id)
.filter(id => id !== boardAssignee); .filter((id) => id !== boardAssignee);
return { return {
...req, ...req,
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
export default boardsStore => { export default (boardsStore) => {
const configEl = document.querySelector('.js-board-config'); const configEl = document.querySelector('.js-board-config');
if (configEl) { if (configEl) {
...@@ -31,7 +31,7 @@ export default boardsStore => { ...@@ -31,7 +31,7 @@ export default boardsStore => {
}, },
}, },
methods: { methods: {
showPage: page => boardsStore.showPage(page), showPage: (page) => boardsStore.showPage(page),
}, },
template: ` template: `
<div class="gl-ml-3"> <div class="gl-ml-3">
......
...@@ -5,7 +5,7 @@ export const setEpicFetchingState = (issue, value) => { ...@@ -5,7 +5,7 @@ export const setEpicFetchingState = (issue, value) => {
issue.setFetchingState('epic', value); issue.setFetchingState('epic', value);
}; };
export const getMilestoneTitle = $boardApp => ({ export const getMilestoneTitle = ($boardApp) => ({
milestoneTitle: $boardApp.dataset.boardMilestoneTitle, milestoneTitle: $boardApp.dataset.boardMilestoneTitle,
}); });
......
...@@ -2,7 +2,7 @@ export default { ...@@ -2,7 +2,7 @@ export default {
methods: { methods: {
buildUpdateRequest(list) { buildUpdateRequest(list) {
const { currentBoard } = this.state; const { currentBoard } = this.state;
const boardLabelIds = currentBoard.labels.map(label => label.id); const boardLabelIds = currentBoard.labels.map((label) => label.id);
const assigneeIds = currentBoard.assignee && [currentBoard.assignee.id]; const assigneeIds = currentBoard.assignee && [currentBoard.assignee.id];
return { return {
......
...@@ -10,7 +10,7 @@ class ListEE extends List { ...@@ -10,7 +10,7 @@ class ListEE extends List {
} }
getIssues(...args) { getIssues(...args) {
return super.getIssues(...args).then(data => { return super.getIssues(...args).then((data) => {
this.totalWeight = data.total_weight; this.totalWeight = data.total_weight;
}); });
} }
...@@ -38,7 +38,7 @@ class ListEE extends List { ...@@ -38,7 +38,7 @@ class ListEE extends List {
onNewIssueResponse(issue, data) { onNewIssueResponse(issue, data) {
issue.milestone = data.milestone ? new ListMilestone(data.milestone) : data.milestone; issue.milestone = data.milestone ? new ListMilestone(data.milestone) : data.milestone;
issue.assignees = Array.isArray(data.assignees) issue.assignees = Array.isArray(data.assignees)
? data.assignees.map(assignee => new ListAssignee(assignee)) ? data.assignees.map((assignee) => new ListAssignee(assignee))
: data.assignees; : data.assignees;
issue.labels = data.labels; issue.labels = data.labels;
......
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
}) })
.then(({ data }) => { .then(({ data }) => {
const { epics, lists } = data[boardType]?.board; const { epics, lists } = data[boardType]?.board;
const epicsFormatted = epics.edges.map(e => ({ const epicsFormatted = epics.edges.map((e) => ({
...e.node, ...e.node,
})); }));
......
...@@ -20,7 +20,7 @@ class BoardsStoreEE { ...@@ -20,7 +20,7 @@ class BoardsStoreEE {
this.store.loadList = (listPath, listType) => this.loadList(listPath, listType); this.store.loadList = (listPath, listType) => this.loadList(listPath, listType);
const superSetCurrentBoard = this.store.setCurrentBoard.bind(this.store); const superSetCurrentBoard = this.store.setCurrentBoard.bind(this.store);
this.store.setCurrentBoard = board => { this.store.setCurrentBoard = (board) => {
superSetCurrentBoard(board); superSetCurrentBoard(board);
this.store.state.assignees = []; this.store.state.assignees = [];
this.store.state.milestones = []; this.store.state.milestones = [];
...@@ -95,7 +95,7 @@ class BoardsStoreEE { ...@@ -95,7 +95,7 @@ class BoardsStoreEE {
.concat( .concat(
this.store.filter.path this.store.filter.path
.split('&') .split('&')
.filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null), .filter((param) => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null),
) )
.join('&'); .join('&');
}; };
...@@ -142,7 +142,7 @@ class BoardsStoreEE { ...@@ -142,7 +142,7 @@ class BoardsStoreEE {
} }
const filterPath = this.store.filter.path.split('&'); const filterPath = this.store.filter.path.split('&');
this.store.boardConfig.labels.forEach(label => { this.store.boardConfig.labels.forEach((label) => {
const labelTitle = encodeURIComponent(label.title); const labelTitle = encodeURIComponent(label.title);
const param = `label_name[]=${labelTitle}`; const param = `label_name[]=${labelTitle}`;
const labelIndex = filterPath.indexOf(param); const labelIndex = filterPath.indexOf(param);
...@@ -176,8 +176,8 @@ class BoardsStoreEE { ...@@ -176,8 +176,8 @@ class BoardsStoreEE {
issue.setLoadingState('weight', true); issue.setLoadingState('weight', true);
this.store this.store
.updateWeight(issue.sidebarInfoEndpoint, newWeight) .updateWeight(issue.sidebarInfoEndpoint, newWeight)
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
const lists = issue.getLists(); const lists = issue.getLists();
const oldWeight = issue.weight; const oldWeight = issue.weight;
const weightDiff = newWeight - oldWeight; const weightDiff = newWeight - oldWeight;
...@@ -186,7 +186,7 @@ class BoardsStoreEE { ...@@ -186,7 +186,7 @@ class BoardsStoreEE {
issue.updateData({ issue.updateData({
weight: data.weight, weight: data.weight,
}); });
lists.forEach(list => { lists.forEach((list) => {
list.addWeight(weightDiff); list.addWeight(weightDiff);
}); });
}) })
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
Vue.set(state.boardLists, listId, list); Vue.set(state.boardLists, listId, list);
}, },
[mutationTypes.UPDATE_LIST_FAILURE]: state => { [mutationTypes.UPDATE_LIST_FAILURE]: (state) => {
state.error = s__('Boards|An error occurred while updating the list. Please try again.'); state.error = s__('Boards|An error occurred while updating the list. Please try again.');
}, },
...@@ -100,12 +100,12 @@ export default { ...@@ -100,12 +100,12 @@ export default {
Vue.set(state.epicsFlags, epicId, { isLoading: false }); Vue.set(state.epicsFlags, epicId, { isLoading: false });
}, },
[mutationTypes.TOGGLE_EPICS_SWIMLANES]: state => { [mutationTypes.TOGGLE_EPICS_SWIMLANES]: (state) => {
state.isShowingEpicsSwimlanes = !state.isShowingEpicsSwimlanes; state.isShowingEpicsSwimlanes = !state.isShowingEpicsSwimlanes;
state.epicsSwimlanesFetchInProgress = true; state.epicsSwimlanesFetchInProgress = true;
}, },
[mutationTypes.SET_EPICS_SWIMLANES]: state => { [mutationTypes.SET_EPICS_SWIMLANES]: (state) => {
state.isShowingEpicsSwimlanes = true; state.isShowingEpicsSwimlanes = true;
state.epicsSwimlanesFetchInProgress = true; state.epicsSwimlanesFetchInProgress = true;
}, },
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
state.epicsSwimlanesFetchInProgress = false; state.epicsSwimlanesFetchInProgress = false;
}, },
[mutationTypes.RECEIVE_SWIMLANES_FAILURE]: state => { [mutationTypes.RECEIVE_SWIMLANES_FAILURE]: (state) => {
state.error = s__( state.error = s__(
'Boards|An error occurred while fetching the board swimlanes. Please reload the page.', 'Boards|An error occurred while fetching the board swimlanes. Please reload the page.',
); );
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
Vue.set(state, 'epics', unionBy(state.epics || [], epics, 'id')); Vue.set(state, 'epics', unionBy(state.epics || [], epics, 'id'));
}, },
[mutationTypes.RESET_EPICS]: state => { [mutationTypes.RESET_EPICS]: (state) => {
Vue.set(state, 'epics', []); Vue.set(state, 'epics', []);
}, },
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
[mutationTypes.SET_BOARD_EPIC_USER_PREFERENCES]: (state, val) => { [mutationTypes.SET_BOARD_EPIC_USER_PREFERENCES]: (state, val) => {
const { userPreferences, epicId } = val; const { userPreferences, epicId } = val;
const epic = state.epics.filter(currentEpic => currentEpic.id === epicId)[0]; const epic = state.epics.filter((currentEpic) => currentEpic.id === epicId)[0];
if (epic) { if (epic) {
Vue.set(epic, 'userPreferences', userPreferences); Vue.set(epic, 'userPreferences', userPreferences);
......
...@@ -9,5 +9,5 @@ export default () => ...@@ -9,5 +9,5 @@ export default () =>
ToggleLabels, ToggleLabels,
}, },
store, store,
render: createElement => createElement('toggle-labels'), render: (createElement) => createElement('toggle-labels'),
}); });
...@@ -35,7 +35,7 @@ export default class BurnChartData { ...@@ -35,7 +35,7 @@ export default class BurnChartData {
const dateString = dateFormat(date, this.dateFormatMask); const dateString = dateFormat(date, this.dateFormatMask);
const openedIssuesToday = this.filterAndSummarizeBurndownEvents( const openedIssuesToday = this.filterAndSummarizeBurndownEvents(
event => (event) =>
event.created_at === dateString && event.created_at === dateString &&
event.event_type === 'milestone' && event.event_type === 'milestone' &&
event.milestone_id === milestoneId && event.milestone_id === milestoneId &&
...@@ -43,7 +43,7 @@ export default class BurnChartData { ...@@ -43,7 +43,7 @@ export default class BurnChartData {
); );
const closedIssuesToday = this.filterAndSummarizeBurndownEvents( const closedIssuesToday = this.filterAndSummarizeBurndownEvents(
event => (event) =>
event.created_at === dateString && event.created_at === dateString &&
event.event_type === 'milestone' && event.event_type === 'milestone' &&
((event.action === 'remove' && event.milestone_id === milestoneId) || ((event.action === 'remove' && event.milestone_id === milestoneId) ||
...@@ -87,13 +87,13 @@ export default class BurnChartData { ...@@ -87,13 +87,13 @@ export default class BurnChartData {
const dateString = dateFormat(date, this.dateFormatMask); const dateString = dateFormat(date, this.dateFormatMask);
const openedIssuesToday = this.filterAndSummarizeBurndownEvents( const openedIssuesToday = this.filterAndSummarizeBurndownEvents(
event => (event) =>
event.created_at === dateString && event.created_at === dateString &&
(event.action === 'created' || event.action === 'reopened'), (event.action === 'created' || event.action === 'reopened'),
); );
const closedIssuesToday = this.filterAndSummarizeBurndownEvents( const closedIssuesToday = this.filterAndSummarizeBurndownEvents(
event => event.created_at === dateString && event.action === 'closed', (event) => event.created_at === dateString && event.action === 'closed',
); );
openIssuesCount += openedIssuesToday.count - closedIssuesToday.count; openIssuesCount += openedIssuesToday.count - closedIssuesToday.count;
...@@ -128,7 +128,7 @@ export default class BurnChartData { ...@@ -128,7 +128,7 @@ export default class BurnChartData {
// 1. Set event creation date to milestone start date if created before milestone start // 1. Set event creation date to milestone start date if created before milestone start
// 2. Convert event creation datetime to date in local timezone // 2. Convert event creation datetime to date in local timezone
processRawEvents(events) { processRawEvents(events) {
return events.map(event => ({ return events.map((event) => ({
...event, ...event,
created_at: created_at:
dateFormat(event.created_at, this.dateFormatMask) < this.startDate dateFormat(event.created_at, this.dateFormatMask) < this.startDate
......
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
axios axios
.get(this.burndownEventsPath) .get(this.burndownEventsPath)
.then(burndownResponse => { .then((burndownResponse) => {
const burndownEvents = burndownResponse.data; const burndownEvents = burndownResponse.data;
const burndownChartData = new BurndownChartData( const burndownChartData = new BurndownChartData(
burndownEvents, burndownEvents,
...@@ -178,8 +178,8 @@ export default { ...@@ -178,8 +178,8 @@ export default {
this.dueDate, this.dueDate,
).generateBurndownTimeseries(); ).generateBurndownTimeseries();
this.openIssuesCount = burndownChartData.map(d => [d[0], d[1]]); this.openIssuesCount = burndownChartData.map((d) => [d[0], d[1]]);
this.openIssuesWeight = burndownChartData.map(d => [d[0], d[2]]); this.openIssuesWeight = burndownChartData.map((d) => [d[0], d[2]]);
}) })
.catch(() => { .catch(() => {
this.fetchedLegacyData = false; this.fetchedLegacyData = false;
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
}); });
}, },
pluckBurnupDataProperties(total, completed) { pluckBurnupDataProperties(total, completed) {
return this.burnupData.map(data => { return this.burnupData.map((data) => {
return [data.date, data[total] - data[completed]]; return [data.date, data[total] - data[completed]];
}); });
}, },
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
padSparseBurnupData(sparseBurnupData) { padSparseBurnupData(sparseBurnupData) {
// if we don't have data for the startDate, we still want to draw a point at 0 // if we don't have data for the startDate, we still want to draw a point at 0
// on the chart, so add an item to the start of the array // on the chart, so add an item to the start of the array
const hasDataForStartDate = sparseBurnupData.find(d => d.date === this.startDate); const hasDataForStartDate = sparseBurnupData.find((d) => d.date === this.startDate);
if (!hasDataForStartDate) { if (!hasDataForStartDate) {
sparseBurnupData.unshift({ sparseBurnupData.unshift({
date: this.startDate, date: this.startDate,
...@@ -222,7 +222,7 @@ export default { ...@@ -222,7 +222,7 @@ export default {
// similar to the startDate padding, if we don't have a value for the // similar to the startDate padding, if we don't have a value for the
// last item in the array, we should add one. If no events occur on // last item in the array, we should add one. If no events occur on
// a day then we don't get any data for that day in the response // a day then we don't get any data for that day in the response
const hasDataForLastDate = sparseBurnupData.find(d => d.date === lastDate); const hasDataForLastDate = sparseBurnupData.find((d) => d.date === lastDate);
if (!hasDataForLastDate) { if (!hasDataForLastDate) {
const lastItem = sparseBurnupData[sparseBurnupData.length - 1]; const lastItem = sparseBurnupData[sparseBurnupData.length - 1];
sparseBurnupData.push({ sparseBurnupData.push({
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
methods: { methods: {
// transform the object to a chart-friendly array of date + value // transform the object to a chart-friendly array of date + value
transform(key) { transform(key) {
return this.burnupData.map(val => [val.date, val[key]]); return this.burnupData.map((val) => [val.date, val[key]]);
}, },
formatTooltipText(params) { formatTooltipText(params) {
const [total, completed] = params.seriesData; const [total, completed] = params.seriesData;
......
...@@ -36,13 +36,13 @@ export default { ...@@ -36,13 +36,13 @@ export default {
type: String, type: String,
required: false, required: false,
default: Namespace.Group, default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value), validator: (value) => Object.values(Namespace).includes(value),
}, },
displayValue: { displayValue: {
type: String, type: String,
required: false, required: false,
default: Unit.count, default: Unit.count,
validator: val => Unit[val], validator: (val) => Unit[val],
}, },
}, },
data() { data() {
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
podsInUseCount() { podsInUseCount() {
let podsInUse = 0; let podsInUse = 0;
this.environments.forEach(environment => { this.environments.forEach((environment) => {
if (this.hasInstances(environment.rolloutStatus)) { if (this.hasInstances(environment.rolloutStatus)) {
podsInUse += environment.rolloutStatus.instances.length; podsInUse += environment.rolloutStatus.instances.length;
} }
...@@ -66,8 +66,8 @@ export default { ...@@ -66,8 +66,8 @@ export default {
]; ];
}, },
methods: { methods: {
hasInstances: rolloutStatus => rolloutStatus.instances && rolloutStatus.instances.length, hasInstances: (rolloutStatus) => rolloutStatus.instances && rolloutStatus.instances.length,
isLoadingRollout: rolloutStatus => rolloutStatus.status === 'loading', isLoadingRollout: (rolloutStatus) => rolloutStatus.status === 'loading',
}, },
}; };
</script> </script>
......
...@@ -2,7 +2,7 @@ import Tracking from '~/tracking'; ...@@ -2,7 +2,7 @@ import Tracking from '~/tracking';
export default { export default {
methods: { methods: {
trackUninstallButtonClick: application => { trackUninstallButtonClick: (application) => {
Tracking.event('k8s_cluster', 'uninstall', { Tracking.event('k8s_cluster', 'uninstall', {
label: application, label: application,
}); });
......
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
projectPath: this.projectPath, projectPath: this.projectPath,
}; };
}, },
update: data => { update: (data) => {
return { return {
list: data?.project?.clusterAgents?.nodes, list: data?.project?.clusterAgents?.nodes,
folders: data?.project?.repository?.tree?.trees?.nodes, folders: data?.project?.repository?.tree?.trees?.nodes,
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
const configFolders = this.agents?.folders; const configFolders = this.agents?.folders;
if (list && configFolders) { if (list && configFolders) {
list = list.map(agent => { list = list.map((agent) => {
const configFolder = configFolders.find(({ name }) => name === agent.name); const configFolder = configFolders.find(({ name }) => name === agent.name);
return { ...agent, configFolder }; return { ...agent, configFolder };
}); });
......
...@@ -23,7 +23,7 @@ export const fetchReport = ({ state, dispatch }) => { ...@@ -23,7 +23,7 @@ export const fetchReport = ({ state, dispatch }) => {
if (!state.blobPath) throw new Error(); if (!state.blobPath) throw new Error();
dispatch('receiveReportSuccess', data); dispatch('receiveReportSuccess', data);
}) })
.catch(error => { .catch((error) => {
dispatch('receiveReportError', error); dispatch('receiveReportError', error);
createFlash(s__('ciReport|There was an error fetching the codequality report.')); createFlash(s__('ciReport|There was an error fetching the codequality report.'));
}); });
......
export const codequalityIssues = state => { export const codequalityIssues = (state) => {
const { page, perPage } = state.pageInfo; const { page, perPage } = state.pageInfo;
const start = (page - 1) * perPage; const start = (page - 1) * perPage;
return state.allCodequalityIssues.slice(start, start + perPage); return state.allCodequalityIssues.slice(start, start + perPage);
}; };
export const codequalityIssueTotal = state => state.allCodequalityIssues.length; export const codequalityIssueTotal = (state) => state.allCodequalityIssues.length;
...@@ -9,7 +9,7 @@ export default () => { ...@@ -9,7 +9,7 @@ export default () => {
return new Vue({ return new Vue({
el, el,
render: createElement => render: (createElement) =>
createElement(ComplianceDashboard, { createElement(ComplianceDashboard, {
props: { props: {
mergeRequests: JSON.parse(mergeRequests), mergeRequests: JSON.parse(mergeRequests),
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
namespace: { namespace: {
type: String, type: String,
required: true, required: true,
validator: value => validator: (value) =>
Object.values(DEPENDENCY_LIST_TYPES).some(({ namespace }) => value === namespace), Object.values(DEPENDENCY_LIST_TYPES).some(({ namespace }) => value === namespace),
}, },
}, },
......
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
namespace: { namespace: {
type: String, type: String,
required: true, required: true,
validator: value => validator: (value) =>
Object.values(DEPENDENCY_LIST_TYPES).some(({ namespace }) => value === namespace), Object.values(DEPENDENCY_LIST_TYPES).some(({ namespace }) => value === namespace),
}, },
}, },
......
...@@ -10,7 +10,7 @@ export const isIncomplete = ({ currentList }, getters) => getters[`${currentList ...@@ -10,7 +10,7 @@ export const isIncomplete = ({ currentList }, getters) => getters[`${currentList
export const hasNoDependencies = ({ currentList }, getters) => export const hasNoDependencies = ({ currentList }, getters) =>
getters[`${currentList}/hasNoDependencies`]; getters[`${currentList}/hasNoDependencies`];
export const totals = state => export const totals = (state) =>
state.listTypes.reduce( state.listTypes.reduce(
(acc, { namespace }) => ({ (acc, { namespace }) => ({
...acc, ...acc,
......
...@@ -41,14 +41,14 @@ export const fetchDependencies = ({ state, dispatch }, params = {}) => { ...@@ -41,14 +41,14 @@ export const fetchDependencies = ({ state, dispatch }, params = {}) => {
...params, ...params,
}, },
}) })
.then(response => { .then((response) => {
if (isValidResponse(response)) { if (isValidResponse(response)) {
dispatch('receiveDependenciesSuccess', response); dispatch('receiveDependenciesSuccess', response);
} else { } else {
throw new Error(__('Invalid server response')); throw new Error(__('Invalid server response'));
} }
}) })
.catch(error => { .catch((error) => {
dispatch('receiveDependenciesError', error); dispatch('receiveDependenciesError', error);
createFlash(FETCH_ERROR_MESSAGE); createFlash(FETCH_ERROR_MESSAGE);
}); });
......
...@@ -3,7 +3,7 @@ import { mapActions } from 'vuex'; ...@@ -3,7 +3,7 @@ import { mapActions } from 'vuex';
export default { export default {
computed: { computed: {
diffFileDiscussions() { diffFileDiscussions() {
return this.allDiscussions.filter(d => !d.isDraft); return this.allDiscussions.filter((d) => !d.isDraft);
}, },
}, },
methods: { methods: {
......
...@@ -10,7 +10,7 @@ const CustomNumber = { ...@@ -10,7 +10,7 @@ const CustomNumber = {
const isValidNumber = !Number.isNaN(parsedValue) && value !== ''; const isValidNumber = !Number.isNaN(parsedValue) && value !== '';
const customOption = [{ id: parsedValue, title: parsedValue }]; const customOption = [{ id: parsedValue, title: parsedValue }];
const defaultDropdownOptions = defaultOptions.map(o => ({ id: o, title: o })); const defaultDropdownOptions = defaultOptions.map((o) => ({ id: o, title: o }));
list.setData(isValidNumber ? customOption : defaultDropdownOptions); list.setData(isValidNumber ? customOption : defaultDropdownOptions);
list.currentIndex = 0; list.currentIndex = 0;
......
...@@ -14,7 +14,7 @@ export default class EETrialBanner { ...@@ -14,7 +14,7 @@ export default class EETrialBanner {
init() { init() {
// Wait for navbars to render before querying // Wait for navbars to render before querying
this.setCookies(); this.setCookies();
this.$trialBanner.on('close.bs.alert', e => this.handleTrialBannerDismiss(e)); this.$trialBanner.on('close.bs.alert', (e) => this.handleTrialBannerDismiss(e));
} }
/** /**
......
...@@ -24,7 +24,7 @@ export default class EnvironmentsStore extends CeEnvironmentsStore { ...@@ -24,7 +24,7 @@ export default class EnvironmentsStore extends CeEnvironmentsStore {
toggleDeployBoard(environmentID) { toggleDeployBoard(environmentID) {
const environments = this.state.environments.slice(); const environments = this.state.environments.slice();
this.state.environments = environments.map(env => { this.state.environments = environments.map((env) => {
let updated = { ...env }; let updated = { ...env };
if (env.id === environmentID) { if (env.id === environmentID) {
......
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
}, },
computed: { computed: {
labelIds() { labelIds() {
return this.labels.map(label => label.id); return this.labels.map((label) => label.id);
}, },
}, },
i18n: { i18n: {
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
const ids = []; const ids = [];
const allLabels = [...labels, ...this.labels]; const allLabels = [...labels, ...this.labels];
this.labels = allLabels.filter(label => { this.labels = allLabels.filter((label) => {
const exists = ids.includes(label.id); const exists = ids.includes(label.id);
ids.push(label.id); ids.push(label.id);
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
if (label.isAny) { if (label.isAny) {
this.epicContext.labels = []; this.epicContext.labels = [];
} else { } else {
const labelIndex = this.epicContext.labels.findIndex(l => l.id === label.id); const labelIndex = this.epicContext.labels.findIndex((l) => l.id === label.id);
if (labelIndex === -1) { if (labelIndex === -1) {
this.epicContext.labels.push( this.epicContext.labels.push(
...@@ -109,9 +109,9 @@ export default { ...@@ -109,9 +109,9 @@ export default {
// either selected or removed aren't leading to same selection // either selected or removed aren't leading to same selection
// as current one, as then we don't want to make network call // as current one, as then we don't want to make network call
// since nothing has changed. // since nothing has changed.
const anyLabelUpdated = labels.some(label => { const anyLabelUpdated = labels.some((label) => {
// Find this label in existing selection. // Find this label in existing selection.
const existingLabel = this.epicContext.labels.find(l => l.id === label.id); const existingLabel = this.epicContext.labels.find((l) => l.id === label.id);
// Check either of the two following conditions; // Check either of the two following conditions;
// 1. A label that's not currently applied is being applied. // 1. A label that's not currently applied is being applied.
......
...@@ -34,7 +34,7 @@ export default (epicCreate = false) => { ...@@ -34,7 +34,7 @@ export default (epicCreate = false) => {
methods: { methods: {
...mapActions(['setEpicMeta']), ...mapActions(['setEpicMeta']),
}, },
render: createElement => render: (createElement) =>
createElement('epic-create-app', { createElement('epic-create-app', {
props: { props: {
alignRight: el.dataset.alignRight, alignRight: el.dataset.alignRight,
...@@ -66,6 +66,6 @@ export default (epicCreate = false) => { ...@@ -66,6 +66,6 @@ export default (epicCreate = false) => {
methods: { methods: {
...mapActions(['setEpicMeta', 'setEpicData']), ...mapActions(['setEpicMeta', 'setEpicData']),
}, },
render: createElement => createElement('epic-app'), render: (createElement) => createElement('epic-app'),
}); });
}; };
...@@ -29,7 +29,7 @@ export default class EpicTabs { ...@@ -29,7 +29,7 @@ export default class EpicTabs {
*/ */
loadRoadmapBundle() { loadRoadmapBundle() {
import('ee/roadmap/roadmap_bundle') import('ee/roadmap/roadmap_bundle')
.then(roadmapBundle => { .then((roadmapBundle) => {
this.initRoadmap = roadmapBundle.default; this.initRoadmap = roadmapBundle.default;
}) })
.catch(() => {}); .catch(() => {});
......
...@@ -29,7 +29,7 @@ export const fetchEpicDetails = ({ state, dispatch }) => { ...@@ -29,7 +29,7 @@ export const fetchEpicDetails = ({ state, dispatch }) => {
variables, variables,
}) })
.then(({ data }) => { .then(({ data }) => {
const participants = data.group.epic.participants.edges.map(participant => ({ const participants = data.group.epic.participants.edges.map((participant) => ({
name: participant.node.name, name: participant.node.name,
avatar_url: participant.node.avatarUrl, avatar_url: participant.node.avatarUrl,
web_url: participant.node.webUrl, web_url: participant.node.webUrl,
...@@ -218,7 +218,7 @@ export const updateConfidentialityOnIssuable = ({ state, commit }, { confidentia ...@@ -218,7 +218,7 @@ export const updateConfidentialityOnIssuable = ({ state, commit }, { confidentia
throw errMsg; throw errMsg;
} }
}) })
.catch(error => { .catch((error) => {
flash(error); flash(error);
throw error; throw error;
}); });
...@@ -235,8 +235,8 @@ export const receiveEpicLabelsSelectFailure = ({ commit }) => { ...@@ -235,8 +235,8 @@ export const receiveEpicLabelsSelectFailure = ({ commit }) => {
flash(s__('Epics|An error occurred while updating labels.')); flash(s__('Epics|An error occurred while updating labels.'));
}; };
export const updateEpicLabels = ({ dispatch, state }, labels) => { export const updateEpicLabels = ({ dispatch, state }, labels) => {
const addLabelIds = labels.filter(label => label.set).map(label => label.id); const addLabelIds = labels.filter((label) => label.set).map((label) => label.id);
const removeLabelIds = labels.filter(label => !label.set).map(label => label.id); const removeLabelIds = labels.filter((label) => !label.set).map((label) => label.id);
const updateEpicInput = { const updateEpicInput = {
iid: `${state.epicIid}`, iid: `${state.epicIid}`,
groupPath: state.fullPath, groupPath: state.fullPath,
......
...@@ -110,9 +110,9 @@ export default { ...@@ -110,9 +110,9 @@ export default {
state.epicLabelsSelectInProgress = true; state.epicLabelsSelectInProgress = true;
}, },
[types.RECEIVE_EPIC_LABELS_SELECT_SUCCESS](state, labels) { [types.RECEIVE_EPIC_LABELS_SELECT_SUCCESS](state, labels) {
const addedLabels = labels.filter(label => label.set); const addedLabels = labels.filter((label) => label.set);
const removeLabelIds = labels.filter(label => !label.set).map(label => label.id); const removeLabelIds = labels.filter((label) => !label.set).map((label) => label.id);
const updatedLabels = state.labels.filter(label => !removeLabelIds.includes(label.id)); const updatedLabels = state.labels.filter((label) => !removeLabelIds.includes(label.id));
updatedLabels.push(...addedLabels); updatedLabels.push(...addedLabels);
state.epicLabelsSelectInProgress = false; state.epicLabelsSelectInProgress = false;
......
...@@ -24,7 +24,7 @@ const bindDocumentEvent = (eventName, callback) => { ...@@ -24,7 +24,7 @@ const bindDocumentEvent = (eventName, callback) => {
$(document).on(eventName, callback); $(document).on(eventName, callback);
}; };
const toggleContainerClass = className => { const toggleContainerClass = (className) => {
const containerEl = document.querySelector('.page-with-contextual-sidebar'); const containerEl = document.querySelector('.page-with-contextual-sidebar');
if (containerEl) { if (containerEl) {
...@@ -34,7 +34,7 @@ const toggleContainerClass = className => { ...@@ -34,7 +34,7 @@ const toggleContainerClass = className => {
const getCollapsedGutter = () => parseBoolean(Cookies.get('collapsed_gutter')); const getCollapsedGutter = () => parseBoolean(Cookies.get('collapsed_gutter'));
const setCollapsedGutter = value => Cookies.set('collapsed_gutter', value); const setCollapsedGutter = (value) => Cookies.set('collapsed_gutter', value);
const getDateValidity = (startDateTime, dueDateTime) => { const getDateValidity = (startDateTime, dueDateTime) => {
// If both dates are defined // If both dates are defined
......
...@@ -9,7 +9,7 @@ const NAVSOURCE_VALUE = 'navbar'; ...@@ -9,7 +9,7 @@ const NAVSOURCE_VALUE = 'navbar';
* intercepts clicks on navbar links * intercepts clicks on navbar links
* and adds the 'nav_source=navbar' query parameter * and adds the 'nav_source=navbar' query parameter
*/ */
const appendLinkParam = e => { const appendLinkParam = (e) => {
const target = e.currentTarget; const target = e.currentTarget;
// get closest link in case the target is a wrapping DOM node // get closest link in case the target is a wrapping DOM node
...@@ -28,8 +28,8 @@ export default function trackNavbarEvents() { ...@@ -28,8 +28,8 @@ export default function trackNavbarEvents() {
if (!navbar) return; if (!navbar) return;
// track search inputs within frequent-items component // track search inputs within frequent-items component
navbar.querySelectorAll(`.frequent-items-dropdown-container input`).forEach(el => { navbar.querySelectorAll(`.frequent-items-dropdown-container input`).forEach((el) => {
el.addEventListener('click', e => { el.addEventListener('click', (e) => {
const parentDropdown = e.currentTarget.closest('li.dropdown'); const parentDropdown = e.currentTarget.closest('li.dropdown');
Tracking.event(TRACKING_CATEGORY, 'activate_form_input', { Tracking.event(TRACKING_CATEGORY, 'activate_form_input', {
......
...@@ -16,7 +16,7 @@ export default class DropdownWeight extends FilteredSearchDropdown { ...@@ -16,7 +16,7 @@ export default class DropdownWeight extends FilteredSearchDropdown {
} }
itemClicked(e) { itemClicked(e) {
super.itemClicked(e, selected => { super.itemClicked(e, (selected) => {
const title = selected.querySelector('.js-data-value').innerText.trim(); const title = selected.querySelector('.js-data-value').innerText.trim();
return `${DropdownUtils.getEscapedText(title)}`; return `${DropdownUtils.getEscapedText(title)}`;
}); });
...@@ -25,7 +25,7 @@ export default class DropdownWeight extends FilteredSearchDropdown { ...@@ -25,7 +25,7 @@ export default class DropdownWeight extends FilteredSearchDropdown {
renderContent(forceShowList = false) { renderContent(forceShowList = false) {
this.droplab.changeHookList(this.hookId, this.dropdown, [CustomNumber], this.config); this.droplab.changeHookList(this.hookId, this.dropdown, [CustomNumber], this.config);
const defaultDropdownOptions = this.defaultOptions.map(o => ({ id: o, title: o })); const defaultDropdownOptions = this.defaultOptions.map((o) => ({ id: o, title: o }));
this.droplab.setData(defaultDropdownOptions); this.droplab.setData(defaultDropdownOptions);
super.renderContent(forceShowList); super.renderContent(forceShowList);
......
...@@ -6,7 +6,7 @@ export default class extends FilteredSearchManager { ...@@ -6,7 +6,7 @@ export default class extends FilteredSearchManager {
const { tokens, ...rest } = super.getSearchTokens(); const { tokens, ...rest } = super.getSearchTokens();
const hasEqualsToEpicIdToken = tokens.some( const hasEqualsToEpicIdToken = tokens.some(
token => (token) =>
token?.key === epicTokenKey.key && token?.key === epicTokenKey.key &&
token?.operator === '=' && token?.operator === '=' &&
!Number.isNaN(Number(token?.value)), !Number.isNaN(Number(token?.value)),
......
...@@ -120,7 +120,7 @@ export const iterationConditions = [ ...@@ -120,7 +120,7 @@ export const iterationConditions = [
*/ */
class IssuesFilteredSearchTokenKeysEE extends FilteredSearchTokenKeys { class IssuesFilteredSearchTokenKeysEE extends FilteredSearchTokenKeys {
constructor() { constructor() {
const milestoneTokenKeyIndex = tokenKeys.findIndex(tk => tk.key === 'milestone'); const milestoneTokenKeyIndex = tokenKeys.findIndex((tk) => tk.key === 'milestone');
tokenKeys.splice(milestoneTokenKeyIndex + 1, 0, iterationTokenKey); tokenKeys.splice(milestoneTokenKeyIndex + 1, 0, iterationTokenKey);
super([...tokenKeys, epicTokenKey, weightTokenKey], alternativeTokenKeys, [ super([...tokenKeys, epicTokenKey, weightTokenKey], alternativeTokenKeys, [
...@@ -135,7 +135,7 @@ class IssuesFilteredSearchTokenKeysEE extends FilteredSearchTokenKeys { ...@@ -135,7 +135,7 @@ class IssuesFilteredSearchTokenKeysEE extends FilteredSearchTokenKeys {
* Changes assignee token to accept multiple values. * Changes assignee token to accept multiple values.
*/ */
enableMultipleAssignees() { enableMultipleAssignees() {
const assigneeTokenKey = this.tokenKeys.find(tk => tk.key === 'assignee'); const assigneeTokenKey = this.tokenKeys.find((tk) => tk.key === 'assignee');
// Add the original as an alternative token key // Add the original as an alternative token key
this.tokenKeysWithAlternative.push({ ...assigneeTokenKey }); this.tokenKeysWithAlternative.push({ ...assigneeTokenKey });
...@@ -153,7 +153,7 @@ class IssuesFilteredSearchTokenKeysEE extends FilteredSearchTokenKeys { ...@@ -153,7 +153,7 @@ class IssuesFilteredSearchTokenKeysEE extends FilteredSearchTokenKeys {
} }
removeToken(tokenKey) { removeToken(tokenKey) {
const index = this.tokenKeys.findIndex(token => token.key === tokenKey.key); const index = this.tokenKeys.findIndex((token) => token.key === tokenKey.key);
if (index >= 0) { if (index >= 0) {
this.tokenKeys.splice(index, 1); this.tokenKeys.splice(index, 1);
} }
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
computed: { computed: {
...mapState(['formErrors']), ...mapState(['formErrors']),
visibleFormGroups() { visibleFormGroups() {
return this.formGroups.filter(group => { return this.formGroups.filter((group) => {
if (group.conditional) { if (group.conditional) {
return this.nodeData.primary return this.nodeData.primary
? group.conditional === 'primary' ? group.conditional === 'primary'
......
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
methods: { methods: {
...mapActions(['fetchSyncNamespaces']), ...mapActions(['fetchSyncNamespaces']),
toggleNamespace(namespace) { toggleNamespace(namespace) {
const index = this.selectedNamespaces.findIndex(id => id === namespace.id); const index = this.selectedNamespaces.findIndex((id) => id === namespace.id);
if (index > -1) { if (index > -1) {
this.$emit('removeSyncOption', { key: SELECTIVE_SYNC_NAMESPACES, index }); this.$emit('removeSyncOption', { key: SELECTIVE_SYNC_NAMESPACES, index });
} else { } else {
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
}, },
methods: { methods: {
toggleShard(shard) { toggleShard(shard) {
const index = this.selectedShards.findIndex(value => value === shard.value); const index = this.selectedShards.findIndex((value) => value === shard.value);
if (index > -1) { if (index > -1) {
this.$emit('removeSyncOption', { key: SELECTIVE_SYNC_SHARDS, index }); this.$emit('removeSyncOption', { key: SELECTIVE_SYNC_SHARDS, index });
} else { } else {
......
...@@ -6,13 +6,13 @@ import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils'; ...@@ -6,13 +6,13 @@ import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import { __ } from '~/locale'; import { __ } from '~/locale';
import * as types from './mutation_types'; import * as types from './mutation_types';
const getSaveErrorMessageParts = messages => { const getSaveErrorMessageParts = (messages) => {
return flatten( return flatten(
Object.entries(messages || {}).map(([key, value]) => value.map(x => `${key} ${x}`)), Object.entries(messages || {}).map(([key, value]) => value.map((x) => `${key} ${x}`)),
); );
}; };
const getSaveErrorMessage = messages => { const getSaveErrorMessage = (messages) => {
const parts = getSaveErrorMessageParts(messages); const parts = getSaveErrorMessageParts(messages);
return `${__('Errors:')} ${parts.join(', ')}`; return `${__('Errors:')} ${parts.join(', ')}`;
}; };
...@@ -29,7 +29,7 @@ export const fetchSyncNamespaces = ({ dispatch }, search) => { ...@@ -29,7 +29,7 @@ export const fetchSyncNamespaces = ({ dispatch }, search) => {
dispatch('requestSyncNamespaces'); dispatch('requestSyncNamespaces');
Api.groups(search) Api.groups(search)
.then(res => { .then((res) => {
dispatch('receiveSyncNamespacesSuccess', res); dispatch('receiveSyncNamespacesSuccess', res);
}) })
.catch(() => { .catch(() => {
......
export const formHasError = state => Object.values(state.formErrors).some(val => Boolean(val)); export const formHasError = (state) => Object.values(state.formErrors).some((val) => Boolean(val));
import { sprintf, s__ } from '~/locale'; import { sprintf, s__ } from '~/locale';
import { isSafeURL } from '~/lib/utils/url_utility'; import { isSafeURL } from '~/lib/utils/url_utility';
export const validateName = data => { export const validateName = (data) => {
if (!data) { if (!data) {
return s__("Geo|Node name can't be blank"); return s__("Geo|Node name can't be blank");
} else if (data.length > 255) { } else if (data.length > 255) {
...@@ -11,7 +11,7 @@ export const validateName = data => { ...@@ -11,7 +11,7 @@ export const validateName = data => {
return ''; return '';
}; };
export const validateUrl = data => { export const validateUrl = (data) => {
if (!data) { if (!data) {
return s__("Geo|URL can't be blank"); return s__("Geo|URL can't be blank");
} else if (!isSafeURL(data)) { } else if (!isSafeURL(data)) {
......
...@@ -89,8 +89,8 @@ export default { ...@@ -89,8 +89,8 @@ export default {
fetchGeoNodes() { fetchGeoNodes() {
return this.service return this.service
.getGeoNodes() .getGeoNodes()
.then(res => res.data) .then((res) => res.data)
.then(nodes => { .then((nodes) => {
this.store.setNodes(nodes); this.store.setNodes(nodes);
this.isLoading = false; this.isLoading = false;
}) })
...@@ -103,8 +103,8 @@ export default { ...@@ -103,8 +103,8 @@ export default {
const nodeId = node.id; const nodeId = node.id;
return this.service return this.service
.getGeoNodeDetails(node) .getGeoNodeDetails(node)
.then(res => res.data) .then((res) => res.data)
.then(nodeDetails => { .then((nodeDetails) => {
const primaryNodeVersion = this.store.getPrimaryNodeVersion(); const primaryNodeVersion = this.store.getPrimaryNodeVersion();
const updatedNodeDetails = Object.assign(nodeDetails, { const updatedNodeDetails = Object.assign(nodeDetails, {
primaryVersion: primaryNodeVersion.version, primaryVersion: primaryNodeVersion.version,
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
this.store.setNodeDetails(nodeId, updatedNodeDetails); this.store.setNodeDetails(nodeId, updatedNodeDetails);
eventHub.$emit('nodeDetailsLoaded', this.store.getNodeDetails(nodeId)); eventHub.$emit('nodeDetailsLoaded', this.store.getNodeDetails(nodeId));
}) })
.catch(err => { .catch((err) => {
this.store.setNodeDetails(nodeId, { this.store.setNodeDetails(nodeId, {
geo_node_id: nodeId, geo_node_id: nodeId,
health: err.message, health: err.message,
...@@ -142,8 +142,8 @@ export default { ...@@ -142,8 +142,8 @@ export default {
this.setNodeActionStatus(targetNode, true); this.setNodeActionStatus(targetNode, true);
return this.service return this.service
.toggleNode(targetNode) .toggleNode(targetNode)
.then(res => res.data) .then((res) => res.data)
.then(node => { .then((node) => {
Object.assign(targetNode, { Object.assign(targetNode, {
enabled: node.enabled, enabled: node.enabled,
nodeActionActive: false, nodeActionActive: false,
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
if (selectiveSyncType === 'namespaces') { if (selectiveSyncType === 'namespaces') {
return sprintf(__('Groups (%{groups})'), { return sprintf(__('Groups (%{groups})'), {
groups: this.nodeDetails.namespaces.map(n => n.full_path).join(', '), groups: this.nodeDetails.namespaces.map((n) => n.full_path).join(', '),
}); });
} }
......
...@@ -11,7 +11,7 @@ export default class GeoNodesStore { ...@@ -11,7 +11,7 @@ export default class GeoNodesStore {
} }
setNodes(nodes) { setNodes(nodes) {
this.state.nodes = nodes.map(node => GeoNodesStore.formatNode(node)); this.state.nodes = nodes.map((node) => GeoNodesStore.formatNode(node));
} }
getNodes() { getNodes() {
...@@ -67,7 +67,7 @@ export default class GeoNodesStore { ...@@ -67,7 +67,7 @@ export default class GeoNodesStore {
} }
static formatNodeDetails(rawNodeDetails, replicableTypes) { static formatNodeDetails(rawNodeDetails, replicableTypes) {
const syncStatuses = replicableTypes.map(replicable => { const syncStatuses = replicableTypes.map((replicable) => {
return { return {
itemEnabled: rawNodeDetails[`${replicable.namePlural}_replication_enabled`], itemEnabled: rawNodeDetails[`${replicable.namePlural}_replication_enabled`],
itemTitle: replicable.titlePlural, itemTitle: replicable.titlePlural,
...@@ -87,7 +87,7 @@ export default class GeoNodesStore { ...@@ -87,7 +87,7 @@ export default class GeoNodesStore {
}); });
// Adds replicable to array as long as value is defined // Adds replicable to array as long as value is defined
const verificationStatuses = syncStatuses.filter(s => const verificationStatuses = syncStatuses.filter((s) =>
Boolean( Boolean(
!isNil(s.itemValue.verificationSuccessCount) || !isNil(s.itemValue.verificationSuccessCount) ||
!isNil(s.itemValue.verificationFailureCount), !isNil(s.itemValue.verificationFailureCount),
...@@ -95,7 +95,7 @@ export default class GeoNodesStore { ...@@ -95,7 +95,7 @@ export default class GeoNodesStore {
); );
// Adds replicable to array as long as value is defined // Adds replicable to array as long as value is defined
const checksumStatuses = syncStatuses.filter(s => const checksumStatuses = syncStatuses.filter((s) =>
Boolean(!isNil(s.itemValue.checksumSuccessCount) || !isNil(s.itemValue.checksumFailureCount)), Boolean(!isNil(s.itemValue.checksumSuccessCount) || !isNil(s.itemValue.checksumFailureCount)),
); );
......
import gql from 'graphql-tag'; import gql from 'graphql-tag';
import PageInfo from '~/graphql_shared/fragments/pageInfo.fragment.graphql'; import PageInfo from '~/graphql_shared/fragments/pageInfo.fragment.graphql';
export default graphQlFieldName => { export default (graphQlFieldName) => {
return gql` return gql`
query($first: Int, $last: Int, $before: String!, $after: String!) { query($first: Int, $last: Int, $before: String!, $after: String!) {
geoNode { geoNode {
......
...@@ -54,7 +54,7 @@ export const fetchReplicableItemsGraphQl = ({ state, dispatch }, direction) => { ...@@ -54,7 +54,7 @@ export const fetchReplicableItemsGraphQl = ({ state, dispatch }, direction) => {
query: buildReplicableTypeQuery(state.graphqlFieldName), query: buildReplicableTypeQuery(state.graphqlFieldName),
variables: { first, last, before, after }, variables: { first, last, before, after },
}) })
.then(res => { .then((res) => {
if (!res.data.geoNode || !(state.graphqlFieldName in res.data.geoNode)) { if (!res.data.geoNode || !(state.graphqlFieldName in res.data.geoNode)) {
dispatch('receiveReplicableItemsSuccess', { data: [], pagination: null }); dispatch('receiveReplicableItemsSuccess', { data: [], pagination: null });
return; return;
...@@ -86,7 +86,7 @@ export const fetchReplicableItemsRestful = ({ state, dispatch }) => { ...@@ -86,7 +86,7 @@ export const fetchReplicableItemsRestful = ({ state, dispatch }) => {
}; };
Api.getGeoReplicableItems(state.replicableType, query) Api.getGeoReplicableItems(state.replicableType, query)
.then(res => { .then((res) => {
const normalizedHeaders = normalizeHeaders(res.headers); const normalizedHeaders = normalizeHeaders(res.headers);
const pagination = parseIntPagination(normalizedHeaders); const pagination = parseIntPagination(normalizedHeaders);
const data = convertObjectPropsToCamelCase(res.data, { deep: true }); const data = convertObjectPropsToCamelCase(res.data, { deep: true });
......
export const replicableTypeName = state => state.replicableType.split('_').join(' '); export const replicableTypeName = (state) => state.replicableType.split('_').join(' ');
...@@ -14,5 +14,5 @@ export const getStoreConfig = ({ replicableType, graphqlFieldName }) => ({ ...@@ -14,5 +14,5 @@ export const getStoreConfig = ({ replicableType, graphqlFieldName }) => ({
state: createState({ replicableType, graphqlFieldName }), state: createState({ replicableType, graphqlFieldName }),
}); });
const createStore = config => new Vuex.Store(getStoreConfig(config)); const createStore = (config) => new Vuex.Store(getStoreConfig(config));
export default createStore; export default createStore;
export const formHasError = state => export const formHasError = (state) =>
Object.keys(state.formErrors) Object.keys(state.formErrors)
.map(key => state.formErrors[key]) .map((key) => state.formErrors[key])
.some(val => Boolean(val)); .some((val) => Boolean(val));
...@@ -5,6 +5,6 @@ export default () => ({ ...@@ -5,6 +5,6 @@ export default () => ({
timeout: DEFAULT_TIMEOUT, timeout: DEFAULT_TIMEOUT,
allowedIp: DEFAULT_ALLOWED_IP, allowedIp: DEFAULT_ALLOWED_IP,
formErrors: Object.keys(FORM_VALIDATION_FIELDS) formErrors: Object.keys(FORM_VALIDATION_FIELDS)
.map(key => FORM_VALIDATION_FIELDS[key]) .map((key) => FORM_VALIDATION_FIELDS[key])
.reduce((acc, cur) => ({ ...acc, [cur]: '' }), {}), .reduce((acc, cur) => ({ ...acc, [cur]: '' }), {}),
}); });
import validateIpAddress from 'ee/validators/ip_address'; import validateIpAddress from 'ee/validators/ip_address';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
const validateIP = data => { const validateIP = (data) => {
let addresses = data.replace(/\s/g, '').split(','); let addresses = data.replace(/\s/g, '').split(',');
addresses = addresses.map(address => validateIpAddress(address)); addresses = addresses.map((address) => validateIpAddress(address));
return !addresses.some(a => !a); return !addresses.some((a) => !a);
}; };
export const validateTimeout = data => { export const validateTimeout = (data) => {
if (!data && data !== 0) { if (!data && data !== 0) {
return s__("Geo|Connection timeout can't be blank"); return s__("Geo|Connection timeout can't be blank");
} else if (data && Number.isNaN(Number(data))) { } else if (data && Number.isNaN(Number(data))) {
...@@ -21,7 +21,7 @@ export const validateTimeout = data => { ...@@ -21,7 +21,7 @@ export const validateTimeout = data => {
return ''; return '';
}; };
export const validateAllowedIp = data => { export const validateAllowedIp = (data) => {
if (!data) { if (!data) {
return s__("Geo|Allowed Geo IP can't be blank"); return s__("Geo|Allowed Geo IP can't be blank");
} else if (data.length > 255) { } else if (data.length > 255) {
......
...@@ -41,7 +41,7 @@ class GfmAutoCompleteEE extends GfmAutoComplete { ...@@ -41,7 +41,7 @@ class GfmAutoCompleteEE extends GfmAutoComplete {
callbacks: { callbacks: {
...defaultCallbacks, ...defaultCallbacks,
beforeSave(merges) { beforeSave(merges) {
return $.map(merges, m => { return $.map(merges, (m) => {
if (m.title == null) { if (m.title == null) {
return m; return m;
} }
...@@ -75,7 +75,7 @@ class GfmAutoCompleteEE extends GfmAutoComplete { ...@@ -75,7 +75,7 @@ class GfmAutoCompleteEE extends GfmAutoComplete {
callbacks: { callbacks: {
...defaultCallbacks, ...defaultCallbacks,
beforeSave(merges) { beforeSave(merges) {
return merges.map(m => { return merges.map((m) => {
if (m.title == null) { if (m.title == null) {
return m; return m;
} }
......
...@@ -37,7 +37,7 @@ export default class GroupMemberStore { ...@@ -37,7 +37,7 @@ export default class GroupMemberStore {
} }
setMembers(rawMembers) { setMembers(rawMembers) {
this.state.members = rawMembers.map(rawMember => GroupMemberStore.formatMember(rawMember)); this.state.members = rawMembers.map((rawMember) => GroupMemberStore.formatMember(rawMember));
} }
sortMembers(sortByColumn) { sortMembers(sortByColumn) {
...@@ -67,13 +67,13 @@ export default class GroupMemberStore { ...@@ -67,13 +67,13 @@ export default class GroupMemberStore {
fetchContributedMembers() { fetchContributedMembers() {
return axios return axios
.get(this.memberContributionsPath) .get(this.memberContributionsPath)
.then(res => res.data) .then((res) => res.data)
.then(members => { .then((members) => {
this.setColumns(COLUMNS); this.setColumns(COLUMNS);
this.setMembers(members); this.setMembers(members);
this.state.isLoading = false; this.state.isLoading = false;
}) })
.catch(e => { .catch((e) => {
this.state.isLoading = false; this.state.isLoading = false;
Flash(__('Something went wrong while fetching group member contributions')); Flash(__('Something went wrong while fetching group member contributions'));
throw e; throw e;
......
import { parseDataAttributes as CEParseDataAttributes } from '~/groups/members/utils'; import { parseDataAttributes as CEParseDataAttributes } from '~/groups/members/utils';
export const parseDataAttributes = el => { export const parseDataAttributes = (el) => {
const { ldapOverridePath } = el.dataset; const { ldapOverridePath } = el.dataset;
return { return {
......
import validateIpAddress from 'ee/validators/ip_address'; import validateIpAddress from 'ee/validators/ip_address';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
export default address => { export default (address) => {
if (!validateIpAddress(address)) { if (!validateIpAddress(address)) {
return sprintf(__('%{address} is an invalid IP address range'), { address }); return sprintf(__('%{address} is an invalid IP address range'), { address });
} }
......
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
const nodes = data.namespace?.complianceFrameworks?.nodes; const nodes = data.namespace?.complianceFrameworks?.nodes;
return ( return (
nodes?.map(framework => ({ nodes?.map((framework) => ({
...framework, ...framework,
parsedId: getIdFromGraphQLId(framework.id), parsedId: getIdFromGraphQLId(framework.id),
})) || [] })) || []
......
...@@ -10,7 +10,7 @@ const apolloProvider = new VueApollo({ ...@@ -10,7 +10,7 @@ const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(), defaultClient: createDefaultClient(),
}); });
const createComplianceFrameworksListApp = el => { const createComplianceFrameworksListApp = (el) => {
if (!el) { if (!el) {
return false; return false;
} }
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
}, },
watch: { watch: {
selectedTokens(newValue) { selectedTokens(newValue) {
this.$options.hiddenInput.value = newValue.map(token => token.name).join(','); this.$options.hiddenInput.value = newValue.map((token) => token.name).join(',');
// Dispatch `input` event so form submit button becomes active // Dispatch `input` event so form submit button becomes active
this.$options.hiddenInput.dispatchEvent( this.$options.hiddenInput.dispatchEvent(
......
...@@ -44,11 +44,11 @@ export default { ...@@ -44,11 +44,11 @@ export default {
}; };
}, },
hasAllChartsLoaded() { hasAllChartsLoaded() {
const requestedChartKeys = this.activePage?.charts?.map(chart => chart.title) || []; const requestedChartKeys = this.activePage?.charts?.map((chart) => chart.title) || [];
return requestedChartKeys.every(key => this.chartData[key]?.loaded); return requestedChartKeys.every((key) => this.chartData[key]?.loaded);
}, },
hasChartsError() { hasChartsError() {
return Object.values(this.chartData).some(data => data.error); return Object.values(this.chartData).some((data) => data.error);
}, },
pageLoading() { pageLoading() {
return !this.hasChartsError && !this.hasAllChartsLoaded; return !this.hasChartsError && !this.hasAllChartsLoaded;
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
} }
} }
return Object.keys(configData).map(key => ({ return Object.keys(configData).map((key) => ({
name: configData[key].title, name: configData[key].title,
scope: key, scope: key,
isActive: this.activeTab === key, isActive: this.activeTab === key,
......
...@@ -100,12 +100,12 @@ export default { ...@@ -100,12 +100,12 @@ export default {
methods: { methods: {
setSvg(name) { setSvg(name) {
return getSvgIconPathContent(name) return getSvgIconPathContent(name)
.then(path => { .then((path) => {
if (path) { if (path) {
this.$set(this.svgs, name, `path://${path}`); this.$set(this.svgs, name, `path://${path}`);
} }
}) })
.catch(e => { .catch((e) => {
// eslint-disable-next-line no-console, @gitlab/require-i18n-strings // eslint-disable-next-line no-console, @gitlab/require-i18n-strings
console.error('SVG could not be rendered correctly: ', e); console.error('SVG could not be rendered correctly: ', e);
}); });
......
...@@ -26,7 +26,7 @@ export const fetchConfigData = ({ dispatch }, endpoint) => { ...@@ -26,7 +26,7 @@ export const fetchConfigData = ({ dispatch }, endpoint) => {
dispatch('receiveConfigError'); dispatch('receiveConfigError');
} }
}) })
.catch(error => { .catch((error) => {
dispatch('receiveConfigError', error.response.data.message); dispatch('receiveConfigError', error.response.data.message);
}); });
}; };
...@@ -45,7 +45,7 @@ export const fetchChartData = ({ dispatch }, { endpoint, chart }) => ...@@ -45,7 +45,7 @@ export const fetchChartData = ({ dispatch }, { endpoint, chart }) =>
data, data,
}), }),
) )
.catch(error => { .catch((error) => {
let message = `${__('There was an error gathering the chart data')}`; let message = `${__('There was an error gathering the chart data')}`;
if (error.response.data && error.response.data.message) { if (error.response.data && error.response.data.message) {
......
import { CHART_TYPES } from 'ee/insights/constants'; import { CHART_TYPES } from 'ee/insights/constants';
import { __ } from '~/locale'; import { __ } from '~/locale';
const getAxisTitle = label => { const getAxisTitle = (label) => {
switch (label) { switch (label) {
case 'day': case 'day':
return __('Days'); return __('Days');
...@@ -41,7 +41,7 @@ export const transformChartDataForGlCharts = ( ...@@ -41,7 +41,7 @@ export const transformChartDataForGlCharts = (
break; break;
case CHART_TYPES.STACKED_BAR: case CHART_TYPES.STACKED_BAR:
formattedData.datasets.push( formattedData.datasets.push(
...datasets.map(dataset => ({ ...datasets.map((dataset) => ({
name: dataset.label, name: dataset.label,
data: dataset.data, data: dataset.data,
})), })),
...@@ -49,7 +49,7 @@ export const transformChartDataForGlCharts = ( ...@@ -49,7 +49,7 @@ export const transformChartDataForGlCharts = (
break; break;
case CHART_TYPES.LINE: case CHART_TYPES.LINE:
formattedData.datasets.push( formattedData.datasets.push(
...datasets.map(dataset => ({ ...datasets.map((dataset) => ({
name: dataset.label, name: dataset.label,
data: labels.map((label, i) => [label, dataset.data[i]]), data: labels.map((label, i) => [label, dataset.data[i]]),
})), })),
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
[types.RECEIVE_CONFIG_SUCCESS](state, data) { [types.RECEIVE_CONFIG_SUCCESS](state, data) {
state.configData = pick( state.configData = pick(
data, data,
Object.keys(data).filter(key => data[key].title && data[key].charts), Object.keys(data).filter((key) => data[key].title && data[key].charts),
); );
state.configLoading = false; state.configLoading = false;
}, },
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
search: this.filterParams.search, search: this.filterParams.search,
}, },
}) })
.then(res => { .then((res) => {
const { headers, data } = res; const { headers, data } = res;
this.currentPage = parseInt(headers['x-page'], 10); this.currentPage = parseInt(headers['x-page'], 10);
this.totalIssues = parseInt(headers['x-total'], 10); this.totalIssues = parseInt(headers['x-total'], 10);
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
}); });
this.issuesCount[this.currentState] = this.issues.length; this.issuesCount[this.currentState] = this.issues.length;
}) })
.catch(error => { .catch((error) => {
this.issuesListLoadFailed = true; this.issuesListLoadFailed = true;
createFlash({ createFlash({
message: __('An error occurred while loading issues'), message: __('An error occurred while loading issues'),
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
const filterParams = {}; const filterParams = {};
const plainText = []; const plainText = [];
filters.forEach(filter => { filters.forEach((filter) => {
if (filter.type === 'filtered-search-term' && filter.value.data) { if (filter.type === 'filtered-search-term' && filter.value.data) {
plainText.push(filter.value.data); plainText.push(filter.value.data);
} }
......
...@@ -32,7 +32,7 @@ export default function initJiraIssuesList({ mountPointSelector }) { ...@@ -32,7 +32,7 @@ export default function initJiraIssuesList({ mountPointSelector }) {
initialState, initialState,
initialSortBy, initialSortBy,
}, },
render: createElement => render: (createElement) =>
createElement(JiraIssuesListApp, { createElement(JiraIssuesListApp, {
props: { props: {
initialFilterParams, initialFilterParams,
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
const data = []; const data = [];
if (chartHasData()) { if (chartHasData()) {
Object.keys(chartData).forEach(key => { Object.keys(chartData).forEach((key) => {
const date = new Date(key); const date = new Date(key);
const label = `${getMonthNames(true)[date.getUTCMonth()]} ${date.getUTCFullYear()}`; const label = `${getMonthNames(true)[date.getUTCMonth()]} ${date.getUTCFullYear()}`;
const val = chartData[key]; const val = chartData[key];
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
return data; return data;
}, },
chartLabels() { chartLabels() {
return this.data.map(val => val[0]); return this.data.map((val) => val[0]);
}, },
chartDateRange() { chartDateRange() {
return `${this.chartLabels[0]} - ${this.chartLabels[this.chartLabels.length - 1]}`; return `${this.chartLabels[0]} - ${this.chartLabels[this.chartLabels.length - 1]}`;
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
}; };
}, },
series() { series() {
return this.data.map(val => val[1]); return this.data.map((val) => val[1]);
}, },
seriesAverage() { seriesAverage() {
return engineeringNotation(average(...this.series), 0); return engineeringNotation(average(...this.series), 0);
...@@ -159,11 +159,11 @@ export default { ...@@ -159,11 +159,11 @@ export default {
return false; return false;
} }
return Object.values(this.chartData).some(val => val > 0); return Object.values(this.chartData).some((val) => val > 0);
}, },
setSvg(name) { setSvg(name) {
getSvgIconPathContent(name) getSvgIconPathContent(name)
.then(path => { .then((path) => {
if (path) { if (path) {
this.$set(this.svgs, name, `path://${path}`); this.$set(this.svgs, name, `path://${path}`);
} }
......
...@@ -32,7 +32,7 @@ export default class FilteredSearchIssueAnalytics extends FilteredSearchManager ...@@ -32,7 +32,7 @@ export default class FilteredSearchIssueAnalytics extends FilteredSearchManager
* Updates issue analytics store and window history * Updates issue analytics store and window history
* with filter path * with filter path
*/ */
updateObject = path => { updateObject = (path) => {
historyPushState(path); historyPushState(path);
const filters = urlParamsToObject(path); const filters = urlParamsToObject(path);
......
...@@ -16,8 +16,8 @@ export const fetchChartData = ({ commit, dispatch, getters }, endpoint) => { ...@@ -16,8 +16,8 @@ export const fetchChartData = ({ commit, dispatch, getters }, endpoint) => {
return service return service
.fetchChartData(endpoint, getters.appliedFilters) .fetchChartData(endpoint, getters.appliedFilters)
.then(res => res.data) .then((res) => res.data)
.then(data => commit(types.SET_CHART_DATA, data)) .then((data) => commit(types.SET_CHART_DATA, data))
.then(() => dispatch('setLoadingState', false)) .then(() => dispatch('setLoadingState', false))
.catch(() => flash(__('An error occurred while loading chart data'))); .catch(() => flash(__('An error occurred while loading chart data')));
}; };
export const hasFilters = state => Object.keys(state.filters).length > 0; export const hasFilters = (state) => Object.keys(state.filters).length > 0;
export const appliedFilters = state => state.filters; export const appliedFilters = (state) => state.filters;
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: Namespace.Group, default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value), validator: (value) => Object.values(Namespace).includes(value),
}, },
previewMarkdownPath: { previewMarkdownPath: {
type: String, type: String,
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
update(data) { update(data) {
const { nodes: issues = [], count, pageInfo = {} } = data[this.namespaceType]?.issues || {}; const { nodes: issues = [], count, pageInfo = {} } = data[this.namespaceType]?.issues || {};
const list = issues.map(issue => ({ const list = issues.map((issue) => ({
...issue, ...issue,
labels: issue?.labels?.nodes || [], labels: issue?.labels?.nodes || [],
assignees: issue?.assignees?.nodes || [], assignees: issue?.assignees?.nodes || [],
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: Namespace.Group, default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value), validator: (value) => Object.values(Namespace).includes(value),
}, },
}, },
data() { data() {
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: Namespace.Group, default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value), validator: (value) => Object.values(Namespace).includes(value),
}, },
newIterationPath: { newIterationPath: {
type: String, type: String,
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: Namespace.Group, default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value), validator: (value) => Object.values(Namespace).includes(value),
}, },
}, },
methods: { methods: {
......
...@@ -26,7 +26,7 @@ export default function initLDAPGroupsSelect() { ...@@ -26,7 +26,7 @@ export default function initLDAPGroupsSelect() {
minimumInputLength: 1, minimumInputLength: 1,
query(query) { query(query) {
const provider = $('#ldap_group_link_provider').val(); const provider = $('#ldap_group_link_provider').val();
return Api.ldapGroups(query.term, provider, groups => { return Api.ldapGroups(query.term, provider, (groups) => {
const data = { const data = {
results: groups, results: groups,
}; };
......
...@@ -26,10 +26,10 @@ export const fetchLicenses = ({ state, dispatch }, params = {}) => { ...@@ -26,10 +26,10 @@ export const fetchLicenses = ({ state, dispatch }, params = {}) => {
...params, ...params,
}, },
}) })
.then(response => { .then((response) => {
dispatch('receiveLicensesSuccess', response); dispatch('receiveLicensesSuccess', response);
}) })
.catch(error => { .catch((error) => {
dispatch('receiveLicensesError', error); dispatch('receiveLicensesError', error);
}); });
}; };
......
import { LICENSE_APPROVAL_CLASSIFICATION } from 'ee/vue_shared/license_compliance/constants'; import { LICENSE_APPROVAL_CLASSIFICATION } from 'ee/vue_shared/license_compliance/constants';
import { REPORT_STATUS } from './constants'; import { REPORT_STATUS } from './constants';
export const isJobSetUp = state => state.reportInfo.status !== REPORT_STATUS.jobNotSetUp; export const isJobSetUp = (state) => state.reportInfo.status !== REPORT_STATUS.jobNotSetUp;
export const isJobFailed = state => export const isJobFailed = (state) =>
[REPORT_STATUS.jobFailed, REPORT_STATUS.noLicenses, REPORT_STATUS.incomplete].includes( [REPORT_STATUS.jobFailed, REPORT_STATUS.noLicenses, REPORT_STATUS.incomplete].includes(
state.reportInfo.status, state.reportInfo.status,
); );
export const hasPolicyViolations = state => { export const hasPolicyViolations = (state) => {
return state.licenses.some( return state.licenses.some(
license => license.classification === LICENSE_APPROVAL_CLASSIFICATION.DENIED, (license) => license.classification === LICENSE_APPROVAL_CLASSIFICATION.DENIED,
); );
}; };
...@@ -2,7 +2,7 @@ import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/const ...@@ -2,7 +2,7 @@ import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/const
import * as licenseMangementMutationTypes from 'ee/vue_shared/license_compliance/store/mutation_types'; import * as licenseMangementMutationTypes from 'ee/vue_shared/license_compliance/store/mutation_types';
import { LICENSE_LIST } from '../constants'; import { LICENSE_LIST } from '../constants';
export default store => { export default (store) => {
store.subscribe(({ type }) => { store.subscribe(({ type }) => {
switch (type) { switch (type) {
case `${LICENSE_MANAGEMENT}/${licenseMangementMutationTypes.RECEIVE_SET_LICENSE_APPROVAL}`: case `${LICENSE_MANAGEMENT}/${licenseMangementMutationTypes.RECEIVE_SET_LICENSE_APPROVAL}`:
......
...@@ -12,7 +12,7 @@ export const getLicenseKey = ({ id }) => { ...@@ -12,7 +12,7 @@ export const getLicenseKey = ({ id }) => {
* Maps an individual license response entity into the license object we'll store in our Vuex state * Maps an individual license response entity into the license object we'll store in our Vuex state
* @param {Object} license * @param {Object} license
*/ */
export const toLicenseObject = license => ({ export const toLicenseObject = (license) => ({
...license, ...license,
key: getLicenseKey(license), key: getLicenseKey(license),
}); });
...@@ -12,4 +12,4 @@ export const getStoreConfig = ({ maintenanceEnabled, bannerMessage }) => ({ ...@@ -12,4 +12,4 @@ export const getStoreConfig = ({ maintenanceEnabled, bannerMessage }) => ({
state: createState({ maintenanceEnabled, bannerMessage }), state: createState({ maintenanceEnabled, bannerMessage }),
}); });
export const createStore = config => new Vuex.Store(getStoreConfig(config)); export const createStore = (config) => new Vuex.Store(getStoreConfig(config));
...@@ -70,7 +70,7 @@ export default class MembersEE extends Members { ...@@ -70,7 +70,7 @@ export default class MembersEE extends Members {
$toggle.enable(); $toggle.enable();
$dateInput.enable(); $dateInput.enable();
}) })
.catch(xhr => { .catch((xhr) => {
$btn.enable(); $btn.enable();
if (xhr.status === 403) { if (xhr.status === 403) {
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
return createElement(CEMembersTableCell, { return createElement(CEMembersTableCell, {
props: { member: this.member }, props: { member: this.member },
scopedSlots: { scopedSlots: {
default: props => { default: (props) => {
return this.$scopedSlots.default({ return this.$scopedSlots.default({
...props, ...props,
permissions: { permissions: {
......
import createState from '~/members/store/state'; import createState from '~/members/store/state';
export default initialState => { export default (initialState) => {
const { ldapOverridePath } = initialState; const { ldapOverridePath } = initialState;
return { return {
......
...@@ -34,4 +34,4 @@ export const generateBadges = (member, isCurrentUser) => [ ...@@ -34,4 +34,4 @@ export const generateBadges = (member, isCurrentUser) => [
}, },
]; ];
export const canOverride = member => member.canOverride; export const canOverride = (member) => member.canOverride;
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
return ERROR_MESSAGES[this.errorType] || null; return ERROR_MESSAGES[this.errorType] || null;
}, },
isLoadingProfiles() { isLoadingProfiles() {
return ['scannerProfiles', 'siteProfiles'].some(name => this.$apollo.queries[name].loading); return ['scannerProfiles', 'siteProfiles'].some((name) => this.$apollo.queries[name].loading);
}, },
failedToLoadProfiles() { failedToLoadProfiles() {
return [ERROR_FETCH_SCANNER_PROFILES, ERROR_FETCH_SITE_PROFILES].includes(this.errorType); return [ERROR_FETCH_SCANNER_PROFILES, ERROR_FETCH_SITE_PROFILES].includes(this.errorType);
...@@ -201,7 +201,7 @@ export default { ...@@ -201,7 +201,7 @@ export default {
} }
}, },
) )
.catch(e => { .catch((e) => {
Sentry.captureException(e); Sentry.captureException(e);
this.showErrors(ERROR_RUN_SCAN); this.showErrors(ERROR_RUN_SCAN);
this.loading = false; this.loading = false;
......
...@@ -26,8 +26,8 @@ export default { ...@@ -26,8 +26,8 @@ export default {
}, },
computed: { computed: {
formattedProfiles() { formattedProfiles() {
return this.profiles.map(profile => { return this.profiles.map((profile) => {
const addSuffix = str => const addSuffix = (str) =>
this.glFeatures.securityOnDemandScansSiteValidation this.glFeatures.securityOnDemandScansSiteValidation
? `${str} (${SCAN_TYPE_LABEL[profile.scanType]})` ? `${str} (${SCAN_TYPE_LABEL[profile.scanType]})`
: str; : str;
......
...@@ -27,12 +27,12 @@ export default { ...@@ -27,12 +27,12 @@ export default {
}, },
computed: { computed: {
formattedProfiles() { formattedProfiles() {
return this.profiles.map(profile => { return this.profiles.map((profile) => {
const isValidated = profile.validationStatus === DAST_SITE_VALIDATION_STATUS.PASSED; const isValidated = profile.validationStatus === DAST_SITE_VALIDATION_STATUS.PASSED;
const suffix = isValidated const suffix = isValidated
? s__('DastProfiles|Validated') ? s__('DastProfiles|Validated')
: s__('DastProfiles|Not Validated'); : s__('DastProfiles|Not Validated');
const addSuffix = str => const addSuffix = (str) =>
this.glFeatures.securityOnDemandScansSiteValidation ? `${str} (${suffix})` : str; this.glFeatures.securityOnDemandScansSiteValidation ? `${str} (${suffix})` : str;
return { return {
...profile, ...profile,
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
computed: { computed: {
filteredTimezones() { filteredTimezones() {
const lowerCaseTzSearchTerm = this.tzSearchTerm.toLowerCase(); const lowerCaseTzSearchTerm = this.tzSearchTerm.toLowerCase();
return this.timezones.filter(tz => return this.timezones.filter((tz) =>
this.getFormattedTimezone(tz).toLowerCase().includes(lowerCaseTzSearchTerm), this.getFormattedTimezone(tz).toLowerCase().includes(lowerCaseTzSearchTerm),
); );
}, },
......
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
this.$emit('scheduleCreated'); this.$emit('scheduleCreated');
}, },
) )
.catch(error => { .catch((error) => {
this.error = error; this.error = error;
}) })
.finally(() => { .finally(() => {
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
this.$refs.addUpdateScheduleModal.hide(); this.$refs.addUpdateScheduleModal.hide();
}, },
) )
.catch(error => { .catch((error) => {
this.error = error; this.error = error;
}) })
.finally(() => { .finally(() => {
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
} }
this.$refs.deleteScheduleModal.hide(); this.$refs.deleteScheduleModal.hide();
}) })
.catch(error => { .catch((error) => {
this.error = error; this.error = error;
}) })
.finally(() => { .finally(() => {
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
computed: { computed: {
offset() { offset() {
const selectedTz = this.timezones.find(tz => tz.identifier === this.schedule.timezone); const selectedTz = this.timezones.find((tz) => tz.identifier === this.schedule.timezone);
return __(`(UTC ${selectedTz.formatted_offset})`); return __(`(UTC ${selectedTz.formatted_offset})`);
}, },
timeframe() { timeframe() {
......
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
this.$refs.createScheduleModal.hide(); this.$refs.createScheduleModal.hide();
}, },
) )
.catch(error => { .catch((error) => {
this.error = error; this.error = error;
}) })
.finally(() => { .finally(() => {
......
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