Commit 281cc730 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 8 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 1877bf55
...@@ -10,40 +10,6 @@ doc/api/graphql/reference/gitlab_schema.graphql ...@@ -10,40 +10,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.scss *.scss
*.md *.md
## keen-chatelet
app/assets/javascripts/boards/components/board_assignee_dropdown.vue
app/assets/javascripts/boards/components/board_card_layout.vue
app/assets/javascripts/boards/components/board_form.vue
app/assets/javascripts/boards/components/board_list.vue
app/assets/javascripts/boards/components/board_list_new.vue
app/assets/javascripts/boards/components/board_new_issue_new.vue
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/boards_selector.vue
app/assets/javascripts/boards/components/modal/footer.vue
app/assets/javascripts/boards/components/modal/index.vue
app/assets/javascripts/boards/components/project_select.vue
app/assets/javascripts/boards/components/sidebar/board_sidebar_labels_select.vue
app/assets/javascripts/boards/components/sidebar/board_sidebar_milestone_select.vue
app/assets/javascripts/boards/filtered_search_boards.js
app/assets/javascripts/boards/filters/due_date_filters.js
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/mixins/sortable_default_options.js
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/getters.js
app/assets/javascripts/boards/stores/modal_store.js
app/assets/javascripts/boards/stores/mutations.js
app/assets/javascripts/branches/divergence_graph.js
app/assets/javascripts/breadcrumb.js
app/assets/javascripts/broadcast_notification.js
app/assets/javascripts/build_artifacts.js
app/assets/javascripts/ci_settings_pipeline_triggers/index.js
app/assets/javascripts/ci_variable_list/ci_variable_list.js
app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue
app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
## relaxed-kilby ## relaxed-kilby
app/assets/javascripts/ci_variable_list/store/actions.js app/assets/javascripts/ci_variable_list/store/actions.js
app/assets/javascripts/ci_variable_list/store/getters.js app/assets/javascripts/ci_variable_list/store/getters.js
......
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
this.selected = this.selected.concat(name); this.selected = this.selected.concat(name);
}, },
unselect(name) { unselect(name) {
this.selected = this.selected.filter(user => user.username !== name); this.selected = this.selected.filter((user) => user.username !== name);
}, },
saveAssignees() { saveAssignees() {
this.setAssignees(this.selectedUserNames); this.setAssignees(this.selectedUserNames);
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
}, },
computed: { computed: {
multiSelectVisible() { multiSelectVisible() {
return this.multiSelect.list.findIndex(issue => issue.id === this.issue.id) > -1; return this.multiSelect.list.findIndex((issue) => issue.id === this.issue.id) > -1;
}, },
}, },
methods: { methods: {
......
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
// For each list we check if the destination list is // For each list we check if the destination list is
// a the list were we should clone the issue // a the list were we should clone the issue
const shouldClone = Object.entries(cloneActions).some( const shouldClone = Object.entries(cloneActions).some(
entry => fromBoardType === entry[0] && entry[1].includes(toBoardType), (entry) => fromBoardType === entry[0] && entry[1].includes(toBoardType),
); );
if (shouldClone) { if (shouldClone) {
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
}, },
revertClone: true, revertClone: true,
}, },
onStart: e => { onStart: (e) => {
const card = this.$refs.issue[e.oldIndex]; const card = this.$refs.issue[e.oldIndex];
card.showDetail = false; card.showDetail = false;
...@@ -171,15 +171,15 @@ export default { ...@@ -171,15 +171,15 @@ export default {
sortableStart(); sortableStart();
}, },
onAdd: e => { onAdd: (e) => {
const { items = [], newIndicies = [] } = e; const { items = [], newIndicies = [] } = e;
if (items.length) { if (items.length) {
// Not using e.newIndex here instead taking a min of all // Not using e.newIndex here instead taking a min of all
// the newIndicies. Basically we have to find that during // the newIndicies. Basically we have to find that during
// a drop what is the index we're going to start putting // a drop what is the index we're going to start putting
// all the dropped elements from. // all the dropped elements from.
const newIndex = Math.min(...newIndicies.map(obj => obj.index).filter(i => i !== -1)); const newIndex = Math.min(...newIndicies.map((obj) => obj.index).filter((i) => i !== -1));
const issues = items.map(item => const issues = items.map((item) =>
boardsStore.moving.list.findIssue(Number(item.dataset.issueId)), boardsStore.moving.list.findIssue(Number(item.dataset.issueId)),
); );
...@@ -201,23 +201,23 @@ export default { ...@@ -201,23 +201,23 @@ export default {
}); });
} }
}, },
onUpdate: e => { onUpdate: (e) => {
const sortedArray = this.sortable.toArray().filter(id => id !== '-1'); const sortedArray = this.sortable.toArray().filter((id) => id !== '-1');
const { items = [], newIndicies = [], oldIndicies = [] } = e; const { items = [], newIndicies = [], oldIndicies = [] } = e;
if (items.length) { if (items.length) {
const newIndex = Math.min(...newIndicies.map(obj => obj.index)); const newIndex = Math.min(...newIndicies.map((obj) => obj.index));
const issues = items.map(item => const issues = items.map((item) =>
boardsStore.moving.list.findIssue(Number(item.dataset.issueId)), boardsStore.moving.list.findIssue(Number(item.dataset.issueId)),
); );
boardsStore.moveMultipleIssuesInList({ boardsStore.moveMultipleIssuesInList({
list: this.list, list: this.list,
issues, issues,
oldIndicies: oldIndicies.map(obj => obj.index), oldIndicies: oldIndicies.map((obj) => obj.index),
newIndex, newIndex,
idArray: sortedArray, idArray: sortedArray,
}); });
e.items.forEach(el => { e.items.forEach((el) => {
Sortable.utils.deselect(el); Sortable.utils.deselect(el);
}); });
boardsStore.clearMultiSelect(); boardsStore.clearMultiSelect();
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
sortedArray, sortedArray,
); );
}, },
onEnd: e => { onEnd: (e) => {
const { items = [], clones = [], to } = e; const { items = [], clones = [], to } = e;
// This is not a multi select operation // This is not a multi select operation
...@@ -253,14 +253,14 @@ export default { ...@@ -253,14 +253,14 @@ export default {
*/ */
const isSameList = toList && toList.id === this.list.id; const isSameList = toList && toList.id === this.list.id;
if (toList && !isSameList && boardsStore.shouldRemoveIssue(this.list, toList)) { if (toList && !isSameList && boardsStore.shouldRemoveIssue(this.list, toList)) {
const issues = items.map(item => this.list.findIssue(Number(item.dataset.issueId))); const issues = items.map((item) => this.list.findIssue(Number(item.dataset.issueId)));
if ( if (
issues.filter(Boolean).length && issues.filter(Boolean).length &&
!boardsStore.issuesAreContiguous(this.list, issues) !boardsStore.issuesAreContiguous(this.list, issues)
) { ) {
const indexes = []; const indexes = [];
const ids = this.list.issues.map(i => i.id); const ids = this.list.issues.map((i) => i.id);
issues.forEach(issue => { issues.forEach((issue) => {
const index = ids.indexOf(issue.id); const index = ids.indexOf(issue.id);
if (index > -1) { if (index > -1) {
indexes.push(index); indexes.push(index);
...@@ -270,7 +270,7 @@ export default { ...@@ -270,7 +270,7 @@ export default {
// Descending sort because splice would cause index discrepancy otherwise // Descending sort because splice would cause index discrepancy otherwise
const sortedIndexes = indexes.sort((a, b) => (a < b ? 1 : -1)); const sortedIndexes = indexes.sort((a, b) => (a < b ? 1 : -1));
sortedIndexes.forEach(i => { sortedIndexes.forEach((i) => {
/** /**
* **setTimeout and splice each element one-by-one in a loop * **setTimeout and splice each element one-by-one in a loop
* is intended.** * is intended.**
...@@ -301,14 +301,14 @@ export default { ...@@ -301,14 +301,14 @@ export default {
// Since Vue's list does not re-render the same keyed item, we'll // Since Vue's list does not re-render the same keyed item, we'll
// remove `multi-select` class to express it's unselected // remove `multi-select` class to express it's unselected
if (clones && clones.length) { if (clones && clones.length) {
clones.forEach(el => el.classList.remove('multi-select')); clones.forEach((el) => el.classList.remove('multi-select'));
} }
// Due to some bug which I am unable to figure out // Due to some bug which I am unable to figure out
// Sortable does not deselect some pending items from the // Sortable does not deselect some pending items from the
// source list. // source list.
// We'll just do it forcefully here. // We'll just do it forcefully here.
Array.from(document.querySelectorAll('.js-multi-select') || []).forEach(item => { Array.from(document.querySelectorAll('.js-multi-select') || []).forEach((item) => {
Sortable.utils.deselect(item); Sortable.utils.deselect(item);
}); });
...@@ -322,7 +322,7 @@ export default { ...@@ -322,7 +322,7 @@ export default {
*/ */
this.$nextTick(() => { this.$nextTick(() => {
if (items && items.length) { if (items && items.length) {
items.forEach(item => { items.forEach((item) => {
item.remove(); item.remove();
}); });
} }
...@@ -346,7 +346,7 @@ export default { ...@@ -346,7 +346,7 @@ export default {
Sortable.utils.deselect(e.item); Sortable.utils.deselect(e.item);
} }
}, },
onDeselect: e => { onDeselect: (e) => {
const { const {
item: { dataset, classList }, item: { dataset, classList },
} = e; } = e;
......
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
let moveBeforeId; let moveBeforeId;
let moveAfterId; let moveAfterId;
const getIssueId = el => Number(el.dataset.issueId); const getIssueId = (el) => Number(el.dataset.issueId);
// If issue is being moved within the same list // If issue is being moved within the same list
if (from === to) { if (from === to) {
......
...@@ -65,8 +65,8 @@ export default { ...@@ -65,8 +65,8 @@ export default {
return this.addListNewIssue({ return this.addListNewIssue({
issueInput: { issueInput: {
title, title,
labelIds: labels?.map(l => l.id), labelIds: labels?.map((l) => l.id),
assigneeIds: assignees?.map(a => a?.id), assigneeIds: assignees?.map((a) => a?.id),
milestoneId: milestone?.id, milestoneId: milestone?.id,
projectPath: this.selectedProject.path, projectPath: this.selectedProject.path,
weight: weight >= 0 ? weight : null, weight: weight >= 0 ? weight : null,
......
...@@ -68,7 +68,7 @@ export default Vue.extend({ ...@@ -68,7 +68,7 @@ export default Vue.extend({
: __('Label'); : __('Label');
}, },
selectedLabels() { selectedLabels() {
return this.hasLabels ? this.issue.labels.map(l => l.title).join(',') : ''; return this.hasLabels ? this.issue.labels.map((l) => l.title).join(',') : '';
}, },
}, },
watch: { watch: {
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
return this.state.currentPage; return this.state.currentPage;
}, },
filteredBoards() { filteredBoards() {
return this.boards.filter(board => return this.boards.filter((board) =>
board.name.toLowerCase().includes(this.filterTerm.toLowerCase()), board.name.toLowerCase().includes(this.filterTerm.toLowerCase()),
); );
}, },
...@@ -181,10 +181,10 @@ export default { ...@@ -181,10 +181,10 @@ export default {
this.loadingRecentBoards = true; this.loadingRecentBoards = true;
boardsStore boardsStore
.recentBoards() .recentBoards()
.then(res => { .then((res) => {
this.recentBoards = res.data; this.recentBoards = res.data;
}) })
.catch(err => { .catch((err) => {
/** /**
* If user is unauthorized we'd still want to resolve the * If user is unauthorized we'd still want to resolve the
* request to display all boards. * request to display all boards.
......
...@@ -40,21 +40,21 @@ export default { ...@@ -40,21 +40,21 @@ export default {
const firstListIndex = 1; const firstListIndex = 1;
const list = this.modal.selectedList || this.state.lists[firstListIndex]; const list = this.modal.selectedList || this.state.lists[firstListIndex];
const selectedIssues = ModalStore.getSelectedIssues(); const selectedIssues = ModalStore.getSelectedIssues();
const issueIds = selectedIssues.map(issue => issue.id); const issueIds = selectedIssues.map((issue) => issue.id);
const req = this.buildUpdateRequest(list); const req = this.buildUpdateRequest(list);
// Post the data to the backend // Post the data to the backend
boardsStore.bulkUpdate(issueIds, req).catch(() => { boardsStore.bulkUpdate(issueIds, req).catch(() => {
Flash(__('Failed to update issues, please try again.')); Flash(__('Failed to update issues, please try again.'));
selectedIssues.forEach(issue => { selectedIssues.forEach((issue) => {
list.removeIssue(issue); list.removeIssue(issue);
list.issuesSize -= 1; list.issuesSize -= 1;
}); });
}); });
// Add the issues on the frontend // Add the issues on the frontend
selectedIssues.forEach(issue => { selectedIssues.forEach((issue) => {
list.addIssue(issue); list.addIssue(issue);
list.issuesSize += 1; list.issuesSize += 1;
}); });
......
...@@ -100,13 +100,13 @@ export default { ...@@ -100,13 +100,13 @@ export default {
page: this.page, page: this.page,
per: this.perPage, per: this.perPage,
}) })
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
if (clearIssues) { if (clearIssues) {
this.issues = []; this.issues = [];
} }
data.issues.forEach(issueObj => { data.issues.forEach((issueObj) => {
const issue = new ListIssue(issueObj); const issue = new ListIssue(issueObj);
const foundSelectedIssue = ModalStore.findSelectedIssue(issue); const foundSelectedIssue = ModalStore.findSelectedIssue(issue);
issue.selected = Boolean(foundSelectedIssue); issue.selected = Boolean(foundSelectedIssue);
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
try { try {
const projects = await Api.groupProjects(this.groupId, this.searchTerm, this.fetchOptions); const projects = await Api.groupProjects(this.groupId, this.searchTerm, this.fetchOptions);
this.projects = projects.map(project => { this.projects = projects.map((project) => {
return { return {
id: project.id, id: project.id,
name: project.name, name: project.name,
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
} }
}, },
selectProject(projectId) { selectProject(projectId) {
this.selectedProject = this.projects.find(project => project.id === projectId); this.selectedProject = this.projects.find((project) => project.id === projectId);
/* /*
TODO Remove eventhub, use Vuex for BoardNewIssue and GraphQL for BoardNewIssueNew TODO Remove eventhub, use Vuex for BoardNewIssue and GraphQL for BoardNewIssueNew
......
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
selectedLabels() { selectedLabels() {
const { labels = [] } = this.activeIssue; const { labels = [] } = this.activeIssue;
return labels.map(label => ({ return labels.map((label) => ({
...label, ...label,
id: getIdFromGraphQLId(label.id), id: getIdFromGraphQLId(label.id),
})); }));
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
issueLabels() { issueLabels() {
const { labels = [] } = this.activeIssue; const { labels = [] } = this.activeIssue;
return labels.map(label => ({ return labels.map((label) => ({
...label, ...label,
scoped: isScopedLabel(label), scoped: isScopedLabel(label),
})); }));
...@@ -46,10 +46,10 @@ export default { ...@@ -46,10 +46,10 @@ export default {
this.$refs.sidebarItem.collapse(); this.$refs.sidebarItem.collapse();
try { try {
const addLabelIds = payload.filter(label => label.set).map(label => label.id); const addLabelIds = payload.filter((label) => label.set).map((label) => label.id);
const removeLabelIds = this.selectedLabels const removeLabelIds = this.selectedLabels
.filter(label => !payload.find(selected => selected.id === label.id)) .filter((label) => !payload.find((selected) => selected.id === label.id))
.map(label => label.id); .map((label) => label.id);
const input = { addLabelIds, removeLabelIds, projectPath: this.projectPathForActiveIssue }; const input = { addLabelIds, removeLabelIds, projectPath: this.projectPathForActiveIssue };
await this.setActiveIssueLabels(input); await this.setActiveIssueLabels(input);
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
}, },
update(data) { update(data) {
const edges = data?.group?.milestones?.edges ?? []; const edges = data?.group?.milestones?.edges ?? [];
return edges.map(item => item.node); return edges.map((item) => item.node);
}, },
error() { error() {
createFlash({ message: this.$options.i18n.fetchMilestonesError }); createFlash({ message: this.$options.i18n.fetchMilestonesError });
......
...@@ -23,8 +23,8 @@ export default class FilteredSearchBoards extends FilteredSearchManager { ...@@ -23,8 +23,8 @@ export default class FilteredSearchBoards extends FilteredSearchManager {
// Issue boards is slightly different, we handle all the requests async // Issue boards is slightly different, we handle all the requests async
// instead or reloading the page, we just re-fire the list ajax requests // instead or reloading the page, we just re-fire the list ajax requests
this.isHandledAsync = true; this.isHandledAsync = true;
this.cantEdit = cantEdit.filter(i => typeof i === 'string'); this.cantEdit = cantEdit.filter((i) => typeof i === 'string');
this.cantEditWithValue = cantEdit.filter(i => typeof i === 'object'); this.cantEditWithValue = cantEdit.filter((i) => typeof i === 'object');
if (vuexstore.getters.shouldUseGraphQL && vuexstore.state.boardConfig) { if (vuexstore.getters.shouldUseGraphQL && vuexstore.state.boardConfig) {
const boardConfigPath = transformBoardConfig(vuexstore.state.boardConfig); const boardConfigPath = transformBoardConfig(vuexstore.state.boardConfig);
...@@ -55,7 +55,7 @@ export default class FilteredSearchBoards extends FilteredSearchManager { ...@@ -55,7 +55,7 @@ export default class FilteredSearchBoards extends FilteredSearchManager {
const tokens = FilteredSearchContainer.container.querySelectorAll('.js-visual-token'); const tokens = FilteredSearchContainer.container.querySelectorAll('.js-visual-token');
// Remove all the tokens as they will be replaced by the search manager // Remove all the tokens as they will be replaced by the search manager
[].forEach.call(tokens, el => { [].forEach.call(tokens, (el) => {
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
}); });
...@@ -75,7 +75,7 @@ export default class FilteredSearchBoards extends FilteredSearchManager { ...@@ -75,7 +75,7 @@ export default class FilteredSearchBoards extends FilteredSearchManager {
if (this.cantEdit.includes(tokenName)) return false; if (this.cantEdit.includes(tokenName)) return false;
return ( return (
this.cantEditWithValue.findIndex( this.cantEditWithValue.findIndex(
token => token.name === tokenName && token.value === tokenValue, (token) => token.name === tokenName && token.value === tokenValue,
) === -1 ) === -1
); );
} }
......
import Vue from 'vue'; import Vue from 'vue';
import dateFormat from 'dateformat'; import dateFormat from 'dateformat';
Vue.filter('due-date', value => { Vue.filter('due-date', (value) => {
const date = new Date(value); const date = new Date(value);
return dateFormat(date, 'mmm d, yyyy', true); return dateFormat(date, 'mmm d, yyyy', true);
}); });
...@@ -55,7 +55,7 @@ export default () => { ...@@ -55,7 +55,7 @@ export default () => {
const $boardApp = document.getElementById('board-app'); const $boardApp = document.getElementById('board-app');
// check for browser back and trigger a hard reload to circumvent browser caching. // check for browser back and trigger a hard reload to circumvent browser caching.
window.addEventListener('pageshow', event => { window.addEventListener('pageshow', (event) => {
const isNavTypeBackForward = const isNavTypeBackForward =
window.performance && window.performance.navigation.type === NavigationType.TYPE_BACK_FORWARD; window.performance && window.performance.navigation.type === NavigationType.TYPE_BACK_FORWARD;
...@@ -174,9 +174,9 @@ export default () => { ...@@ -174,9 +174,9 @@ export default () => {
initialBoardLoad() { initialBoardLoad() {
boardsStore boardsStore
.all() .all()
.then(res => res.data) .then((res) => res.data)
.then(lists => { .then((lists) => {
lists.forEach(list => boardsStore.addList(list)); lists.forEach((list) => boardsStore.addList(list));
this.loading = false; this.loading = false;
}) })
.catch(() => { .catch(() => {
...@@ -194,8 +194,8 @@ export default () => { ...@@ -194,8 +194,8 @@ export default () => {
setEpicFetchingState(newIssue, true); setEpicFetchingState(newIssue, true);
boardsStore boardsStore
.getIssueInfo(sidebarInfoEndpoint) .getIssueInfo(sidebarInfoEndpoint)
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
const { const {
subscribed, subscribed,
totalTimeSpent, totalTimeSpent,
...@@ -305,7 +305,7 @@ export default () => { ...@@ -305,7 +305,7 @@ export default () => {
if (!this.store) { if (!this.store) {
return true; return true;
} }
return !this.store.lists.filter(list => !list.preset).length; return !this.store.lists.filter((list) => !list.preset).length;
}, },
}, },
methods: { methods: {
......
...@@ -24,7 +24,7 @@ export function getBoardSortableDefaultOptions(obj) { ...@@ -24,7 +24,7 @@ export function getBoardSortableDefaultOptions(obj) {
onEnd: sortableEnd, onEnd: sortableEnd,
}; };
Object.keys(obj).forEach(key => { Object.keys(obj).forEach((key) => {
defaultSortOptions[key] = obj[key]; defaultSortOptions[key] = obj[key];
}); });
return defaultSortOptions; return defaultSortOptions;
......
...@@ -70,7 +70,7 @@ class ListIssue { ...@@ -70,7 +70,7 @@ class ListIssue {
} }
getLists() { getLists() {
return boardsStore.state.lists.filter(list => list.findIssue(this.id)); return boardsStore.state.lists.filter((list) => list.findIssue(this.id));
} }
updateData(newData) { updateData(newData) {
......
...@@ -134,7 +134,7 @@ class List { ...@@ -134,7 +134,7 @@ class List {
updateMultipleIssues(issues, listFrom, moveBeforeId, moveAfterId) { updateMultipleIssues(issues, listFrom, moveBeforeId, moveAfterId) {
boardsStore boardsStore
.moveMultipleIssues({ .moveMultipleIssues({
ids: issues.map(issue => issue.id), ids: issues.map((issue) => issue.id),
fromListId: listFrom.id, fromListId: listFrom.id,
toListId: this.id, toListId: this.id,
moveBeforeId, moveBeforeId,
......
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
const { lists, hideBacklogList } = data[boardType]?.board; const { lists, hideBacklogList } = data[boardType]?.board;
commit(types.RECEIVE_BOARD_LISTS_SUCCESS, formatBoardLists(lists)); commit(types.RECEIVE_BOARD_LISTS_SUCCESS, formatBoardLists(lists));
// Backlog list needs to be created if it doesn't exist and it's not hidden // Backlog list needs to be created if it doesn't exist and it's not hidden
if (!lists.nodes.find(l => l.listType === ListType.backlog) && !hideBacklogList) { if (!lists.nodes.find((l) => l.listType === ListType.backlog) && !hideBacklogList) {
dispatch('createList', { backlog: true }); dispatch('createList', { backlog: true });
} }
}) })
...@@ -390,7 +390,7 @@ export default { ...@@ -390,7 +390,7 @@ export default {
commit(types.ADD_ISSUE_TO_LIST, { list, issue, position: 0 }); commit(types.ADD_ISSUE_TO_LIST, { list, issue, position: 0 });
dispatch('createNewIssue', issueInput) dispatch('createNewIssue', issueInput)
.then(res => { .then((res) => {
commit(types.ADD_ISSUE_TO_LIST, { commit(types.ADD_ISSUE_TO_LIST, {
list, list,
issue: formatIssue({ ...res, id: getIdFromGraphQLId(res.id) }), issue: formatIssue({ ...res, id: getIdFromGraphQLId(res.id) }),
......
...@@ -124,7 +124,7 @@ const boardsStore = { ...@@ -124,7 +124,7 @@ const boardsStore = {
}, },
findIssueLabel(issue, findLabel) { findIssueLabel(issue, findLabel) {
return issue.labels.find(label => label.id === findLabel.id); return issue.labels.find((label) => label.id === findLabel.id);
}, },
goToNextPage(list) { goToNextPage(list) {
...@@ -182,7 +182,7 @@ const boardsStore = { ...@@ -182,7 +182,7 @@ const boardsStore = {
} }
}, },
findListIssue(list, id) { findListIssue(list, id) {
return list.issues.find(issue => issue.id === id); return list.issues.find((issue) => issue.id === id);
}, },
removeList(id, type = 'blank') { removeList(id, type = 'blank') {
...@@ -190,7 +190,7 @@ const boardsStore = { ...@@ -190,7 +190,7 @@ const boardsStore = {
if (!list) return; if (!list) return;
this.state.lists = this.state.lists.filter(list => list.id !== id); this.state.lists = this.state.lists.filter((list) => list.id !== id);
}, },
moveList(listFrom, orderLists) { moveList(listFrom, orderLists) {
orderLists.forEach((id, i) => { orderLists.forEach((id, i) => {
...@@ -205,7 +205,7 @@ const boardsStore = { ...@@ -205,7 +205,7 @@ const boardsStore = {
let moveBeforeId = null; let moveBeforeId = null;
let moveAfterId = null; let moveAfterId = null;
const listHasIssues = issues.every(issue => list.findIssue(issue.id)); const listHasIssues = issues.every((issue) => list.findIssue(issue.id));
if (!listHasIssues) { if (!listHasIssues) {
if (newIndex !== undefined) { if (newIndex !== undefined) {
...@@ -223,21 +223,21 @@ const boardsStore = { ...@@ -223,21 +223,21 @@ const boardsStore = {
} }
if (list.label) { if (list.label) {
issues.forEach(issue => issue.addLabel(list.label)); issues.forEach((issue) => issue.addLabel(list.label));
} }
if (list.assignee) { if (list.assignee) {
if (listFrom && listFrom.type === 'assignee') { if (listFrom && listFrom.type === 'assignee') {
issues.forEach(issue => issue.removeAssignee(listFrom.assignee)); issues.forEach((issue) => issue.removeAssignee(listFrom.assignee));
} }
issues.forEach(issue => issue.addAssignee(list.assignee)); issues.forEach((issue) => issue.addAssignee(list.assignee));
} }
if (IS_EE && list.milestone) { if (IS_EE && list.milestone) {
if (listFrom && listFrom.type === 'milestone') { if (listFrom && listFrom.type === 'milestone') {
issues.forEach(issue => issue.removeMilestone(listFrom.milestone)); issues.forEach((issue) => issue.removeMilestone(listFrom.milestone));
} }
issues.forEach(issue => issue.addMilestone(list.milestone)); issues.forEach((issue) => issue.addMilestone(list.milestone));
} }
if (listFrom) { if (listFrom) {
...@@ -249,7 +249,7 @@ const boardsStore = { ...@@ -249,7 +249,7 @@ const boardsStore = {
}, },
removeListIssues(list, removeIssue) { removeListIssues(list, removeIssue) {
list.issues = list.issues.filter(issue => { list.issues = list.issues.filter((issue) => {
const matchesRemove = removeIssue.id === issue.id; const matchesRemove = removeIssue.id === issue.id;
if (matchesRemove) { if (matchesRemove) {
...@@ -261,9 +261,9 @@ const boardsStore = { ...@@ -261,9 +261,9 @@ const boardsStore = {
}); });
}, },
removeListMultipleIssues(list, removeIssues) { removeListMultipleIssues(list, removeIssues) {
const ids = removeIssues.map(issue => issue.id); const ids = removeIssues.map((issue) => issue.id);
list.issues = list.issues.filter(issue => { list.issues = list.issues.filter((issue) => {
const matchesRemove = ids.includes(issue.id); const matchesRemove = ids.includes(issue.id);
if (matchesRemove) { if (matchesRemove) {
...@@ -289,9 +289,9 @@ const boardsStore = { ...@@ -289,9 +289,9 @@ const boardsStore = {
}, },
moveMultipleIssuesToList({ listFrom, listTo, issues, newIndex }) { moveMultipleIssuesToList({ listFrom, listTo, issues, newIndex }) {
const issueTo = issues.map(issue => listTo.findIssue(issue.id)); const issueTo = issues.map((issue) => listTo.findIssue(issue.id));
const issueLists = issues.map(issue => issue.getLists()).flat(); const issueLists = issues.map((issue) => issue.getLists()).flat();
const listLabels = issueLists.map(list => list.label); const listLabels = issueLists.map((list) => list.label);
const hasMoveableIssues = issueTo.filter(Boolean).length > 0; const hasMoveableIssues = issueTo.filter(Boolean).length > 0;
if (!hasMoveableIssues) { if (!hasMoveableIssues) {
...@@ -299,30 +299,30 @@ const boardsStore = { ...@@ -299,30 +299,30 @@ const boardsStore = {
if ( if (
listTo.type === ListType.assignee && listTo.type === ListType.assignee &&
listFrom.type === ListType.assignee && listFrom.type === ListType.assignee &&
issues.some(issue => issue.findAssignee(listTo.assignee)) issues.some((issue) => issue.findAssignee(listTo.assignee))
) { ) {
const targetIssues = issues.map(issue => listTo.findIssue(issue.id)); const targetIssues = issues.map((issue) => listTo.findIssue(issue.id));
targetIssues.forEach(targetIssue => targetIssue.removeAssignee(listFrom.assignee)); targetIssues.forEach((targetIssue) => targetIssue.removeAssignee(listFrom.assignee));
} else if (listTo.type === 'milestone') { } else if (listTo.type === 'milestone') {
const currentMilestones = issues.map(issue => issue.milestone); const currentMilestones = issues.map((issue) => issue.milestone);
const currentLists = this.state.lists const currentLists = this.state.lists
.filter(list => list.type === 'milestone' && list.id !== listTo.id) .filter((list) => list.type === 'milestone' && list.id !== listTo.id)
.filter(list => .filter((list) =>
list.issues.some(listIssue => issues.some(issue => listIssue.id === issue.id)), list.issues.some((listIssue) => issues.some((issue) => listIssue.id === issue.id)),
); );
issues.forEach(issue => { issues.forEach((issue) => {
currentMilestones.forEach(milestone => { currentMilestones.forEach((milestone) => {
issue.removeMilestone(milestone); issue.removeMilestone(milestone);
}); });
}); });
issues.forEach(issue => { issues.forEach((issue) => {
issue.addMilestone(listTo.milestone); issue.addMilestone(listTo.milestone);
}); });
currentLists.forEach(currentList => { currentLists.forEach((currentList) => {
issues.forEach(issue => { issues.forEach((issue) => {
currentList.removeIssue(issue); currentList.removeIssue(issue);
}); });
}); });
...@@ -334,36 +334,36 @@ const boardsStore = { ...@@ -334,36 +334,36 @@ const boardsStore = {
} }
} else { } else {
listTo.updateMultipleIssues(issues, listFrom); listTo.updateMultipleIssues(issues, listFrom);
issues.forEach(issue => { issues.forEach((issue) => {
issue.removeLabel(listFrom.label); issue.removeLabel(listFrom.label);
}); });
} }
if (listTo.type === ListType.closed && listFrom.type !== ListType.backlog) { if (listTo.type === ListType.closed && listFrom.type !== ListType.backlog) {
issueLists.forEach(list => { issueLists.forEach((list) => {
issues.forEach(issue => { issues.forEach((issue) => {
list.removeIssue(issue); list.removeIssue(issue);
}); });
}); });
issues.forEach(issue => { issues.forEach((issue) => {
issue.removeLabels(listLabels); issue.removeLabels(listLabels);
}); });
} else if (listTo.type === ListType.backlog && listFrom.type === ListType.assignee) { } else if (listTo.type === ListType.backlog && listFrom.type === ListType.assignee) {
issues.forEach(issue => { issues.forEach((issue) => {
issue.removeAssignee(listFrom.assignee); issue.removeAssignee(listFrom.assignee);
}); });
issueLists.forEach(list => { issueLists.forEach((list) => {
issues.forEach(issue => { issues.forEach((issue) => {
list.removeIssue(issue); list.removeIssue(issue);
}); });
}); });
} else if (listTo.type === ListType.backlog && listFrom.type === ListType.milestone) { } else if (listTo.type === ListType.backlog && listFrom.type === ListType.milestone) {
issues.forEach(issue => { issues.forEach((issue) => {
issue.removeMilestone(listFrom.milestone); issue.removeMilestone(listFrom.milestone);
}); });
issueLists.forEach(list => { issueLists.forEach((list) => {
issues.forEach(issue => { issues.forEach((issue) => {
list.removeIssue(issue); list.removeIssue(issue);
}); });
}); });
...@@ -380,8 +380,8 @@ const boardsStore = { ...@@ -380,8 +380,8 @@ const boardsStore = {
if (issues.length === 1) return true; if (issues.length === 1) return true;
// Create list of ids for issues involved. // Create list of ids for issues involved.
const listIssueIds = list.issues.map(issue => issue.id); const listIssueIds = list.issues.map((issue) => issue.id);
const movedIssueIds = issues.map(issue => issue.id); const movedIssueIds = issues.map((issue) => issue.id);
// Check if moved issue IDs is sub-array // Check if moved issue IDs is sub-array
// of source list issue IDs (i.e. contiguous selection). // of source list issue IDs (i.e. contiguous selection).
...@@ -391,7 +391,7 @@ const boardsStore = { ...@@ -391,7 +391,7 @@ const boardsStore = {
moveIssueToList(listFrom, listTo, issue, newIndex) { moveIssueToList(listFrom, listTo, issue, newIndex) {
const issueTo = listTo.findIssue(issue.id); const issueTo = listTo.findIssue(issue.id);
const issueLists = issue.getLists(); const issueLists = issue.getLists();
const listLabels = issueLists.map(listIssue => listIssue.label); const listLabels = issueLists.map((listIssue) => listIssue.label);
if (!issueTo) { if (!issueTo) {
// Check if target list assignee is already present in this issue // Check if target list assignee is already present in this issue
...@@ -405,12 +405,12 @@ const boardsStore = { ...@@ -405,12 +405,12 @@ const boardsStore = {
} else if (listTo.type === 'milestone') { } else if (listTo.type === 'milestone') {
const currentMilestone = issue.milestone; const currentMilestone = issue.milestone;
const currentLists = this.state.lists const currentLists = this.state.lists
.filter(list => list.type === 'milestone' && list.id !== listTo.id) .filter((list) => list.type === 'milestone' && list.id !== listTo.id)
.filter(list => list.issues.some(listIssue => issue.id === listIssue.id)); .filter((list) => list.issues.some((listIssue) => issue.id === listIssue.id));
issue.removeMilestone(currentMilestone); issue.removeMilestone(currentMilestone);
issue.addMilestone(listTo.milestone); issue.addMilestone(listTo.milestone);
currentLists.forEach(currentList => currentList.removeIssue(issue)); currentLists.forEach((currentList) => currentList.removeIssue(issue));
listTo.addIssue(issue, listFrom, newIndex); listTo.addIssue(issue, listFrom, newIndex);
} else { } else {
// Add to new lists issues if it doesn't already exist // Add to new lists issues if it doesn't already exist
...@@ -422,7 +422,7 @@ const boardsStore = { ...@@ -422,7 +422,7 @@ const boardsStore = {
} }
if (listTo.type === 'closed' && listFrom.type !== 'backlog') { if (listTo.type === 'closed' && listFrom.type !== 'backlog') {
issueLists.forEach(list => { issueLists.forEach((list) => {
list.removeIssue(issue); list.removeIssue(issue);
}); });
issue.removeLabels(listLabels); issue.removeLabels(listLabels);
...@@ -462,7 +462,7 @@ const boardsStore = { ...@@ -462,7 +462,7 @@ const boardsStore = {
}); });
}, },
findList(key, val, type = 'label') { findList(key, val, type = 'label') {
const filteredList = this.state.lists.filter(list => { const filteredList = this.state.lists.filter((list) => {
const byType = type const byType = type
? list.type === type || list.type === 'assignee' || list.type === 'milestone' ? list.type === type || list.type === 'assignee' || list.type === 'milestone'
: true; : true;
...@@ -472,7 +472,7 @@ const boardsStore = { ...@@ -472,7 +472,7 @@ const boardsStore = {
return filteredList[0]; return filteredList[0];
}, },
findListByLabelId(id) { findListByLabelId(id) {
return this.state.lists.find(list => list.type === 'label' && list.label.id === id); return this.state.lists.find((list) => list.type === 'label' && list.label.id === id);
}, },
toggleFilter(filter) { toggleFilter(filter) {
...@@ -589,8 +589,8 @@ const boardsStore = { ...@@ -589,8 +589,8 @@ const boardsStore = {
} }
return this.createList(entity.id, entityType) return this.createList(entity.id, entityType)
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
list.id = data.id; list.id = data.id;
list.type = data.list_type; list.type = data.list_type;
list.position = data.position; list.position = data.position;
...@@ -607,7 +607,7 @@ const boardsStore = { ...@@ -607,7 +607,7 @@ const boardsStore = {
}; };
if (list.label && data.label_name) { if (list.label && data.label_name) {
data.label_name = data.label_name.filter(label => label !== list.label.title); data.label_name = data.label_name.filter((label) => label !== list.label.title);
} }
if (emptyIssues) { if (emptyIssues) {
...@@ -615,8 +615,8 @@ const boardsStore = { ...@@ -615,8 +615,8 @@ const boardsStore = {
} }
return this.getIssuesForList(list.id, data) return this.getIssuesForList(list.id, data)
.then(res => res.data) .then((res) => res.data)
.then(data => { .then((data) => {
list.loading = false; list.loading = false;
list.issuesSize = data.size; list.issuesSize = data.size;
...@@ -624,7 +624,7 @@ const boardsStore = { ...@@ -624,7 +624,7 @@ const boardsStore = {
list.issues = []; list.issues = [];
} }
data.issues.forEach(issueObj => { data.issues.forEach((issueObj) => {
list.addIssue(new ListIssue(issueObj)); list.addIssue(new ListIssue(issueObj));
}); });
...@@ -634,7 +634,7 @@ const boardsStore = { ...@@ -634,7 +634,7 @@ const boardsStore = {
getIssuesForList(id, filter = {}) { getIssuesForList(id, filter = {}) {
const data = { id }; const data = { id };
Object.keys(filter).forEach(key => { Object.keys(filter).forEach((key) => {
data[key] = filter[key]; data[key] = filter[key];
}); });
...@@ -670,13 +670,13 @@ const boardsStore = { ...@@ -670,13 +670,13 @@ const boardsStore = {
}, },
moveListMultipleIssues({ list, issues, oldIndicies, newIndex, moveBeforeId, moveAfterId }) { moveListMultipleIssues({ list, issues, oldIndicies, newIndex, moveBeforeId, moveAfterId }) {
oldIndicies.reverse().forEach(index => { oldIndicies.reverse().forEach((index) => {
list.issues.splice(index, 1); list.issues.splice(index, 1);
}); });
list.issues.splice(newIndex, 0, ...issues); list.issues.splice(newIndex, 0, ...issues);
return this.moveMultipleIssues({ return this.moveMultipleIssues({
ids: issues.map(issue => issue.id), ids: issues.map((issue) => issue.id),
fromListId: null, fromListId: null,
toListId: null, toListId: null,
moveBeforeId, moveBeforeId,
...@@ -703,8 +703,8 @@ const boardsStore = { ...@@ -703,8 +703,8 @@ const boardsStore = {
} }
return this.newIssue(list.id, issue) return this.newIssue(list.id, issue)
.then(res => res.data) .then((res) => res.data)
.then(data => list.onNewIssueResponse(issue, data)); .then((data) => list.onNewIssueResponse(issue, data));
}, },
getBacklog(data) { getBacklog(data) {
...@@ -717,7 +717,7 @@ const boardsStore = { ...@@ -717,7 +717,7 @@ const boardsStore = {
}, },
removeIssueLabel(issue, removeLabel) { removeIssueLabel(issue, removeLabel) {
if (removeLabel) { if (removeLabel) {
issue.labels = issue.labels.filter(label => removeLabel.id !== label.id); issue.labels = issue.labels.filter((label) => removeLabel.id !== label.id);
} }
}, },
...@@ -762,7 +762,7 @@ const boardsStore = { ...@@ -762,7 +762,7 @@ const boardsStore = {
}, },
toggleMultiSelect(issue) { toggleMultiSelect(issue) {
const selectedIssueIds = this.multiSelect.list.map(issue => issue.id); const selectedIssueIds = this.multiSelect.list.map((issue) => issue.id);
const index = selectedIssueIds.indexOf(issue.id); const index = selectedIssueIds.indexOf(issue.id);
if (index === -1) { if (index === -1) {
...@@ -777,12 +777,12 @@ const boardsStore = { ...@@ -777,12 +777,12 @@ const boardsStore = {
}, },
removeIssueAssignee(issue, removeAssignee) { removeIssueAssignee(issue, removeAssignee) {
if (removeAssignee) { if (removeAssignee) {
issue.assignees = issue.assignees.filter(assignee => assignee.id !== removeAssignee.id); issue.assignees = issue.assignees.filter((assignee) => assignee.id !== removeAssignee.id);
} }
}, },
findIssueAssignee(issue, findAssignee) { findIssueAssignee(issue, findAssignee) {
return issue.assignees.find(assignee => assignee.id === findAssignee.id); return issue.assignees.find((assignee) => assignee.id === findAssignee.id);
}, },
clearMultiSelect() { clearMultiSelect() {
...@@ -837,11 +837,11 @@ const boardsStore = { ...@@ -837,11 +837,11 @@ const boardsStore = {
} }
if (obj.labels) { if (obj.labels) {
issue.labels = obj.labels.map(label => new ListLabel(label)); issue.labels = obj.labels.map((label) => new ListLabel(label));
} }
if (obj.assignees) { if (obj.assignees) {
issue.assignees = obj.assignees.map(a => new ListAssignee(a)); issue.assignees = obj.assignees.map((a) => new ListAssignee(a));
} }
}, },
addIssueLabel(issue, label) { addIssueLabel(issue, label) {
......
...@@ -2,18 +2,18 @@ import { find } from 'lodash'; ...@@ -2,18 +2,18 @@ import { find } from 'lodash';
import { inactiveId } from '../constants'; import { inactiveId } from '../constants';
export default { export default {
isSidebarOpen: state => state.activeId !== inactiveId, isSidebarOpen: (state) => state.activeId !== inactiveId,
isSwimlanesOn: () => false, isSwimlanesOn: () => false,
getIssueById: state => id => { getIssueById: (state) => (id) => {
return state.issues[id] || {}; return state.issues[id] || {};
}, },
getIssuesByList: (state, getters) => listId => { getIssuesByList: (state, getters) => (listId) => {
const listIssueIds = state.issuesByListId[listId] || []; const listIssueIds = state.issuesByListId[listId] || [];
return listIssueIds.map(id => getters.getIssueById(id)); return listIssueIds.map((id) => getters.getIssueById(id));
}, },
activeIssue: state => { activeIssue: (state) => {
return state.issues[state.activeId] || {}; return state.issues[state.activeId] || {};
}, },
...@@ -22,12 +22,12 @@ export default { ...@@ -22,12 +22,12 @@ export default {
return referencePath.slice(0, referencePath.indexOf('#')); return referencePath.slice(0, referencePath.indexOf('#'));
}, },
getListByLabelId: state => labelId => { getListByLabelId: (state) => (labelId) => {
return find(state.boardLists, l => l.label?.id === labelId); return find(state.boardLists, (l) => l.label?.id === labelId);
}, },
getListByTitle: state => title => { getListByTitle: (state) => (title) => {
return find(state.boardLists, l => l.title === title); return find(state.boardLists, (l) => l.title === title);
}, },
shouldUseGraphQL: () => { shouldUseGraphQL: () => {
......
...@@ -40,7 +40,7 @@ class ModalStore { ...@@ -40,7 +40,7 @@ class ModalStore {
toggleAll() { toggleAll() {
const select = this.selectedCount() !== this.store.issues.length; const select = this.selectedCount() !== this.store.issues.length;
this.store.issues.forEach(issue => { this.store.issues.forEach((issue) => {
const issueUpdate = issue; const issueUpdate = issue;
if (issueUpdate.selected !== select) { if (issueUpdate.selected !== select) {
...@@ -56,7 +56,7 @@ class ModalStore { ...@@ -56,7 +56,7 @@ class ModalStore {
} }
getSelectedIssues() { getSelectedIssues() {
return this.store.selectedIssues.filter(issue => issue.selected); return this.store.selectedIssues.filter((issue) => issue.selected);
} }
addSelectedIssue(issue) { addSelectedIssue(issue) {
...@@ -70,13 +70,13 @@ class ModalStore { ...@@ -70,13 +70,13 @@ class ModalStore {
removeSelectedIssue(issue, forcePurge = false) { removeSelectedIssue(issue, forcePurge = false) {
if (this.store.activeTab === 'all' || forcePurge) { if (this.store.activeTab === 'all' || forcePurge) {
this.store.selectedIssues = this.store.selectedIssues.filter( this.store.selectedIssues = this.store.selectedIssues.filter(
fIssue => fIssue.id !== issue.id, (fIssue) => fIssue.id !== issue.id,
); );
} }
} }
purgeUnselectedIssues() { purgeUnselectedIssues() {
this.store.selectedIssues.forEach(issue => { this.store.selectedIssues.forEach((issue) => {
if (!issue.selected) { if (!issue.selected) {
this.removeSelectedIssue(issue, true); this.removeSelectedIssue(issue, true);
} }
...@@ -88,7 +88,7 @@ class ModalStore { ...@@ -88,7 +88,7 @@ class ModalStore {
} }
findSelectedIssue(issue) { findSelectedIssue(issue) {
return this.store.selectedIssues.filter(filteredIssue => filteredIssue.id === issue.id)[0]; return this.store.selectedIssues.filter((filteredIssue) => filteredIssue.id === issue.id)[0];
} }
} }
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
state.boardLists = lists; state.boardLists = lists;
}, },
[mutationTypes.RECEIVE_BOARD_LISTS_FAILURE]: state => { [mutationTypes.RECEIVE_BOARD_LISTS_FAILURE]: (state) => {
state.error = s__( state.error = s__(
'Boards|An error occurred while fetching the board lists. Please reload the page.', 'Boards|An error occurred while fetching the board lists. Please reload the page.',
); );
...@@ -59,15 +59,15 @@ export default { ...@@ -59,15 +59,15 @@ export default {
state.filterParams = filterParams; state.filterParams = filterParams;
}, },
[mutationTypes.CREATE_LIST_FAILURE]: state => { [mutationTypes.CREATE_LIST_FAILURE]: (state) => {
state.error = s__('Boards|An error occurred while creating the list. Please try again.'); state.error = s__('Boards|An error occurred while creating the list. Please try again.');
}, },
[mutationTypes.RECEIVE_LABELS_FAILURE]: state => { [mutationTypes.RECEIVE_LABELS_FAILURE]: (state) => {
state.error = s__('Boards|An error occurred while fetching labels. Please reload the page.'); state.error = s__('Boards|An error occurred while fetching labels. Please reload the page.');
}, },
[mutationTypes.GENERATE_DEFAULT_LISTS_FAILURE]: state => { [mutationTypes.GENERATE_DEFAULT_LISTS_FAILURE]: (state) => {
state.error = s__('Boards|An error occurred while generating lists. Please reload the page.'); state.error = s__('Boards|An error occurred while generating lists. Please reload the page.');
}, },
...@@ -129,8 +129,8 @@ export default { ...@@ -129,8 +129,8 @@ export default {
Vue.set(state.listsFlags, listId, { isLoading: false, isLoadingMore: false }); Vue.set(state.listsFlags, listId, { isLoading: false, isLoadingMore: false });
}, },
[mutationTypes.RESET_ISSUES]: state => { [mutationTypes.RESET_ISSUES]: (state) => {
Object.keys(state.issuesByListId).forEach(listId => { Object.keys(state.issuesByListId).forEach((listId) => {
Vue.set(state.issuesByListId, listId, []); Vue.set(state.issuesByListId, listId, []);
}); });
}, },
...@@ -206,7 +206,7 @@ export default { ...@@ -206,7 +206,7 @@ export default {
notImplemented(); notImplemented();
}, },
[mutationTypes.CREATE_ISSUE_FAILURE]: state => { [mutationTypes.CREATE_ISSUE_FAILURE]: (state) => {
state.error = s__('Boards|An error occurred while creating the issue. Please try again.'); state.error = s__('Boards|An error occurred while creating the issue. Please try again.');
}, },
......
...@@ -21,7 +21,7 @@ export function createGraphVueApp(el, data, maxCommits) { ...@@ -21,7 +21,7 @@ export function createGraphVueApp(el, data, maxCommits) {
}); });
} }
export default endpoint => { export default (endpoint) => {
const names = [...document.querySelectorAll('.js-branch-item')].map( const names = [...document.querySelectorAll('.js-branch-item')].map(
({ dataset }) => dataset.name, ({ dataset }) => dataset.name,
); );
......
import $ from 'jquery'; import $ from 'jquery';
import { hide } from '~/tooltips'; import { hide } from '~/tooltips';
export const addTooltipToEl = el => { export const addTooltipToEl = (el) => {
const textEl = el.querySelector('.js-breadcrumb-item-text'); const textEl = el.querySelector('.js-breadcrumb-item-text');
if (textEl && textEl.scrollWidth > textEl.offsetWidth) { if (textEl && textEl.scrollWidth > textEl.offsetWidth) {
...@@ -16,14 +16,14 @@ export default () => { ...@@ -16,14 +16,14 @@ export default () => {
if (breadcrumbs) { if (breadcrumbs) {
const topLevelLinks = [...breadcrumbs.children] const topLevelLinks = [...breadcrumbs.children]
.filter(el => !el.classList.contains('dropdown')) .filter((el) => !el.classList.contains('dropdown'))
.map(el => el.querySelector('a')) .map((el) => el.querySelector('a'))
.filter(el => el); .filter((el) => el);
const $expander = $('.js-breadcrumbs-collapsed-expander'); const $expander = $('.js-breadcrumbs-collapsed-expander');
topLevelLinks.forEach(el => addTooltipToEl(el)); topLevelLinks.forEach((el) => addTooltipToEl(el));
$expander.closest('.dropdown').on('show.bs.dropdown hide.bs.dropdown', e => { $expander.closest('.dropdown').on('show.bs.dropdown hide.bs.dropdown', (e) => {
const $el = $('.js-breadcrumbs-collapsed-expander', e.currentTarget); const $el = $('.js-breadcrumbs-collapsed-expander', e.currentTarget);
$el.toggleClass('open'); $el.toggleClass('open');
......
...@@ -15,5 +15,5 @@ const handleOnDismiss = ({ currentTarget }) => { ...@@ -15,5 +15,5 @@ const handleOnDismiss = ({ currentTarget }) => {
export default () => { export default () => {
document document
.querySelectorAll('.js-dismiss-current-broadcast-notification') .querySelectorAll('.js-dismiss-current-broadcast-notification')
.forEach(dismissButton => dismissButton.addEventListener('click', handleOnDismiss)); .forEach((dismissButton) => dismissButton.addEventListener('click', handleOnDismiss));
}; };
...@@ -14,10 +14,10 @@ export default class BuildArtifacts { ...@@ -14,10 +14,10 @@ export default class BuildArtifacts {
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
disablePropagation() { disablePropagation() {
$('.top-block').on('click', '.download', e => { $('.top-block').on('click', '.download', (e) => {
e.stopPropagation(); e.stopPropagation();
}); });
return $('.tree-holder').on('click', 'tr[data-link] a', e => { return $('.tree-holder').on('click', 'tr[data-link] a', (e) => {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
}); });
} }
...@@ -41,12 +41,12 @@ export default class BuildArtifacts { ...@@ -41,12 +41,12 @@ export default class BuildArtifacts {
// We want the tooltip to show if you hover anywhere on the row // We want the tooltip to show if you hover anywhere on the row
// But be placed below and in the middle of the file name // But be placed below and in the middle of the file name
$('.js-artifact-tree-row') $('.js-artifact-tree-row')
.on('mouseenter', e => { .on('mouseenter', (e) => {
const $el = $(e.currentTarget).find('.js-artifact-tree-tooltip'); const $el = $(e.currentTarget).find('.js-artifact-tree-tooltip');
show($el); show($el);
}) })
.on('mouseleave', e => { .on('mouseleave', (e) => {
const $el = $(e.currentTarget).find('.js-artifact-tree-tooltip'); const $el = $(e.currentTarget).find('.js-artifact-tree-tooltip');
hide($el); hide($el);
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import TriggersList from './components/triggers_list.vue'; import TriggersList from './components/triggers_list.vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
const parseJsonArray = triggers => { const parseJsonArray = (triggers) => {
try { try {
return convertObjectPropsToCamelCase(JSON.parse(triggers), { deep: true }); return convertObjectPropsToCamelCase(JSON.parse(triggers), { deep: true });
} catch { } catch {
......
...@@ -81,17 +81,17 @@ export default class VariableList { ...@@ -81,17 +81,17 @@ export default class VariableList {
this.initRow(rowEl); this.initRow(rowEl);
}); });
this.$container.on('click', '.js-row-remove-button', e => { this.$container.on('click', '.js-row-remove-button', (e) => {
e.preventDefault(); e.preventDefault();
this.removeRow($(e.currentTarget).closest('.js-row')); this.removeRow($(e.currentTarget).closest('.js-row'));
}); });
const inputSelector = Object.keys(this.inputMap) const inputSelector = Object.keys(this.inputMap)
.map(name => this.inputMap[name].selector) .map((name) => this.inputMap[name].selector)
.join(','); .join(',');
// Remove any empty rows except the last row // Remove any empty rows except the last row
this.$container.on('blur', inputSelector, e => { this.$container.on('blur', inputSelector, (e) => {
const $row = $(e.currentTarget).closest('.js-row'); const $row = $(e.currentTarget).closest('.js-row');
if ($row.is(':not(:last-child)') && !this.checkIfRowTouched($row)) { if ($row.is(':not(:last-child)') && !this.checkIfRowTouched($row)) {
...@@ -99,7 +99,7 @@ export default class VariableList { ...@@ -99,7 +99,7 @@ export default class VariableList {
} }
}); });
this.$container.on('input trigger-change', inputSelector, e => { this.$container.on('input trigger-change', inputSelector, (e) => {
// Always make sure there is an empty last row // Always make sure there is an empty last row
const $lastRow = this.$container.find('.js-row').last(); const $lastRow = this.$container.find('.js-row').last();
...@@ -149,7 +149,7 @@ export default class VariableList { ...@@ -149,7 +149,7 @@ export default class VariableList {
$rowClone.removeAttr('data-is-persisted'); $rowClone.removeAttr('data-is-persisted');
// Reset the inputs to their defaults // Reset the inputs to their defaults
Object.keys(this.inputMap).forEach(name => { Object.keys(this.inputMap).forEach((name) => {
const entry = this.inputMap[name]; const entry = this.inputMap[name];
$rowClone.find(entry.selector).val(entry.default); $rowClone.find(entry.selector).val(entry.default);
}); });
...@@ -184,7 +184,7 @@ export default class VariableList { ...@@ -184,7 +184,7 @@ export default class VariableList {
} }
checkIfRowTouched($row) { checkIfRowTouched($row) {
return Object.keys(this.inputMap).some(name => { return Object.keys(this.inputMap).some((name) => {
// Row should not qualify as touched if only switches have been touched // Row should not qualify as touched if only switches have been touched
if (['protected', 'masked'].includes(name)) return false; if (['protected', 'masked'].includes(name)) return false;
...@@ -225,9 +225,9 @@ export default class VariableList { ...@@ -225,9 +225,9 @@ export default class VariableList {
// a blank variable and run into validation problems. // a blank variable and run into validation problems.
const validRows = this.$container.find('.js-row').toArray().slice(0, -1); const validRows = this.$container.find('.js-row').toArray().slice(0, -1);
return validRows.map(rowEl => { return validRows.map((rowEl) => {
const resultant = {}; const resultant = {};
Object.keys(this.inputMap).forEach(name => { Object.keys(this.inputMap).forEach((name) => {
const entry = this.inputMap[name]; const entry = this.inputMap[name];
const $input = $(rowEl).find(entry.selector); const $input = $(rowEl).find(entry.selector);
if ($input.length) { if ($input.length) {
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
filteredResults() { filteredResults() {
const lowerCasedSearchTerm = this.searchTerm.toLowerCase(); const lowerCasedSearchTerm = this.searchTerm.toLowerCase();
return this.joinedEnvironments.filter(resultString => return this.joinedEnvironments.filter((resultString) =>
resultString.toLowerCase().includes(lowerCasedSearchTerm), resultString.toLowerCase().includes(lowerCasedSearchTerm),
); );
}, },
......
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
}, },
fields() { fields() {
if (this.isGroup) { if (this.isGroup) {
return this.$options.fields.filter(field => field.key !== 'environment_scope'); return this.$options.fields.filter((field) => field.key !== 'environment_scope');
} }
return this.$options.fields; return this.$options.fields;
}, },
......
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