Commit cfb36828 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 38 of 73

Part of our prettier migration; changing the arrow-parens style.
parent aa653d5a
...@@ -1020,39 +1020,6 @@ ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/duration_chart ...@@ -1020,39 +1020,6 @@ ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/duration_chart
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.js ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.js
ee/app/assets/javascripts/analytics/cycle_analytics/store/mutations.js ee/app/assets/javascripts/analytics/cycle_analytics/store/mutations.js
## 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
......
...@@ -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