Commit b3ece842 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 12 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 5ebea3a4
......@@ -162,39 +162,6 @@ app/assets/javascripts/ci_variable_list/ci_variable_list.js
app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue
app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
## distracted-nash
app/assets/javascripts/droplab/drop_down.js
app/assets/javascripts/droplab/drop_lab.js
app/assets/javascripts/droplab/hook_button.js
app/assets/javascripts/droplab/hook_input.js
app/assets/javascripts/droplab/plugins/ajax.js
app/assets/javascripts/droplab/plugins/ajax_filter.js
app/assets/javascripts/droplab/plugins/input_setter.js
app/assets/javascripts/due_date_select.js
app/assets/javascripts/editor/editor_lite.js
app/assets/javascripts/editor/editor_markdown_ext.js
app/assets/javascripts/editor/utils.js
app/assets/javascripts/emoji/index.js
app/assets/javascripts/emoji/no_emoji_validator.js
app/assets/javascripts/emoji/support/is_emoji_unicode_supported.js
app/assets/javascripts/emoji/support/unicode_support_map.js
app/assets/javascripts/environments/components/environment_item.vue
app/assets/javascripts/environments/components/environment_rollback.vue
app/assets/javascripts/environments/components/environments_app.vue
app/assets/javascripts/environments/components/environments_table.vue
app/assets/javascripts/environments/mixins/environments_mixin.js
app/assets/javascripts/environments/stores/environments_store.js
app/assets/javascripts/error_tracking/components/error_details.vue
app/assets/javascripts/error_tracking/store/actions.js
app/assets/javascripts/error_tracking/store/details/actions.js
app/assets/javascripts/error_tracking/store/details/getters.js
app/assets/javascripts/error_tracking/store/list/mutations.js
app/assets/javascripts/error_tracking/utils.js
app/assets/javascripts/error_tracking_settings/store/actions.js
app/assets/javascripts/error_tracking_settings/store/getters.js
app/assets/javascripts/error_tracking_settings/store/mutations.js
app/assets/javascripts/error_tracking_settings/utils.js
## modest-mayer
app/assets/javascripts/experimental_flags.js
app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
......
......@@ -68,7 +68,7 @@ class DropDown {
removeSelectedClasses() {
const items = this.items || this.getItems();
items.forEach(item => item.classList.remove(SELECTED_CLASS));
items.forEach((item) => item.classList.remove(SELECTED_CLASS));
}
addEvents() {
......@@ -162,7 +162,7 @@ class DropDown {
static setImagesSrc(template) {
const images = [...template.querySelectorAll('img[data-src]')];
images.forEach(image => {
images.forEach((image) => {
const img = image;
img.src = img.getAttribute('data-src');
......
......@@ -28,7 +28,7 @@ class DropLab {
}
destroy() {
this.hooks.forEach(hook => hook.destroy());
this.hooks.forEach((hook) => hook.destroy());
this.hooks = [];
this.removeEvents();
}
......@@ -51,7 +51,7 @@ class DropLab {
}
processData(trigger, data, methodName) {
this.hooks.forEach(hook => {
this.hooks.forEach((hook) => {
if (Array.isArray(trigger)) hook.list[methodName](trigger);
if (hook.trigger.id === trigger) hook.list[methodName](data);
......@@ -70,7 +70,7 @@ class DropLab {
if (utils.isDropDownParts(thisTag, this.hooks)) return;
if (utils.isDropDownParts(e.target, this.hooks)) return;
this.hooks.forEach(hook => hook.list.hide());
this.hooks.forEach((hook) => hook.list.hide());
}
removeEvents() {
......@@ -115,7 +115,7 @@ class DropLab {
}
addHooks(hooks, plugins, config) {
hooks.forEach(hook => this.addHook(hook, null, plugins, config));
hooks.forEach((hook) => this.addHook(hook, null, plugins, config));
return this;
}
......@@ -147,7 +147,7 @@ class DropLab {
this.fireReady();
this.queuedData.forEach(data => this.addData(data));
this.queuedData.forEach((data) => this.addData(data));
this.queuedData = [];
return this;
......
......@@ -14,7 +14,7 @@ class HookButton extends Hook {
}
addPlugins() {
this.plugins.forEach(plugin => plugin.init(this));
this.plugins.forEach((plugin) => plugin.init(this));
}
clicked(e) {
......@@ -44,7 +44,7 @@ class HookButton extends Hook {
}
removePlugins() {
this.plugins.forEach(plugin => plugin.destroy());
this.plugins.forEach((plugin) => plugin.destroy());
}
destroy() {
......
......@@ -14,7 +14,7 @@ class HookInput extends Hook {
}
addPlugins() {
this.plugins.forEach(plugin => plugin.init(this));
this.plugins.forEach((plugin) => plugin.init(this));
}
addEvents() {
......@@ -101,7 +101,7 @@ class HookInput extends Hook {
}
removePlugins() {
this.plugins.forEach(plugin => plugin.destroy());
this.plugins.forEach((plugin) => plugin.destroy());
}
destroy() {
......
......@@ -43,7 +43,7 @@ const Ajax = {
return AjaxCache.retrieve(config.endpoint)
.then(self.preprocessing.bind(null, config))
.then(data => self._loadData(data, config, self))
.then((data) => self._loadData(data, config, self))
.catch(config.onError);
},
destroy: function () {
......
......@@ -63,7 +63,7 @@ const AjaxFilter = {
params[config.searchKey] = searchValue;
var url = config.endpoint + this.buildParams(params);
return AjaxCache.retrieve(url)
.then(data => {
.then((data) => {
this._loadData(data, config);
if (config.onLoadingFinished) {
config.onLoadingFinished(data);
......
......@@ -27,7 +27,7 @@ const InputSetter = {
if (!Array.isArray(this.config)) this.config = [this.config];
this.config.forEach(config => this.setInput(config, selectedItem));
this.config.forEach((config) => this.setInput(config, selectedItem));
},
setInput(config, selectedItem) {
......
......@@ -55,9 +55,9 @@ class DueDateSelect {
field: $dueDateInput.get(0),
theme: 'gitlab-theme',
format: 'yyyy-mm-dd',
parse: dateString => parsePikadayDate(dateString),
toString: date => pikadayToString(date),
onSelect: dateText => {
parse: (dateString) => parsePikadayDate(dateString),
toString: (date) => pikadayToString(date),
onSelect: (dateText) => {
$dueDateInput.val(calendar.toString(dateText));
if (this.$dropdown.hasClass('js-issue-boards-due-date')) {
......@@ -76,7 +76,7 @@ class DueDateSelect {
}
initRemoveDueDate() {
this.$block.on('click', '.js-remove-due-date', e => {
this.$block.on('click', '.js-remove-due-date', (e) => {
const calendar = this.$datePicker.data('pikaday');
e.preventDefault();
......@@ -103,7 +103,7 @@ class DueDateSelect {
if (this.rawSelectedDate.length) {
// Construct Date object manually to avoid buggy dateString support within Date constructor
const dateArray = this.rawSelectedDate.split('-').map(v => parseInt(v, 10));
const dateArray = this.rawSelectedDate.split('-').map((v) => parseInt(v, 10));
const dateObj = new Date(dateArray[0], dateArray[1] - 1, dateArray[2]);
this.displayedDate = dateFormat(dateObj, 'mmm d, yyyy');
} else {
......@@ -182,8 +182,8 @@ export default class DueDateSelectors {
theme: 'gitlab-theme animate-picker',
format: 'yyyy-mm-dd',
container: $datePicker.parent().get(0),
parse: dateString => parsePikadayDate(dateString),
toString: date => pikadayToString(date),
parse: (dateString) => parsePikadayDate(dateString),
toString: (date) => pikadayToString(date),
onSelect(dateText) {
$datePicker.val(calendar.toString(dateText));
},
......@@ -195,7 +195,7 @@ export default class DueDateSelectors {
$datePicker.data('pikaday', calendar);
});
$('.js-clear-due-date,.js-clear-start-date').on('click', e => {
$('.js-clear-due-date,.js-clear-start-date').on('click', (e) => {
e.preventDefault();
const calendar = $(e.target).siblings('.datepicker').data('pikaday');
calendar.setDate(null);
......
......@@ -24,7 +24,7 @@ export default class EditorLite {
static setupMonacoTheme() {
const themeName = window.gon?.user_color_scheme || DEFAULT_THEME;
const theme = themes.find(t => t.name === themeName);
const theme = themes.find((t) => t.name === themeName);
if (theme) monacoEditor.defineTheme(themeName, theme.data);
monacoEditor.setTheme(theme ? themeName : DEFAULT_THEME);
}
......@@ -35,7 +35,7 @@ export default class EditorLite {
const ext = `.${path.split('.').pop()}`;
const language = monacoLanguages
.getLanguages()
.find(lang => lang.extensions.indexOf(ext) !== -1);
.find((lang) => lang.extensions.indexOf(ext) !== -1);
const id = language ? language.id : 'plaintext';
monacoEditor.setModelLanguage(model, id);
}
......@@ -51,7 +51,7 @@ export default class EditorLite {
const promises = [];
const extensionsArray = typeof extensions === 'string' ? extensions.split(',') : extensions;
extensionsArray.forEach(ext => {
extensionsArray.forEach((ext) => {
const prefix = ext.includes('/') ? '' : 'editor/';
const trimmedExt = ext.replace(/^\//, '').trim();
EditorLite.pushToImportsArray(promises, `~/${prefix}${trimmedExt}`);
......@@ -66,7 +66,7 @@ export default class EditorLite {
}
const isClassInstance = source.constructor.prototype !== Object.prototype;
const sanitizedSource = isClassInstance ? source.constructor.prototype : source;
Object.getOwnPropertyNames(sanitizedSource).forEach(prop => {
Object.getOwnPropertyNames(sanitizedSource).forEach((prop) => {
if (prop !== 'constructor') {
Object.assign(inst, { [prop]: source[prop] });
}
......@@ -110,17 +110,17 @@ export default class EditorLite {
});
instance.setModel(model);
instance.onDidDispose(() => {
const index = this.instances.findIndex(inst => inst === instance);
const index = this.instances.findIndex((inst) => inst === instance);
this.instances.splice(index, 1);
model.dispose();
});
instance.updateModelLanguage = path => EditorLite.updateModelLanguage(path, instance);
instance.use = args => this.use(args, instance);
instance.updateModelLanguage = (path) => EditorLite.updateModelLanguage(path, instance);
instance.use = (args) => this.use(args, instance);
EditorLite.loadExtensions(extensions, instance)
.then(modules => {
.then((modules) => {
if (modules) {
modules.forEach(module => {
modules.forEach((module) => {
instance.use(module.default);
});
}
......@@ -128,7 +128,7 @@ export default class EditorLite {
.then(() => {
el.dispatchEvent(new Event('editor-ready'));
})
.catch(e => {
.catch((e) => {
throw e;
});
......@@ -137,20 +137,20 @@ export default class EditorLite {
}
dispose() {
this.instances.forEach(instance => instance.dispose());
this.instances.forEach((instance) => instance.dispose());
}
use(exts = [], instance = null) {
const extensions = Array.isArray(exts) ? exts : [exts];
const initExtensions = inst => {
extensions.forEach(extension => {
const initExtensions = (inst) => {
extensions.forEach((extension) => {
EditorLite.mixIntoInstance(extension, inst);
});
};
if (instance) {
initExtensions(instance);
} else {
this.instances.forEach(inst => {
this.instances.forEach((inst) => {
initExtensions(inst);
});
}
......
......@@ -76,7 +76,7 @@ export class EditorMarkdownExtension extends EditorLiteExtension {
if (textLines.length > 1) {
// Multi-line selection
lineShift = textLines.findIndex(line => line.indexOf(toSelect) !== -1);
lineShift = textLines.findIndex((line) => line.indexOf(toSelect) !== -1);
newStartLineNumber = currentSelection.startLineNumber + lineShift;
newStartColumn = textLines[lineShift].indexOf(toSelect) + 1;
} else {
......
export const clearDomElement = el => {
export const clearDomElement = (el) => {
if (!el || !el.firstChild) return;
while (el.firstChild) {
......
......@@ -35,7 +35,7 @@ async function prepareEmojiMap() {
validEmojiNames = [...Object.keys(emojiMap), ...Object.keys(emojiAliases)];
Object.keys(emojiMap).forEach(name => {
Object.keys(emojiMap).forEach((name) => {
emojiMap[name].aliases = [];
emojiMap[name].name = name;
});
......@@ -122,23 +122,23 @@ const searchMatchers = {
const searchPredicates = {
// Search by name
name: (matcher, query) => emoji => {
name: (matcher, query) => (emoji) => {
const m = matcher(emoji.name, query);
return [{ ...m, emoji, field: emoji.name }];
},
// Search by alias
alias: (matcher, query) => emoji =>
emoji.aliases.map(alias => {
alias: (matcher, query) => (emoji) =>
emoji.aliases.map((alias) => {
const m = matcher(alias, query);
return { ...m, emoji, field: alias };
}),
// Search by description
description: (matcher, query) => emoji => {
description: (matcher, query) => (emoji) => {
const m = matcher(emoji.d, query);
return [{ ...m, emoji, field: emoji.d }];
},
// Search by unicode value (always exact)
unicode: (matcher, query) => emoji => {
unicode: (matcher, query) => (emoji) => {
return [{ emoji, field: emoji.e, success: emoji.e === query }];
},
};
......@@ -196,18 +196,18 @@ export function searchEmoji(query, opts) {
}
const matcher = searchMatchers[match] || searchMatchers.exact;
const predicates = fields.map(f => searchPredicates[f](matcher, query));
const predicates = fields.map((f) => searchPredicates[f](matcher, query));
const results = Object.values(emojiMap)
.flatMap(emoji => predicates.flatMap(predicate => predicate(emoji)))
.filter(r => r.success);
.flatMap((emoji) => predicates.flatMap((predicate) => predicate(emoji)))
.filter((r) => r.success);
// Fallback to question mark for unknown emojis
if (fallback && results.length === 0) {
return raw ? [{ emoji: fallbackEmoji }] : [fallbackEmoji];
}
return raw ? results : results.map(r => r.emoji);
return raw ? results : results.map((r) => r.emoji);
}
let emojiCategoryMap;
......@@ -223,7 +223,7 @@ export function getEmojiCategoryMap() {
symbols: [],
flags: [],
};
Object.keys(emojiMap).forEach(name => {
Object.keys(emojiMap).forEach((name) => {
const emoji = emojiMap[name];
if (emojiCategoryMap[emoji.c]) {
emojiCategoryMap[emoji.c].push(name);
......
......@@ -9,7 +9,7 @@ export default class NoEmojiValidator extends InputValidator {
const container = opts.container || '';
this.noEmojiEmelents = document.querySelectorAll(`${container} .js-block-emoji`);
this.noEmojiEmelents.forEach(element =>
this.noEmojiEmelents.forEach((element) =>
element.addEventListener('input', this.eventHandler.bind(this)),
);
}
......
......@@ -33,7 +33,7 @@ const tone5 = 127999; // parseInt('1F3FF', 16)
function isSkinToneComboEmoji(emojiUnicode) {
return (
emojiUnicode.length > 2 &&
Array.from(emojiUnicode).some(char => {
Array.from(emojiUnicode).some((char) => {
const cp = char.codePointAt(0);
return cp >= tone1 && cp <= tone5;
})
......@@ -60,7 +60,7 @@ const personEndCodePoint = 128105; // parseInt('1F469', 16)
function isPersonZwjEmoji(emojiUnicode) {
let hasPersonEmoji = false;
let hasZwj = false;
Array.from(emojiUnicode).forEach(character => {
Array.from(emojiUnicode).forEach((character) => {
const cp = character.codePointAt(0);
if (cp === zwj) {
hasZwj = true;
......
......@@ -89,9 +89,9 @@ function generateUnicodeSupportMap(testMap) {
ctx.font = `${fontSize}px "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
// Write each emoji to the canvas vertically
let writeIndex = 0;
testMapKeys.forEach(testKey => {
testMapKeys.forEach((testKey) => {
const testEntry = testMap[testKey];
[].concat(testEntry).forEach(emojiUnicode => {
[].concat(testEntry).forEach((emojiUnicode) => {
ctx.fillText(emojiUnicode, 0, writeIndex * fontSize + fontSize / 2);
writeIndex += 1;
});
......@@ -100,11 +100,11 @@ function generateUnicodeSupportMap(testMap) {
// Read from the canvas
const resultMap = {};
let readIndex = 0;
testMapKeys.forEach(testKey => {
testMapKeys.forEach((testKey) => {
const testEntry = testMap[testKey];
// This needs to be a `reduce` instead of `every` because we need to
// keep the `readIndex` in sync from the writes by running all entries
const isTestSatisfied = [].concat(testEntry).reduce(isSatisfied => {
const isTestSatisfied = [].concat(testEntry).reduce((isSatisfied) => {
// Sample along the vertical-middle for a couple of characters
const imageData = ctx.getImageData(0, readIndex * fontSize + fontSize / 2, 2 * fontSize, 1)
.data;
......
......@@ -226,7 +226,7 @@ export default {
{ deep: true },
);
const combinedActions = (manualActions || []).concat(scheduledActions || []);
return combinedActions.map(action => ({
return combinedActions.map((action) => ({
...action,
name: action.name,
}));
......
......@@ -55,7 +55,7 @@ export default {
retryUrl: this.retryUrl,
isLastDeployment: this.isLastDeployment,
});
eventHub.$on('rollbackEnvironment', environment => {
eventHub.$on('rollbackEnvironment', (environment) => {
if (environment.id === this.environment.id) {
this.isLoading = true;
}
......
......@@ -116,7 +116,7 @@ export default {
this.service
.getFolderContent(folder.folder_path)
.then(response => this.store.setfolderContent(folder, response.data.environments))
.then((response) => this.store.setfolderContent(folder, response.data.environments))
.then(() => this.store.updateEnvironmentProp(folder, 'isLoadingFolderContent', false))
.catch(() => {
Flash(s__('Environments|An error occurred while fetching the environments.'));
......@@ -130,7 +130,7 @@ export default {
// We need to verify if any folder is open to also update it
const openFolders = this.store.getOpenFolders();
if (openFolders.length) {
openFolders.forEach(folder => this.fetchChildEnvironments(folder));
openFolders.forEach((folder) => this.fetchChildEnvironments(folder));
}
},
},
......
......@@ -67,7 +67,7 @@ export default {
},
computed: {
sortedEnvironments() {
return this.sortEnvironments(this.environments).map(env =>
return this.sortEnvironments(this.environments).map((env) =>
this.shouldRenderFolderContent(env)
? { ...env, children: this.sortEnvironments(env.children) }
: env,
......@@ -144,11 +144,11 @@ export default {
* 5. Put folders first.
*/
return flow(
sortBy(env => (env.isFolder ? env.folderName : env.name)),
sortBy((env) => (env.isFolder ? env.folderName : env.name)),
reverse,
sortBy(env => (env.last_deployment ? env.last_deployment.created_at : '0000')),
sortBy((env) => (env.last_deployment ? env.last_deployment.created_at : '0000')),
reverse,
sortBy(env => (env.isFolder ? -1 : 1)),
sortBy((env) => (env.isFolder ? -1 : 1)),
)(environments);
},
changeCanaryWeight(model, weight) {
......
......@@ -64,7 +64,7 @@ export default {
},
filterNilValues(obj) {
return omitBy(obj, value => value === undefined || value === null);
return omitBy(obj, (value) => value === undefined || value === null);
},
/**
......@@ -80,7 +80,7 @@ export default {
// fetch new data
return this.service
.fetchEnvironments(this.requestData)
.then(response => {
.then((response) => {
this.successCallback(response);
this.poll.enable({ data: this.requestData, response });
})
......@@ -107,7 +107,7 @@ export default {
this.service
.postAction(endpoint)
.then(() => this.fetchEnvironments())
.catch(err => {
.catch((err) => {
this.isLoading = false;
Flash(isFunction(errorMessage) ? errorMessage(err.response.data) : errorMessage);
});
......@@ -219,7 +219,7 @@ export default {
data: this.requestData,
successCallback: this.successCallback,
errorCallback: this.errorCallback,
notificationCallback: isMakingRequest => {
notificationCallback: (isMakingRequest) => {
this.isMakingRequest = isMakingRequest;
},
});
......
......@@ -46,9 +46,9 @@ export default class EnvironmentsStore {
* @returns {Array}
*/
storeEnvironments(environments = []) {
const filteredEnvironments = environments.map(env => {
const filteredEnvironments = environments.map((env) => {
const oldEnvironmentState =
this.state.environments.find(element => {
this.state.environments.find((element) => {
if (env.latest) {
return element.id === env.latest.id;
}
......@@ -163,7 +163,7 @@ export default class EnvironmentsStore {
* @return {Object}
*/
setfolderContent(folder, environments) {
const updatedEnvironments = environments.map(env => {
const updatedEnvironments = environments.map((env) => {
let updated = env;
if (env.latest) {
......@@ -192,7 +192,7 @@ export default class EnvironmentsStore {
updateEnvironmentProp(environment, prop, newValue) {
const { environments } = this.state;
const updatedEnvironments = environments.map(env => {
const updatedEnvironments = environments.map((env) => {
const updateEnv = { ...env };
if (env.id === environment.id) {
updateEnv[prop] = newValue;
......@@ -207,6 +207,6 @@ export default class EnvironmentsStore {
getOpenFolders() {
const { environments } = this.state;
return environments.filter(env => env.isFolder && env.isOpen);
return environments.filter((env) => env.isFolder && env.isOpen);
}
}
......@@ -87,7 +87,7 @@ export default {
};
},
pollInterval: 2000,
update: data => data.project.sentryErrors.detailedError,
update: (data) => data.project.sentryErrors.detailedError,
error: () => createFlash(__('Failed to load error details from Sentry.')),
result(res) {
if (res.data.project?.sentryErrors?.detailedError) {
......@@ -213,7 +213,7 @@ export default {
this.errorStatus === errorStatus.RESOLVED ? errorStatus.UNRESOLVED : errorStatus.RESOLVED;
// eslint-disable-next-line promise/catch-or-return
this.updateResolveStatus({ endpoint: this.issueUpdatePath, status }).then(res => {
this.updateResolveStatus({ endpoint: this.issueUpdatePath, status }).then((res) => {
this.closedIssueId = res.closed_issue_iid;
if (this.closedIssueId) {
this.isAlertVisible = true;
......
......@@ -11,7 +11,7 @@ export const setStatus = ({ commit }, status) => {
export const updateStatus = ({ commit }, { endpoint, redirectUrl, status }) =>
service
.updateErrorStatus(endpoint, status)
.then(resp => {
.then((resp) => {
commit(types.SET_ERROR_STATUS, status);
if (redirectUrl) visitUrl(redirectUrl);
......
......@@ -6,7 +6,7 @@ import { __ } from '~/locale';
let stackTracePoll;
const stopPolling = poll => {
const stopPolling = (poll) => {
if (poll) poll.stop();
};
......
export const stacktrace = state =>
export const stacktrace = (state) =>
state.stacktraceData.stack_trace_entries
? state.stacktraceData.stack_trace_entries.reverse()
: [];
......@@ -17,7 +17,7 @@ export default {
return;
}
// remove any existing item, then add it to the start of the list
const recentSearches = state.recentSearches.filter(s => s !== searchTerm);
const recentSearches = state.recentSearches.filter((s) => s !== searchTerm);
recentSearches.unshift(searchTerm);
// only keep the last 5
state.recentSearches = recentSearches.slice(0, 5);
......@@ -60,7 +60,7 @@ export default {
state.endpoint = endpoint;
},
[types.REMOVE_IGNORED_RESOLVED_ERRORS](state, error) {
state.errors = state.errors.filter(err => err.id !== error);
state.errors = state.errors.filter((err) => err.id !== error);
},
[types.SET_STATUS_FILTER](state, query) {
state.statusFilter = query;
......
......@@ -4,7 +4,7 @@
* Tracks snowplow event when User clicks on error link to Sentry
* @param {String} externalUrl that will be send as a property for the event
*/
export const trackClickErrorLinkToSentryOptions = url => ({
export const trackClickErrorLinkToSentryOptions = (url) => ({
category: 'Error Tracking',
action: 'click_error_link_to_sentry',
label: 'Error Link',
......@@ -30,7 +30,7 @@ export const trackErrorDetailsViewsOptions = {
/**
* Tracks snowplow event when error status is updated
*/
export const trackErrorStatusUpdateOptions = status => ({
export const trackErrorStatusUpdateOptions = (status) => ({
category: 'Error Tracking',
action: `update_${status}_status`,
});
......@@ -63,7 +63,7 @@ export const updateSettings = ({ dispatch, state }) => {
.then(() => {
refreshCurrentPage();
})
.catch(err => {
.catch((err) => {
dispatch('receiveSettingsError', err);
});
};
......
......@@ -2,12 +2,12 @@ import { isMatch } from 'lodash';
import { __, s__, sprintf } from '~/locale';
import { getDisplayName } from '../utils';
export const hasProjects = state => Boolean(state.projects) && state.projects.length > 0;
export const hasProjects = (state) => Boolean(state.projects) && state.projects.length > 0;
export const isProjectInvalid = (state, getters) =>
Boolean(state.selectedProject) &&
getters.hasProjects &&
!state.projects.some(project => isMatch(state.selectedProject, project));
!state.projects.some((project) => isMatch(state.selectedProject, project));
export const dropdownLabel = (state, getters) => {
if (state.selectedProject !== null) {
......@@ -19,7 +19,7 @@ export const dropdownLabel = (state, getters) => {
return s__('ErrorTracking|Select project');
};
export const invalidProjectLabel = state => {
export const invalidProjectLabel = (state) => {
if (state.selectedProject) {
return sprintf(
__('Project "%{name}" is no longer available. Select another project to continue.'),
......@@ -31,7 +31,7 @@ export const invalidProjectLabel = state => {
return '';
};
export const projectSelectionLabel = state => {
export const projectSelectionLabel = (state) => {
if (state.token) {
return s__(
"ErrorTracking|Click 'Connect' to re-establish the connection to Sentry and activate the dropdown.",
......
......@@ -12,7 +12,7 @@ export default {
.map(convertObjectPropsToCamelCase)
// The `pick` strips out extra properties returned from Sentry.
// Such properties could be problematic later, e.g. when checking whether `projects` contains `selectedProject`
.map(project => pick(project, projectKeys));
.map((project) => pick(project, projectKeys));
},
[types.RESET_CONNECT](state) {
state.connectSuccessful = false;
......
......@@ -13,4 +13,4 @@ export const transformFrontendSettings = ({ apiHost, enabled, token, selectedPro
return { api_host: apiHost || null, enabled, token: token || null, project };
};
export const getDisplayName = project => `${project.organizationName} | ${project.slug}`;
export const getDisplayName = (project) => `${project.organizationName} | ${project.slug}`;
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