Commit 0e6e345f authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 19 of 73

Part of our prettier migration; changing the arrow-parens style.
parent dc6c2412
......@@ -517,39 +517,6 @@ app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_utility.js
app/assets/javascripts/lib/utils/type_utility.js
## zen-robinson
app/assets/javascripts/lib/utils/unit_format/formatter_factory.js
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/line_highlighter.js
app/assets/javascripts/locale/ensure_single_line.js
app/assets/javascripts/locale/index.js
app/assets/javascripts/locale/sprintf.js
app/assets/javascripts/logs/components/log_advanced_filters.vue
app/assets/javascripts/logs/logs_tracking_helper.js
app/assets/javascripts/logs/stores/actions.js
app/assets/javascripts/logs/stores/getters.js
app/assets/javascripts/logs/utils.js
app/assets/javascripts/main.js
app/assets/javascripts/manual_ordering.js
app/assets/javascripts/member_expiration_date.js
app/assets/javascripts/members.js
app/assets/javascripts/members/components/avatars/user_avatar.vue
app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue
app/assets/javascripts/members/components/filter_sort/sort_dropdown.vue
app/assets/javascripts/members/store/index.js
app/assets/javascripts/members/utils.js
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js
app/assets/javascripts/merge_conflicts/components/inline_conflict_lines.js
app/assets/javascripts/merge_conflicts/components/parallel_conflict_lines.js
app/assets/javascripts/merge_conflicts/merge_conflict_store.js
app/assets/javascripts/merge_request.js
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/milestone.js
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestones/components/milestone_combobox.vue
app/assets/javascripts/milestones/stores/actions.js
app/assets/javascripts/milestones/stores/mutations.js
## inspiring-lovelace
app/assets/javascripts/mini_pipeline_graph_dropdown.js
app/assets/javascripts/mirrors/mirror_repos.js
......
......@@ -106,7 +106,7 @@ export const scaledSIFormatter = (unit = '', prefixOffset = 0) => {
const multiplicative = ['k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
const symbols = [...fractional, '', ...multiplicative];
const units = symbols.slice(fractional.length + prefixOffset).map(prefix => {
const units = symbols.slice(fractional.length + prefixOffset).map((prefix) => {
return `${prefix}${unit}`;
});
......@@ -126,7 +126,7 @@ export const scaledBinaryFormatter = (unit = '', prefixOffset = 0) => {
const multiplicative = ['Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'];
const symbols = ['', ...multiplicative];
const units = symbols.slice(prefixOffset).map(prefix => {
const units = symbols.slice(prefixOffset).map((prefix) => {
return `${prefix}${unit}`;
});
......
......@@ -112,13 +112,13 @@ export function mergeUrlParams(params, url, options = {}) {
const mergedKeys = sort ? Object.keys(merged).sort() : Object.keys(merged);
const newQuery = mergedKeys
.filter(key => merged[key] !== null)
.map(key => {
.filter((key) => merged[key] !== null)
.map((key) => {
let value = merged[key];
const encodedKey = encodeURIComponent(key);
if (spreadArrays && Array.isArray(value)) {
value = merged[key]
.map(arrayValue => encodeURIComponent(arrayValue))
.map((arrayValue) => encodeURIComponent(arrayValue))
.join(`&${encodedKey}[]=`);
return `${encodedKey}[]=${value}`;
}
......@@ -150,11 +150,11 @@ export function removeParams(params, url = window.location.href, skipEncoding =
return url;
}
const removableParams = skipEncoding ? params : params.map(param => encodeURIComponent(param));
const removableParams = skipEncoding ? params : params.map((param) => encodeURIComponent(param));
const updatedQuery = query
.split('&')
.filter(paramPair => {
.filter((paramPair) => {
const [foundParam] = paramPair.split('=');
return removableParams.indexOf(foundParam) < 0;
})
......@@ -237,7 +237,7 @@ export function redirectTo(url) {
return window.location.assign(url);
}
export const escapeFileUrl = fileUrl => encodeURIComponent(fileUrl).replace(/%2F/g, '/');
export const escapeFileUrl = (fileUrl) => encodeURIComponent(fileUrl).replace(/%2F/g, '/');
export function webIDEUrl(route = undefined) {
let returnUrl = `${gon.relative_url_root || ''}/-/ide/`;
......@@ -396,7 +396,7 @@ export function queryToObject(query, options = {}) {
*/
export function objectToQuery(obj) {
return Object.keys(obj)
.map(k => `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`)
.map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`)
.join('&');
}
......@@ -420,7 +420,7 @@ export const setUrlParams = (
const queryString = urlObj.search;
const searchParams = clearParams ? new URLSearchParams('') : new URLSearchParams(queryString);
Object.keys(params).forEach(key => {
Object.keys(params).forEach((key) => {
if (params[key] === null || params[key] === undefined) {
searchParams.delete(key);
} else if (Array.isArray(params[key])) {
......
......@@ -55,7 +55,7 @@ LineHighlighter.prototype.bindEvents = function () {
$fileHolder.on('click', 'a[data-line-number]', this.clickHandler);
$fileHolder.on('highlight:line', this.highlightHash);
window.addEventListener('hashchange', e => this.highlightHash(e.target.location.hash));
window.addEventListener('hashchange', (e) => this.highlightHash(e.target.location.hash));
};
LineHighlighter.prototype.highlightHash = function (newHash) {
......
......@@ -18,7 +18,7 @@ module.exports = function ensureSingleLine(str) {
if (str.includes('\n') || str.includes('\r')) {
return str
.split(SPLIT_REGEX)
.filter(s => s !== '')
.filter((s) => s !== '')
.join(' ');
}
return str;
......
......@@ -11,7 +11,7 @@ delete window.translations;
@param text The text to be translated
@returns {String} The translated text
*/
const gettext = text => locale.gettext(ensureSingleLine(text));
const gettext = (text) => locale.gettext(ensureSingleLine(text));
/**
Translate the text with a number
......@@ -56,7 +56,7 @@ const pgettext = (keyOrContext, key) => {
@param formatOptions for available options, please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
@returns {Intl.DateTimeFormat}
*/
const createDateTimeFormat = formatOptions => Intl.DateTimeFormat(languageCode(), formatOptions);
const createDateTimeFormat = (formatOptions) => Intl.DateTimeFormat(languageCode(), formatOptions);
export { languageCode };
export { gettext as __ };
......
......@@ -15,7 +15,7 @@ export default (input, parameters, escapeParameters = true) => {
let output = input;
if (parameters) {
Object.keys(parameters).forEach(parameterName => {
Object.keys(parameters).forEach((parameterName) => {
const parameterValue = parameters[parameterName];
const escapedParameterValue = escapeParameters ? escape(parameterValue) : parameterValue;
output = output.replace(new RegExp(`%{${parameterName}}`, 'g'), escapedParameterValue);
......
......@@ -42,7 +42,7 @@ export default {
*/
podOptions() {
if (this.pods.options.length) {
return this.pods.options.map(podName => ({ value: podName, title: podName }));
return this.pods.options.map((podName) => ({ value: podName, title: podName }));
}
return null;
},
......
......@@ -8,7 +8,7 @@ import Tracking from '~/tracking';
* 3. Change the time range
* 4. Use the search bar
*/
const trackLogs = label =>
const trackLogs = (label) =>
Tracking.event(document.body.dataset.page, 'logs_view', {
label,
property: 'count',
......
......@@ -11,14 +11,14 @@ const requestUntilData = (url, params) =>
backOff((next, stop) => {
axios
.get(url, { params })
.then(res => {
.then((res) => {
if (res.status === httpStatusCodes.ACCEPTED) {
next();
return;
}
stop(res);
})
.catch(err => {
.catch((err) => {
stop(err);
});
});
......@@ -66,12 +66,12 @@ const requestLogsUntilData = ({ commit, state }) => {
const filtersToParams = (filters = []) => {
// Strings become part of the `search`
const search = filters
.filter(f => typeof f === 'string')
.filter((f) => typeof f === 'string')
.join(' ')
.trim();
// null podName to show all pods
const podName = filters.find(f => f?.type === TOKEN_TYPE_POD_NAME)?.value?.data ?? null;
const podName = filters.find((f) => f?.type === TOKEN_TYPE_POD_NAME)?.value?.data ?? null;
return { search, podName };
};
......
......@@ -3,9 +3,9 @@ import { formatDate } from '../utils';
const mapTrace = ({ timestamp = null, pod = '', message = '' }) =>
[timestamp ? formatDate(timestamp) : '', pod, message].join(' | ');
export const trace = state => state.logs.lines.map(mapTrace).join('\n');
export const trace = (state) => state.logs.lines.map(mapTrace).join('\n');
export const showAdvancedFilters = state => {
export const showAdvancedFilters = (state) => {
if (state.environments.current) {
const environment = state.environments.options.find(
({ name }) => name === state.environments.current,
......
......@@ -22,4 +22,4 @@ export const getTimeRange = (seconds = 0) => {
};
};
export const formatDate = timestamp => dateFormat(timestamp, dateFormatMask);
export const formatDate = (timestamp) => dateFormat(timestamp, dateFormatMask);
......@@ -298,7 +298,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (flashContainer && flashContainer.children.length) {
flashContainer
.querySelectorAll('.flash-alert, .flash-notice, .flash-success')
.forEach(flashEl => {
.forEach((flashEl) => {
removeFlashClickListener(flashEl);
});
}
......
......@@ -39,7 +39,7 @@ const initManualOrdering = (draggableSelector = 'li.issue') => {
onStart: () => {
sortableStart();
},
onUpdate: event => {
onUpdate: (event) => {
const el = event.item;
const url = el.getAttribute('url') || el.dataset.url;
......
......@@ -24,8 +24,8 @@ export default function memberExpirationDate(selector = '.js-access-expiration-d
format: 'yyyy-mm-dd',
minDate: new Date(),
container: $input.parent().get(0),
parse: dateString => parsePikadayDate(dateString),
toString: date => pikadayToString(date),
parse: (dateString) => parsePikadayDate(dateString),
toString: (date) => pikadayToString(date),
onSelect(dateText) {
$input.val(calendar.toString(dateText));
......
......@@ -46,7 +46,7 @@ export default class Members {
return $el.data('id');
},
toggleLabel: (selected, $el) => this.dropdownToggleLabel(selected, $el, $btn),
clicked: options => this.dropdownClicked(options),
clicked: (options) => this.dropdownClicked(options),
});
});
}
......
......@@ -38,7 +38,7 @@ export default {
return this.member.user;
},
badges() {
return generateBadges(this.member, this.isCurrentUser).filter(badge => badge.show);
return generateBadges(this.member, this.isCurrentUser).filter((badge) => badge.show);
},
statusEmoji() {
return this.user?.status?.emoji;
......
......@@ -45,7 +45,7 @@ export default {
computed: {
...mapState(['sourceId', 'filteredSearchBar', 'canManageMembers']),
tokens() {
return this.$options.availableTokens.filter(token => {
return this.$options.availableTokens.filter((token) => {
if (
Object.prototype.hasOwnProperty.call(token, 'requiredPermissions') &&
!this[token.requiredPermissions]
......@@ -61,8 +61,8 @@ export default {
const query = queryToObject(window.location.search);
const tokens = this.tokens
.filter(token => query[token.type])
.map(token => ({
.filter((token) => query[token.type])
.map((token) => ({
type: token.type,
value: {
data: query[token.type],
......
......@@ -14,7 +14,7 @@ export default {
return parseSortParam(this.tableSortableFields);
},
activeOption() {
return FIELDS.find(field => field.key === this.sort.sortByKey);
return FIELDS.find((field) => field.key === this.sort.sortByKey);
},
activeOptionLabel() {
return this.activeOption?.label;
......@@ -23,18 +23,18 @@ export default {
return !this.sort.sortDesc;
},
filteredOptions() {
return FIELDS.filter(field => this.tableSortableFields.includes(field.key) && field.sort).map(
field => ({
key: field.key,
label: field.label,
href: buildSortHref({
sortBy: field.key,
sortDesc: false,
filteredSearchBarTokens: this.filteredSearchBar.tokens,
filteredSearchBarSearchParam: this.filteredSearchBar.searchParam,
}),
return FIELDS.filter(
(field) => this.tableSortableFields.includes(field.key) && field.sort,
).map((field) => ({
key: field.key,
label: field.label,
href: buildSortHref({
sortBy: field.key,
sortDesc: false,
filteredSearchBarTokens: this.filteredSearchBar.tokens,
filteredSearchBarSearchParam: this.filteredSearchBar.searchParam,
}),
);
}));
},
},
methods: {
......
......@@ -2,7 +2,7 @@ import createState from 'ee_else_ce/members/store/state';
import mutations from 'ee_else_ce/members/store/mutations';
import * as actions from 'ee_else_ce/members/store/actions';
export default initialState => ({
export default (initialState) => ({
state: createState(initialState),
actions,
mutations,
......
......@@ -21,7 +21,7 @@ export const generateBadges = (member, isCurrentUser) => [
},
];
export const isGroup = member => {
export const isGroup = (member) => {
return Boolean(member.sharedWithGroup);
};
......@@ -37,7 +37,7 @@ export const canRemove = (member, sourceId) => {
return isDirectMember(member, sourceId) && member.canRemove;
};
export const canResend = member => {
export const canResend = (member) => {
return Boolean(member.invite?.canResend);
};
......@@ -47,11 +47,11 @@ export const canUpdate = (member, currentUserId, sourceId) => {
);
};
export const parseSortParam = sortableFields => {
export const parseSortParam = (sortableFields) => {
const sortParam = getParameterByName('sort');
const sortedField = FIELDS.filter(field => sortableFields.includes(field.key)).find(
field => field.sort?.asc === sortParam || field.sort?.desc === sortParam,
const sortedField = FIELDS.filter((field) => sortableFields.includes(field.key)).find(
(field) => field.sort?.asc === sortParam || field.sort?.desc === sortParam,
);
if (!sortedField) {
......@@ -70,7 +70,7 @@ export const buildSortHref = ({
filteredSearchBarTokens,
filteredSearchBarSearchParam,
}) => {
const sortDefinition = FIELDS.find(field => field.key === sortBy)?.sort;
const sortDefinition = FIELDS.find((field) => field.key === sortBy)?.sort;
if (!sortDefinition) {
return '';
......
......@@ -6,7 +6,7 @@ import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as flash } from '~/flash';
import { __ } from '~/locale';
(global => {
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
global.mergeConflicts.diffFileEditor = Vue.extend({
......
......@@ -4,7 +4,7 @@ import Vue from 'vue';
import actionsMixin from '../mixins/line_conflict_actions';
import utilsMixin from '../mixins/line_conflict_utils';
(global => {
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
global.mergeConflicts.inlineConflictLines = Vue.extend({
......
......@@ -4,7 +4,7 @@ import Vue from 'vue';
import actionsMixin from '../mixins/line_conflict_actions';
import utilsMixin from '../mixins/line_conflict_utils';
(global => {
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
global.mergeConflicts.parallelConflictLines = Vue.extend({
......
......@@ -5,7 +5,7 @@ import Vue from 'vue';
import Cookies from 'js-cookie';
import { s__ } from '~/locale';
(global => {
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
const diffViewType = Cookies.get('diff_view');
......@@ -48,7 +48,7 @@ import { s__ } from '~/locale';
},
decorateFiles(files) {
files.forEach(file => {
files.forEach((file) => {
file.content = '';
file.resolutionData = {};
file.promptDiscardConfirmation = false;
......@@ -72,7 +72,7 @@ import { s__ } from '~/locale';
setInlineLine(file) {
file.inlineLines = [];
file.sections.forEach(section => {
file.sections.forEach((section) => {
let currentLineType = 'new';
const { conflict, lines, id } = section;
......@@ -80,7 +80,7 @@ import { s__ } from '~/locale';
file.inlineLines.push(this.getHeadHeaderLine(id));
}
lines.forEach(line => {
lines.forEach((line) => {
const { type } = line;
if ((type === 'new' || type === 'old') && currentLineType !== type) {
......@@ -102,7 +102,7 @@ import { s__ } from '~/locale';
file.parallelLines = [];
const linesObj = { left: [], right: [] };
file.sections.forEach(section => {
file.sections.forEach((section) => {
const { conflict, lines, id } = section;
if (conflict) {
......@@ -110,7 +110,7 @@ import { s__ } from '~/locale';
linesObj.right.push(this.getHeadHeaderLine(id));
}
lines.forEach(line => {
lines.forEach((line) => {
const { type } = line;
if (conflict) {
......@@ -156,9 +156,9 @@ import { s__ } from '~/locale';
const { files } = this.state.conflictsData;
let count = 0;
files.forEach(file => {
files.forEach((file) => {
if (file.type === CONFLICT_TYPES.TEXT) {
file.sections.forEach(section => {
file.sections.forEach((section) => {
if (section.conflict) {
count += 1;
}
......@@ -287,14 +287,14 @@ import { s__ } from '~/locale';
},
restoreFileLinesState(file) {
file.inlineLines.forEach(line => {
file.inlineLines.forEach((line) => {
if (line.hasConflict || line.isHeader) {
line.isSelected = false;
line.isUnselected = false;
}
});
file.parallelLines.forEach(lines => {
file.parallelLines.forEach((lines) => {
const left = lines[0];
const right = lines[1];
const isLeftMatch = left.hasConflict || left.isHeader;
......@@ -362,7 +362,7 @@ import { s__ } from '~/locale';
files: [],
};
this.state.conflictsData.files.forEach(file => {
this.state.conflictsData.files.forEach((file) => {
const addFile = {
old_path: file.old_path,
new_path: file.new_path,
......@@ -388,13 +388,13 @@ import { s__ } from '~/locale';
handleSelected(file, sectionId, selection) {
Vue.set(file.resolutionData, sectionId, selection);
file.inlineLines.forEach(line => {
file.inlineLines.forEach((line) => {
if (line.id === sectionId && (line.hasConflict || line.isHeader)) {
this.markLine(line, selection);
}
});
file.parallelLines.forEach(lines => {
file.parallelLines.forEach((lines) => {
const left = lines[0];
const right = lines[1];
const hasSameId = right.id === sectionId || left.id === sectionId;
......@@ -426,7 +426,7 @@ import { s__ } from '~/locale';
},
fileTextTypePresent() {
return this.state.conflictsData.files.some(f => f.type === CONFLICT_TYPES.TEXT);
return this.state.conflictsData.files.some((f) => f.type === CONFLICT_TYPES.TEXT);
},
};
})(window.gl || (window.gl = {}));
......@@ -31,7 +31,7 @@ function MergeRequest(opts) {
fieldName: 'description',
selector: '.detail-page-description',
lockVersion: this.$el.data('lockVersion'),
onSuccess: result => {
onSuccess: (result) => {
document.querySelector('#task_status').innerText = result.task_status;
document.querySelector('#task_status_short').innerText = result.task_status_short;
},
......@@ -69,8 +69,8 @@ MergeRequest.prototype.initMRBtnListeners = function () {
const draftToggles = document.querySelectorAll('.js-draft-toggle-button');
if (draftToggles.length) {
draftToggles.forEach(draftToggle => {
draftToggle.addEventListener('click', e => {
draftToggles.forEach((draftToggle) => {
draftToggle.addEventListener('click', (e) => {
e.preventDefault();
e.stopImmediatePropagation();
......@@ -127,7 +127,7 @@ MergeRequest.prototype.submitNoteForm = function (form, $button) {
};
MergeRequest.prototype.initCommitMessageListeners = function () {
$(document).on('click', 'a.js-with-description-link', e => {
$(document).on('click', 'a.js-with-description-link', (e) => {
const textarea = $('textarea.js-commit-message');
e.preventDefault();
......@@ -136,7 +136,7 @@ MergeRequest.prototype.initCommitMessageListeners = function () {
$('.js-without-description-hint').show();
});
$(document).on('click', 'a.js-without-description-link', e => {
$(document).on('click', 'a.js-without-description-link', (e) => {
const textarea = $('textarea.js-commit-message');
e.preventDefault();
......@@ -180,7 +180,7 @@ MergeRequest.toggleDraftStatus = function (title, isReady) {
const draftToggles = document.querySelectorAll('.js-draft-toggle-button');
if (draftToggles.length) {
draftToggles.forEach(el => {
draftToggles.forEach((el) => {
const draftToggle = el;
const url = setUrlParams(
{ 'merge_request[wip_event]': isReady ? 'wip' : 'unwip' },
......
......@@ -128,7 +128,7 @@ export default class MergeRequestTabs {
bindEvents() {
$('.merge-request-tabs a[data-toggle="tabvue"]').on('click', this.clickTab);
window.addEventListener('popstate', event => {
window.addEventListener('popstate', (event) => {
if (event.state && event.state.action) {
this.tabShown(event.state.action, event.target.location);
this.currentAction = event.state.action;
......@@ -177,14 +177,14 @@ export default class MergeRequestTabs {
this.currentTab = action;
if (this.mergeRequestTabPanesAll) {
this.mergeRequestTabPanesAll.forEach(el => {
this.mergeRequestTabPanesAll.forEach((el) => {
const tabPane = el;
tabPane.style.display = 'none';
});
}
if (this.mergeRequestTabsAll) {
this.mergeRequestTabsAll.forEach(el => {
this.mergeRequestTabsAll.forEach((el) => {
el.classList.remove('active');
});
}
......
......@@ -11,7 +11,7 @@ export default class Milestone {
}
bindTabsSwitching() {
return $('a[data-toggle="tab"]').on('show.bs.tab', e => {
return $('a[data-toggle="tab"]').on('show.bs.tab', (e) => {
const $target = $(e.target);
window.location.hash = $target.attr('href');
......
......@@ -89,7 +89,7 @@ export default class MilestoneSelect {
return getMilestones(contextId, reqParams)
.then(({ data }) =>
data
.map(m => ({
.map((m) => ({
...m,
// Public API includes `title` instead of `name`.
name: m.title,
......@@ -105,7 +105,7 @@ export default class MilestoneSelect {
return 0;
}),
)
.then(data => {
.then((data) => {
const extraOptions = [];
if (showAny) {
extraOptions.push({
......@@ -146,7 +146,7 @@ export default class MilestoneSelect {
$(`[data-milestone-id="${selectedMilestone}"] > a`).addClass('is-active');
});
},
renderRow: milestone => {
renderRow: (milestone) => {
const milestoneName = milestone.title || milestone.name;
let milestoneDisplayName = escape(milestoneName);
......@@ -178,8 +178,8 @@ export default class MilestoneSelect {
},
defaultLabel,
fieldName: $dropdown.data('fieldName'),
text: milestone => escape(milestone.title),
id: milestone => {
text: (milestone) => escape(milestone.title),
id: (milestone) => {
if (milestone !== undefined) {
if (!useId && !$dropdown.is('.js-issuable-form-dropdown')) {
return milestone.name;
......@@ -193,7 +193,7 @@ export default class MilestoneSelect {
// display:block overrides the hide-collapse rule
return $value.css('display', '');
},
opened: e => {
opened: (e) => {
const $el = $(e.currentTarget);
if ($dropdown.hasClass('js-issue-board-sidebar') || options.handleClick) {
selectedMilestone = $dropdown[0].dataset.selected || selectedMilestoneDefault;
......@@ -202,7 +202,7 @@ export default class MilestoneSelect {
$(`[data-milestone-id="${selectedMilestone}"] > a`, $el).addClass('is-active');
},
vue: $dropdown.hasClass('js-issue-board-sidebar'),
clicked: clickEvent => {
clicked: (clickEvent) => {
const { e } = clickEvent;
let selected = clickEvent.selectedObj;
......
......@@ -112,7 +112,7 @@ export default {
value: {
immediate: true,
handler() {
const milestoneTitles = this.value.map(milestone =>
const milestoneTitles = this.value.map((milestone) =>
milestone.title ? milestone.title : milestone,
);
if (!isEqual(milestoneTitles, this.selectedMilestones)) {
......
......@@ -41,10 +41,10 @@ export const fetchProjectMilestones = ({ commit, state }) => {
commit(types.REQUEST_START);
Api.projectMilestones(state.projectId)
.then(response => {
.then((response) => {
commit(types.RECEIVE_PROJECT_MILESTONES_SUCCESS, response);
})
.catch(error => {
.catch((error) => {
commit(types.RECEIVE_PROJECT_MILESTONES_ERROR, error);
})
.finally(() => {
......@@ -56,10 +56,10 @@ export const fetchGroupMilestones = ({ commit, state }) => {
commit(types.REQUEST_START);
Api.groupMilestones(state.groupId)
.then(response => {
.then((response) => {
commit(types.RECEIVE_GROUP_MILESTONES_SUCCESS, response);
})
.catch(error => {
.catch((error) => {
commit(types.RECEIVE_GROUP_MILESTONES_ERROR, error);
})
.finally(() => {
......@@ -76,10 +76,10 @@ export const searchProjectMilestones = ({ commit, state }) => {
commit(types.REQUEST_START);
Api.projectSearch(state.projectId, options)
.then(response => {
.then((response) => {
commit(types.RECEIVE_PROJECT_MILESTONES_SUCCESS, response);
})
.catch(error => {
.catch((error) => {
commit(types.RECEIVE_PROJECT_MILESTONES_ERROR, error);
})
.finally(() => {
......@@ -95,10 +95,10 @@ export const searchGroupMilestones = ({ commit, state }) => {
commit(types.REQUEST_START);
Api.groupMilestones(state.groupId, options)
.then(response => {
.then((response) => {
commit(types.RECEIVE_GROUP_MILESTONES_SUCCESS, response);
})
.catch(error => {
.catch((error) => {
commit(types.RECEIVE_GROUP_MILESTONES_ERROR, error);
})
.finally(() => {
......
......@@ -22,7 +22,7 @@ export default {
},
[types.REMOVE_SELECTED_MILESTONE](state, selectedMilestone) {
const filteredMilestones = state.selectedMilestones.filter(
milestone => milestone !== selectedMilestone,
(milestone) => milestone !== selectedMilestone,
);
Vue.set(state, 'selectedMilestones', filteredMilestones);
},
......
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