Commit 216f795b authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 24 of 73

Part of our prettier migration; changing the arrow-parens style.
parent b1f29131
...@@ -9,7 +9,7 @@ export default class PerformanceBarService { ...@@ -9,7 +9,7 @@ export default class PerformanceBarService {
} }
static registerInterceptor(peekUrl, callback) { static registerInterceptor(peekUrl, callback) {
PerformanceBarService.interceptor = response => { PerformanceBarService.interceptor = (response) => {
const [fireCallback, requestId, requestUrl] = PerformanceBarService.callbackParams( const [fireCallback, requestId, requestUrl] = PerformanceBarService.callbackParams(
response, response,
peekUrl, peekUrl,
......
...@@ -20,7 +20,7 @@ export default class PerformanceBarStore { ...@@ -20,7 +20,7 @@ export default class PerformanceBarStore {
} }
findRequest(requestId) { findRequest(requestId) {
return this.requests.find(request => request.id === requestId); return this.requests.find((request) => request.id === requestId);
} }
addRequestDetails(requestId, requestDetails) { addRequestDetails(requestId, requestDetails) {
...@@ -43,13 +43,13 @@ export default class PerformanceBarStore { ...@@ -43,13 +43,13 @@ export default class PerformanceBarStore {
} }
requestsWithDetails() { requestsWithDetails() {
return this.requests.filter(request => request.details); return this.requests.filter((request) => request.details);
} }
canTrackRequest(requestUrl) { canTrackRequest(requestUrl) {
return ( return (
requestUrl.endsWith('/api/graphql') || requestUrl.endsWith('/api/graphql') ||
this.requests.filter(request => request.url === requestUrl).length < 2 this.requests.filter((request) => request.url === requestUrl).length < 2
); );
} }
......
...@@ -28,10 +28,10 @@ export default class PersistentUserCallout { ...@@ -28,10 +28,10 @@ export default class PersistentUserCallout {
} }
handleCloseButtonCallout(closeButton) { handleCloseButtonCallout(closeButton) {
closeButton.addEventListener('click', event => this.dismiss(event)); closeButton.addEventListener('click', (event) => this.dismiss(event));
if (this.deferLinks) { if (this.deferLinks) {
this.container.addEventListener('click', event => { this.container.addEventListener('click', (event) => {
const isDeferredLink = event.target.classList.contains(DEFERRED_LINK_CLASS); const isDeferredLink = event.target.classList.contains(DEFERRED_LINK_CLASS);
if (isDeferredLink) { if (isDeferredLink) {
const { href, target } = event.target; const { href, target } = event.target;
...@@ -43,7 +43,7 @@ export default class PersistentUserCallout { ...@@ -43,7 +43,7 @@ export default class PersistentUserCallout {
} }
handleFollowLinkCallout(followLink) { handleFollowLinkCallout(followLink) {
followLink.addEventListener('click', event => this.registerCalloutWithLink(event)); followLink.addEventListener('click', (event) => this.registerCalloutWithLink(event));
} }
dismiss(event, deferredLinkOptions = null) { dismiss(event, deferredLinkOptions = null) {
......
...@@ -11,7 +11,7 @@ const PERSISTENT_USER_CALLOUTS = [ ...@@ -11,7 +11,7 @@ const PERSISTENT_USER_CALLOUTS = [
]; ];
const initCallouts = () => { const initCallouts = () => {
PERSISTENT_USER_CALLOUTS.forEach(calloutContainer => PERSISTENT_USER_CALLOUTS.forEach((calloutContainer) =>
PersistentUserCallout.factory(document.querySelector(calloutContainer)), PersistentUserCallout.factory(document.querySelector(calloutContainer)),
); );
}; };
......
...@@ -18,7 +18,7 @@ export const resolvers = { ...@@ -18,7 +18,7 @@ export const resolvers = {
valid: data.valid, valid: data.valid,
errors: data.errors, errors: data.errors,
warnings: data.warnings, warnings: data.warnings,
jobs: data.jobs.map(job => { jobs: data.jobs.map((job) => {
const only = job.only ? { refs: job.only.refs, __typename: 'CiLintJobOnlyPolicy' } : null; const only = job.only ? { refs: job.only.refs, __typename: 'CiLintJobOnlyPolicy' } : null;
return { return {
......
...@@ -121,12 +121,12 @@ export default { ...@@ -121,12 +121,12 @@ export default {
return this.searchTerm.toLowerCase(); return this.searchTerm.toLowerCase();
}, },
filteredBranches() { filteredBranches() {
return this.branches.filter(branch => return this.branches.filter((branch) =>
branch.shortName.toLowerCase().includes(this.lowerCasedSearchTerm), branch.shortName.toLowerCase().includes(this.lowerCasedSearchTerm),
); );
}, },
filteredTags() { filteredTags() {
return this.tags.filter(tag => return this.tags.filter((tag) =>
tag.shortName.toLowerCase().includes(this.lowerCasedSearchTerm), tag.shortName.toLowerCase().includes(this.lowerCasedSearchTerm),
); );
}, },
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
setVariable(refValue, type, key, value) { setVariable(refValue, type, key, value) {
const { variables } = this.form[refValue]; const { variables } = this.form[refValue];
const variable = variables.find(v => v.key === key); const variable = variables.find((v) => v.key === key);
if (variable) { if (variable) {
variable.type = type; variable.type = type;
variable.value = value; variable.value = value;
...@@ -270,11 +270,11 @@ export default { ...@@ -270,11 +270,11 @@ export default {
stop(data); stop(data);
} }
}) })
.catch(error => { .catch((error) => {
stop(error); stop(error);
}); });
}, CONFIG_VARIABLES_TIMEOUT) }, CONFIG_VARIABLES_TIMEOUT)
.then(data => { .then((data) => {
const params = {}; const params = {};
const descriptions = {}; const descriptions = {};
...@@ -287,7 +287,7 @@ export default { ...@@ -287,7 +287,7 @@ export default {
return { params, descriptions }; return { params, descriptions };
}) })
.catch(error => { .catch((error) => {
this.isLoading = false; this.isLoading = false;
Sentry.captureException(error); Sentry.captureException(error);
...@@ -314,7 +314,7 @@ export default { ...@@ -314,7 +314,7 @@ export default {
.then(({ data }) => { .then(({ data }) => {
redirectTo(`${this.pipelinesPath}/${data.id}`); redirectTo(`${this.pipelinesPath}/${data.id}`);
}) })
.catch(err => { .catch((err) => {
const { errors, warnings, total_warnings: totalWarnings } = err.response.data; const { errors, warnings, total_warnings: totalWarnings } = err.response.data;
const [error] = errors; const [error] = errors;
this.error = error; this.error = error;
......
...@@ -3,7 +3,7 @@ import { BRANCH_REF_TYPE, TAG_REF_TYPE } from '../constants'; ...@@ -3,7 +3,7 @@ import { BRANCH_REF_TYPE, TAG_REF_TYPE } from '../constants';
export default (refs, type) => { export default (refs, type) => {
let fullName; let fullName;
return refs.map(ref => { return refs.map((ref) => {
if (type === BRANCH_REF_TYPE) { if (type === BRANCH_REF_TYPE) {
fullName = `refs/heads/${ref}`; fullName = `refs/heads/${ref}`;
} else if (type === TAG_REF_TYPE) { } else if (type === TAG_REF_TYPE) {
......
...@@ -56,15 +56,15 @@ export default { ...@@ -56,15 +56,15 @@ export default {
const unwrappedGroups = stages const unwrappedGroups = stages
.map(({ name, groups: { nodes: groups } }) => { .map(({ name, groups: { nodes: groups } }) => {
return groups.map(group => { return groups.map((group) => {
return { category: name, ...group }; return { category: name, ...group };
}); });
}) })
.flat(2); .flat(2);
const nodes = unwrappedGroups.map(group => { const nodes = unwrappedGroups.map((group) => {
const jobs = group.jobs.nodes.map(({ name, needs }) => { const jobs = group.jobs.nodes.map(({ name, needs }) => {
return { name, needs: needs.nodes.map(need => need.name) }; return { name, needs: needs.nodes.map((need) => need.name) };
}); });
return { ...group, jobs }; return { ...group, jobs };
......
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
createClip(link) { createClip(link) {
return link return link
.append('clipPath') .append('clipPath')
.attr('id', d => { .attr('id', (d) => {
return this.createAndAssignId(d, 'clipId', 'dag-clip'); return this.createAndAssignId(d, 'clipId', 'dag-clip');
}) })
.append('path') .append('path')
...@@ -183,7 +183,7 @@ export default { ...@@ -183,7 +183,7 @@ export default {
createGradient(link) { createGradient(link) {
const gradient = link const gradient = link
.append('linearGradient') .append('linearGradient')
.attr('id', d => { .attr('id', (d) => {
return this.createAndAssignId(d, 'gradId', 'dag-grad'); return this.createAndAssignId(d, 'gradId', 'dag-grad');
}) })
.attr('gradientUnits', 'userSpaceOnUse') .attr('gradientUnits', 'userSpaceOnUse')
...@@ -251,7 +251,7 @@ export default { ...@@ -251,7 +251,7 @@ export default {
.data(linksData) .data(linksData)
.enter() .enter()
.append('g') .append('g')
.attr('id', d => { .attr('id', (d) => {
return this.createAndAssignId(d, 'uid', LINK_SELECTOR); return this.createAndAssignId(d, 'uid', LINK_SELECTOR);
}) })
.classed( .classed(
...@@ -273,10 +273,10 @@ export default { ...@@ -273,10 +273,10 @@ export default {
`${NODE_SELECTOR} gl-transition-property-stroke ${this.$options.viewOptions.hoverFadeClasses}`, `${NODE_SELECTOR} gl-transition-property-stroke ${this.$options.viewOptions.hoverFadeClasses}`,
true, true,
) )
.attr('id', d => { .attr('id', (d) => {
return this.createAndAssignId(d, 'uid', NODE_SELECTOR); return this.createAndAssignId(d, 'uid', NODE_SELECTOR);
}) })
.attr('stroke', d => { .attr('stroke', (d) => {
const color = this.color(d); const color = this.color(d);
/* eslint-disable-next-line no-param-reassign */ /* eslint-disable-next-line no-param-reassign */
d.color = color; d.color = color;
...@@ -284,10 +284,10 @@ export default { ...@@ -284,10 +284,10 @@ export default {
}) })
.attr('stroke-width', nodeWidth) .attr('stroke-width', nodeWidth)
.attr('stroke-linecap', 'round') .attr('stroke-linecap', 'round')
.attr('x1', d => Math.floor((d.x1 + d.x0) / 2)) .attr('x1', (d) => Math.floor((d.x1 + d.x0) / 2))
.attr('x2', d => Math.floor((d.x1 + d.x0) / 2)) .attr('x2', (d) => Math.floor((d.x1 + d.x0) / 2))
.attr('y1', d => d.y0 + 4) .attr('y1', (d) => d.y0 + 4)
.attr('y2', d => d.y1 - 4); .attr('y2', (d) => d.y1 - 4);
}, },
initColors() { initColors() {
......
...@@ -92,8 +92,8 @@ export const createSankey = ({ ...@@ -92,8 +92,8 @@ export const createSankey = ({
]); ]);
return ({ nodes, links }) => return ({ nodes, links }) =>
sankeyGenerator({ sankeyGenerator({
nodes: nodes.map(d => ({ ...d })), nodes: nodes.map((d) => ({ ...d })),
links: links.map(d => ({ ...d })), links: links.map((d) => ({ ...d })),
}); });
}; };
......
...@@ -13,22 +13,22 @@ export const getLiveLinksAsDict = () => { ...@@ -13,22 +13,22 @@ export const getLiveLinksAsDict = () => {
return Object.fromEntries( return Object.fromEntries(
getLiveLinks() getLiveLinks()
.data() .data()
.map(d => [d.uid, d]), .map((d) => [d.uid, d]),
); );
}; };
export const currentIsLive = (idx, collection) => export const currentIsLive = (idx, collection) =>
getCurrent(idx, collection).classed(IS_HIGHLIGHTED); getCurrent(idx, collection).classed(IS_HIGHLIGHTED);
const backgroundLinks = selection => selection.style('stroke-opacity', highlightOut); const backgroundLinks = (selection) => selection.style('stroke-opacity', highlightOut);
const backgroundNodes = selection => selection.attr('stroke', '#f2f2f2'); const backgroundNodes = (selection) => selection.attr('stroke', '#f2f2f2');
const foregroundLinks = selection => selection.style('stroke-opacity', highlightIn); const foregroundLinks = (selection) => selection.style('stroke-opacity', highlightIn);
const foregroundNodes = selection => selection.attr('stroke', d => d.color); const foregroundNodes = (selection) => selection.attr('stroke', (d) => d.color);
const renewLinks = (selection, baseOpacity) => selection.style('stroke-opacity', baseOpacity); const renewLinks = (selection, baseOpacity) => selection.style('stroke-opacity', baseOpacity);
const renewNodes = selection => selection.attr('stroke', d => d.color); const renewNodes = (selection) => selection.attr('stroke', (d) => d.color);
export const getAllLinkAncestors = node => { export const getAllLinkAncestors = (node) => {
if (node.targetLinks) { if (node.targetLinks) {
return node.targetLinks.flatMap(n => { return node.targetLinks.flatMap((n) => {
return [n, ...getAllLinkAncestors(n.source)]; return [n, ...getAllLinkAncestors(n.source)];
}); });
} }
...@@ -36,11 +36,11 @@ export const getAllLinkAncestors = node => { ...@@ -36,11 +36,11 @@ export const getAllLinkAncestors = node => {
return []; return [];
}; };
const getAllNodeAncestors = node => { const getAllNodeAncestors = (node) => {
let allNodes = []; let allNodes = [];
if (node.targetLinks) { if (node.targetLinks) {
allNodes = node.targetLinks.flatMap(n => { allNodes = node.targetLinks.flatMap((n) => {
return getAllNodeAncestors(n.source); return getAllNodeAncestors(n.source);
}); });
} }
...@@ -74,7 +74,7 @@ const highlightPath = (parentLinks, parentNodes) => { ...@@ -74,7 +74,7 @@ const highlightPath = (parentLinks, parentNodes) => {
}); });
/* highlight correct nodes */ /* highlight correct nodes */
parentNodes.forEach(id => { parentNodes.forEach((id) => {
foregroundNodes(d3.select(`#${id}`)).classed(IS_HIGHLIGHTED, true); foregroundNodes(d3.select(`#${id}`)).classed(IS_HIGHLIGHTED, true);
}); });
}; };
...@@ -86,7 +86,7 @@ const restoreNodes = () => { ...@@ -86,7 +86,7 @@ const restoreNodes = () => {
rehighlights their nodes. rehighlights their nodes.
*/ */
getLiveLinks().each(d => { getLiveLinks().each((d) => {
foregroundNodes(d3.select(`#${d.source.uid}`)).classed(IS_HIGHLIGHTED, true); foregroundNodes(d3.select(`#${d.source.uid}`)).classed(IS_HIGHLIGHTED, true);
foregroundNodes(d3.select(`#${d.target.uid}`)).classed(IS_HIGHLIGHTED, true); foregroundNodes(d3.select(`#${d.target.uid}`)).classed(IS_HIGHLIGHTED, true);
}); });
...@@ -97,7 +97,7 @@ const restorePath = (parentLinks, parentNodes, baseOpacity) => { ...@@ -97,7 +97,7 @@ const restorePath = (parentLinks, parentNodes, baseOpacity) => {
renewLinks(d3.select(`#${uid}`), baseOpacity).classed(IS_HIGHLIGHTED, false); renewLinks(d3.select(`#${uid}`), baseOpacity).classed(IS_HIGHLIGHTED, false);
}); });
parentNodes.forEach(id => { parentNodes.forEach((id) => {
d3.select(`#${id}`).classed(IS_HIGHLIGHTED, false); d3.select(`#${id}`).classed(IS_HIGHLIGHTED, false);
}); });
...@@ -112,7 +112,7 @@ const restorePath = (parentLinks, parentNodes, baseOpacity) => { ...@@ -112,7 +112,7 @@ const restorePath = (parentLinks, parentNodes, baseOpacity) => {
restoreNodes(); restoreNodes();
}; };
export const restoreLinks = baseOpacity => { export const restoreLinks = (baseOpacity) => {
/* /*
if there exist live links, reset to highlight out / pale if there exist live links, reset to highlight out / pale
otherwise, reset to base otherwise, reset to base
......
...@@ -78,11 +78,11 @@ export default { ...@@ -78,11 +78,11 @@ export default {
return ( return (
this.pipeline.triggered_by && this.pipeline.triggered_by &&
Array.isArray(this.pipeline.triggered_by) && Array.isArray(this.pipeline.triggered_by) &&
this.pipeline.triggered_by.find(el => el.isExpanded) this.pipeline.triggered_by.find((el) => el.isExpanded)
); );
}, },
expandedDownstream() { expandedDownstream() {
return this.pipeline.triggered && this.pipeline.triggered.find(el => el.isExpanded); return this.pipeline.triggered && this.pipeline.triggered.find((el) => el.isExpanded);
}, },
pipelineTypeUpstream() { pipelineTypeUpstream() {
return this.type !== this.$options.downstream && this.expandedUpstream; return this.type !== this.$options.downstream && this.expandedUpstream;
......
...@@ -9,7 +9,7 @@ const addMulti = (mainPipelineProjectPath, linkedPipeline) => { ...@@ -9,7 +9,7 @@ const addMulti = (mainPipelineProjectPath, linkedPipeline) => {
}; };
}; };
const transformId = linkedPipeline => { const transformId = (linkedPipeline) => {
return { ...linkedPipeline, id: getIdFromGraphQLId(linkedPipeline.id) }; return { ...linkedPipeline, id: getIdFromGraphQLId(linkedPipeline.id) };
}; };
...@@ -42,7 +42,7 @@ const unwrapPipelineData = (mainPipelineProjectPath, data) => { ...@@ -42,7 +42,7 @@ const unwrapPipelineData = (mainPipelineProjectPath, data) => {
}; };
const toggleQueryPollingByVisibility = (queryRef, interval = 10000) => { const toggleQueryPollingByVisibility = (queryRef, interval = 10000) => {
const stopStartQuery = query => { const stopStartQuery = (query) => {
if (!Visibility.hidden()) { if (!Visibility.hidden()) {
query.startPolling(interval); query.startPolling(interval);
} else { } else {
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
iid: this.pipelineIid, iid: this.pipelineIid,
}; };
}, },
update: data => data.project.pipeline, update: (data) => data.project.pipeline,
error() { error() {
this.reportFailure(LOAD_FAILURE); this.reportFailure(LOAD_FAILURE);
}, },
......
...@@ -33,15 +33,15 @@ import { uniqWith, isEqual } from 'lodash'; ...@@ -33,15 +33,15 @@ import { uniqWith, isEqual } from 'lodash';
10 -> value (constant) 10 -> value (constant)
*/ */
export const createNodeDict = nodes => { export const createNodeDict = (nodes) => {
return nodes.reduce((acc, node) => { return nodes.reduce((acc, node) => {
const newNode = { const newNode = {
...node, ...node,
needs: node.jobs.map(job => job.needs || []).flat(), needs: node.jobs.map((job) => job.needs || []).flat(),
}; };
if (node.size > 1) { if (node.size > 1) {
node.jobs.forEach(job => { node.jobs.forEach((job) => {
acc[job.name] = newNode; acc[job.name] = newNode;
}); });
} }
...@@ -54,13 +54,13 @@ export const createNodeDict = nodes => { ...@@ -54,13 +54,13 @@ export const createNodeDict = nodes => {
export const makeLinksFromNodes = (nodes, nodeDict) => { export const makeLinksFromNodes = (nodes, nodeDict) => {
const constantLinkValue = 10; // all links are the same weight const constantLinkValue = 10; // all links are the same weight
return nodes return nodes
.map(group => { .map((group) => {
return group.jobs.map(job => { return group.jobs.map((job) => {
if (!job.needs) { if (!job.needs) {
return []; return [];
} }
return job.needs.map(needed => { return job.needs.map((needed) => {
return { return {
source: nodeDict[needed]?.name, source: nodeDict[needed]?.name,
target: group.name, target: group.name,
...@@ -74,7 +74,7 @@ export const makeLinksFromNodes = (nodes, nodeDict) => { ...@@ -74,7 +74,7 @@ export const makeLinksFromNodes = (nodes, nodeDict) => {
export const getAllAncestors = (nodes, nodeDict) => { export const getAllAncestors = (nodes, nodeDict) => {
const needs = nodes const needs = nodes
.map(node => { .map((node) => {
return nodeDict[node].needs || ''; return nodeDict[node].needs || '';
}) })
.flat() .flat()
...@@ -102,13 +102,13 @@ export const filterByAncestors = (links, nodeDict) => ...@@ -102,13 +102,13 @@ export const filterByAncestors = (links, nodeDict) =>
*/ */
const targetNode = target; const targetNode = target;
const targetNodeNeeds = nodeDict[targetNode].needs; const targetNodeNeeds = nodeDict[targetNode].needs;
const targetNodeNeedsMinusSource = targetNodeNeeds.filter(need => need !== source); const targetNodeNeedsMinusSource = targetNodeNeeds.filter((need) => need !== source);
const allAncestors = getAllAncestors(targetNodeNeedsMinusSource, nodeDict); const allAncestors = getAllAncestors(targetNodeNeedsMinusSource, nodeDict);
return !allAncestors.includes(source); return !allAncestors.includes(source);
}); });
export const parseData = nodes => { export const parseData = (nodes) => {
const nodeDict = createNodeDict(nodes); const nodeDict = createNodeDict(nodes);
const allLinks = makeLinksFromNodes(nodes, nodeDict); const allLinks = makeLinksFromNodes(nodes, nodeDict);
const filteredLinks = filterByAncestors(allLinks, nodeDict); const filteredLinks = filterByAncestors(allLinks, nodeDict);
...@@ -121,7 +121,7 @@ export const parseData = nodes => { ...@@ -121,7 +121,7 @@ export const parseData = nodes => {
The number of nodes in the most populous generation drives the height of the graph. The number of nodes in the most populous generation drives the height of the graph.
*/ */
export const getMaxNodes = nodes => { export const getMaxNodes = (nodes) => {
const counts = nodes.reduce((acc, { layer }) => { const counts = nodes.reduce((acc, { layer }) => {
if (!acc[layer]) { if (!acc[layer]) {
acc[layer] = 0; acc[layer] = 0;
...@@ -141,6 +141,6 @@ export const getMaxNodes = nodes => { ...@@ -141,6 +141,6 @@ export const getMaxNodes = nodes => {
to find nodes that have no relations. to find nodes that have no relations.
*/ */
export const removeOrphanNodes = sankeyfiedNodes => { export const removeOrphanNodes = (sankeyfiedNodes) => {
return sankeyfiedNodes.filter(node => node.sourceLinks.length || node.targetLinks.length); return sankeyfiedNodes.filter((node) => node.sourceLinks.length || node.targetLinks.length);
}; };
...@@ -14,7 +14,7 @@ import { createUniqueLinkId } from '../../utils'; ...@@ -14,7 +14,7 @@ import { createUniqueLinkId } from '../../utils';
export const generateLinksData = ({ links }, containerID) => { export const generateLinksData = ({ links }, containerID) => {
const containerEl = document.getElementById(containerID); const containerEl = document.getElementById(containerID);
return links.map(link => { return links.map((link) => {
const path = d3.path(); const path = d3.path();
const sourceId = link.source; const sourceId = link.source;
......
...@@ -111,13 +111,13 @@ export default { ...@@ -111,13 +111,13 @@ export default {
// If you are hovering on a job, then the links we want to highlight are: // If you are hovering on a job, then the links we want to highlight are:
// All the links whose `source` and `target` are highlighted jobs. // All the links whose `source` and `target` are highlighted jobs.
if (this.hasHighlightedJob) { if (this.hasHighlightedJob) {
const filteredLinks = this.links.filter(link => { const filteredLinks = this.links.filter((link) => {
return ( return (
this.highlightedJobs.includes(link.source) && this.highlightedJobs.includes(link.target) this.highlightedJobs.includes(link.source) && this.highlightedJobs.includes(link.target)
); );
}); });
return filteredLinks.map(link => link.ref); return filteredLinks.map((link) => link.ref);
} }
return []; return [];
......
...@@ -246,7 +246,7 @@ export default { ...@@ -246,7 +246,7 @@ export default {
filterPipelines(filters) { filterPipelines(filters) {
this.resetRequestData(); this.resetRequestData();
filters.forEach(filter => { filters.forEach((filter) => {
// do not add Any for username query param, so we // do not add Any for username query param, so we
// can fetch all trigger authors // can fetch all trigger authors
if ( if (
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
computed: { computed: {
selectedTypes() { selectedTypes() {
return this.value.map(i => i.type); return this.value.map((i) => i.type);
}, },
tokens() { tokens() {
return [ return [
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
$( $(
'.js-builds-dropdown-list button, .js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item', '.js-builds-dropdown-list button, .js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item',
this.$el, this.$el,
).on('click', e => { ).on('click', (e) => {
e.stopPropagation(); e.stopPropagation();
}); });
}, },
......
...@@ -34,10 +34,10 @@ export default { ...@@ -34,10 +34,10 @@ export default {
fetchBranches(searchterm) { fetchBranches(searchterm) {
Api.branches(this.config.projectId, searchterm) Api.branches(this.config.projectId, searchterm)
.then(({ data }) => { .then(({ data }) => {
this.branches = data.map(branch => branch.name); this.branches = data.map((branch) => branch.name);
this.loading = false; this.loading = false;
}) })
.catch(err => { .catch((err) => {
createFlash(FETCH_BRANCH_ERROR_MESSAGE); createFlash(FETCH_BRANCH_ERROR_MESSAGE);
this.loading = false; this.loading = false;
throw err; throw err;
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
]; ];
}, },
findActiveStatus() { findActiveStatus() {
return this.statuses.find(status => status.value === this.value.data); return this.statuses.find((status) => status.value === this.value.data);
}, },
}, },
}; };
......
...@@ -34,10 +34,10 @@ export default { ...@@ -34,10 +34,10 @@ export default {
fetchTags(searchTerm) { fetchTags(searchTerm) {
Api.tags(this.config.projectId, searchTerm) Api.tags(this.config.projectId, searchTerm)
.then(({ data }) => { .then(({ data }) => {
this.tags = data.map(tag => tag.name); this.tags = data.map((tag) => tag.name);
this.loading = false; this.loading = false;
}) })
.catch(err => { .catch((err) => {
createFlash(FETCH_TAG_ERROR_MESSAGE); createFlash(FETCH_TAG_ERROR_MESSAGE);
this.loading = false; this.loading = false;
throw err; throw err;
......
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
return this.value.data.toLowerCase(); return this.value.data.toLowerCase();
}, },
activeUser() { activeUser() {
return this.users.find(user => { return this.users.find((user) => {
return user.username.toLowerCase() === this.currentValue; return user.username.toLowerCase() === this.currentValue;
}); });
}, },
...@@ -56,11 +56,11 @@ export default { ...@@ -56,11 +56,11 @@ export default {
methods: { methods: {
fetchProjectUsers(searchTerm) { fetchProjectUsers(searchTerm) {
Api.projectUsers(this.config.projectId, searchTerm) Api.projectUsers(this.config.projectId, searchTerm)
.then(users => { .then((users) => {
this.users = users; this.users = users;
this.loading = false; this.loading = false;
}) })
.catch(err => { .catch((err) => {
createFlash(FETCH_AUTHOR_ERROR_MESSAGE); createFlash(FETCH_AUTHOR_ERROR_MESSAGE);
this.loading = false; this.loading = false;
throw err; throw err;
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
export const unwrapArrayOfJobs = (stages = []) => { export const unwrapArrayOfJobs = (stages = []) => {
return stages return stages
.map(({ name, groups }) => { .map(({ name, groups }) => {
return groups.map(group => { return groups.map((group) => {
return { category: name, ...group }; return { category: name, ...group };
}); });
}) })
.flat(2); .flat(2);
}; };
const unwrapGroups = stages => { const unwrapGroups = (stages) => {
return stages.map(stage => { return stages.map((stage) => {
const { const {
groups: { nodes: groups }, groups: { nodes: groups },
} = stage; } = stage;
...@@ -25,21 +25,21 @@ const unwrapGroups = stages => { ...@@ -25,21 +25,21 @@ const unwrapGroups = stages => {
}; };
const unwrapNodesWithName = (jobArray, prop, field = 'name') => { const unwrapNodesWithName = (jobArray, prop, field = 'name') => {
return jobArray.map(job => { return jobArray.map((job) => {
return { ...job, [prop]: job[prop].nodes.map(item => item[field]) }; return { ...job, [prop]: job[prop].nodes.map((item) => item[field]) };
}); });
}; };
const unwrapJobWithNeeds = denodedJobArray => { const unwrapJobWithNeeds = (denodedJobArray) => {
return unwrapNodesWithName(denodedJobArray, 'needs'); return unwrapNodesWithName(denodedJobArray, 'needs');
}; };
const unwrapStagesWithNeeds = denodedStages => { const unwrapStagesWithNeeds = (denodedStages) => {
const unwrappedNestedGroups = unwrapGroups(denodedStages); const unwrappedNestedGroups = unwrapGroups(denodedStages);
const nodes = unwrappedNestedGroups.map(node => { const nodes = unwrappedNestedGroups.map((node) => {
const { groups } = node; const { groups } = node;
const groupsWithJobs = groups.map(group => { const groupsWithJobs = groups.map((group) => {
const jobs = unwrapJobWithNeeds(group.jobs.nodes); const jobs = unwrapJobWithNeeds(group.jobs.nodes);
return { ...group, jobs }; return { ...group, jobs };
}); });
......
...@@ -6,7 +6,7 @@ export default { ...@@ -6,7 +6,7 @@ export default {
getExpandedPipelines(pipeline) { getExpandedPipelines(pipeline) {
this.mediator.service this.mediator.service
.getPipeline(this.mediator.getExpandedParameters()) .getPipeline(this.mediator.getExpandedParameters())
.then(response => { .then((response) => {
this.mediator.store.toggleLoading(pipeline); this.mediator.store.toggleLoading(pipeline);
this.mediator.store.storePipeline(response.data); this.mediator.store.storePipeline(response.data);
this.mediator.poll.enable({ data: this.mediator.getExpandedParameters() }); this.mediator.poll.enable({ data: this.mediator.getExpandedParameters() });
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
// fetch new data // fetch new data
return this.service return this.service
.getPipelines(this.requestData) .getPipelines(this.requestData)
.then(response => { .then((response) => {
this.isLoading = false; this.isLoading = false;
this.successCallback(response); this.successCallback(response);
...@@ -124,8 +124,8 @@ export default { ...@@ -124,8 +124,8 @@ export default {
getPipelines() { getPipelines() {
return this.service return this.service
.getPipelines(this.requestData) .getPipelines(this.requestData)
.then(response => this.successCallback(response)) .then((response) => this.successCallback(response))
.catch(error => this.errorCallback(error)); .catch((error) => this.errorCallback(error));
}, },
setCommonData(pipelines) { setCommonData(pipelines) {
this.store.storePipelines(pipelines); this.store.storePipelines(pipelines);
......
...@@ -20,7 +20,7 @@ const SELECTORS = { ...@@ -20,7 +20,7 @@ const SELECTORS = {
PIPELINE_TESTS: '#js-pipeline-tests-detail', PIPELINE_TESTS: '#js-pipeline-tests-detail',
}; };
const createLegacyPipelinesDetailApp = mediator => { const createLegacyPipelinesDetailApp = (mediator) => {
if (!document.querySelector(SELECTORS.PIPELINE_GRAPH)) { if (!document.querySelector(SELECTORS.PIPELINE_GRAPH)) {
return; return;
} }
...@@ -47,15 +47,15 @@ const createLegacyPipelinesDetailApp = mediator => { ...@@ -47,15 +47,15 @@ const createLegacyPipelinesDetailApp = mediator => {
refreshPipelineGraph: this.requestRefreshPipelineGraph, refreshPipelineGraph: this.requestRefreshPipelineGraph,
onResetDownstream: (parentPipeline, pipeline) => onResetDownstream: (parentPipeline, pipeline) =>
this.resetDownstreamPipelines(parentPipeline, pipeline), this.resetDownstreamPipelines(parentPipeline, pipeline),
onClickUpstreamPipeline: pipeline => this.clickUpstreamPipeline(pipeline), onClickUpstreamPipeline: (pipeline) => this.clickUpstreamPipeline(pipeline),
onClickDownstreamPipeline: pipeline => this.clickDownstreamPipeline(pipeline), onClickDownstreamPipeline: (pipeline) => this.clickDownstreamPipeline(pipeline),
}, },
}); });
}, },
}); });
}; };
const createLegacyPipelineHeaderApp = mediator => { const createLegacyPipelineHeaderApp = (mediator) => {
if (!document.querySelector(SELECTORS.PIPELINE_HEADER)) { if (!document.querySelector(SELECTORS.PIPELINE_HEADER)) {
return; return;
} }
......
...@@ -9,7 +9,7 @@ const apolloProvider = new VueApollo({ ...@@ -9,7 +9,7 @@ const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(), defaultClient: createDefaultClient(),
}); });
export const createPipelineHeaderApp = elSelector => { export const createPipelineHeaderApp = (elSelector) => {
const el = document.querySelector(elSelector); const el = document.querySelector(elSelector);
if (!el) { if (!el) {
......
...@@ -55,7 +55,7 @@ export default class pipelinesMediator { ...@@ -55,7 +55,7 @@ export default class pipelinesMediator {
return this.service return this.service
.getPipeline() .getPipeline()
.then(response => this.successCallback(response)) .then((response) => this.successCallback(response))
.catch(() => this.errorCallback()) .catch(() => this.errorCallback())
.finally(() => .finally(() =>
this.poll.restart( this.poll.restart(
......
...@@ -29,11 +29,11 @@ export default class PipelineStore { ...@@ -29,11 +29,11 @@ export default class PipelineStore {
} }
if (pipelineCopy.triggered && pipelineCopy.triggered.length) { if (pipelineCopy.triggered && pipelineCopy.triggered.length) {
pipelineCopy.triggered.forEach(el => { pipelineCopy.triggered.forEach((el) => {
const oldPipeline = const oldPipeline =
this.state.pipeline && this.state.pipeline &&
this.state.pipeline.triggered && this.state.pipeline.triggered &&
this.state.pipeline.triggered.find(element => element.id === el.id); this.state.pipeline.triggered.find((element) => element.id === el.id);
this.parseTriggeredPipelines(oldPipeline, el); this.parseTriggeredPipelines(oldPipeline, el);
}); });
...@@ -67,8 +67,8 @@ export default class PipelineStore { ...@@ -67,8 +67,8 @@ export default class PipelineStore {
} }
if (newPipeline.triggered_by?.length > 0) { if (newPipeline.triggered_by?.length > 0) {
newPipeline.triggered_by.forEach(el => { newPipeline.triggered_by.forEach((el) => {
const oldTriggeredBy = oldPipeline.triggered_by?.find(element => element.id === el.id); const oldTriggeredBy = oldPipeline.triggered_by?.find((element) => element.id === el.id);
this.parseTriggeredPipelines(oldTriggeredBy, el); this.parseTriggeredPipelines(oldTriggeredBy, el);
}); });
} }
...@@ -88,9 +88,9 @@ export default class PipelineStore { ...@@ -88,9 +88,9 @@ export default class PipelineStore {
Vue.set(newPipeline, 'isLoading', false); Vue.set(newPipeline, 'isLoading', false);
if (newPipeline.triggered && newPipeline.triggered.length > 0) { if (newPipeline.triggered && newPipeline.triggered.length > 0) {
newPipeline.triggered.forEach(el => { newPipeline.triggered.forEach((el) => {
const oldTriggered = const oldTriggered =
oldPipeline.triggered && oldPipeline.triggered.find(element => element.id === el.id); oldPipeline.triggered && oldPipeline.triggered.find((element) => element.id === el.id);
this.parseTriggeredPipelines(oldTriggered, el); this.parseTriggeredPipelines(oldTriggered, el);
}); });
} }
...@@ -102,7 +102,7 @@ export default class PipelineStore { ...@@ -102,7 +102,7 @@ export default class PipelineStore {
* @param {Object} pipeline * @param {Object} pipeline
*/ */
resetTriggeredByPipeline(parentPipeline, pipeline) { resetTriggeredByPipeline(parentPipeline, pipeline) {
parentPipeline.triggered_by.forEach(el => this.closePipeline(el)); parentPipeline.triggered_by.forEach((el) => this.closePipeline(el));
if (pipeline.triggered_by && pipeline.triggered_by) { if (pipeline.triggered_by && pipeline.triggered_by) {
this.resetTriggeredByPipeline(pipeline, pipeline.triggered_by); this.resetTriggeredByPipeline(pipeline, pipeline.triggered_by);
...@@ -129,7 +129,7 @@ export default class PipelineStore { ...@@ -129,7 +129,7 @@ export default class PipelineStore {
this.closePipeline(pipeline); this.closePipeline(pipeline);
if (pipeline.triggered_by && pipeline.triggered_by.length) { if (pipeline.triggered_by && pipeline.triggered_by.length) {
pipeline.triggered_by.forEach(triggeredBy => this.closeTriggeredByPipeline(triggeredBy)); pipeline.triggered_by.forEach((triggeredBy) => this.closeTriggeredByPipeline(triggeredBy));
} }
} }
...@@ -139,10 +139,10 @@ export default class PipelineStore { ...@@ -139,10 +139,10 @@ export default class PipelineStore {
* @param {Object} pipeline * @param {Object} pipeline
*/ */
resetTriggeredPipelines(parentPipeline, pipeline) { resetTriggeredPipelines(parentPipeline, pipeline) {
parentPipeline.triggered.forEach(el => this.closePipeline(el)); parentPipeline.triggered.forEach((el) => this.closePipeline(el));
if (pipeline.triggered && pipeline.triggered.length) { if (pipeline.triggered && pipeline.triggered.length) {
pipeline.triggered.forEach(el => this.resetTriggeredPipelines(pipeline, el)); pipeline.triggered.forEach((el) => this.resetTriggeredPipelines(pipeline, el));
} }
} }
...@@ -165,7 +165,7 @@ export default class PipelineStore { ...@@ -165,7 +165,7 @@ export default class PipelineStore {
this.closePipeline(pipeline); this.closePipeline(pipeline);
if (pipeline.triggered && pipeline.triggered.length) { if (pipeline.triggered && pipeline.triggered.length) {
pipeline.triggered.forEach(triggered => this.closeTriggeredPipeline(triggered)); pipeline.triggered.forEach((triggered) => this.closeTriggeredPipeline(triggered));
} }
} }
...@@ -199,7 +199,7 @@ export default class PipelineStore { ...@@ -199,7 +199,7 @@ export default class PipelineStore {
removeExpandedPipelineToRequestData(id) { removeExpandedPipelineToRequestData(id) {
this.state.expandedPipelines.splice( this.state.expandedPipelines.splice(
this.state.expandedPipelines.findIndex(el => el === id), this.state.expandedPipelines.findIndex((el) => el === id),
1, 1,
); );
} }
......
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