Commit a536349d authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 42 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 6f0bd2d8
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
projectPath: this.projectFullPath, projectPath: this.projectFullPath,
title: issuableTitle, title: issuableTitle,
description: issuableDescription, description: issuableDescription,
labelIds: selectedLabels.map(label => label.id), labelIds: selectedLabels.map((label) => label.id),
}, },
}, },
}) })
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
} }
redirectTo(this.projectTestCasesPath); redirectTo(this.projectTestCasesPath);
}) })
.catch(error => { .catch((error) => {
createFlash({ createFlash({
message: s__('TestCases|Something went wrong while creating a test case.'), message: s__('TestCases|Something went wrong while creating a test case.'),
captureError: true, captureError: true,
......
...@@ -24,6 +24,6 @@ export function initTestCaseCreate({ mountPointSelector }) { ...@@ -24,6 +24,6 @@ export function initTestCaseCreate({ mountPointSelector }) {
provide: { provide: {
...mountPointEl.dataset, ...mountPointEl.dataset,
}, },
render: createElement => createElement(TestCaseCreateApp), render: (createElement) => createElement(TestCaseCreateApp),
}); });
} }
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
if (labelName?.length) { if (labelName?.length) {
filteredSearchValue.push( filteredSearchValue.push(
...labelName.map(label => ({ ...labelName.map((label) => ({
type: 'label_name', type: 'label_name',
value: { data: label }, value: { data: label },
})), })),
...@@ -290,7 +290,7 @@ export default { ...@@ -290,7 +290,7 @@ export default {
const labels = []; const labels = [];
const plainText = []; const plainText = [];
filters.forEach(filter => { filters.forEach((filter) => {
switch (filter.type) { switch (filter.type) {
case 'author_username': case 'author_username':
filterParams.authorUsername = filter.value.data; filterParams.authorUsername = filter.value.data;
......
...@@ -52,7 +52,7 @@ const initTestCaseList = ({ mountPointSelector }) => { ...@@ -52,7 +52,7 @@ const initTestCaseList = ({ mountPointSelector }) => {
initialState, initialState,
initialSortBy, initialSortBy,
}, },
render: createElement => render: (createElement) =>
createElement(TestCaseListApp, { createElement(TestCaseListApp, {
props: { props: {
initialFilterParams, initialFilterParams,
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
return todos.length ? todos[0] : null; return todos.length ? todos[0] : null;
}, },
selectedLabels() { selectedLabels() {
return this.testCase.labels.nodes.map(label => ({ return this.testCase.labels.nodes.map((label) => ({
...label, ...label,
id: getIdFromGraphQLId(label.id), id: getIdFromGraphQLId(label.id),
})); }));
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
}, },
errorMessage: s__('TestCases|Something went wrong while updating the test case.'), errorMessage: s__('TestCases|Something went wrong while updating the test case.'),
}) })
.then(updatedTestCase => { .then((updatedTestCase) => {
this.testCase = updatedTestCase; this.testCase = updatedTestCase;
}) })
.finally(() => { .finally(() => {
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
}, },
errorMessage: s__('TestCases|Something went wrong while updating the test case.'), errorMessage: s__('TestCases|Something went wrong while updating the test case.'),
}) })
.then(updatedTestCase => { .then((updatedTestCase) => {
this.testCase = updatedTestCase; this.testCase = updatedTestCase;
this.editTestCaseFormVisible = false; this.editTestCaseFormVisible = false;
IssuableEventHub.$emit('update.issuable'); IssuableEventHub.$emit('update.issuable');
......
...@@ -130,9 +130,9 @@ export default { ...@@ -130,9 +130,9 @@ export default {
// either selected or removed aren't leading to same selection // either selected or removed aren't leading to same selection
// as current one, as then we don't want to make network call // as current one, as then we don't want to make network call
// since nothing has changed. // since nothing has changed.
const anyLabelUpdated = labels.some(label => { const anyLabelUpdated = labels.some((label) => {
// Find this label in existing selection. // Find this label in existing selection.
const existingLabel = this.selectedLabels.find(l => l.id === label.id); const existingLabel = this.selectedLabels.find((l) => l.id === label.id);
// Check either of the two following conditions; // Check either of the two following conditions;
// 1. A label that's not currently applied is being applied. // 1. A label that's not currently applied is being applied.
...@@ -146,12 +146,12 @@ export default { ...@@ -146,12 +146,12 @@ export default {
return this.updateTestCase({ return this.updateTestCase({
variables: { variables: {
addLabelIds: labels.filter(label => label.set).map(label => label.id), addLabelIds: labels.filter((label) => label.set).map((label) => label.id),
removeLabelIds: labels.filter(label => !label.set).map(label => label.id), removeLabelIds: labels.filter((label) => !label.set).map((label) => label.id),
}, },
errorMessage: s__('TestCases|Something went wrong while updating the test case labels.'), errorMessage: s__('TestCases|Something went wrong while updating the test case labels.'),
}) })
.then(updatedTestCase => { .then((updatedTestCase) => {
this.$emit('test-case-updated', updatedTestCase); this.$emit('test-case-updated', updatedTestCase);
}) })
.finally(() => { .finally(() => {
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
} }
return data.updateIssue?.issue; return data.updateIssue?.issue;
}) })
.catch(error => { .catch((error) => {
createFlash({ createFlash({
message: errorMessage, message: errorMessage,
captureError: true, captureError: true,
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
.then(() => { .then(() => {
this.$apollo.queries.testCase.refetch(); this.$apollo.queries.testCase.refetch();
}) })
.catch(error => { .catch((error) => {
createFlash({ createFlash({
message: s__('TestCases|Something went wrong while adding test case to Todo.'), message: s__('TestCases|Something went wrong while adding test case to Todo.'),
captureError: true, captureError: true,
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
} }
this.$apollo.queries.testCase.refetch(); this.$apollo.queries.testCase.refetch();
}) })
.catch(error => { .catch((error) => {
createFlash({ createFlash({
message: s__('TestCases|Something went wrong while marking test case todo as done.'), message: s__('TestCases|Something went wrong while marking test case todo as done.'),
captureError: true, captureError: true,
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
} }
visitUrl(data.issueMove?.issue.webUrl); visitUrl(data.issueMove?.issue.webUrl);
}) })
.catch(error => { .catch((error) => {
this.testCaseMoveInProgress = false; this.testCaseMoveInProgress = false;
createFlash({ createFlash({
message: s__('TestCases|Something went wrong while moving test case.'), message: s__('TestCases|Something went wrong while moving test case.'),
......
...@@ -29,6 +29,6 @@ export default function initTestCaseShow({ mountPointSelector }) { ...@@ -29,6 +29,6 @@ export default function initTestCaseShow({ mountPointSelector }) {
projectsFetchPath: sidebarOptions.projectsAutocompleteEndpoint, projectsFetchPath: sidebarOptions.projectsAutocompleteEndpoint,
canEditTestCase: parseBoolean(el.dataset.canEditTestCase), canEditTestCase: parseBoolean(el.dataset.canEditTestCase),
}, },
render: createElement => createElement(TestCaseShowApp), render: (createElement) => createElement(TestCaseShowApp),
}); });
} }
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
this.$apollo.queries.alerts.fetchMore({ this.$apollo.queries.alerts.fetchMore({
variables: { nextPageCursor: this.pageInfo.endCursor }, variables: { nextPageCursor: this.pageInfo.endCursor },
updateQuery: (previousResult, { fetchMoreResult }) => { updateQuery: (previousResult, { fetchMoreResult }) => {
const results = produce(fetchMoreResult, draftData => { const results = produce(fetchMoreResult, (draftData) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
draftData.project.alertManagementAlerts.nodes = [ draftData.project.alertManagementAlerts.nodes = [
...previousResult.project.alertManagementAlerts.nodes, ...previousResult.project.alertManagementAlerts.nodes,
......
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
selectedPolicy() { selectedPolicy() {
if (!this.hasSelectedPolicy) return null; if (!this.hasSelectedPolicy) return null;
return this.policiesWithDefaults.find(policy => policy.name === this.selectedPolicyName); return this.policiesWithDefaults.find((policy) => policy.name === this.selectedPolicyName);
}, },
hasPolicyChanges() { hasPolicyChanges() {
if (!this.hasSelectedPolicy) return false; if (!this.hasSelectedPolicy) return false;
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
); );
}, },
hasAutoDevopsPolicy() { hasAutoDevopsPolicy() {
return this.policiesWithDefaults.some(policy => policy.isAutodevops); return this.policiesWithDefaults.some((policy) => policy.isAutodevops);
}, },
hasCiliumSelectedPolicy() { hasCiliumSelectedPolicy() {
return this.hasSelectedPolicy return this.hasSelectedPolicy
......
...@@ -27,7 +27,7 @@ function ruleTypeEndpointFunc(items) { ...@@ -27,7 +27,7 @@ function ruleTypeEndpointFunc(items) {
const labels = items const labels = items
.reduce( .reduce(
(acc, { matchLabels }) => (acc, { matchLabels }) =>
acc.concat(Object.keys(matchLabels).map(key => `${key}:${matchLabels[key]}`)), acc.concat(Object.keys(matchLabels).map((key) => `${key}:${matchLabels[key]}`)),
[], [],
) )
.join(' '); .join(' ');
...@@ -125,10 +125,10 @@ export default function fromYaml(manifest) { ...@@ -125,10 +125,10 @@ export default function fromYaml(manifest) {
const rules = [] const rules = []
.concat( .concat(
ingress.map(item => parseRule(item, RuleDirectionInbound)), ingress.map((item) => parseRule(item, RuleDirectionInbound)),
egress.map(item => parseRule(item, RuleDirectionOutbound)), egress.map((item) => parseRule(item, RuleDirectionOutbound)),
) )
.filter(rule => Boolean(rule)); .filter((rule) => Boolean(rule));
return { return {
name, name,
......
...@@ -37,7 +37,7 @@ function humanizeNetworkPolicyRulePorts(rule) { ...@@ -37,7 +37,7 @@ function humanizeNetworkPolicyRulePorts(rule) {
function humanizeNetworkPolicyRuleEndpoint({ matchLabels }) { function humanizeNetworkPolicyRuleEndpoint({ matchLabels }) {
const matchSelector = labelSelector(matchLabels); const matchSelector = labelSelector(matchLabels);
const labels = Object.keys(matchSelector) const labels = Object.keys(matchSelector)
.map(key => `${key}: ${matchSelector[key]}`) .map((key) => `${key}: ${matchSelector[key]}`)
.join(', '); .join(', ');
return labels.length === 0 return labels.length === 0
? sprintf(s__('NetworkPolicies|%{strongOpen}all%{strongClose} pods'), strongArgs, false) ? sprintf(s__('NetworkPolicies|%{strongOpen}all%{strongClose} pods'), strongArgs, false)
...@@ -104,7 +104,7 @@ function humanizeEndpointSelector({ endpointMatchMode, endpointLabels }) { ...@@ -104,7 +104,7 @@ function humanizeEndpointSelector({ endpointMatchMode, endpointLabels }) {
const selector = labelSelector(endpointLabels); const selector = labelSelector(endpointLabels);
const pods = Object.keys(selector) const pods = Object.keys(selector)
.map(key => `${key}: ${selector[key]}`) .map((key) => `${key}: ${selector[key]}`)
.join(', '); .join(', ');
return sprintf( return sprintf(
s__('NetworkPolicies|pods %{pods}'), s__('NetworkPolicies|pods %{pods}'),
...@@ -124,7 +124,7 @@ export default function humanizeNetworkPolicy(policy) { ...@@ -124,7 +124,7 @@ export default function humanizeNetworkPolicy(policy) {
const selector = humanizeEndpointSelector(policy); const selector = humanizeEndpointSelector(policy);
const humanizedRules = rules.map(rule => { const humanizedRules = rules.map((rule) => {
const { direction } = rule; const { direction } = rule;
const template = const template =
direction === RuleDirectionInbound direction === RuleDirectionInbound
......
...@@ -67,7 +67,7 @@ function ruleFQDNSpec({ direction, fqdn }) { ...@@ -67,7 +67,7 @@ function ruleFQDNSpec({ direction, fqdn }) {
if (fqdnList.length === 0) return {}; if (fqdnList.length === 0) return {};
return { return {
toFQDNs: fqdnList.map(item => ({ matchName: item })), toFQDNs: fqdnList.map((item) => ({ matchName: item })),
}; };
} }
......
...@@ -12,7 +12,7 @@ function spec({ rules, isEnabled, endpointMatchMode, endpointLabels }) { ...@@ -12,7 +12,7 @@ function spec({ rules, isEnabled, endpointMatchMode, endpointLabels }) {
const policySpec = {}; const policySpec = {};
policySpec.endpointSelector = Object.keys(matchLabels).length > 0 ? { matchLabels } : {}; policySpec.endpointSelector = Object.keys(matchLabels).length > 0 ? { matchLabels } : {};
rules.forEach(rule => { rules.forEach((rule) => {
const { direction } = rule; const { direction } = rule;
if (!policySpec[direction]) policySpec[direction] = []; if (!policySpec[direction]) policySpec[direction] = [];
......
...@@ -36,5 +36,5 @@ export function portSelectors({ portMatchMode, ports }) { ...@@ -36,5 +36,5 @@ export function portSelectors({ portMatchMode, ports }) {
Expects items in format "0.0.0.0/24 1.1.1.1/32" Expects items in format "0.0.0.0/24 1.1.1.1/32"
*/ */
export function splitItems(items) { export function splitItems(items) {
return items.split(/\s/).filter(item => item.length > 0); return items.split(/\s/).filter((item) => item.length > 0);
} }
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
const { value } = this; const { value } = this;
let entitiesList = []; let entitiesList = [];
if (value.includes(entity)) { if (value.includes(entity)) {
entitiesList = value.filter(e => e !== entity); entitiesList = value.filter((e) => e !== entity);
} else { } else {
entitiesList = [...value, entity]; entitiesList = [...value, entity];
} }
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
return value.includes(entity); return value.includes(entity);
}, },
}, },
entities: Object.keys(EntityTypes).map(type => ({ entities: Object.keys(EntityTypes).map((type) => ({
value: EntityTypes[type], value: EntityTypes[type],
text: EntityTypes[type], text: EntityTypes[type],
})), })),
......
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
name: TIME, name: TIME,
type: 'time', type: 'time',
axisLabel: { axisLabel: {
formatter: value => dateFormat(value, DATE_FORMATS.defaultDate), formatter: (value) => dateFormat(value, DATE_FORMATS.defaultDate),
}, },
min: from, min: from,
max: to, max: to,
......
...@@ -11,11 +11,11 @@ export default () => ...@@ -11,11 +11,11 @@ export default () =>
new Vuex.Store({ new Vuex.Store({
modules: { modules: {
threatMonitoring: threatMonitoring(), threatMonitoring: threatMonitoring(),
threatMonitoringWaf: threatMonitoringStatistics(payload => { threatMonitoringWaf: threatMonitoringStatistics((payload) => {
const { totalTraffic, anomalousTraffic, history } = convertObjectPropsToCamelCase(payload); const { totalTraffic, anomalousTraffic, history } = convertObjectPropsToCamelCase(payload);
return { total: totalTraffic, anomalous: anomalousTraffic, history }; return { total: totalTraffic, anomalous: anomalousTraffic, history };
}), }),
threatMonitoringNetworkPolicy: threatMonitoringStatistics(payload => { threatMonitoringNetworkPolicy: threatMonitoringStatistics((payload) => {
const { const {
opsRate, opsRate,
opsTotal: { total, drops }, opsTotal: { total, drops },
......
...@@ -59,7 +59,7 @@ export const createPolicy = ({ state, commit }, { environmentId, policy }) => { ...@@ -59,7 +59,7 @@ export const createPolicy = ({ state, commit }, { environmentId, policy }) => {
FLASH_TYPES.SUCCESS, FLASH_TYPES.SUCCESS,
); );
}) })
.catch(error => .catch((error) =>
commitPolicyError(commit, types.RECEIVE_CREATE_POLICY_ERROR, error?.response?.data), commitPolicyError(commit, types.RECEIVE_CREATE_POLICY_ERROR, error?.response?.data),
); );
}; };
...@@ -89,7 +89,7 @@ export const updatePolicy = ({ state, commit }, { environmentId, policy }) => { ...@@ -89,7 +89,7 @@ export const updatePolicy = ({ state, commit }, { environmentId, policy }) => {
FLASH_TYPES.SUCCESS, FLASH_TYPES.SUCCESS,
); );
}) })
.catch(error => .catch((error) =>
commitPolicyError(commit, types.RECEIVE_UPDATE_POLICY_ERROR, error?.response?.data), commitPolicyError(commit, types.RECEIVE_UPDATE_POLICY_ERROR, error?.response?.data),
); );
}; };
...@@ -113,7 +113,7 @@ export const deletePolicy = ({ state, commit }, { environmentId, policy }) => { ...@@ -113,7 +113,7 @@ export const deletePolicy = ({ state, commit }, { environmentId, policy }) => {
policy, policy,
}); });
}) })
.catch(error => .catch((error) =>
commitPolicyError(commit, types.RECEIVE_DELETE_POLICY_ERROR, error?.response?.data), commitPolicyError(commit, types.RECEIVE_DELETE_POLICY_ERROR, error?.response?.data),
); );
}; };
...@@ -6,7 +6,7 @@ export const policiesWithDefaults = ({ policies }) => { ...@@ -6,7 +6,7 @@ export const policiesWithDefaults = ({ policies }) => {
// filter out enabled predefined policies and only append the ones // filter out enabled predefined policies and only append the ones
// that are not present in a cluster. // that are not present in a cluster.
const predefined = PREDEFINED_NETWORK_POLICIES.filter( const predefined = PREDEFINED_NETWORK_POLICIES.filter(
({ name }) => !policies.some(policy => name === policy.name), ({ name }) => !policies.some((policy) => name === policy.name),
); );
return [...policies, ...predefined]; return [...policies, ...predefined];
}; };
...@@ -2,7 +2,7 @@ import * as types from './mutation_types'; ...@@ -2,7 +2,7 @@ import * as types from './mutation_types';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
const setPolicies = (state, policies) => { const setPolicies = (state, policies) => {
state.policies = policies.map(policy => convertObjectPropsToCamelCase(policy)); state.policies = policies.map((policy) => convertObjectPropsToCamelCase(policy));
}; };
export default { export default {
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
}, },
[types.RECEIVE_UPDATE_POLICY_SUCCESS](state, { policy, updatedPolicy }) { [types.RECEIVE_UPDATE_POLICY_SUCCESS](state, { policy, updatedPolicy }) {
const newPolicy = convertObjectPropsToCamelCase(updatedPolicy); const newPolicy = convertObjectPropsToCamelCase(updatedPolicy);
state.policies = state.policies.map(pol => (pol.name === policy.name ? newPolicy : pol)); state.policies = state.policies.map((pol) => (pol.name === policy.name ? newPolicy : pol));
state.isUpdatingPolicy = false; state.isUpdatingPolicy = false;
state.errorUpdatingPolicy = false; state.errorUpdatingPolicy = false;
}, },
......
...@@ -35,7 +35,7 @@ const getAllEnvironments = (url, page = 1) => ...@@ -35,7 +35,7 @@ const getAllEnvironments = (url, page = 1) =>
const nextPage = headers && headers['x-next-page']; const nextPage = headers && headers['x-next-page'];
return nextPage return nextPage
? // eslint-disable-next-line promise/no-nesting ? // eslint-disable-next-line promise/no-nesting
getAllEnvironments(url, nextPage).then(environments => [ getAllEnvironments(url, nextPage).then((environments) => [
...data.environments, ...data.environments,
...environments, ...environments,
]) ])
...@@ -50,7 +50,7 @@ export const fetchEnvironments = ({ state, dispatch }) => { ...@@ -50,7 +50,7 @@ export const fetchEnvironments = ({ state, dispatch }) => {
dispatch('requestEnvironments'); dispatch('requestEnvironments');
return getAllEnvironments(state.environmentsEndpoint) return getAllEnvironments(state.environmentsEndpoint)
.then(environments => dispatch('receiveEnvironmentsSuccess', environments)) .then((environments) => dispatch('receiveEnvironmentsSuccess', environments))
.catch(() => dispatch('receiveEnvironmentsError')); .catch(() => dispatch('receiveEnvironmentsError'));
}; };
......
...@@ -33,7 +33,7 @@ export const fetchStatistics = ({ state, dispatch, rootState }) => { ...@@ -33,7 +33,7 @@ export const fetchStatistics = ({ state, dispatch, rootState }) => {
}, },
}) })
.then(({ data }) => dispatch('receiveStatisticsSuccess', data)) .then(({ data }) => dispatch('receiveStatisticsSuccess', data))
.catch(error => { .catch((error) => {
// A NOT_FOUND response from the endpoint means that there is no data for // A NOT_FOUND response from the endpoint means that there is no data for
// the given parameters. There are various reasons *why* there could be // the given parameters. There are various reasons *why* there could be
// no data, but we can't distinguish between them, yet. So, just render // no data, but we can't distinguish between them, yet. So, just render
......
...@@ -3,7 +3,7 @@ import * as getters from './getters'; ...@@ -3,7 +3,7 @@ import * as getters from './getters';
import mutations from './mutations'; import mutations from './mutations';
import state from './state'; import state from './state';
export default transformFunc => ({ export default (transformFunc) => ({
namespaced: true, namespaced: true,
actions, actions,
getters, getters,
......
import * as types from './mutation_types'; import * as types from './mutation_types';
import createState from './state'; import createState from './state';
export default transformFunc => ({ export default (transformFunc) => ({
[types.SET_ENDPOINT](state, endpoint) { [types.SET_ENDPOINT](state, endpoint) {
state.statisticsEndpoint = endpoint; state.statisticsEndpoint = endpoint;
}, },
......
import { pick } from 'lodash'; import { pick } from 'lodash';
import { getTimeWindow, defaultTimeRange } from '~/vue_shared/constants'; import { getTimeWindow, defaultTimeRange } from '~/vue_shared/constants';
export const getTimeWindowConfig = timeWindow => { export const getTimeWindowConfig = (timeWindow) => {
const timeWindowObj = pick(getTimeWindow(timeWindow) || defaultTimeRange, 'duration', 'interval'); const timeWindowObj = pick(getTimeWindow(timeWindow) || defaultTimeRange, 'duration', 'interval');
return { return {
durationInMilliseconds: timeWindowObj.duration.seconds * 1000, durationInMilliseconds: timeWindowObj.duration.seconds * 1000,
......
import ipaddr from 'ipaddr.js'; import ipaddr from 'ipaddr.js';
export default address => { export default (address) => {
// Reject IP addresses that are only integers to match Ruby IPAddr // Reject IP addresses that are only integers to match Ruby IPAddr
// https://github.com/whitequark/ipaddr.js/issues/7#issuecomment-158545695 // https://github.com/whitequark/ipaddr.js/issues/7#issuecomment-158545695
if (/^\d+$/.exec(address)) { if (/^\d+$/.exec(address)) {
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
return this.mr.approvals || {}; return this.mr.approvals || {};
}, },
approvedBy() { approvedBy() {
return this.approvals.approved_by ? this.approvals.approved_by.map(x => x.user) : []; return this.approvals.approved_by ? this.approvals.approved_by.map((x) => x.user) : [];
}, },
approvalsRequired() { approvalsRequired() {
return (!this.isBasic && this.approvals.approvals_required) || 0; return (!this.isBasic && this.approvals.approvals_required) || 0;
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
this.isLoadingRules = true; this.isLoadingRules = true;
return this.service.fetchApprovalSettings().then(settings => { return this.service.fetchApprovalSettings().then((settings) => {
this.mr.setApprovalRules(settings); this.mr.setApprovalRules(settings);
this.isLoadingRules = false; this.isLoadingRules = false;
}); });
......
...@@ -38,20 +38,20 @@ export default { ...@@ -38,20 +38,20 @@ export default {
{ {
id: uniqueId(), id: uniqueId(),
title: '', title: '',
rules: this.approvalRules.filter(rule => rule.rule_type !== RULE_TYPE_CODE_OWNER), rules: this.approvalRules.filter((rule) => rule.rule_type !== RULE_TYPE_CODE_OWNER),
}, },
{ {
id: uniqueId(), id: uniqueId(),
title: __('Code Owners'), title: __('Code Owners'),
rules: orderBy( rules: orderBy(
this.approvalRules this.approvalRules
.filter(rule => rule.rule_type === RULE_TYPE_CODE_OWNER) .filter((rule) => rule.rule_type === RULE_TYPE_CODE_OWNER)
.map(rule => ({ ...rule, nameClass: 'gl-font-monospace gl-word-break-all' })), .map((rule) => ({ ...rule, nameClass: 'gl-font-monospace gl-word-break-all' })),
[o => o.section === 'codeowners', 'name', 'section'], [(o) => o.section === 'codeowners', 'name', 'section'],
['desc', 'asc', 'asc'], ['desc', 'asc', 'asc'],
), ),
}, },
].filter(x => x.rules.length); ].filter((x) => x.rules.length);
}, },
}, },
methods: { methods: {
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
unmergedBlockingMergeRequests() { unmergedBlockingMergeRequests() {
return Object.keys(this.visibleMergeRequests) return Object.keys(this.visibleMergeRequests)
.filter(state => state !== 'merged') .filter((state) => state !== 'merged')
.reduce( .reduce(
(unmergedBlockingMRs, state) => (unmergedBlockingMRs, state) =>
state === 'closed' state === 'closed'
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
/* eslint-enable no-useless-escape */ /* eslint-enable no-useless-escape */
}, },
filteredChanges() { filteredChanges() {
return this.changes.filter(change => change.path.includes(this.changesSearchTerm)); return this.changes.filter((change) => change.path.includes(this.changesSearchTerm));
}, },
instructionText() { instructionText() {
return { return {
......
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