Commit bcbbcb2e authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 28 of 73

Part of our prettier migration; changing the arrow-parens style.
parent a4c662da
...@@ -172,7 +172,7 @@ export class SearchAutocomplete { ...@@ -172,7 +172,7 @@ export class SearchAutocomplete {
term, term,
}, },
}) })
.then(response => { .then((response) => {
const options = this.scopedSearchOptions(term); const options = this.scopedSearchOptions(term);
// List results // List results
...@@ -345,7 +345,7 @@ export class SearchAutocomplete { ...@@ -345,7 +345,7 @@ export class SearchAutocomplete {
this.clearInput.on('click', this.onClearInputClick); this.clearInput.on('click', this.onClearInputClick);
this.dropdownContent.on('scroll', throttle(this.setScrollFade, 250)); this.dropdownContent.on('scroll', throttle(this.setScrollFade, 250));
this.searchInput.on('click', e => { this.searchInput.on('click', (e) => {
e.stopPropagation(); e.stopPropagation();
}); });
} }
......
...@@ -9,7 +9,7 @@ const TWO_MINUTES = 120000; ...@@ -9,7 +9,7 @@ const TWO_MINUTES = 120000;
function backOffRequest(makeRequestCallback) { function backOffRequest(makeRequestCallback) {
return backOff((next, stop) => { return backOff((next, stop) => {
makeRequestCallback() makeRequestCallback()
.then(resp => { .then((resp) => {
if (resp.status === statusCodes.ACCEPTED) { if (resp.status === statusCodes.ACCEPTED) {
next(); next();
} else { } else {
...@@ -30,24 +30,24 @@ export const requestCreateProject = ({ dispatch, state, commit }) => { ...@@ -30,24 +30,24 @@ export const requestCreateProject = ({ dispatch, state, commit }) => {
commit(types.SET_LOADING, true); commit(types.SET_LOADING, true);
axios axios
.post(state.createProjectEndpoint) .post(state.createProjectEndpoint)
.then(resp => { .then((resp) => {
if (resp.status === statusCodes.ACCEPTED) { if (resp.status === statusCodes.ACCEPTED) {
dispatch('requestCreateProjectStatus', resp.data.job_id); dispatch('requestCreateProjectStatus', resp.data.job_id);
} }
}) })
.catch(error => { .catch((error) => {
dispatch('requestCreateProjectError', error); dispatch('requestCreateProjectError', error);
}); });
}; };
export const requestCreateProjectStatus = ({ dispatch, state }, jobId) => { export const requestCreateProjectStatus = ({ dispatch, state }, jobId) => {
backOffRequest(() => axios.get(state.createProjectStatusEndpoint, { params: { job_id: jobId } })) backOffRequest(() => axios.get(state.createProjectStatusEndpoint, { params: { job_id: jobId } }))
.then(resp => { .then((resp) => {
if (resp.status === statusCodes.OK) { if (resp.status === statusCodes.OK) {
dispatch('requestCreateProjectSuccess', resp.data); dispatch('requestCreateProjectSuccess', resp.data);
} }
}) })
.catch(error => { .catch((error) => {
dispatch('requestCreateProjectError', error); dispatch('requestCreateProjectError', error);
}); });
}; };
...@@ -82,24 +82,24 @@ export const requestDeleteProject = ({ dispatch, state, commit }) => { ...@@ -82,24 +82,24 @@ export const requestDeleteProject = ({ dispatch, state, commit }) => {
commit(types.SET_LOADING, true); commit(types.SET_LOADING, true);
axios axios
.delete(state.deleteProjectEndpoint) .delete(state.deleteProjectEndpoint)
.then(resp => { .then((resp) => {
if (resp.status === statusCodes.ACCEPTED) { if (resp.status === statusCodes.ACCEPTED) {
dispatch('requestDeleteProjectStatus', resp.data.job_id); dispatch('requestDeleteProjectStatus', resp.data.job_id);
} }
}) })
.catch(error => { .catch((error) => {
dispatch('requestDeleteProjectError', error); dispatch('requestDeleteProjectError', error);
}); });
}; };
export const requestDeleteProjectStatus = ({ dispatch, state }, jobId) => { export const requestDeleteProjectStatus = ({ dispatch, state }, jobId) => {
backOffRequest(() => axios.get(state.deleteProjectStatusEndpoint, { params: { job_id: jobId } })) backOffRequest(() => axios.get(state.deleteProjectStatusEndpoint, { params: { job_id: jobId } }))
.then(resp => { .then((resp) => {
if (resp.status === statusCodes.OK) { if (resp.status === statusCodes.OK) {
dispatch('requestDeleteProjectSuccess', resp.data); dispatch('requestDeleteProjectSuccess', resp.data);
} }
}) })
.catch(error => { .catch((error) => {
dispatch('requestDeleteProjectError', error); dispatch('requestDeleteProjectError', error);
}); });
}; };
......
...@@ -6,7 +6,7 @@ import mutations from './mutations'; ...@@ -6,7 +6,7 @@ import mutations from './mutations';
Vue.use(Vuex); Vue.use(Vuex);
export const createStore = initialState => export const createStore = (initialState) =>
new Vuex.Store({ new Vuex.Store({
modules: { modules: {
selfMonitoring: { selfMonitoring: {
......
...@@ -13,7 +13,7 @@ export default function initSentryErrorStacktrace() { ...@@ -13,7 +13,7 @@ export default function initSentryErrorStacktrace() {
SentryErrorStackTrace, SentryErrorStackTrace,
}, },
store, store,
render: createElement => render: (createElement) =>
createElement('sentry-error-stack-trace', { createElement('sentry-error-stack-trace', {
props: { issueStackTracePath }, props: { issueStackTracePath },
}), }),
......
...@@ -39,13 +39,13 @@ export default { ...@@ -39,13 +39,13 @@ export default {
}, {}); }, {});
}, },
extractTimeData() { extractTimeData() {
return this.chartData.requests.map(data => data.time); return this.chartData.requests.map((data) => data.time);
}, },
generateSeries() { generateSeries() {
return { return {
name: __('Invocations'), name: __('Invocations'),
type: 'line', type: 'line',
data: this.chartData.requests.map(data => [data.time, data.value]), data: this.chartData.requests.map((data) => [data.time, data.value]),
symbolSize: 0, symbolSize: 0,
}; };
}, },
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
name: 'time', name: 'time',
type: 'time', type: 'time',
axisLabel: { axisLabel: {
formatter: date => dateFormat(date, 'h:MM TT'), formatter: (date) => dateFormat(date, 'h:MM TT'),
}, },
data: this.extractTimeData, data: this.extractTimeData,
nameTextStyle: { nameTextStyle: {
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
}; };
}, },
xAxisLabel() { xAxisLabel() {
return this.graphData.queries.map(query => query.label).join(', '); return this.graphData.queries.map((query) => query.label).join(', ');
}, },
yAxisLabel() { yAxisLabel() {
const [query] = this.graphData.queries; const [query] = this.graphData.queries;
......
...@@ -30,7 +30,7 @@ export const receiveMetricsError = ({ commit }, error) => ...@@ -30,7 +30,7 @@ export const receiveMetricsError = ({ commit }, error) =>
export const fetchFunctions = ({ dispatch }, { functionsPath }) => { export const fetchFunctions = ({ dispatch }, { functionsPath }) => {
let retryCount = 0; let retryCount = 0;
const functionsPartiallyFetched = data => { const functionsPartiallyFetched = (data) => {
if (data.functions !== null && data.functions.length) { if (data.functions !== null && data.functions.length) {
dispatch('receiveFunctionsPartial', data); dispatch('receiveFunctionsPartial', data);
} }
...@@ -41,7 +41,7 @@ export const fetchFunctions = ({ dispatch }, { functionsPath }) => { ...@@ -41,7 +41,7 @@ export const fetchFunctions = ({ dispatch }, { functionsPath }) => {
backOff((next, stop) => { backOff((next, stop) => {
axios axios
.get(functionsPath) .get(functionsPath)
.then(response => { .then((response) => {
if (response.data.knative_installed === CHECKING_INSTALLED) { if (response.data.knative_installed === CHECKING_INSTALLED) {
retryCount += 1; retryCount += 1;
if (retryCount < MAX_REQUESTS) { if (retryCount < MAX_REQUESTS) {
...@@ -56,7 +56,7 @@ export const fetchFunctions = ({ dispatch }, { functionsPath }) => { ...@@ -56,7 +56,7 @@ export const fetchFunctions = ({ dispatch }, { functionsPath }) => {
}) })
.catch(stop); .catch(stop);
}) })
.then(data => { .then((data) => {
if (data === TIMEOUT) { if (data === TIMEOUT) {
dispatch('receiveFunctionsTimeout'); dispatch('receiveFunctionsTimeout');
createFlash(__('Loading functions timed out. Please reload the page to try again.')); createFlash(__('Loading functions timed out. Please reload the page to try again.'));
...@@ -66,7 +66,7 @@ export const fetchFunctions = ({ dispatch }, { functionsPath }) => { ...@@ -66,7 +66,7 @@ export const fetchFunctions = ({ dispatch }, { functionsPath }) => {
dispatch('receiveFunctionsNoDataSuccess', data); dispatch('receiveFunctionsNoDataSuccess', data);
} }
}) })
.catch(error => { .catch((error) => {
dispatch('receiveFunctionsError', error); dispatch('receiveFunctionsError', error);
createFlash(error); createFlash(error);
}); });
...@@ -83,7 +83,7 @@ export const fetchMetrics = ({ dispatch }, { metricsPath, hasPrometheus }) => { ...@@ -83,7 +83,7 @@ export const fetchMetrics = ({ dispatch }, { metricsPath, hasPrometheus }) => {
backOff((next, stop) => { backOff((next, stop) => {
axios axios
.get(metricsPath) .get(metricsPath)
.then(response => { .then((response) => {
if (response.status === statusCodes.NO_CONTENT) { if (response.status === statusCodes.NO_CONTENT) {
retryCount += 1; retryCount += 1;
if (retryCount < MAX_REQUESTS) { if (retryCount < MAX_REQUESTS) {
...@@ -98,15 +98,15 @@ export const fetchMetrics = ({ dispatch }, { metricsPath, hasPrometheus }) => { ...@@ -98,15 +98,15 @@ export const fetchMetrics = ({ dispatch }, { metricsPath, hasPrometheus }) => {
}) })
.catch(stop); .catch(stop);
}) })
.then(data => { .then((data) => {
if (data === null) { if (data === null) {
return; return;
} }
const updatedMetric = data.metrics; const updatedMetric = data.metrics;
const queries = data.metrics.queries.map(query => ({ const queries = data.metrics.queries.map((query) => ({
...query, ...query,
result: query.result.map(result => ({ result: query.result.map((result) => ({
...result, ...result,
values: result.values.map(([timestamp, value]) => ({ values: result.values.map(([timestamp, value]) => ({
time: new Date(timestamp * 1000).toISOString(), time: new Date(timestamp * 1000).toISOString(),
...@@ -118,7 +118,7 @@ export const fetchMetrics = ({ dispatch }, { metricsPath, hasPrometheus }) => { ...@@ -118,7 +118,7 @@ export const fetchMetrics = ({ dispatch }, { metricsPath, hasPrometheus }) => {
updatedMetric.queries = queries; updatedMetric.queries = queries;
dispatch('receiveMetricsSuccess', updatedMetric); dispatch('receiveMetricsSuccess', updatedMetric);
}) })
.catch(error => { .catch((error) => {
dispatch('receiveMetricsError', error); dispatch('receiveMetricsError', error);
createFlash(error); createFlash(error);
}); });
......
import { translate } from '../utils'; import { translate } from '../utils';
export const hasPrometheusMissingData = state => state.hasPrometheus && !state.hasPrometheusData; export const hasPrometheusMissingData = (state) => state.hasPrometheus && !state.hasPrometheusData;
// Convert the function list into a k/v grouping based on the environment scope // Convert the function list into a k/v grouping based on the environment scope
export const getFunctions = state => translate(state.functions); export const getFunctions = (state) => translate(state.functions);
// Validate that the object coming in has valid query details and results // Validate that the object coming in has valid query details and results
export const validateGraphData = data => export const validateGraphData = (data) =>
data.queries && data.queries &&
Array.isArray(data.queries) && Array.isArray(data.queries) &&
data.queries.filter(query => { data.queries.filter((query) => {
if (Array.isArray(query.result)) { if (Array.isArray(query.result)) {
return query.result.filter(res => Array.isArray(res.values)).length === query.result.length; return query.result.filter((res) => Array.isArray(res.values)).length === query.result.length;
} }
return false; return false;
}).length === data.queries.length; }).length === data.queries.length;
export const translate = functions => export const translate = (functions) =>
functions.reduce( functions.reduce(
(acc, func) => (acc, func) =>
Object.assign(acc, { Object.assign(acc, {
......
...@@ -3,7 +3,7 @@ export const AVAILABILITY_STATUS = { ...@@ -3,7 +3,7 @@ export const AVAILABILITY_STATUS = {
NOT_SET: 'not_set', NOT_SET: 'not_set',
}; };
export const isUserBusy = status => status === AVAILABILITY_STATUS.BUSY; export const isUserBusy = (status) => status === AVAILABILITY_STATUS.BUSY;
export const isValidAvailibility = availability => export const isValidAvailibility = (availability) =>
availability.length ? Object.values(AVAILABILITY_STATUS).includes(availability) : true; availability.length ? Object.values(AVAILABILITY_STATUS).includes(availability) : true;
...@@ -34,8 +34,8 @@ export default { ...@@ -34,8 +34,8 @@ export default {
return !this.users.length; return !this.users.length;
}, },
sortedAssigness() { sortedAssigness() {
const canMergeUsers = this.users.filter(user => user.can_merge); const canMergeUsers = this.users.filter((user) => user.can_merge);
const canNotMergeUsers = this.users.filter(user => !user.can_merge); const canNotMergeUsers = this.users.filter((user) => !user.can_merge);
return [...canMergeUsers, ...canNotMergeUsers]; return [...canMergeUsers, ...canNotMergeUsers];
}, },
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
handleFetchResult({ data }) { handleFetchResult({ data }) {
const { nodes } = data.project.issue.assignees; const { nodes } = data.project.issue.assignees;
const assignees = nodes.map(n => ({ const assignees = nodes.map((n) => ({
...n, ...n,
avatar_url: n.avatarUrl, avatar_url: n.avatarUrl,
id: getIdFromGraphQLId(n.id), id: getIdFromGraphQLId(n.id),
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
return this.users.length > 2; return this.users.length > 2;
}, },
allAssigneesCanMerge() { allAssigneesCanMerge() {
return this.users.every(user => user.can_merge); return this.users.every((user) => user.can_merge);
}, },
sidebarAvatarCounter() { sidebarAvatarCounter() {
if (this.users.length > DEFAULT_MAX_COUNTER) { if (this.users.length > DEFAULT_MAX_COUNTER) {
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
return ''; return '';
} }
const mergeLength = this.users.filter(u => u.can_merge).length; const mergeLength = this.users.filter((u) => u.can_merge).length;
if (mergeLength === this.users.length) { if (mergeLength === this.users.length) {
return ''; return '';
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
tooltipTitle() { tooltipTitle() {
const maxRender = Math.min(DEFAULT_RENDER_COUNT, this.users.length); const maxRender = Math.min(DEFAULT_RENDER_COUNT, this.users.length);
const renderUsers = this.users.slice(0, maxRender); const renderUsers = this.users.slice(0, maxRender);
const names = renderUsers.map(u => u.name); const names = renderUsers.map((u) => u.name);
if (!this.users.length) { if (!this.users.length) {
return __('Assignee(s)'); return __('Assignee(s)');
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
.then(() => { .then(() => {
eventHub.$emit('updateIssuableConfidentiality', confidential); eventHub.$emit('updateIssuableConfidentiality', confidential);
}) })
.catch(err => { .catch((err) => {
Flash( Flash(
err || __('Something went wrong trying to change the confidentiality of this issue'), err || __('Something went wrong trying to change the confidentiality of this issue'),
); );
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
return this.users.length > 2; return this.users.length > 2;
}, },
allReviewersCanMerge() { allReviewersCanMerge() {
return this.users.every(user => user.can_merge); return this.users.every((user) => user.can_merge);
}, },
sidebarAvatarCounter() { sidebarAvatarCounter() {
if (this.users.length > DEFAULT_MAX_COUNTER) { if (this.users.length > DEFAULT_MAX_COUNTER) {
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
return this.users.slice(0, collapsedLength); return this.users.slice(0, collapsedLength);
}, },
tooltipTitleMergeStatus() { tooltipTitleMergeStatus() {
const mergeLength = this.users.filter(u => u.can_merge).length; const mergeLength = this.users.filter((u) => u.can_merge).length;
if (mergeLength === this.users.length) { if (mergeLength === this.users.length) {
return ''; return '';
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
tooltipTitle() { tooltipTitle() {
const maxRender = Math.min(DEFAULT_RENDER_COUNT, this.users.length); const maxRender = Math.min(DEFAULT_RENDER_COUNT, this.users.length);
const renderUsers = this.users.slice(0, maxRender); const renderUsers = this.users.slice(0, maxRender);
const names = renderUsers.map(u => u.name); const names = renderUsers.map((u) => u.name);
if (!this.users.length) { if (!this.users.length) {
return __('Reviewer(s)'); return __('Reviewer(s)');
......
...@@ -36,8 +36,8 @@ export default { ...@@ -36,8 +36,8 @@ export default {
return !this.users.length; return !this.users.length;
}, },
sortedReviewers() { sortedReviewers() {
const canMergeUsers = this.users.filter(user => user.can_merge); const canMergeUsers = this.users.filter((user) => user.can_merge);
const canNotMergeUsers = this.users.filter(user => !user.can_merge); const canNotMergeUsers = this.users.filter((user) => !user.can_merge);
return [...canMergeUsers, ...canNotMergeUsers]; return [...canMergeUsers, ...canNotMergeUsers];
}, },
......
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: ISSUABLE_TYPES.INCIDENT, default: ISSUABLE_TYPES.INCIDENT,
validator: value => { validator: (value) => {
// currently severity is supported only for incidents, but this list might be extended // currently severity is supported only for incidents, but this list might be extended
return [ISSUABLE_TYPES.INCIDENT].includes(value); return [ISSUABLE_TYPES.INCIDENT].includes(value);
}, },
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
return this.isDropdownShowing ? 'show' : 'gl-display-none'; return this.isDropdownShowing ? 'show' : 'gl-display-none';
}, },
selectedItem() { selectedItem() {
return this.severitiesList.find(severity => severity.value === this.severity); return this.severitiesList.find((severity) => severity.value === this.severity);
}, },
}, },
mounted() { mounted() {
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
projectPath: this.projectPath, projectPath: this.projectPath,
}, },
}) })
.then(resp => { .then((resp) => {
const { const {
data: { data: {
issueSetSeverity: { issueSetSeverity: {
......
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
listenForQuickActions() { listenForQuickActions() {
$(document).on('ajax:success', '.gfm-form', this.quickActionListened); $(document).on('ajax:success', '.gfm-form', this.quickActionListened);
eventHub.$on('timeTrackingUpdated', data => { eventHub.$on('timeTrackingUpdated', (data) => {
this.quickActionListened({ detail: [data] }); this.quickActionListened({ detail: [data] });
}); });
}, },
......
...@@ -46,14 +46,14 @@ class SidebarMoveIssue { ...@@ -46,14 +46,14 @@ class SidebarMoveIssue {
() => new window.Flash(__('An error occurred while fetching projects autocomplete.')), () => new window.Flash(__('An error occurred while fetching projects autocomplete.')),
); );
}, },
renderRow: project => ` renderRow: (project) => `
<li> <li>
<a href="#" class="js-move-issue-dropdown-item"> <a href="#" class="js-move-issue-dropdown-item">
${escape(project.name_with_namespace)} ${escape(project.name_with_namespace)}
</a> </a>
</li> </li>
`, `,
clicked: options => { clicked: (options) => {
const project = options.selectedObj; const project = options.selectedObj;
const selectedProjectId = options.isMarking ? project.id : 0; const selectedProjectId = options.isMarking ? project.id : 0;
this.mediator.setMoveToProjectId(selectedProjectId); this.mediator.setMoveToProjectId(selectedProjectId);
......
...@@ -16,7 +16,7 @@ export default class SidebarMilestone { ...@@ -16,7 +16,7 @@ export default class SidebarMilestone {
components: { components: {
timeTracker, timeTracker,
}, },
render: createElement => render: (createElement) =>
createElement('timeTracker', { createElement('timeTracker', {
props: { props: {
timeEstimate: parseInt(timeEstimate, 10), timeEstimate: parseInt(timeEstimate, 10),
......
...@@ -40,7 +40,7 @@ function mountAssigneesComponent(mediator) { ...@@ -40,7 +40,7 @@ function mountAssigneesComponent(mediator) {
components: { components: {
SidebarAssignees, SidebarAssignees,
}, },
render: createElement => render: (createElement) =>
createElement('sidebar-assignees', { createElement('sidebar-assignees', {
props: { props: {
mediator, mediator,
...@@ -70,7 +70,7 @@ function mountReviewersComponent(mediator) { ...@@ -70,7 +70,7 @@ function mountReviewersComponent(mediator) {
components: { components: {
SidebarReviewers, SidebarReviewers,
}, },
render: createElement => render: (createElement) =>
createElement('sidebar-reviewers', { createElement('sidebar-reviewers', {
props: { props: {
mediator, mediator,
...@@ -105,7 +105,7 @@ export function mountSidebarLabels() { ...@@ -105,7 +105,7 @@ export function mountSidebarLabels() {
allowScopedLabels: parseBoolean(el.dataset.allowScopedLabels), allowScopedLabels: parseBoolean(el.dataset.allowScopedLabels),
initiallySelectedLabels: JSON.parse(el.dataset.selectedLabels), initiallySelectedLabels: JSON.parse(el.dataset.selectedLabels),
}, },
render: createElement => createElement(SidebarLabels), render: (createElement) => createElement(SidebarLabels),
}); });
} }
...@@ -128,7 +128,7 @@ function mountConfidentialComponent(mediator) { ...@@ -128,7 +128,7 @@ function mountConfidentialComponent(mediator) {
components: { components: {
ConfidentialIssueSidebar, ConfidentialIssueSidebar,
}, },
render: createElement => render: (createElement) =>
createElement('confidential-issue-sidebar', { createElement('confidential-issue-sidebar', {
props: { props: {
iid: String(iid), iid: String(iid),
...@@ -163,20 +163,20 @@ function mountLockComponent() { ...@@ -163,20 +163,20 @@ function mountLockComponent() {
); );
} else { } else {
importStore = import(/* webpackChunkName: 'mrNotesStore' */ '~/mr_notes/stores').then( importStore = import(/* webpackChunkName: 'mrNotesStore' */ '~/mr_notes/stores').then(
store => store.default, (store) => store.default,
); );
} }
importStore importStore
.then( .then(
store => (store) =>
new Vue({ new Vue({
el, el,
store, store,
provide: { provide: {
fullPath, fullPath,
}, },
render: createElement => render: (createElement) =>
createElement(IssuableLockForm, { createElement(IssuableLockForm, {
props: { props: {
isEditable: initialData.is_editable, isEditable: initialData.is_editable,
...@@ -200,7 +200,7 @@ function mountParticipantsComponent(mediator) { ...@@ -200,7 +200,7 @@ function mountParticipantsComponent(mediator) {
components: { components: {
sidebarParticipants, sidebarParticipants,
}, },
render: createElement => render: (createElement) =>
createElement('sidebar-participants', { createElement('sidebar-participants', {
props: { props: {
mediator, mediator,
...@@ -220,7 +220,7 @@ function mountSubscriptionsComponent(mediator) { ...@@ -220,7 +220,7 @@ function mountSubscriptionsComponent(mediator) {
components: { components: {
sidebarSubscriptions, sidebarSubscriptions,
}, },
render: createElement => render: (createElement) =>
createElement('sidebar-subscriptions', { createElement('sidebar-subscriptions', {
props: { props: {
mediator, mediator,
...@@ -240,7 +240,7 @@ function mountTimeTrackingComponent() { ...@@ -240,7 +240,7 @@ function mountTimeTrackingComponent() {
components: { components: {
SidebarTimeTracking, SidebarTimeTracking,
}, },
render: createElement => createElement('sidebar-time-tracking', {}), render: (createElement) => createElement('sidebar-time-tracking', {}),
}); });
} }
...@@ -262,7 +262,7 @@ function mountSeverityComponent() { ...@@ -262,7 +262,7 @@ function mountSeverityComponent() {
components: { components: {
SidebarSeverity, SidebarSeverity,
}, },
render: createElement => render: (createElement) =>
createElement('sidebar-severity', { createElement('sidebar-severity', {
props: { props: {
projectPath: fullPath, projectPath: fullPath,
......
...@@ -30,7 +30,7 @@ export default class SidebarMediator { ...@@ -30,7 +30,7 @@ export default class SidebarMediator {
} }
saveAssignees(field) { saveAssignees(field) {
const selected = this.store.assignees.map(u => u.id); const selected = this.store.assignees.map((u) => u.id);
// If there are no ids, that means we have to unassign (which is id = 0) // If there are no ids, that means we have to unassign (which is id = 0)
// And it only accepts an array, hence [0] // And it only accepts an array, hence [0]
...@@ -41,7 +41,7 @@ export default class SidebarMediator { ...@@ -41,7 +41,7 @@ export default class SidebarMediator {
} }
saveReviewers(field) { saveReviewers(field) {
const selected = this.store.reviewers.map(u => u.id); const selected = this.store.reviewers.map((u) => u.id);
// If there are no ids, that means we have to unassign (which is id = 0) // If there are no ids, that means we have to unassign (which is id = 0)
// And it only accepts an array, hence [0] // And it only accepts an array, hence [0]
...@@ -80,7 +80,7 @@ export default class SidebarMediator { ...@@ -80,7 +80,7 @@ export default class SidebarMediator {
this.store.setSubscribedState(!this.store.subscribed); this.store.setSubscribedState(!this.store.subscribed);
this.store.setFetchingState('subscriptions', false); this.store.setFetchingState('subscriptions', false);
}) })
.catch(err => { .catch((err) => {
this.store.setFetchingState('subscriptions', false); this.store.setFetchingState('subscriptions', false);
throw err; throw err;
}); });
......
export const toLabelGid = id => `gid://gitlab/Label/${id}`; export const toLabelGid = (id) => `gid://gitlab/Label/${id}`;
...@@ -39,7 +39,7 @@ export default class SingleFileDiff { ...@@ -39,7 +39,7 @@ export default class SingleFileDiff {
this.$chevronDownIcon.removeClass('gl-display-none'); this.$chevronDownIcon.removeClass('gl-display-none');
} }
$('.js-file-title, .click-to-expand', this.file).on('click', e => { $('.js-file-title, .click-to-expand', this.file).on('click', (e) => {
this.toggleDiff($(e.target)); this.toggleDiff($(e.target));
}); });
} }
......
...@@ -119,7 +119,7 @@ export default class SmartInterval { ...@@ -119,7 +119,7 @@ export default class SmartInterval {
.then(() => { .then(() => {
this.isLoading = false; this.isLoading = false;
}) })
.catch(err => { .catch((err) => {
this.isLoading = false; this.isLoading = false;
throw err; throw err;
}); });
......
const hide = el => el.classList.add('d-none'); const hide = (el) => el.classList.add('d-none');
const show = el => el.classList.remove('d-none'); const show = (el) => el.classList.remove('d-none');
const setupCollapsibleInput = el => { const setupCollapsibleInput = (el) => {
const collapsedEl = el.querySelector('.js-collapsed'); const collapsedEl = el.querySelector('.js-collapsed');
const expandedEl = el.querySelector('.js-expanded'); const expandedEl = el.querySelector('.js-expanded');
const collapsedInputEl = collapsedEl.querySelector('textarea,input,select'); const collapsedInputEl = collapsedEl.querySelector('textarea,input,select');
...@@ -21,7 +21,7 @@ const setupCollapsibleInput = el => { ...@@ -21,7 +21,7 @@ const setupCollapsibleInput = el => {
// NOTE: // NOTE:
// We add focus listener to all form inputs so that we can collapse // We add focus listener to all form inputs so that we can collapse
// when something is focused that's not the expanded input. // when something is focused that's not the expanded input.
formEl.addEventListener('focusin', e => { formEl.addEventListener('focusin', (e) => {
if (e.target === collapsedInputEl) { if (e.target === collapsedInputEl) {
expand(); expand();
expandedInputEl.focus(); expandedInputEl.focus();
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
return this.actions.length > 0; return this.actions.length > 0;
}, },
hasValidBlobs() { hasValidBlobs() {
return this.actions.every(x => x.content); return this.actions.every((x) => x.content);
}, },
updatePrevented() { updatePrevented() {
return this.snippet.title === '' || !this.hasValidBlobs || this.isUpdating; return this.snippet.title === '' || !this.hasValidBlobs || this.isUpdating;
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
}, },
getAttachedFiles() { getAttachedFiles() {
const fileInputs = Array.from(this.$el.querySelectorAll('[name="files[]"]')); const fileInputs = Array.from(this.$el.querySelectorAll('[name="files[]"]'));
return fileInputs.map(node => node.value); return fileInputs.map((node) => node.value);
}, },
createMutation() { createMutation() {
return { return {
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
redirectTo(baseObj.snippet.webUrl); redirectTo(baseObj.snippet.webUrl);
} }
}) })
.catch(e => { .catch((e) => {
this.flashAPIFailure(e); this.flashAPIFailure(e);
}); });
}, },
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
this.blobsOrig = blobsById; this.blobsOrig = blobsById;
this.blobs = cloneDeep(blobsById); this.blobs = cloneDeep(blobsById);
this.blobIds = blobs.map(x => x.id); this.blobIds = blobs.map((x) => x.id);
// Show 1 empty blob if none exist // Show 1 empty blob if none exist
if (!this.blobIds.length) { if (!this.blobIds.length) {
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
this.blobIds.push(blob.id); this.blobIds.push(blob.id);
}, },
deleteBlob(id) { deleteBlob(id) {
this.blobIds = this.blobIds.filter(x => x !== id); this.blobIds = this.blobIds.filter((x) => x !== id);
this.$delete(this.blobs, id); this.$delete(this.blobs, id);
}, },
updateBlob(id, args) { updateBlob(id, args) {
......
...@@ -55,12 +55,12 @@ export default { ...@@ -55,12 +55,12 @@ export default {
axios axios
.get(url, { .get(url, {
// This prevents axios from automatically JSON.parse response // This prevents axios from automatically JSON.parse response
transformResponse: [f => f], transformResponse: [(f) => f],
}) })
.then(res => { .then((res) => {
this.notifyAboutUpdates({ content: res.data }); this.notifyAboutUpdates({ content: res.data });
}) })
.catch(e => this.flashAPIFailure(e)); .catch((e) => this.flashAPIFailure(e));
}, },
flashAPIFailure(err) { flashAPIFailure(err) {
Flash(sprintf(SNIPPET_BLOB_CONTENT_FETCH_ERROR, { err })); Flash(sprintf(SNIPPET_BLOB_CONTENT_FETCH_ERROR, { err }));
......
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
const { const {
blobs: { nodes: dataBlobs }, blobs: { nodes: dataBlobs },
} = data.snippets.nodes[0]; } = data.snippets.nodes[0];
const updatedBlobData = dataBlobs.find(blob => blob.path === blobPath); const updatedBlobData = dataBlobs.find((blob) => blob.path === blobPath);
return updatedBlobData.richData || updatedBlobData.plainData; return updatedBlobData.richData || updatedBlobData.plainData;
}, },
}, },
......
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
}, },
computed: { computed: {
snippetHasBinary() { snippetHasBinary() {
return Boolean(this.snippet.blobs.find(blob => blob.binary)); return Boolean(this.snippet.blobs.find((blob) => blob.binary));
}, },
authoredMessage() { authoredMessage() {
return this.snippet.author return this.snippet.author
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
this.closeDeleteModal(); this.closeDeleteModal();
this.redirectToSnippets(); this.redirectToSnippets();
}) })
.catch(err => { .catch((err) => {
this.isDeleting = false; this.isDeleting = false;
this.errorMessage = err.message; this.errorMessage = err.message;
}); });
......
...@@ -11,7 +11,7 @@ export const getSnippetMixin = { ...@@ -11,7 +11,7 @@ export const getSnippetMixin = {
ids: [this.snippetGid], ids: [this.snippetGid],
}; };
}, },
update: data => { update: (data) => {
const res = data.snippets.nodes[0]; const res = data.snippets.nodes[0];
if (res) { if (res) {
res.blobs = res.blobs.nodes; res.blobs = res.blobs.nodes;
......
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