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
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.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
ee/app/assets/javascripts/oncall_schedules/utils/cache_updates.js
ee/app/assets/javascripts/oncall_schedules/utils/common_utils.js
......
......@@ -26,7 +26,7 @@ export const fetchConfigData = ({ dispatch }, endpoint) => {
dispatch('receiveConfigError');
}
})
.catch(error => {
.catch((error) => {
dispatch('receiveConfigError', error.response.data.message);
});
};
......@@ -45,7 +45,7 @@ export const fetchChartData = ({ dispatch }, { endpoint, chart }) =>
data,
}),
)
.catch(error => {
.catch((error) => {
let message = `${__('There was an error gathering the chart data')}`;
if (error.response.data && error.response.data.message) {
......
import { CHART_TYPES } from 'ee/insights/constants';
import { __ } from '~/locale';
const getAxisTitle = label => {
const getAxisTitle = (label) => {
switch (label) {
case 'day':
return __('Days');
......@@ -41,7 +41,7 @@ export const transformChartDataForGlCharts = (
break;
case CHART_TYPES.STACKED_BAR:
formattedData.datasets.push(
...datasets.map(dataset => ({
...datasets.map((dataset) => ({
name: dataset.label,
data: dataset.data,
})),
......@@ -49,7 +49,7 @@ export const transformChartDataForGlCharts = (
break;
case CHART_TYPES.LINE:
formattedData.datasets.push(
...datasets.map(dataset => ({
...datasets.map((dataset) => ({
name: dataset.label,
data: labels.map((label, i) => [label, dataset.data[i]]),
})),
......
......@@ -11,7 +11,7 @@ export default {
[types.RECEIVE_CONFIG_SUCCESS](state, data) {
state.configData = pick(
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;
},
......
......@@ -106,7 +106,7 @@ export default {
search: this.filterParams.search,
},
})
.then(res => {
.then((res) => {
const { headers, data } = res;
this.currentPage = parseInt(headers['x-page'], 10);
this.totalIssues = parseInt(headers['x-total'], 10);
......@@ -126,7 +126,7 @@ export default {
});
this.issuesCount[this.currentState] = this.issues.length;
})
.catch(error => {
.catch((error) => {
this.issuesListLoadFailed = true;
createFlash({
message: __('An error occurred while loading issues'),
......@@ -156,7 +156,7 @@ export default {
const filterParams = {};
const plainText = [];
filters.forEach(filter => {
filters.forEach((filter) => {
if (filter.type === 'filtered-search-term' && filter.value.data) {
plainText.push(filter.value.data);
}
......
......@@ -32,7 +32,7 @@ export default function initJiraIssuesList({ mountPointSelector }) {
initialState,
initialSortBy,
},
render: createElement =>
render: (createElement) =>
createElement(JiraIssuesListApp, {
props: {
initialFilterParams,
......
......@@ -66,7 +66,7 @@ export default {
const data = [];
if (chartHasData()) {
Object.keys(chartData).forEach(key => {
Object.keys(chartData).forEach((key) => {
const date = new Date(key);
const label = `${getMonthNames(true)[date.getUTCMonth()]} ${date.getUTCFullYear()}`;
const val = chartData[key];
......@@ -78,7 +78,7 @@ export default {
return data;
},
chartLabels() {
return this.data.map(val => val[0]);
return this.data.map((val) => val[0]);
},
chartDateRange() {
return `${this.chartLabels[0]} - ${this.chartLabels[this.chartLabels.length - 1]}`;
......@@ -110,7 +110,7 @@ export default {
};
},
series() {
return this.data.map(val => val[1]);
return this.data.map((val) => val[1]);
},
seriesAverage() {
return engineeringNotation(average(...this.series), 0);
......@@ -159,11 +159,11 @@ export default {
return false;
}
return Object.values(this.chartData).some(val => val > 0);
return Object.values(this.chartData).some((val) => val > 0);
},
setSvg(name) {
getSvgIconPathContent(name)
.then(path => {
.then((path) => {
if (path) {
this.$set(this.svgs, name, `path://${path}`);
}
......
......@@ -32,7 +32,7 @@ export default class FilteredSearchIssueAnalytics extends FilteredSearchManager
* Updates issue analytics store and window history
* with filter path
*/
updateObject = path => {
updateObject = (path) => {
historyPushState(path);
const filters = urlParamsToObject(path);
......
......@@ -16,8 +16,8 @@ export const fetchChartData = ({ commit, dispatch, getters }, endpoint) => {
return service
.fetchChartData(endpoint, getters.appliedFilters)
.then(res => res.data)
.then(data => commit(types.SET_CHART_DATA, data))
.then((res) => res.data)
.then((data) => commit(types.SET_CHART_DATA, data))
.then(() => dispatch('setLoadingState', false))
.catch(() => flash(__('An error occurred while loading chart data')));
};
export const hasFilters = state => Object.keys(state.filters).length > 0;
export const appliedFilters = state => state.filters;
export const hasFilters = (state) => Object.keys(state.filters).length > 0;
export const appliedFilters = (state) => state.filters;
......@@ -92,7 +92,7 @@ export default {
type: String,
required: false,
default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value),
validator: (value) => Object.values(Namespace).includes(value),
},
previewMarkdownPath: {
type: String,
......
......@@ -66,7 +66,7 @@ export default {
update(data) {
const { nodes: issues = [], count, pageInfo = {} } = data[this.namespaceType]?.issues || {};
const list = issues.map(issue => ({
const list = issues.map((issue) => ({
...issue,
labels: issue?.labels?.nodes || [],
assignees: issue?.assignees?.nodes || [],
......@@ -96,7 +96,7 @@ export default {
type: String,
required: false,
default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value),
validator: (value) => Object.values(Namespace).includes(value),
},
},
data() {
......
......@@ -31,7 +31,7 @@ export default {
type: String,
required: false,
default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value),
validator: (value) => Object.values(Namespace).includes(value),
},
newIterationPath: {
type: String,
......
......@@ -17,7 +17,7 @@ export default {
type: String,
required: false,
default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value),
validator: (value) => Object.values(Namespace).includes(value),
},
},
methods: {
......
......@@ -26,7 +26,7 @@ export default function initLDAPGroupsSelect() {
minimumInputLength: 1,
query(query) {
const provider = $('#ldap_group_link_provider').val();
return Api.ldapGroups(query.term, provider, groups => {
return Api.ldapGroups(query.term, provider, (groups) => {
const data = {
results: groups,
};
......
......@@ -26,10 +26,10 @@ export const fetchLicenses = ({ state, dispatch }, params = {}) => {
...params,
},
})
.then(response => {
.then((response) => {
dispatch('receiveLicensesSuccess', response);
})
.catch(error => {
.catch((error) => {
dispatch('receiveLicensesError', error);
});
};
......
import { LICENSE_APPROVAL_CLASSIFICATION } from 'ee/vue_shared/license_compliance/constants';
import { REPORT_STATUS } from './constants';
export const isJobSetUp = state => state.reportInfo.status !== REPORT_STATUS.jobNotSetUp;
export const isJobFailed = state =>
export const isJobSetUp = (state) => state.reportInfo.status !== REPORT_STATUS.jobNotSetUp;
export const isJobFailed = (state) =>
[REPORT_STATUS.jobFailed, REPORT_STATUS.noLicenses, REPORT_STATUS.incomplete].includes(
state.reportInfo.status,
);
export const hasPolicyViolations = state => {
export const hasPolicyViolations = (state) => {
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
import * as licenseMangementMutationTypes from 'ee/vue_shared/license_compliance/store/mutation_types';
import { LICENSE_LIST } from '../constants';
export default store => {
export default (store) => {
store.subscribe(({ type }) => {
switch (type) {
case `${LICENSE_MANAGEMENT}/${licenseMangementMutationTypes.RECEIVE_SET_LICENSE_APPROVAL}`:
......
......@@ -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
* @param {Object} license
*/
export const toLicenseObject = license => ({
export const toLicenseObject = (license) => ({
...license,
key: getLicenseKey(license),
});
......@@ -12,4 +12,4 @@ export const getStoreConfig = ({ 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 {
$toggle.enable();
$dateInput.enable();
})
.catch(xhr => {
.catch((xhr) => {
$btn.enable();
if (xhr.status === 403) {
......
......@@ -19,7 +19,7 @@ export default {
return createElement(CEMembersTableCell, {
props: { member: this.member },
scopedSlots: {
default: props => {
default: (props) => {
return this.$scopedSlots.default({
...props,
permissions: {
......
import createState from '~/members/store/state';
export default initialState => {
export default (initialState) => {
const { ldapOverridePath } = initialState;
return {
......
......@@ -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 {
return ERROR_MESSAGES[this.errorType] || null;
},
isLoadingProfiles() {
return ['scannerProfiles', 'siteProfiles'].some(name => this.$apollo.queries[name].loading);
return ['scannerProfiles', 'siteProfiles'].some((name) => this.$apollo.queries[name].loading);
},
failedToLoadProfiles() {
return [ERROR_FETCH_SCANNER_PROFILES, ERROR_FETCH_SITE_PROFILES].includes(this.errorType);
......@@ -201,7 +201,7 @@ export default {
}
},
)
.catch(e => {
.catch((e) => {
Sentry.captureException(e);
this.showErrors(ERROR_RUN_SCAN);
this.loading = false;
......
......@@ -26,8 +26,8 @@ export default {
},
computed: {
formattedProfiles() {
return this.profiles.map(profile => {
const addSuffix = str =>
return this.profiles.map((profile) => {
const addSuffix = (str) =>
this.glFeatures.securityOnDemandScansSiteValidation
? `${str} (${SCAN_TYPE_LABEL[profile.scanType]})`
: str;
......
......@@ -27,12 +27,12 @@ export default {
},
computed: {
formattedProfiles() {
return this.profiles.map(profile => {
return this.profiles.map((profile) => {
const isValidated = profile.validationStatus === DAST_SITE_VALIDATION_STATUS.PASSED;
const suffix = isValidated
? s__('DastProfiles|Validated')
: s__('DastProfiles|Not Validated');
const addSuffix = str =>
const addSuffix = (str) =>
this.glFeatures.securityOnDemandScansSiteValidation ? `${str} (${suffix})` : str;
return {
...profile,
......
......@@ -74,7 +74,7 @@ export default {
computed: {
filteredTimezones() {
const lowerCaseTzSearchTerm = this.tzSearchTerm.toLowerCase();
return this.timezones.filter(tz =>
return this.timezones.filter((tz) =>
this.getFormattedTimezone(tz).toLowerCase().includes(lowerCaseTzSearchTerm),
);
},
......
......@@ -128,7 +128,7 @@ export default {
this.$emit('scheduleCreated');
},
)
.catch(error => {
.catch((error) => {
this.error = error;
})
.finally(() => {
......@@ -161,7 +161,7 @@ export default {
this.$refs.addUpdateScheduleModal.hide();
},
)
.catch(error => {
.catch((error) => {
this.error = error;
})
.finally(() => {
......
......@@ -75,7 +75,7 @@ export default {
}
this.$refs.deleteScheduleModal.hide();
})
.catch(error => {
.catch((error) => {
this.error = error;
})
.finally(() => {
......
......@@ -65,7 +65,7 @@ export default {
},
computed: {
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})`);
},
timeframe() {
......
......@@ -154,7 +154,7 @@ export default {
this.$refs.createScheduleModal.hide();
},
)
.catch(error => {
.catch((error) => {
this.error = error;
})
.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