Commit a4c662da authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 27 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 9aa1f620
...@@ -68,7 +68,7 @@ export const fetchReleasesGraphQl = ( ...@@ -68,7 +68,7 @@ export const fetchReleasesGraphQl = (
...paginationParams, ...paginationParams,
}, },
}) })
.then(response => { .then((response) => {
const { data, paginationInfo: graphQlPageInfo } = convertAllReleasesGraphQLResponse(response); const { data, paginationInfo: graphQlPageInfo } = convertAllReleasesGraphQLResponse(response);
commit(types.RECEIVE_RELEASES_SUCCESS, { commit(types.RECEIVE_RELEASES_SUCCESS, {
......
...@@ -2,7 +2,7 @@ import createState from './state'; ...@@ -2,7 +2,7 @@ import createState from './state';
import * as actions from './actions'; import * as actions from './actions';
import mutations from './mutations'; import mutations from './mutations';
export default initialState => ({ export default (initialState) => ({
namespaced: true, namespaced: true,
actions, actions,
mutations, mutations,
......
...@@ -17,7 +17,7 @@ export const releaseToApiJson = (release, createFrom = null) => { ...@@ -17,7 +17,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
// Milestones may be either a list of milestone objects OR just a list // Milestones may be either a list of milestone objects OR just a list
// of milestone titles. The API requires only the titles be sent. // of milestone titles. The API requires only the titles be sent.
const milestones = (release.milestones || []).map(m => m.title || m); const milestones = (release.milestones || []).map((m) => m.title || m);
return convertObjectPropsToSnakeCase( return convertObjectPropsToSnakeCase(
{ {
...@@ -37,7 +37,7 @@ export const releaseToApiJson = (release, createFrom = null) => { ...@@ -37,7 +37,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
* into the structure this Vue application can work with. * into the structure this Vue application can work with.
* @param {Object} json The JSON object received from the release API * @param {Object} json The JSON object received from the release API
*/ */
export const apiJsonToRelease = json => { export const apiJsonToRelease = (json) => {
const release = convertObjectPropsToCamelCase(json, { deep: true }); const release = convertObjectPropsToCamelCase(json, { deep: true });
release.milestones = release.milestones || []; release.milestones = release.milestones || [];
...@@ -47,7 +47,7 @@ export const apiJsonToRelease = json => { ...@@ -47,7 +47,7 @@ export const apiJsonToRelease = json => {
export const gqClient = createGqClient({}, { fetchPolicy: fetchPolicies.NO_CACHE }); export const gqClient = createGqClient({}, { fetchPolicy: fetchPolicies.NO_CACHE });
const convertScalarProperties = graphQLRelease => const convertScalarProperties = (graphQLRelease) =>
pick(graphQLRelease, [ pick(graphQLRelease, [
'name', 'name',
'tagName', 'tagName',
...@@ -57,29 +57,29 @@ const convertScalarProperties = graphQLRelease => ...@@ -57,29 +57,29 @@ const convertScalarProperties = graphQLRelease =>
'upcomingRelease', 'upcomingRelease',
]); ]);
const convertAssets = graphQLRelease => ({ const convertAssets = (graphQLRelease) => ({
assets: { assets: {
count: graphQLRelease.assets.count, count: graphQLRelease.assets.count,
sources: [...graphQLRelease.assets.sources.nodes], sources: [...graphQLRelease.assets.sources.nodes],
links: graphQLRelease.assets.links.nodes.map(l => ({ links: graphQLRelease.assets.links.nodes.map((l) => ({
...l, ...l,
linkType: l.linkType?.toLowerCase(), linkType: l.linkType?.toLowerCase(),
})), })),
}, },
}); });
const convertEvidences = graphQLRelease => ({ const convertEvidences = (graphQLRelease) => ({
evidences: graphQLRelease.evidences.nodes.map(e => e), evidences: graphQLRelease.evidences.nodes.map((e) => e),
}); });
const convertLinks = graphQLRelease => ({ const convertLinks = (graphQLRelease) => ({
_links: { _links: {
...graphQLRelease.links, ...graphQLRelease.links,
self: graphQLRelease.links?.selfUrl, self: graphQLRelease.links?.selfUrl,
}, },
}); });
const convertCommit = graphQLRelease => { const convertCommit = (graphQLRelease) => {
if (!graphQLRelease.commit) { if (!graphQLRelease.commit) {
return {}; return {};
} }
...@@ -93,10 +93,10 @@ const convertCommit = graphQLRelease => { ...@@ -93,10 +93,10 @@ const convertCommit = graphQLRelease => {
}; };
}; };
const convertAuthor = graphQLRelease => ({ author: graphQLRelease.author }); const convertAuthor = (graphQLRelease) => ({ author: graphQLRelease.author });
const convertMilestones = graphQLRelease => ({ const convertMilestones = (graphQLRelease) => ({
milestones: graphQLRelease.milestones.nodes.map(m => ({ milestones: graphQLRelease.milestones.nodes.map((m) => ({
...m, ...m,
webUrl: m.webPath, webUrl: m.webPath,
webPath: undefined, webPath: undefined,
...@@ -115,7 +115,7 @@ const convertMilestones = graphQLRelease => ({ ...@@ -115,7 +115,7 @@ const convertMilestones = graphQLRelease => ({
* *
* @param graphQLRelease The release object returned from a GraphQL query * @param graphQLRelease The release object returned from a GraphQL query
*/ */
export const convertGraphQLRelease = graphQLRelease => ({ export const convertGraphQLRelease = (graphQLRelease) => ({
...convertScalarProperties(graphQLRelease), ...convertScalarProperties(graphQLRelease),
...convertAssets(graphQLRelease), ...convertAssets(graphQLRelease),
...convertEvidences(graphQLRelease), ...convertEvidences(graphQLRelease),
...@@ -134,7 +134,7 @@ export const convertGraphQLRelease = graphQLRelease => ({ ...@@ -134,7 +134,7 @@ export const convertGraphQLRelease = graphQLRelease => ({
* *
* @param response The response received from the GraphQL endpoint * @param response The response received from the GraphQL endpoint
*/ */
export const convertAllReleasesGraphQLResponse = response => { export const convertAllReleasesGraphQLResponse = (response) => {
const releases = response.data.project.releases.nodes.map(convertGraphQLRelease); const releases = response.data.project.releases.nodes.map(convertGraphQLRelease);
const paginationInfo = { const paginationInfo = {
...@@ -153,7 +153,7 @@ export const convertAllReleasesGraphQLResponse = response => { ...@@ -153,7 +153,7 @@ export const convertAllReleasesGraphQLResponse = response => {
* *
* @param response The response received from the GraphQL endpoint * @param response The response received from the GraphQL endpoint
*/ */
export const convertOneReleaseGraphQLResponse = response => { export const convertOneReleaseGraphQLResponse = (response) => {
const release = convertGraphQLRelease(response.data.project.release); const release = convertGraphQLRelease(response.data.project.release);
return { data: release }; return { data: release };
......
import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../../constants'; import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../../constants';
import { s__, n__ } from '~/locale'; import { s__, n__ } from '~/locale';
export const groupedSummaryText = state => { export const groupedSummaryText = (state) => {
if (state.isLoading) { if (state.isLoading) {
return s__('Reports|Accessibility scanning results are being parsed'); return s__('Reports|Accessibility scanning results are being parsed');
} }
...@@ -22,7 +22,7 @@ export const groupedSummaryText = state => { ...@@ -22,7 +22,7 @@ export const groupedSummaryText = state => {
); );
}; };
export const summaryStatus = state => { export const summaryStatus = (state) => {
if (state.isLoading) { if (state.isLoading) {
return LOADING; return LOADING;
} }
...@@ -34,12 +34,12 @@ export const summaryStatus = state => { ...@@ -34,12 +34,12 @@ export const summaryStatus = state => {
return SUCCESS; return SUCCESS;
}; };
export const shouldRenderIssuesList = state => export const shouldRenderIssuesList = (state) =>
Object.values(state.report).some(x => Array.isArray(x) && x.length > 0); Object.values(state.report).some((x) => Array.isArray(x) && x.length > 0);
// We could just map state, but we're going to iterate in the future // We could just map state, but we're going to iterate in the future
// to add notes and warnings to these issue lists, so I'm going to // to add notes and warnings to these issue lists, so I'm going to
// keep these as getters // keep these as getters
export const unresolvedIssues = state => state.report.existing_errors; export const unresolvedIssues = (state) => state.report.existing_errors;
export const resolvedIssues = state => state.report.resolved_errors; export const resolvedIssues = (state) => state.report.resolved_errors;
export const newIssues = state => state.report.new_errors; export const newIssues = (state) => state.report.new_errors;
...@@ -7,11 +7,11 @@ import state from './state'; ...@@ -7,11 +7,11 @@ import state from './state';
Vue.use(Vuex); Vue.use(Vuex);
export const getStoreConfig = initialState => ({ export const getStoreConfig = (initialState) => ({
actions, actions,
getters, getters,
mutations, mutations,
state: state(initialState), state: state(initialState),
}); });
export default initialState => new Vuex.Store(getStoreConfig(initialState)); export default (initialState) => new Vuex.Store(getStoreConfig(initialState));
...@@ -11,13 +11,13 @@ export const fetchReports = ({ state, dispatch, commit }) => { ...@@ -11,13 +11,13 @@ export const fetchReports = ({ state, dispatch, commit }) => {
return dispatch('receiveReportsError'); return dispatch('receiveReportsError');
} }
return Promise.all([axios.get(state.headPath), axios.get(state.basePath)]) return Promise.all([axios.get(state.headPath), axios.get(state.basePath)])
.then(results => .then((results) =>
doCodeClimateComparison( doCodeClimateComparison(
parseCodeclimateMetrics(results[0].data, state.headBlobPath), parseCodeclimateMetrics(results[0].data, state.headBlobPath),
parseCodeclimateMetrics(results[1].data, state.baseBlobPath), parseCodeclimateMetrics(results[1].data, state.baseBlobPath),
), ),
) )
.then(data => dispatch('receiveReportsSuccess', data)) .then((data) => dispatch('receiveReportsSuccess', data))
.catch(() => dispatch('receiveReportsError')); .catch(() => dispatch('receiveReportsError'));
}; };
......
...@@ -2,10 +2,10 @@ import { LOADING, ERROR, SUCCESS } from '../../constants'; ...@@ -2,10 +2,10 @@ import { LOADING, ERROR, SUCCESS } from '../../constants';
import { sprintf, __, s__, n__ } from '~/locale'; import { sprintf, __, s__, n__ } from '~/locale';
import { spriteIcon } from '~/lib/utils/common_utils'; import { spriteIcon } from '~/lib/utils/common_utils';
export const hasCodequalityIssues = state => export const hasCodequalityIssues = (state) =>
Boolean(state.newIssues?.length || state.resolvedIssues?.length); Boolean(state.newIssues?.length || state.resolvedIssues?.length);
export const codequalityStatus = state => { export const codequalityStatus = (state) => {
if (state.isLoading) { if (state.isLoading) {
return LOADING; return LOADING;
} }
...@@ -16,7 +16,7 @@ export const codequalityStatus = state => { ...@@ -16,7 +16,7 @@ export const codequalityStatus = state => {
return SUCCESS; return SUCCESS;
}; };
export const codequalityText = state => { export const codequalityText = (state) => {
const { newIssues, resolvedIssues } = state; const { newIssues, resolvedIssues } = state;
const text = []; const text = [];
...@@ -41,7 +41,7 @@ export const codequalityText = state => { ...@@ -41,7 +41,7 @@ export const codequalityText = state => {
return text.join(''); return text.join('');
}; };
export const codequalityPopover = state => { export const codequalityPopover = (state) => {
if (state.headPath && !state.basePath) { if (state.headPath && !state.basePath) {
return { return {
title: s__('ciReport|Base pipeline codequality artifact not found'), title: s__('ciReport|Base pipeline codequality artifact not found'),
......
...@@ -7,11 +7,11 @@ import state from './state'; ...@@ -7,11 +7,11 @@ import state from './state';
Vue.use(Vuex); Vue.use(Vuex);
export const getStoreConfig = initialState => ({ export const getStoreConfig = (initialState) => ({
actions, actions,
getters, getters,
mutations, mutations,
state: state(initialState), state: state(initialState),
}); });
export default initialState => new Vuex.Store(getStoreConfig(initialState)); export default (initialState) => new Vuex.Store(getStoreConfig(initialState));
import CodeQualityComparisonWorker from '../../workers/codequality_comparison_worker'; import CodeQualityComparisonWorker from '../../workers/codequality_comparison_worker';
export const parseCodeclimateMetrics = (issues = [], path = '') => { export const parseCodeclimateMetrics = (issues = [], path = '') => {
return issues.map(issue => { return issues.map((issue) => {
const parsedIssue = { const parsedIssue = {
...issue, ...issue,
name: issue.description, name: issue.description,
......
...@@ -3,7 +3,7 @@ import { differenceBy } from 'lodash'; ...@@ -3,7 +3,7 @@ import { differenceBy } from 'lodash';
const KEY_TO_FILTER_BY = 'fingerprint'; const KEY_TO_FILTER_BY = 'fingerprint';
// eslint-disable-next-line no-restricted-globals // eslint-disable-next-line no-restricted-globals
self.addEventListener('message', e => { self.addEventListener('message', (e) => {
const { data } = e; const { data } = e;
if (data === undefined) { if (data === undefined) {
......
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
computed: { computed: {
groups() { groups() {
return this.$options.groups return this.$options.groups
.map(group => ({ .map((group) => ({
name: group, name: group,
issues: this[`${group}Issues`], issues: this[`${group}Issues`],
heading: this[`${group}Heading`], heading: this[`${group}Heading`],
......
...@@ -44,8 +44,8 @@ export default { ...@@ -44,8 +44,8 @@ export default {
computed: { computed: {
...mapState(['reports', 'isLoading', 'hasError', 'summary']), ...mapState(['reports', 'isLoading', 'hasError', 'summary']),
...mapState({ ...mapState({
modalTitle: state => state.modal.title || '', modalTitle: (state) => state.modal.title || '',
modalData: state => state.modal.data || {}, modalData: (state) => state.modal.data || {},
}), }),
...mapGetters(['summaryStatus']), ...mapGetters(['summaryStatus']),
groupedSummaryText() { groupedSummaryText() {
......
...@@ -3,7 +3,7 @@ import ReportItem from '~/reports/components/report_item.vue'; ...@@ -3,7 +3,7 @@ import ReportItem from '~/reports/components/report_item.vue';
import { STATUS_FAILED, STATUS_NEUTRAL, STATUS_SUCCESS } from '~/reports/constants'; import { STATUS_FAILED, STATUS_NEUTRAL, STATUS_SUCCESS } from '~/reports/constants';
import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue'; import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue';
const wrapIssueWithState = (status, isNew = false) => issue => ({ const wrapIssueWithState = (status, isNew = false) => (issue) => ({
status: issue.status || status, status: issue.status || status,
isNew, isNew,
issue, issue,
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: '', default: '',
validator: value => value === '' || Object.values(componentNames).includes(value), validator: (value) => value === '' || Object.values(componentNames).includes(value),
}, },
// failed || success // failed || success
status: { status: {
......
import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../constants'; import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../constants';
export const summaryStatus = state => { export const summaryStatus = (state) => {
if (state.isLoading) { if (state.isLoading) {
return LOADING; return LOADING;
} }
......
...@@ -9,7 +9,7 @@ export default { ...@@ -9,7 +9,7 @@ export default {
state.isLoading = true; state.isLoading = true;
}, },
[types.RECEIVE_REPORTS_SUCCESS](state, response) { [types.RECEIVE_REPORTS_SUCCESS](state, response) {
state.hasError = response.suites.some(suite => suite.status === 'error'); state.hasError = response.suites.some((suite) => suite.status === 'error');
state.isLoading = false; state.isLoading = false;
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
[types.SET_ISSUE_MODAL_DATA](state, payload) { [types.SET_ISSUE_MODAL_DATA](state, payload) {
state.modal.title = payload.issue.name; state.modal.title = payload.issue.name;
Object.keys(payload.issue).forEach(key => { Object.keys(payload.issue).forEach((key) => {
if (Object.prototype.hasOwnProperty.call(state.modal.data, key)) { if (Object.prototype.hasOwnProperty.call(state.modal.data, key)) {
state.modal.data[key] = { state.modal.data[key] = {
...state.modal.data[key], ...state.modal.data[key],
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
ICON_NOTFOUND, ICON_NOTFOUND,
} from '../constants'; } from '../constants';
const textBuilder = results => { const textBuilder = (results) => {
const { failed, errored, resolved, total } = results; const { failed, errored, resolved, total } = results;
const failedOrErrored = (failed || 0) + (errored || 0); const failedOrErrored = (failed || 0) + (errored || 0);
...@@ -70,18 +70,18 @@ export const recentFailuresTextBuilder = (summary = {}) => { ...@@ -70,18 +70,18 @@ export const recentFailuresTextBuilder = (summary = {}) => {
); );
}; };
export const countRecentlyFailedTests = subject => { export const countRecentlyFailedTests = (subject) => {
// handle either a single report or an array of reports // handle either a single report or an array of reports
const reports = !subject.length ? [subject] : subject; const reports = !subject.length ? [subject] : subject;
return reports return reports
.map(report => { .map((report) => {
return ( return (
[report.new_failures, report.existing_failures, report.resolved_failures] [report.new_failures, report.existing_failures, report.resolved_failures]
// only count tests which have failed more than once // only count tests which have failed more than once
.map( .map(
failureArray => (failureArray) =>
failureArray.filter(failure => failure.recent_failures?.count > 1).length, failureArray.filter((failure) => failure.recent_failures?.count > 1).length,
) )
.reduce((total, count) => total + count, 0) .reduce((total, count) => total + count, 0)
); );
...@@ -89,7 +89,7 @@ export const countRecentlyFailedTests = subject => { ...@@ -89,7 +89,7 @@ export const countRecentlyFailedTests = subject => {
.reduce((total, count) => total + count, 0); .reduce((total, count) => total + count, 0);
}; };
export const statusIcon = status => { export const statusIcon = (status) => {
if (status === STATUS_FAILED) { if (status === STATUS_FAILED) {
return ICON_WARNING; return ICON_WARNING;
} }
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
projectPath: this.projectPath, projectPath: this.projectPath,
}; };
}, },
update: data => data.project?.userPermissions, update: (data) => data.project?.userPermissions,
error(error) { error(error) {
throw error; throw error;
}, },
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
pathLinks() { pathLinks() {
return this.currentPath return this.currentPath
.split('/') .split('/')
.filter(p => p !== '') .filter((p) => p !== '')
.reduce( .reduce(
(acc, name, i) => { (acc, name, i) => {
const path = joinPaths(i > 0 ? acc[i].path : '', escapeFileUrl(name)); const path = joinPaths(i > 0 ? acc[i].path : '', escapeFileUrl(name));
......
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
}, },
computed: { computed: {
normalizedLinks() { normalizedLinks() {
return this.links.map(link => ({ return this.links.map((link) => ({
text: link.text, text: link.text,
path: `${link.path}?path=${this.currentPath}`, path: `${link.path}?path=${this.currentPath}`,
})); }));
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
path: this.currentPath.replace(/^\//, ''), path: this.currentPath.replace(/^\//, ''),
}; };
}, },
update: data => { update: (data) => {
const pipelines = data.project?.repository?.tree?.lastCommit?.pipelines?.edges; const pipelines = data.project?.repository?.tree?.lastCommit?.pipelines?.edges;
return { return {
......
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
const splitArray = this.path.split('/'); const splitArray = this.path.split('/');
splitArray.pop(); splitArray.pop();
return splitArray.map(p => encodeURIComponent(p)).join('/'); return splitArray.map((p) => encodeURIComponent(p)).join('/');
}, },
parentRoute() { parentRoute() {
return { path: `/-/tree/${this.commitRef}/${this.parentPath}` }; return { path: `/-/tree/${this.commitRef}/${this.parentPath}` };
......
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
} }
} }
}) })
.catch(error => { .catch((error) => {
createFlash(__('An error occurred while fetching folder content.')); createFlash(__('An error occurred while fetching folder content.'));
throw error; throw error;
}); });
......
...@@ -18,7 +18,7 @@ const defaultClient = createDefaultClient( ...@@ -18,7 +18,7 @@ const defaultClient = createDefaultClient(
{ {
Query: { Query: {
commit(_, { path, fileName, type }) { commit(_, { path, fileName, type }) {
return new Promise(resolve => { return new Promise((resolve) => {
fetchLogsTree(defaultClient, path, '0', { fetchLogsTree(defaultClient, path, '0', {
resolve, resolve,
entry: { entry: {
...@@ -38,7 +38,7 @@ const defaultClient = createDefaultClient( ...@@ -38,7 +38,7 @@ const defaultClient = createDefaultClient(
{ {
cacheConfig: { cacheConfig: {
fragmentMatcher, fragmentMatcher,
dataIdFromObject: obj => { dataIdFromObject: (obj) => {
/* eslint-disable @gitlab/require-i18n-strings */ /* eslint-disable @gitlab/require-i18n-strings */
// eslint-disable-next-line no-underscore-dangle // eslint-disable-next-line no-underscore-dangle
switch (obj.__typename) { switch (obj.__typename) {
......
...@@ -10,7 +10,7 @@ Vue.use(VueRouter); ...@@ -10,7 +10,7 @@ Vue.use(VueRouter);
export default function createRouter(base, baseRef) { export default function createRouter(base, baseRef) {
const treePathRoute = { const treePathRoute = {
component: TreePage, component: TreePage,
props: route => ({ props: (route) => ({
path: route.params.path?.replace(/^\//, '') || '/', path: route.params.path?.replace(/^\//, '') || '/',
}), }),
}; };
......
export function normalizeData(data, path, extra = () => {}) { export function normalizeData(data, path, extra = () => {}) {
return data.map(d => ({ return data.map((d) => ({
sha: d.commit.id, sha: d.commit.id,
message: d.commit.message, message: d.commit.message,
titleHtml: d.commit_title_html, titleHtml: d.commit_title_html,
......
...@@ -18,14 +18,14 @@ const MARKUP_EXTENSIONS = [ ...@@ -18,14 +18,14 @@ const MARKUP_EXTENSIONS = [
'wiki', 'wiki',
]; ];
const isRichReadme = file => { const isRichReadme = (file) => {
const re = new RegExp(`^(${FILENAMES.join('|')})\\.(${MARKUP_EXTENSIONS.join('|')})$`, 'i'); const re = new RegExp(`^(${FILENAMES.join('|')})\\.(${MARKUP_EXTENSIONS.join('|')})$`, 'i');
return re.test(file.name); return re.test(file.name);
}; };
const isPlainReadme = file => { const isPlainReadme = (file) => {
const re = new RegExp(`^(${FILENAMES.join('|')})(\\.txt)?$`, 'i'); const re = new RegExp(`^(${FILENAMES.join('|')})(\\.txt)?$`, 'i');
return re.test(file.name); return re.test(file.name);
}; };
export const readmeFile = blobs => blobs.find(isRichReadme) || blobs.find(isPlainReadme); export const readmeFile = (blobs) => blobs.find(isRichReadme) || blobs.find(isPlainReadme);
...@@ -4,9 +4,9 @@ export default () => { ...@@ -4,9 +4,9 @@ export default () => {
const searchTerm = contentBody.querySelector('.js-search-input').value.toLowerCase(); const searchTerm = contentBody.querySelector('.js-search-input').value.toLowerCase();
const blobs = contentBody.querySelectorAll('.blob-result'); const blobs = contentBody.querySelectorAll('.blob-result');
blobs.forEach(blob => { blobs.forEach((blob) => {
const lines = blob.querySelectorAll('.line'); const lines = blob.querySelectorAll('.line');
lines.forEach(line => { lines.forEach((line) => {
if (line.textContent.toLowerCase().includes(searchTerm)) { if (line.textContent.toLowerCase().includes(searchTerm)) {
line.classList.add(highlightLineClass); line.classList.add(highlightLineClass);
} }
......
...@@ -4,7 +4,7 @@ import GlobalSearchSidebar from './components/app.vue'; ...@@ -4,7 +4,7 @@ import GlobalSearchSidebar from './components/app.vue';
Vue.use(Translate); Vue.use(Translate);
export const initSidebar = store => { export const initSidebar = (store) => {
const el = document.getElementById('js-search-sidebar'); const el = document.getElementById('js-search-sidebar');
if (!el) return false; if (!el) return false;
......
...@@ -7,7 +7,7 @@ import * as types from './mutation_types'; ...@@ -7,7 +7,7 @@ import * as types from './mutation_types';
export const fetchGroups = ({ commit }, search) => { export const fetchGroups = ({ commit }, search) => {
commit(types.REQUEST_GROUPS); commit(types.REQUEST_GROUPS);
Api.groups(search) Api.groups(search)
.then(data => { .then((data) => {
commit(types.RECEIVE_GROUPS_SUCCESS, data); commit(types.RECEIVE_GROUPS_SUCCESS, data);
}) })
.catch(() => { .catch(() => {
...@@ -19,7 +19,7 @@ export const fetchGroups = ({ commit }, search) => { ...@@ -19,7 +19,7 @@ export const fetchGroups = ({ commit }, search) => {
export const fetchProjects = ({ commit, state }, search) => { export const fetchProjects = ({ commit, state }, search) => {
commit(types.REQUEST_PROJECTS); commit(types.REQUEST_PROJECTS);
const groupId = state.query?.group_id; const groupId = state.query?.group_id;
const callback = data => { const callback = (data) => {
if (data) { if (data) {
commit(types.RECEIVE_PROJECTS_SUCCESS, data); commit(types.RECEIVE_PROJECTS_SUCCESS, data);
} else { } else {
......
...@@ -12,5 +12,5 @@ export const getStoreConfig = ({ query }) => ({ ...@@ -12,5 +12,5 @@ export const getStoreConfig = ({ query }) => ({
state: createState({ query }), state: createState({ query }),
}); });
const createStore = config => new Vuex.Store(getStoreConfig(config)); const createStore = (config) => new Vuex.Store(getStoreConfig(config));
export default createStore; export default createStore;
...@@ -40,5 +40,5 @@ const searchableDropdowns = [ ...@@ -40,5 +40,5 @@ const searchableDropdowns = [
}, },
]; ];
export const initTopbar = store => export const initTopbar = (store) =>
searchableDropdowns.map(dropdown => mountSearchableDropdown(store, dropdown)); searchableDropdowns.map((dropdown) => mountSearchableDropdown(store, dropdown));
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