Commit 2f8dbd48 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 17 of 73

Part of our prettier migration; changing the arrow-parens style.
parent e7d50054
...@@ -7,7 +7,7 @@ export default () => { ...@@ -7,7 +7,7 @@ export default () => {
const renderCommentBadge = true; const renderCommentBadge = true;
const diffFileEls = document.querySelectorAll('.timeline-content .diff-file.js-image-file'); const diffFileEls = document.querySelectorAll('.timeline-content .diff-file.js-image-file');
[...diffFileEls].forEach(diffFileEl => [...diffFileEls].forEach((diffFileEl) =>
initImageDiffHelper.initImageDiff(diffFileEl, canCreateNote, renderCommentBadge), initImageDiffHelper.initImageDiff(diffFileEl, canCreateNote, renderCommentBadge),
); );
}; };
...@@ -26,7 +26,7 @@ export default class ReplacedImageDiff extends ImageDiff { ...@@ -26,7 +26,7 @@ export default class ReplacedImageDiff extends ImageDiff {
this.imageEls = {}; this.imageEls = {};
const viewTypeNames = Object.getOwnPropertyNames(viewTypes); const viewTypeNames = Object.getOwnPropertyNames(viewTypes);
viewTypeNames.forEach(viewType => { viewTypeNames.forEach((viewType) => {
this.imageEls[viewType] = this.imageFrameEls[viewType].querySelector('img'); this.imageEls[viewType] = this.imageFrameEls[viewType].querySelector('img');
}); });
} }
...@@ -62,7 +62,7 @@ export default class ReplacedImageDiff extends ImageDiff { ...@@ -62,7 +62,7 @@ export default class ReplacedImageDiff extends ImageDiff {
// Clear existing badges on new view // Clear existing badges on new view
const existingBadges = this.imageFrameEl.querySelectorAll('.badge'); const existingBadges = this.imageFrameEl.querySelectorAll('.badge');
[...existingBadges].map(badge => badge.remove()); [...existingBadges].map((badge) => badge.remove());
// Remove existing references to old view image badges // Remove existing references to old view image badges
this.imageBadges = []; this.imageBadges = [];
......
...@@ -5,5 +5,5 @@ export const viewTypes = { ...@@ -5,5 +5,5 @@ export const viewTypes = {
}; };
export function isValidViewType(validate) { export function isValidViewType(validate) {
return Boolean(Object.getOwnPropertyNames(viewTypes).find(viewType => viewType === validate)); return Boolean(Object.getOwnPropertyNames(viewTypes).find((viewType) => viewType === validate));
} }
...@@ -7,7 +7,7 @@ import setNewNameMutation from '../graphql/mutations/set_new_name.mutation.graph ...@@ -7,7 +7,7 @@ import setNewNameMutation from '../graphql/mutations/set_new_name.mutation.graph
import importGroupMutation from '../graphql/mutations/import_group.mutation.graphql'; import importGroupMutation from '../graphql/mutations/import_group.mutation.graphql';
import ImportTableRow from './import_table_row.vue'; import ImportTableRow from './import_table_row.vue';
const mapApolloMutations = mutations => const mapApolloMutations = (mutations) =>
Object.fromEntries( Object.fromEntries(
Object.entries(mutations).map(([key, mutation]) => [ Object.entries(mutations).map(([key, mutation]) => [
key, key,
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
select2Options() { select2Options() {
return { return {
data: this.availableNamespaces.map(namespace => ({ data: this.availableNamespaces.map((namespace) => ({
id: namespace.full_path, id: namespace.full_path,
text: namespace.full_path, text: namespace.full_path,
})), })),
......
...@@ -23,7 +23,7 @@ export function createResolvers({ endpoints }) { ...@@ -23,7 +23,7 @@ export function createResolvers({ endpoints }) {
} = await client.query({ query: availableNamespacesQuery }); } = await client.query({ query: availableNamespacesQuery });
return axios.get(endpoints.status).then(({ data }) => { return axios.get(endpoints.status).then(({ data }) => {
return data.importable_data.map(group => ({ return data.importable_data.map((group) => ({
__typename: clientTypenames.BulkImportSourceGroup, __typename: clientTypenames.BulkImportSourceGroup,
...group, ...group,
status: STATUSES.NONE, status: STATUSES.NONE,
...@@ -37,7 +37,7 @@ export function createResolvers({ endpoints }) { ...@@ -37,7 +37,7 @@ export function createResolvers({ endpoints }) {
availableNamespaces: () => availableNamespaces: () =>
axios.get(endpoints.availableNamespaces).then(({ data }) => axios.get(endpoints.availableNamespaces).then(({ data }) =>
data.map(namespace => ({ data.map((namespace) => ({
__typename: clientTypenames.AvailableNamespace, __typename: clientTypenames.AvailableNamespace,
...namespace, ...namespace,
})), })),
...@@ -45,14 +45,14 @@ export function createResolvers({ endpoints }) { ...@@ -45,14 +45,14 @@ export function createResolvers({ endpoints }) {
}, },
Mutation: { Mutation: {
setTargetNamespace(_, { targetNamespace, sourceGroupId }, { client }) { setTargetNamespace(_, { targetNamespace, sourceGroupId }, { client }) {
new SourceGroupsManager({ client }).updateById(sourceGroupId, sourceGroup => { new SourceGroupsManager({ client }).updateById(sourceGroupId, (sourceGroup) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
sourceGroup.import_target.target_namespace = targetNamespace; sourceGroup.import_target.target_namespace = targetNamespace;
}); });
}, },
setNewName(_, { newName, sourceGroupId }, { client }) { setNewName(_, { newName, sourceGroupId }, { client }) {
new SourceGroupsManager({ client }).updateById(sourceGroupId, sourceGroup => { new SourceGroupsManager({ client }).updateById(sourceGroupId, (sourceGroup) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
sourceGroup.import_target.new_name = newName; sourceGroup.import_target.new_name = newName;
}); });
......
...@@ -37,7 +37,7 @@ export class SourceGroupsManager { ...@@ -37,7 +37,7 @@ export class SourceGroupsManager {
} }
setImportStatus(group, status) { setImportStatus(group, status) {
this.update(group, sourceGroup => { this.update(group, (sourceGroup) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
sourceGroup.status = status; sourceGroup.status = status;
}); });
......
...@@ -5,7 +5,7 @@ import bulkImportSourceGroupsQuery from '../queries/bulk_import_source_groups.qu ...@@ -5,7 +5,7 @@ import bulkImportSourceGroupsQuery from '../queries/bulk_import_source_groups.qu
import { STATUSES } from '../../../constants'; import { STATUSES } from '../../../constants';
import { SourceGroupsManager } from './source_groups_manager'; import { SourceGroupsManager } from './source_groups_manager';
const groupId = i => `group${i}`; const groupId = (i) => `group${i}`;
function generateGroupsQuery(groups) { function generateGroupsQuery(groups) {
return gql`{ return gql`{
...@@ -46,14 +46,14 @@ export class StatusPoller { ...@@ -46,14 +46,14 @@ export class StatusPoller {
const { bulkImportSourceGroups } = this.client.readQuery({ const { bulkImportSourceGroups } = this.client.readQuery({
query: bulkImportSourceGroupsQuery, query: bulkImportSourceGroupsQuery,
}); });
const groupsInProgress = bulkImportSourceGroups.filter(g => g.status === STATUSES.STARTED); const groupsInProgress = bulkImportSourceGroups.filter((g) => g.status === STATUSES.STARTED);
if (groupsInProgress.length) { if (groupsInProgress.length) {
const { data: results } = await this.client.query({ const { data: results } = await this.client.query({
query: generateGroupsQuery(groupsInProgress), query: generateGroupsQuery(groupsInProgress),
fetchPolicy: 'no-cache', fetchPolicy: 'no-cache',
}); });
const completedGroups = groupsInProgress.filter((_, idx) => Boolean(results[groupId(idx)])); const completedGroups = groupsInProgress.filter((_, idx) => Boolean(results[groupId(idx)]));
completedGroups.forEach(group => { completedGroups.forEach((group) => {
this.groupManager.setImportStatus(group, STATUSES.FINISHED); this.groupManager.setImportStatus(group, STATUSES.FINISHED);
}); });
} }
......
...@@ -12,9 +12,9 @@ import { capitalizeFirstCharacter } from '~/lib/utils/text_utility'; ...@@ -12,9 +12,9 @@ import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';
let eTagPoll; let eTagPoll;
const hasRedirectInError = e => e?.response?.data?.error?.redirect; const hasRedirectInError = (e) => e?.response?.data?.error?.redirect;
const redirectToUrlInError = e => visitUrl(e.response.data.error.redirect); const redirectToUrlInError = (e) => visitUrl(e.response.data.error.redirect);
const tooManyRequests = e => e.response.status === httpStatusCodes.TOO_MANY_REQUESTS; const tooManyRequests = (e) => e.response.status === httpStatusCodes.TOO_MANY_REQUESTS;
const pathWithParams = ({ path, ...params }) => { const pathWithParams = ({ path, ...params }) => {
const filteredParams = Object.fromEntries( const filteredParams = Object.fromEntries(
Object.entries(params).filter(([, value]) => value !== ''), Object.entries(params).filter(([, value]) => value !== ''),
...@@ -47,7 +47,7 @@ const importAll = ({ state, dispatch }) => { ...@@ -47,7 +47,7 @@ const importAll = ({ state, dispatch }) => {
return Promise.all( return Promise.all(
state.repositories state.repositories
.filter(isProjectImportable) .filter(isProjectImportable)
.map(r => dispatch('fetchImport', r.importSource.id)), .map((r) => dispatch('fetchImport', r.importSource.id)),
); );
}; };
...@@ -69,7 +69,7 @@ const fetchReposFactory = ({ reposPath = isRequired() }) => ({ state, commit }) ...@@ -69,7 +69,7 @@ const fetchReposFactory = ({ reposPath = isRequired() }) => ({ state, commit })
.then(({ data }) => { .then(({ data }) => {
commit(types.RECEIVE_REPOS_SUCCESS, convertObjectPropsToCamelCase(data, { deep: true })); commit(types.RECEIVE_REPOS_SUCCESS, convertObjectPropsToCamelCase(data, { deep: true }));
}) })
.catch(e => { .catch((e) => {
commit(types.SET_PAGE, nextPage - 1); commit(types.SET_PAGE, nextPage - 1);
if (hasRedirectInError(e)) { if (hasRedirectInError(e)) {
...@@ -114,7 +114,7 @@ const fetchImportFactory = (importPath = isRequired()) => ({ state, commit, gett ...@@ -114,7 +114,7 @@ const fetchImportFactory = (importPath = isRequired()) => ({ state, commit, gett
repoId, repoId,
}); });
}) })
.catch(e => { .catch((e) => {
const serverErrorMessage = e?.response?.data?.errors; const serverErrorMessage = e?.response?.data?.errors;
const flashMessage = serverErrorMessage const flashMessage = serverErrorMessage
? sprintf( ? sprintf(
...@@ -145,7 +145,7 @@ export const fetchJobsFactory = (jobsPath = isRequired()) => ({ state, commit, d ...@@ -145,7 +145,7 @@ export const fetchJobsFactory = (jobsPath = isRequired()) => ({ state, commit, d
method: 'fetchJobs', method: 'fetchJobs',
successCallback: ({ data }) => successCallback: ({ data }) =>
commit(types.RECEIVE_JOBS_SUCCESS, convertObjectPropsToCamelCase(data, { deep: true })), commit(types.RECEIVE_JOBS_SUCCESS, convertObjectPropsToCamelCase(data, { deep: true })),
errorCallback: e => { errorCallback: (e) => {
if (hasRedirectInError(e)) { if (hasRedirectInError(e)) {
redirectToUrlInError(e); redirectToUrlInError(e);
} else { } else {
......
import { STATUSES } from '../../constants'; import { STATUSES } from '../../constants';
import { isProjectImportable, isIncompatible } from '../utils'; import { isProjectImportable, isIncompatible } from '../utils';
export const isLoading = state => state.isLoadingRepos || state.isLoadingNamespaces; export const isLoading = (state) => state.isLoadingRepos || state.isLoadingNamespaces;
export const isImportingAnyRepo = state => export const isImportingAnyRepo = (state) =>
state.repositories.some(repo => state.repositories.some((repo) =>
[STATUSES.SCHEDULING, STATUSES.SCHEDULED, STATUSES.STARTED].includes( [STATUSES.SCHEDULING, STATUSES.SCHEDULED, STATUSES.STARTED].includes(
repo.importedProject?.importStatus, repo.importedProject?.importStatus,
), ),
); );
export const hasIncompatibleRepos = state => state.repositories.some(isIncompatible); export const hasIncompatibleRepos = (state) => state.repositories.some(isIncompatible);
export const hasImportableRepos = state => state.repositories.some(isProjectImportable); export const hasImportableRepos = (state) => state.repositories.some(isProjectImportable);
export const importAllCount = state => state.repositories.filter(isProjectImportable).length; export const importAllCount = (state) => state.repositories.filter(isProjectImportable).length;
export const getImportTarget = state => repoId => { export const getImportTarget = (state) => (repoId) => {
if (state.customImportTargets[repoId]) { if (state.customImportTargets[repoId]) {
return state.customImportTargets[repoId]; return state.customImportTargets[repoId];
} }
const repo = state.repositories.find(r => r.importSource.id === repoId); const repo = state.repositories.find((r) => r.importSource.id === repoId);
return { return {
newName: repo.importSource.sanitizedName, newName: repo.importSource.sanitizedName,
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { STATUSES } from '../../constants'; import { STATUSES } from '../../constants';
const makeNewImportedProject = importedProject => ({ const makeNewImportedProject = (importedProject) => ({
importSource: { importSource: {
id: importedProject.id, id: importedProject.id,
fullName: importedProject.importSource, fullName: importedProject.importSource,
...@@ -12,15 +12,15 @@ const makeNewImportedProject = importedProject => ({ ...@@ -12,15 +12,15 @@ const makeNewImportedProject = importedProject => ({
importedProject, importedProject,
}); });
const makeNewIncompatibleProject = project => ({ const makeNewIncompatibleProject = (project) => ({
importSource: { ...project, incompatible: true }, importSource: { ...project, incompatible: true },
importedProject: null, importedProject: null,
}); });
const processLegacyEntries = ({ newRepositories, existingRepositories, factory }) => { const processLegacyEntries = ({ newRepositories, existingRepositories, factory }) => {
const newEntries = []; const newEntries = [];
newRepositories.forEach(project => { newRepositories.forEach((project) => {
const existingProject = existingRepositories.find(p => p.importSource.id === project.id); const existingProject = existingRepositories.find((p) => p.importSource.id === project.id);
const importedProjectShape = factory(project); const importedProjectShape = factory(project);
if (existingProject) { if (existingProject) {
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
state.repositories = [ state.repositories = [
...newImportedProjects, ...newImportedProjects,
...state.repositories, ...state.repositories,
...repositories.providerRepos.map(project => ({ ...repositories.providerRepos.map((project) => ({
importSource: project, importSource: project,
importedProject: null, importedProject: null,
})), })),
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
}, },
[types.REQUEST_IMPORT](state, { repoId, importTarget }) { [types.REQUEST_IMPORT](state, { repoId, importTarget }) {
const existingRepo = state.repositories.find(r => r.importSource.id === repoId); const existingRepo = state.repositories.find((r) => r.importSource.id === repoId);
existingRepo.importedProject = { existingRepo.importedProject = {
importStatus: STATUSES.SCHEDULING, importStatus: STATUSES.SCHEDULING,
fullPath: `/${importTarget.targetNamespace}/${importTarget.newName}`, fullPath: `/${importTarget.targetNamespace}/${importTarget.newName}`,
...@@ -99,18 +99,18 @@ export default { ...@@ -99,18 +99,18 @@ export default {
}, },
[types.RECEIVE_IMPORT_SUCCESS](state, { importedProject, repoId }) { [types.RECEIVE_IMPORT_SUCCESS](state, { importedProject, repoId }) {
const existingRepo = state.repositories.find(r => r.importSource.id === repoId); const existingRepo = state.repositories.find((r) => r.importSource.id === repoId);
existingRepo.importedProject = importedProject; existingRepo.importedProject = importedProject;
}, },
[types.RECEIVE_IMPORT_ERROR](state, repoId) { [types.RECEIVE_IMPORT_ERROR](state, repoId) {
const existingRepo = state.repositories.find(r => r.importSource.id === repoId); const existingRepo = state.repositories.find((r) => r.importSource.id === repoId);
existingRepo.importedProject = null; existingRepo.importedProject = null;
}, },
[types.RECEIVE_JOBS_SUCCESS](state, updatedProjects) { [types.RECEIVE_JOBS_SUCCESS](state, updatedProjects) {
updatedProjects.forEach(updatedProject => { updatedProjects.forEach((updatedProject) => {
const repo = state.repositories.find(p => p.importedProject?.id === updatedProject.id); const repo = state.repositories.find((p) => p.importedProject?.id === updatedProject.id);
if (repo?.importedProject) { if (repo?.importedProject) {
repo.importedProject.importStatus = updatedProject.importStatus; repo.importedProject.importStatus = updatedProject.importStatus;
} }
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
}, },
[types.SET_IMPORT_TARGET](state, { repoId, importTarget }) { [types.SET_IMPORT_TARGET](state, { repoId, importTarget }) {
const existingRepo = state.repositories.find(r => r.importSource.id === repoId); const existingRepo = state.repositories.find((r) => r.importSource.id === repoId);
if ( if (
importTarget.targetNamespace === state.defaultTargetNamespace && importTarget.targetNamespace === state.defaultTargetNamespace &&
......
...@@ -2,7 +2,7 @@ import $ from 'jquery'; ...@@ -2,7 +2,7 @@ import $ from 'jquery';
import { stickyMonitor } from './lib/utils/sticky'; import { stickyMonitor } from './lib/utils/sticky';
import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown';
export default stickyTop => { export default (stickyTop) => {
stickyMonitor(document.querySelector('.js-diff-files-changed'), stickyTop); stickyMonitor(document.querySelector('.js-diff-files-changed'), stickyTop);
initDeprecatedJQueryDropdown($('.js-diff-stats-dropdown'), { initDeprecatedJQueryDropdown($('.js-diff-stats-dropdown'), {
......
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
return isEmpty(this.value) && this.required; return isEmpty(this.value) && this.required;
}, },
options() { options() {
return this.choices.map(choice => { return this.choices.map((choice) => {
return { return {
value: choice[1], value: choice[1],
text: choice[0], text: choice[0],
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
data() { data() {
return { return {
selected: dropdownOptions.find(x => x.value === this.override), selected: dropdownOptions.find((x) => x.value === this.override),
}; };
}, },
computed: { computed: {
......
export const isInheriting = state => (state.defaultState === null ? false : !state.override); export const isInheriting = (state) => (state.defaultState === null ? false : !state.override);
export const isDisabled = state => state.isSaving || state.isTesting || state.isResetting; export const isDisabled = (state) => state.isSaving || state.isTesting || state.isResetting;
export const propsSource = (state, getters) => export const propsSource = (state, getters) =>
getters.isInheriting ? state.defaultState : state.customState; getters.isInheriting ? state.defaultState : state.customState;
......
...@@ -23,7 +23,7 @@ export default class IntegrationSettingsForm { ...@@ -23,7 +23,7 @@ export default class IntegrationSettingsForm {
document.querySelector('.js-vue-integration-settings'), document.querySelector('.js-vue-integration-settings'),
document.querySelector('.js-vue-default-integration-settings'), document.querySelector('.js-vue-default-integration-settings'),
); );
eventHub.$on('toggle', active => { eventHub.$on('toggle', (active) => {
this.formActive = active; this.formActive = active;
this.toggleServiceState(); this.toggleServiceState();
}); });
......
...@@ -16,6 +16,6 @@ export default function initInviteMembersModal() { ...@@ -16,6 +16,6 @@ export default function initInviteMembersModal() {
return new Vue({ return new Vue({
el, el,
provide: { membersPath }, provide: { membersPath },
render: createElement => createElement(InviteMemberModal), render: (createElement) => createElement(InviteMemberModal),
}); });
} }
...@@ -11,6 +11,6 @@ export default function initInviteMembersTrigger() { ...@@ -11,6 +11,6 @@ export default function initInviteMembersTrigger() {
return new Vue({ return new Vue({
el, el,
provide: { ...el.dataset }, provide: { ...el.dataset },
render: createElement => createElement(InviteMemberTrigger), render: (createElement) => createElement(InviteMemberTrigger),
}); });
} }
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
}, },
selectedRoleName() { selectedRoleName() {
return Object.keys(this.accessLevels).find( return Object.keys(this.accessLevels).find(
key => this.accessLevels[key] === Number(this.selectedAccessLevel), (key) => this.accessLevels[key] === Number(this.selectedAccessLevel),
); );
}, },
}, },
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
computed: { computed: {
newUsersToInvite() { newUsersToInvite() {
return this.selectedTokens return this.selectedTokens
.map(obj => { .map((obj) => {
return obj.id; return obj.id;
}) })
.join(','); .join(',');
...@@ -55,8 +55,8 @@ export default { ...@@ -55,8 +55,8 @@ export default {
}, },
retrieveUsers: debounce(function debouncedRetrieveUsers() { retrieveUsers: debounce(function debouncedRetrieveUsers() {
return Api.users(this.query, this.$options.queryOptions) return Api.users(this.query, this.$options.queryOptions)
.then(response => { .then((response) => {
this.users = response.data.map(token => ({ this.users = response.data.map((token) => ({
id: token.id, id: token.id,
name: token.name, name: token.name,
username: token.username, username: token.username,
......
...@@ -13,7 +13,7 @@ export default function initInviteMembersModal() { ...@@ -13,7 +13,7 @@ export default function initInviteMembersModal() {
return new Vue({ return new Vue({
el, el,
render: createElement => render: (createElement) =>
createElement(InviteMembersModal, { createElement(InviteMembersModal, {
props: { props: {
...el.dataset, ...el.dataset,
......
...@@ -10,7 +10,7 @@ export default function initInviteMembersTrigger() { ...@@ -10,7 +10,7 @@ export default function initInviteMembersTrigger() {
return new Vue({ return new Vue({
el, el,
render: createElement => render: (createElement) =>
createElement(InviteMembersTrigger, { createElement(InviteMembersTrigger, {
props: { props: {
...el.dataset, ...el.dataset,
......
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
// Collect unique label IDs for all checked issues // Collect unique label IDs for all checked issues
this.getElement('.selected-issuable:checked').each((i, el) => { this.getElement('.selected-issuable:checked').each((i, el) => {
issuableLabels = this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels'); issuableLabels = this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels');
issuableLabels.forEach(labelId => { issuableLabels.forEach((labelId) => {
// Store unique IDs // Store unique IDs
if (uniqueIds.indexOf(labelId) === -1) { if (uniqueIds.indexOf(labelId) === -1) {
uniqueIds.push(labelId); uniqueIds.push(labelId);
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
// Add uniqueIds to add it as argument for _.intersection // Add uniqueIds to add it as argument for _.intersection
labelIds.unshift(uniqueIds); labelIds.unshift(uniqueIds);
// Return IDs that are present but not in all selected issueables // Return IDs that are present but not in all selected issueables
return uniqueIds.filter(x => !intersection.apply(this, labelIds).includes(x)); return uniqueIds.filter((x) => !intersection.apply(this, labelIds).includes(x));
}, },
getElement(selector) { getElement(selector) {
......
...@@ -39,9 +39,9 @@ export default class IssuableBulkUpdateSidebar { ...@@ -39,9 +39,9 @@ export default class IssuableBulkUpdateSidebar {
} }
bindEvents() { bindEvents() {
this.$bulkUpdateEnableBtn.on('click', e => this.toggleBulkEdit(e, true)); this.$bulkUpdateEnableBtn.on('click', (e) => this.toggleBulkEdit(e, true));
this.$bulkEditCancelBtn.on('click', e => this.toggleBulkEdit(e, false)); this.$bulkEditCancelBtn.on('click', (e) => this.toggleBulkEdit(e, false));
this.$checkAllContainer.on('click', e => this.selectAll(e)); this.$checkAllContainer.on('click', (e) => this.selectAll(e));
this.$issuesList.on('change', () => this.updateFormState()); this.$issuesList.on('change', () => this.updateFormState());
this.$bulkEditSubmitBtn.on('click', () => this.prepForSubmit()); this.$bulkEditSubmitBtn.on('click', () => this.prepForSubmit());
this.$checkAllContainer.on('click', () => this.updateFormState()); this.$checkAllContainer.on('click', () => this.updateFormState());
...@@ -159,7 +159,7 @@ export default class IssuableBulkUpdateSidebar { ...@@ -159,7 +159,7 @@ export default class IssuableBulkUpdateSidebar {
const $checkedIssues = $('.selected-issuable:checked'); const $checkedIssues = $('.selected-issuable:checked');
if ($checkedIssues.length > 0) { if ($checkedIssues.length > 0) {
return $.map($checkedIssues, value => $(value).data('id')); return $.map($checkedIssues, (value) => $(value).data('id'));
} }
return []; return [];
......
...@@ -31,7 +31,7 @@ export default class IssuableContext { ...@@ -31,7 +31,7 @@ export default class IssuableContext {
}); });
$(document) $(document)
.off('click', '.issuable-sidebar .dropdown-content a') .off('click', '.issuable-sidebar .dropdown-content a')
.on('click', '.issuable-sidebar .dropdown-content a', e => e.preventDefault()); .on('click', '.issuable-sidebar .dropdown-content a', (e) => e.preventDefault());
$(document) $(document)
.off('click', '.edit-link') .off('click', '.edit-link')
......
...@@ -89,9 +89,9 @@ export default class IssuableForm { ...@@ -89,9 +89,9 @@ export default class IssuableForm {
theme: 'gitlab-theme animate-picker', theme: 'gitlab-theme animate-picker',
format: 'yyyy-mm-dd', format: 'yyyy-mm-dd',
container: $issuableDueDate.parent().get(0), container: $issuableDueDate.parent().get(0),
parse: dateString => parsePikadayDate(dateString), parse: (dateString) => parsePikadayDate(dateString),
toString: date => pikadayToString(date), toString: (date) => pikadayToString(date),
onSelect: dateText => $issuableDueDate.val(calendar.toString(dateText)), onSelect: (dateText) => $issuableDueDate.val(calendar.toString(dateText)),
firstDay: gon.first_day_of_week, firstDay: gon.first_day_of_week,
}); });
calendar.setDate(parsePikadayDate($issuableDueDate.val())); calendar.setDate(parsePikadayDate($issuableDueDate.val()));
...@@ -202,7 +202,7 @@ export default class IssuableForm { ...@@ -202,7 +202,7 @@ export default class IssuableForm {
results(data) { results(data) {
return { return {
// `data` keys are translated so we can't just access them with a string based key // `data` keys are translated so we can't just access them with a string based key
results: data[Object.keys(data)[0]].map(name => ({ results: data[Object.keys(data)[0]].map((name) => ({
id: name, id: name,
text: name, text: name,
})), })),
......
...@@ -13,7 +13,7 @@ export default class IssuableIndex { ...@@ -13,7 +13,7 @@ export default class IssuableIndex {
static resetIncomingEmailToken() { static resetIncomingEmailToken() {
const $resetToken = $('.incoming-email-token-reset'); const $resetToken = $('.incoming-email-token-reset');
$resetToken.on('click', e => { $resetToken.on('click', (e) => {
e.preventDefault(); e.preventDefault();
$resetToken.text(s__('EmailToken|resetting...')); $resetToken.text(s__('EmailToken|resetting...'));
......
...@@ -200,7 +200,7 @@ export default { ...@@ -200,7 +200,7 @@ export default {
this.checkedIssuables[this.issuableId(issuable)].checked = value; this.checkedIssuables[this.issuableId(issuable)].checked = value;
}, },
handleAllIssuablesCheckedInput(value) { handleAllIssuablesCheckedInput(value) {
Object.keys(this.checkedIssuables).forEach(issuableId => { Object.keys(this.checkedIssuables).forEach((issuableId) => {
this.checkedIssuables[issuableId].checked = value; this.checkedIssuables[issuableId].checked = value;
}); });
}, },
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
skip() { skip() {
return this.isSearchEmpty; return this.isSearchEmpty;
}, },
update: data => data.project.issues.edges.map(({ node }) => node), update: (data) => data.project.issues.edges.map(({ node }) => node),
variables() { variables() {
return { return {
fullPath: this.projectPath, fullPath: this.projectPath,
......
...@@ -23,7 +23,7 @@ export default class Issue { ...@@ -23,7 +23,7 @@ export default class Issue {
} }
// Listen to state changes in the Vue app // Listen to state changes in the Vue app
document.addEventListener('issuable_vue_app:change', event => { document.addEventListener('issuable_vue_app:change', (event) => {
this.updateTopState(event.detail.isClosed, event.detail.data); this.updateTopState(event.detail.isClosed, event.detail.data);
}); });
} }
...@@ -80,7 +80,7 @@ export default class Issue { ...@@ -80,7 +80,7 @@ export default class Issue {
alertMovedFromServiceDeskWarning.show(); alertMovedFromServiceDeskWarning.show();
} }
alertMovedFromServiceDeskWarning.on('click', '.js-close', e => { alertMovedFromServiceDeskWarning.on('click', '.js-close', (e) => {
e.preventDefault(); e.preventDefault();
e.stopImmediatePropagation(); e.stopImmediatePropagation();
alertMovedFromServiceDeskWarning.remove(); alertMovedFromServiceDeskWarning.remove();
......
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
this.poll = new Poll({ this.poll = new Poll({
resource: this.service, resource: this.service,
method: 'getData', method: 'getData',
successCallback: res => this.store.updateState(res.data), successCallback: (res) => this.store.updateState(res.data),
errorCallback(err) { errorCallback(err) {
throw new Error(err); throw new Error(err);
}, },
...@@ -294,8 +294,8 @@ export default { ...@@ -294,8 +294,8 @@ export default {
updateStoreState() { updateStoreState() {
return this.service return this.service
.getData() .getData()
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
this.store.updateState(data); this.store.updateState(data);
}) })
.catch(() => { .catch(() => {
...@@ -320,7 +320,7 @@ export default { ...@@ -320,7 +320,7 @@ export default {
requestTemplatesAndShowForm() { requestTemplatesAndShowForm() {
return this.service return this.service
.loadTemplates(this.issuableTemplateNamesPath) .loadTemplates(this.issuableTemplateNamesPath)
.then(res => { .then((res) => {
this.updateAndShowForm(res.data); this.updateAndShowForm(res.data);
}) })
.catch(() => { .catch(() => {
...@@ -345,9 +345,9 @@ export default { ...@@ -345,9 +345,9 @@ export default {
updateIssuable() { updateIssuable() {
return this.service return this.service
.updateIssuable(this.store.formState) .updateIssuable(this.store.formState)
.then(res => res.data) .then((res) => res.data)
.then(data => this.checkForSpam(data)) .then((data) => this.checkForSpam(data))
.then(data => { .then((data) => {
if (!window.location.pathname.includes(data.web_url)) { if (!window.location.pathname.includes(data.web_url)) {
visitUrl(data.web_url); visitUrl(data.web_url);
} }
...@@ -384,8 +384,8 @@ export default { ...@@ -384,8 +384,8 @@ export default {
deleteIssuable(payload) { deleteIssuable(payload) {
return this.service return this.service
.deleteIssuable(payload) .deleteIssuable(payload)
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
// Stop the poll so we don't get 404's with the issuable not existing // Stop the poll so we don't get 404's with the issuable not existing
this.poll.stop(); this.poll.stop();
......
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