Commit 96ed4677 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 36 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 72c11eb5
......@@ -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
## 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
......
......@@ -7,9 +7,9 @@ export default {
seedPatchRequest(issue, req) {
/* eslint-disable no-param-reassign */
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) {
req.milestone_id = -1;
......@@ -21,8 +21,8 @@ export default {
const boardAssignee = board.assignee ? board.assignee.id : null;
const assigneeIds = issue.assignees
.map(assignee => assignee.id)
.filter(id => id !== boardAssignee);
.map((assignee) => assignee.id)
.filter((id) => id !== boardAssignee);
return {
...req,
......
......@@ -2,7 +2,7 @@ import Vue from 'vue';
import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui';
import { s__, __ } from '~/locale';
export default boardsStore => {
export default (boardsStore) => {
const configEl = document.querySelector('.js-board-config');
if (configEl) {
......@@ -31,7 +31,7 @@ export default boardsStore => {
},
},
methods: {
showPage: page => boardsStore.showPage(page),
showPage: (page) => boardsStore.showPage(page),
},
template: `
<div class="gl-ml-3">
......
......@@ -5,7 +5,7 @@ export const setEpicFetchingState = (issue, value) => {
issue.setFetchingState('epic', value);
};
export const getMilestoneTitle = $boardApp => ({
export const getMilestoneTitle = ($boardApp) => ({
milestoneTitle: $boardApp.dataset.boardMilestoneTitle,
});
......
......@@ -2,7 +2,7 @@ export default {
methods: {
buildUpdateRequest(list) {
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];
return {
......
......@@ -10,7 +10,7 @@ class ListEE extends List {
}
getIssues(...args) {
return super.getIssues(...args).then(data => {
return super.getIssues(...args).then((data) => {
this.totalWeight = data.total_weight;
});
}
......@@ -38,7 +38,7 @@ class ListEE extends List {
onNewIssueResponse(issue, data) {
issue.milestone = data.milestone ? new ListMilestone(data.milestone) : data.milestone;
issue.assignees = Array.isArray(data.assignees)
? data.assignees.map(assignee => new ListAssignee(assignee))
? data.assignees.map((assignee) => new ListAssignee(assignee))
: data.assignees;
issue.labels = data.labels;
......
......@@ -144,7 +144,7 @@ export default {
})
.then(({ data }) => {
const { epics, lists } = data[boardType]?.board;
const epicsFormatted = epics.edges.map(e => ({
const epicsFormatted = epics.edges.map((e) => ({
...e.node,
}));
......
......@@ -20,7 +20,7 @@ class BoardsStoreEE {
this.store.loadList = (listPath, listType) => this.loadList(listPath, listType);
const superSetCurrentBoard = this.store.setCurrentBoard.bind(this.store);
this.store.setCurrentBoard = board => {
this.store.setCurrentBoard = (board) => {
superSetCurrentBoard(board);
this.store.state.assignees = [];
this.store.state.milestones = [];
......@@ -95,7 +95,7 @@ class BoardsStoreEE {
.concat(
this.store.filter.path
.split('&')
.filter(param => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null),
.filter((param) => param.match(new RegExp(`^${key}=(.*)$`, 'g')) === null),
)
.join('&');
};
......@@ -142,7 +142,7 @@ class BoardsStoreEE {
}
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 param = `label_name[]=${labelTitle}`;
const labelIndex = filterPath.indexOf(param);
......@@ -176,8 +176,8 @@ class BoardsStoreEE {
issue.setLoadingState('weight', true);
this.store
.updateWeight(issue.sidebarInfoEndpoint, newWeight)
.then(res => res.data)
.then(data => {
.then((res) => res.data)
.then((data) => {
const lists = issue.getLists();
const oldWeight = issue.weight;
const weightDiff = newWeight - oldWeight;
......@@ -186,7 +186,7 @@ class BoardsStoreEE {
issue.updateData({
weight: data.weight,
});
lists.forEach(list => {
lists.forEach((list) => {
list.addWeight(weightDiff);
});
})
......
......@@ -59,7 +59,7 @@ export default {
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.');
},
......@@ -100,12 +100,12 @@ export default {
Vue.set(state.epicsFlags, epicId, { isLoading: false });
},
[mutationTypes.TOGGLE_EPICS_SWIMLANES]: state => {
[mutationTypes.TOGGLE_EPICS_SWIMLANES]: (state) => {
state.isShowingEpicsSwimlanes = !state.isShowingEpicsSwimlanes;
state.epicsSwimlanesFetchInProgress = true;
},
[mutationTypes.SET_EPICS_SWIMLANES]: state => {
[mutationTypes.SET_EPICS_SWIMLANES]: (state) => {
state.isShowingEpicsSwimlanes = true;
state.epicsSwimlanesFetchInProgress = true;
},
......@@ -115,7 +115,7 @@ export default {
state.epicsSwimlanesFetchInProgress = false;
},
[mutationTypes.RECEIVE_SWIMLANES_FAILURE]: state => {
[mutationTypes.RECEIVE_SWIMLANES_FAILURE]: (state) => {
state.error = s__(
'Boards|An error occurred while fetching the board swimlanes. Please reload the page.',
);
......@@ -133,7 +133,7 @@ export default {
Vue.set(state, 'epics', unionBy(state.epics || [], epics, 'id'));
},
[mutationTypes.RESET_EPICS]: state => {
[mutationTypes.RESET_EPICS]: (state) => {
Vue.set(state, 'epics', []);
},
......@@ -159,7 +159,7 @@ export default {
[mutationTypes.SET_BOARD_EPIC_USER_PREFERENCES]: (state, 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) {
Vue.set(epic, 'userPreferences', userPreferences);
......
......@@ -9,5 +9,5 @@ export default () =>
ToggleLabels,
},
store,
render: createElement => createElement('toggle-labels'),
render: (createElement) => createElement('toggle-labels'),
});
......@@ -35,7 +35,7 @@ export default class BurnChartData {
const dateString = dateFormat(date, this.dateFormatMask);
const openedIssuesToday = this.filterAndSummarizeBurndownEvents(
event =>
(event) =>
event.created_at === dateString &&
event.event_type === 'milestone' &&
event.milestone_id === milestoneId &&
......@@ -43,7 +43,7 @@ export default class BurnChartData {
);
const closedIssuesToday = this.filterAndSummarizeBurndownEvents(
event =>
(event) =>
event.created_at === dateString &&
event.event_type === 'milestone' &&
((event.action === 'remove' && event.milestone_id === milestoneId) ||
......@@ -87,13 +87,13 @@ export default class BurnChartData {
const dateString = dateFormat(date, this.dateFormatMask);
const openedIssuesToday = this.filterAndSummarizeBurndownEvents(
event =>
(event) =>
event.created_at === dateString &&
(event.action === 'created' || event.action === 'reopened'),
);
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;
......@@ -128,7 +128,7 @@ export default class BurnChartData {
// 1. Set event creation date to milestone start date if created before milestone start
// 2. Convert event creation datetime to date in local timezone
processRawEvents(events) {
return events.map(event => ({
return events.map((event) => ({
...event,
created_at:
dateFormat(event.created_at, this.dateFormatMask) < this.startDate
......
......@@ -170,7 +170,7 @@ export default {
axios
.get(this.burndownEventsPath)
.then(burndownResponse => {
.then((burndownResponse) => {
const burndownEvents = burndownResponse.data;
const burndownChartData = new BurndownChartData(
burndownEvents,
......@@ -178,8 +178,8 @@ export default {
this.dueDate,
).generateBurndownTimeseries();
this.openIssuesCount = burndownChartData.map(d => [d[0], d[1]]);
this.openIssuesWeight = burndownChartData.map(d => [d[0], d[2]]);
this.openIssuesCount = burndownChartData.map((d) => [d[0], d[1]]);
this.openIssuesWeight = burndownChartData.map((d) => [d[0], d[2]]);
})
.catch(() => {
this.fetchedLegacyData = false;
......@@ -187,7 +187,7 @@ export default {
});
},
pluckBurnupDataProperties(total, completed) {
return this.burnupData.map(data => {
return this.burnupData.map((data) => {
return [data.date, data[total] - data[completed]];
});
},
......@@ -203,7 +203,7 @@ export default {
padSparseBurnupData(sparseBurnupData) {
// 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
const hasDataForStartDate = sparseBurnupData.find(d => d.date === this.startDate);
const hasDataForStartDate = sparseBurnupData.find((d) => d.date === this.startDate);
if (!hasDataForStartDate) {
sparseBurnupData.unshift({
date: this.startDate,
......@@ -222,7 +222,7 @@ export default {
// 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
// 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) {
const lastItem = sparseBurnupData[sparseBurnupData.length - 1];
sparseBurnupData.push({
......
......@@ -81,7 +81,7 @@ export default {
methods: {
// transform the object to a chart-friendly array of date + value
transform(key) {
return this.burnupData.map(val => [val.date, val[key]]);
return this.burnupData.map((val) => [val.date, val[key]]);
},
formatTooltipText(params) {
const [total, completed] = params.seriesData;
......
......@@ -36,13 +36,13 @@ export default {
type: String,
required: false,
default: Namespace.Group,
validator: value => Object.values(Namespace).includes(value),
validator: (value) => Object.values(Namespace).includes(value),
},
displayValue: {
type: String,
required: false,
default: Unit.count,
validator: val => Unit[val],
validator: (val) => Unit[val],
},
},
data() {
......
......@@ -43,7 +43,7 @@ export default {
podsInUseCount() {
let podsInUse = 0;
this.environments.forEach(environment => {
this.environments.forEach((environment) => {
if (this.hasInstances(environment.rolloutStatus)) {
podsInUse += environment.rolloutStatus.instances.length;
}
......@@ -66,8 +66,8 @@ export default {
];
},
methods: {
hasInstances: rolloutStatus => rolloutStatus.instances && rolloutStatus.instances.length,
isLoadingRollout: rolloutStatus => rolloutStatus.status === 'loading',
hasInstances: (rolloutStatus) => rolloutStatus.instances && rolloutStatus.instances.length,
isLoadingRollout: (rolloutStatus) => rolloutStatus.status === 'loading',
},
};
</script>
......
......@@ -2,7 +2,7 @@ import Tracking from '~/tracking';
export default {
methods: {
trackUninstallButtonClick: application => {
trackUninstallButtonClick: (application) => {
Tracking.event('k8s_cluster', 'uninstall', {
label: application,
});
......
......@@ -14,7 +14,7 @@ export default {
projectPath: this.projectPath,
};
},
update: data => {
update: (data) => {
return {
list: data?.project?.clusterAgents?.nodes,
folders: data?.project?.repository?.tree?.trees?.nodes,
......@@ -52,7 +52,7 @@ export default {
const configFolders = this.agents?.folders;
if (list && configFolders) {
list = list.map(agent => {
list = list.map((agent) => {
const configFolder = configFolders.find(({ name }) => name === agent.name);
return { ...agent, configFolder };
});
......
......@@ -23,7 +23,7 @@ export const fetchReport = ({ state, dispatch }) => {
if (!state.blobPath) throw new Error();
dispatch('receiveReportSuccess', data);
})
.catch(error => {
.catch((error) => {
dispatch('receiveReportError', error);
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 start = (page - 1) * 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 () => {
return new Vue({
el,
render: createElement =>
render: (createElement) =>
createElement(ComplianceDashboard, {
props: {
mergeRequests: JSON.parse(mergeRequests),
......
......@@ -19,7 +19,7 @@ export default {
namespace: {
type: String,
required: true,
validator: value =>
validator: (value) =>
Object.values(DEPENDENCY_LIST_TYPES).some(({ namespace }) => value === namespace),
},
},
......
......@@ -14,7 +14,7 @@ export default {
namespace: {
type: String,
required: true,
validator: value =>
validator: (value) =>
Object.values(DEPENDENCY_LIST_TYPES).some(({ namespace }) => value === namespace),
},
},
......
......@@ -10,7 +10,7 @@ export const isIncomplete = ({ currentList }, getters) => getters[`${currentList
export const hasNoDependencies = ({ currentList }, getters) =>
getters[`${currentList}/hasNoDependencies`];
export const totals = state =>
export const totals = (state) =>
state.listTypes.reduce(
(acc, { namespace }) => ({
...acc,
......
......@@ -41,14 +41,14 @@ export const fetchDependencies = ({ state, dispatch }, params = {}) => {
...params,
},
})
.then(response => {
.then((response) => {
if (isValidResponse(response)) {
dispatch('receiveDependenciesSuccess', response);
} else {
throw new Error(__('Invalid server response'));
}
})
.catch(error => {
.catch((error) => {
dispatch('receiveDependenciesError', error);
createFlash(FETCH_ERROR_MESSAGE);
});
......
......@@ -3,7 +3,7 @@ import { mapActions } from 'vuex';
export default {
computed: {
diffFileDiscussions() {
return this.allDiscussions.filter(d => !d.isDraft);
return this.allDiscussions.filter((d) => !d.isDraft);
},
},
methods: {
......
......@@ -10,7 +10,7 @@ const CustomNumber = {
const isValidNumber = !Number.isNaN(parsedValue) && value !== '';
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.currentIndex = 0;
......
......@@ -14,7 +14,7 @@ export default class EETrialBanner {
init() {
// Wait for navbars to render before querying
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 {
toggleDeployBoard(environmentID) {
const environments = this.state.environments.slice();
this.state.environments = environments.map(env => {
this.state.environments = environments.map((env) => {
let updated = { ...env };
if (env.id === environmentID) {
......
......@@ -46,7 +46,7 @@ export default {
},
computed: {
labelIds() {
return this.labels.map(label => label.id);
return this.labels.map((label) => label.id);
},
},
i18n: {
......@@ -102,7 +102,7 @@ export default {
const ids = [];
const allLabels = [...labels, ...this.labels];
this.labels = allLabels.filter(label => {
this.labels = allLabels.filter((label) => {
const exists = ids.includes(label.id);
ids.push(label.id);
......
......@@ -84,7 +84,7 @@ export default {
if (label.isAny) {
this.epicContext.labels = [];
} 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) {
this.epicContext.labels.push(
......@@ -109,9 +109,9 @@ export default {
// either selected or removed aren't leading to same selection
// as current one, as then we don't want to make network call
// since nothing has changed.
const anyLabelUpdated = labels.some(label => {
const anyLabelUpdated = labels.some((label) => {
// 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;
// 1. A label that's not currently applied is being applied.
......
......@@ -34,7 +34,7 @@ export default (epicCreate = false) => {
methods: {
...mapActions(['setEpicMeta']),
},
render: createElement =>
render: (createElement) =>
createElement('epic-create-app', {
props: {
alignRight: el.dataset.alignRight,
......@@ -66,6 +66,6 @@ export default (epicCreate = false) => {
methods: {
...mapActions(['setEpicMeta', 'setEpicData']),
},
render: createElement => createElement('epic-app'),
render: (createElement) => createElement('epic-app'),
});
};
......@@ -29,7 +29,7 @@ export default class EpicTabs {
*/
loadRoadmapBundle() {
import('ee/roadmap/roadmap_bundle')
.then(roadmapBundle => {
.then((roadmapBundle) => {
this.initRoadmap = roadmapBundle.default;
})
.catch(() => {});
......
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