Commit 0e334037 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 30 files: 5 of 8

Mandatory not to break master. Automatically created with prettier.
parent 07f5bc94
......@@ -80,7 +80,7 @@ export default {
v-on="$listeners"
@input="searchAuthors"
>
<template #view="{inputValue}">
<template #view="{ inputValue }">
<gl-avatar
v-if="activeUser"
:size="16"
......
......@@ -125,7 +125,7 @@ const createTestDetails = () => {
});
};
export default async function() {
export default async function () {
createTestDetails();
createDagApp();
......
......@@ -198,6 +198,9 @@ export default class PipelineStore {
}
removeExpandedPipelineToRequestData(id) {
this.state.expandedPipelines.splice(this.state.expandedPipelines.findIndex(el => el === id), 1);
this.state.expandedPipelines.splice(
this.state.expandedPipelines.findIndex(el => el === id),
1,
);
}
}
......@@ -61,7 +61,7 @@ import { loadCSSFile } from '../lib/utils/css_utils';
bindEvents() {
const _this = this;
this.fileInput.on('change', function(e) {
this.fileInput.on('change', function (e) {
_this.onFileInputChange(e, this);
this.value = null;
});
......@@ -69,7 +69,7 @@ import { loadCSSFile } from '../lib/utils/css_utils';
this.modalCrop.on('shown.bs.modal', this.onModalShow);
this.modalCrop.on('hidden.bs.modal', this.onModalHide);
this.uploadImageBtn.on('click', this.onUploadImageBtnClick);
this.cropActionsBtn.on('click', function() {
this.cropActionsBtn.on('click', function () {
const btn = this;
return _this.onActionBtnClick(btn);
});
......@@ -184,8 +184,8 @@ import { loadCSSFile } from '../lib/utils/css_utils';
const cropModal = document.querySelector('.modal-profile-crop');
if (cropModal) loadCSSFile(cropModal.dataset.cropperCssPath);
$.fn.glCrop = function(opts) {
return this.each(function() {
$.fn.glCrop = function (opts) {
return this.each(function () {
return $(this).data('glcrop', new GitLabCrop(this, opts));
});
};
......
......@@ -33,9 +33,7 @@ export default class Profile {
uploadImageBtn: '.js-upload-user-avatar',
modalCropImg: '.modal-profile-crop-image',
};
this.avatarGlCrop = $('.js-user-avatar-input')
.glCrop(cropOpts)
.data('glcrop');
this.avatarGlCrop = $('.js-user-avatar-input').glCrop(cropOpts).data('glcrop');
}
bindEvents() {
......
......@@ -10,7 +10,7 @@ import { deprecatedCreateFlash as flash } from '~/flash';
import { __ } from '~/locale';
// highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> )
const highlighter = function(element, text, matches) {
const highlighter = function (element, text, matches) {
let j = 0;
let len = 0;
let lastIndex = 0;
......@@ -65,11 +65,7 @@ export default class ProjectFindFile {
if (value !== oldValue) {
target.data('oldValue', value);
this.findFile();
return this.element
.find('tr.tree-item')
.eq(0)
.addClass('selected')
.focus();
return this.element.find('tr.tree-item').eq(0).addClass('selected').focus();
}
});
}
......@@ -90,11 +86,7 @@ export default class ProjectFindFile {
this.element.find('.loading').hide();
this.filePaths = data;
this.findFile();
this.element
.find('.files-slider tr.tree-item')
.eq(0)
.addClass('selected')
.focus();
this.element.find('.files-slider tr.tree-item').eq(0).addClass('selected').focus();
})
.catch(() => flash(__('An error occurred while loading filenames')));
}
......
......@@ -9,7 +9,7 @@ import { loadCSSFile } from './lib/utils/css_utils';
const projectSelect = () => {
loadCSSFile(gon.select2_css_path)
.then(() => {
$('.ajax-project-select').each(function(i, select) {
$('.ajax-project-select').each(function (i, select) {
let placeholder;
const simpleFilter = $(select).data('simpleFilter') || false;
const isInstantiated = $(select).data('select2');
......@@ -35,15 +35,15 @@ const projectSelect = () => {
minimumInputLength: 0,
query: query => {
let projectsCallback;
const finalCallback = function(projects) {
const finalCallback = function (projects) {
const data = {
results: projects,
};
return query.callback(data);
};
if (this.includeGroups) {
projectsCallback = function(projects) {
const groupsCallback = function(groups) {
projectsCallback = function (projects) {
const groupsCallback = function (groups) {
const data = groups.concat(projects);
return finalCallback(data);
};
......
......@@ -50,9 +50,7 @@ export default class ProjectSelectComboButton {
// eslint-disable-next-line promise/no-nesting
loadCSSFile(gon.select2_css_path)
.then(() => {
$(event.currentTarget)
.siblings('.project-item-select')
.select2('open');
$(event.currentTarget).siblings('.project-item-select').select2('open');
})
.catch(() => {});
})
......@@ -104,14 +102,8 @@ export default class ProjectSelectComboButton {
const defaultTextPrefix = this.resourceLabel;
// the trailing slice call depluralizes each of these strings (e.g. new-issues -> new-issue)
const localStorageItemType = `new-${this.resourceType
.split('_')
.join('-')
.slice(0, -1)}`;
const presetTextSuffix = this.resourceType
.split('_')
.join(' ')
.slice(0, -1);
const localStorageItemType = `new-${this.resourceType.split('_').join('-').slice(0, -1)}`;
const presetTextSuffix = this.resourceType.split('_').join(' ').slice(0, -1);
return {
localStorageItemType, // new-issue / new-merge-request
......
......@@ -3,9 +3,7 @@ import $ from 'jquery';
export const initDetailsButton = () => {
$('body').on('click', '.js-details-expand', function expand(e) {
e.preventDefault();
$(this)
.next('.js-details-content')
.removeClass('hide');
$(this).next('.js-details-content').removeClass('hide');
$(this).hide();
});
};
import Vue from 'vue';
import NewProjectCreationApp from './components/app.vue';
export default function(el, props) {
export default function (el, props) {
return new Vue({
el,
components: {
......
......@@ -91,9 +91,7 @@ const bindEvents = () => {
$('.how_to_import_link').on('click', e => {
e.preventDefault();
$(e.currentTarget)
.next('.modal')
.show();
$(e.currentTarget).next('.modal').show();
});
$('.modal-header .close').on('click', () => {
......@@ -151,10 +149,7 @@ const bindEvents = () => {
const selectedTemplate = DEFAULT_PROJECT_TEMPLATES[value];
$selectedTemplateText.text(selectedTemplate.text);
$(selectedTemplate.icon)
.clone()
.addClass('d-block')
.appendTo($selectedIcon);
$(selectedTemplate.icon).clone().addClass('d-block').appendTo($selectedIcon);
const $activeTabProjectName = $('.tab-pane.active #project_name');
const $activeTabProjectPath = $('.tab-pane.active #project_path');
......
......@@ -83,10 +83,7 @@ export default {
});
},
fetchPipelineCommitData() {
this.service
.fetchData()
.then(this.successCallback)
.catch(this.errorCallback);
this.service.fetchData().then(this.successCallback).catch(this.errorCallback);
},
},
};
......
......@@ -60,7 +60,7 @@ export default {
@dismiss="$emit('change', null)"
>
<gl-sprintf :message="deleteAlertConfig.message">
<template #docLink="{content}">
<template #docLink="{ content }">
<gl-link :href="garbageCollectionHelpPagePath" target="_blank">
{{ content }}
</gl-link>
......
......@@ -23,12 +23,12 @@ export default {
<template>
<gl-alert variant="warning" :title="$options.i18n.DELETE_ALERT_TITLE" @dismiss="$emit('dismiss')">
<gl-sprintf :message="$options.i18n.DELETE_ALERT_LINK_TEXT">
<template #adminLink="{content}">
<template #adminLink="{ content }">
<gl-link data-testid="run-link" :href="runCleanupPoliciesHelpPagePath" target="_blank">{{
content
}}</gl-link>
</template>
<template #docLink="{content}">
<template #docLink="{ content }">
<gl-link data-testid="help-link" :href="cleanupPoliciesHelpPagePath" target="_blank">{{
content
}}</gl-link>
......
......@@ -138,9 +138,7 @@ export default {
<template #left-secondary>
<span data-testid="size">
{{ formattedSize }}
<template v-if="formattedSize && layers"
>&middot;</template
>
<template v-if="formattedSize && layers">&middot;</template>
{{ layers }}
</span>
</template>
......
......@@ -25,7 +25,7 @@ export default {
)
"
>
<template #docLink="{content}">
<template #docLink="{ content }">
<gl-link :href="config.helpPagePath" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
......
......@@ -45,7 +45,7 @@ export default {
<template #description>
<p>
<gl-sprintf :message="$options.i18n.introText">
<template #docLink="{content}">
<template #docLink="{ content }">
<gl-link :href="config.helpPagePath" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
......@@ -53,10 +53,10 @@ export default {
<h5>{{ $options.i18n.quickStart }}</h5>
<p>
<gl-sprintf :message="$options.i18n.notLoggedInMessage">
<template #twofaDocLink="{content}">
<template #twofaDocLink="{ content }">
<gl-link :href="config.twoFactorAuthHelpLink" target="_blank">{{ content }}</gl-link>
</template>
<template #personalAccessTokensDocLink="{content}">
<template #personalAccessTokensDocLink="{ content }">
<gl-link :href="config.personalAccessTokensHelpLink" target="_blank">{{
content
}}</gl-link>
......@@ -81,7 +81,7 @@ export default {
<p class="gl-mb-4">
{{ $options.i18n.addImageText }}
</p>
<gl-form-input-group class="gl-mb-4 ">
<gl-form-input-group class="gl-mb-4">
<gl-form-input
:value="dockerBuildCommand"
readonly
......
......@@ -230,7 +230,7 @@ export default {
<template #description>
<p>
<gl-sprintf :message="$options.i18n.CONNECTION_ERROR_MESSAGE">
<template #docLink="{content}">
<template #docLink="{ content }">
<gl-link :href="`${config.helpPagePath}#docker-connection-error`" target="_blank">
{{ content }}
</gl-link>
......
......@@ -83,7 +83,7 @@ export default {
<template #label>
<span data-testid="label">
<gl-sprintf :message="label">
<template #italic="{content}">
<template #italic="{ content }">
<i>{{ content }}</i>
</template>
</gl-sprintf>
......@@ -100,7 +100,7 @@ export default {
<template #description>
<span data-testid="description" class="gl-text-gray-400">
<gl-sprintf :message="description">
<template #link="{content}">
<template #link="{ content }">
<gl-link :href="tagsRegexHelpPagePath" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
......
......@@ -42,7 +42,7 @@ export default {
<gl-toggle id="expiration-policy-toggle" v-model="enabled" :disabled="disabled" />
<span class="gl-ml-5 gl-line-height-24" data-testid="description">
<gl-sprintf :message="toggleText">
<template #strong="{content}">
<template #strong="{ content }">
<strong>{{ content }}</strong>
</template>
</gl-sprintf>
......
......@@ -214,10 +214,10 @@ export default {
<div>
<p>
<gl-sprintf :message="$options.i18n.KEEP_INFO_TEXT">
<template #strong="{content}">
<template #strong="{ content }">
<strong>{{ content }}</strong>
</template>
<template #secondStrong="{content}">
<template #secondStrong="{ content }">
<strong>{{ content }}</strong>
</template>
</gl-sprintf>
......@@ -253,10 +253,10 @@ export default {
<div>
<p>
<gl-sprintf :message="$options.i18n.REMOVE_INFO_TEXT">
<template #strong="{content}">
<template #strong="{ content }">
<strong>{{ content }}</strong>
</template>
<template #secondStrong="{content}">
<template #secondStrong="{ content }">
<strong>{{ content }}</strong>
</template>
</gl-sprintf>
......
......@@ -21,16 +21,10 @@ export default {
rel="noopener noreferrer nofollow"
class="break-link"
>
{{ issue.path
}}<template v-if="issue.line"
>:{{ issue.line }}</template
>
{{ issue.path }}<template v-if="issue.line">:{{ issue.line }}</template>
</a>
<template v-else>
{{ issue.path
}}<template v-if="issue.line"
>:{{ issue.line }}</template
>
{{ issue.path }}<template v-if="issue.line">:{{ issue.line }}</template>
</template>
</div>
</template>
......@@ -48,9 +48,7 @@ export default {
inline
class="d-inline-block align-text-bottom"
/>
<router-link v-else :to="parentRoute" :aria-label="__('Go to parent')">
..
</router-link>
<router-link v-else :to="parentRoute" :aria-label="__('Go to parent')"> .. </router-link>
</td>
</tr>
</template>
......@@ -15,13 +15,13 @@ function Sidebar() {
this.addEventListeners();
}
Sidebar.initialize = function() {
Sidebar.initialize = function () {
if (!this.instance) {
this.instance = new Sidebar();
}
};
Sidebar.prototype.removeListeners = function() {
Sidebar.prototype.removeListeners = function () {
this.sidebar.off('click', '.sidebar-collapsed-icon');
// eslint-disable-next-line @gitlab/no-global-event-off
this.sidebar.off('hidden.gl.dropdown');
......@@ -32,7 +32,7 @@ Sidebar.prototype.removeListeners = function() {
$(document).off('click', '.js-sidebar-toggle');
};
Sidebar.prototype.addEventListeners = function() {
Sidebar.prototype.addEventListeners = function () {
const $document = $(document);
this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked);
......@@ -44,7 +44,7 @@ Sidebar.prototype.addEventListeners = function() {
.on('click', '.js-issuable-todo', this.toggleTodo);
};
Sidebar.prototype.sidebarToggleClicked = function(e, triggered) {
Sidebar.prototype.sidebarToggleClicked = function (e, triggered) {
const $this = $(this);
const $collapseIcon = $('.js-sidebar-collapse');
const $expandIcon = $('.js-sidebar-expand');
......@@ -60,9 +60,7 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) {
$('aside.right-sidebar')
.removeClass('right-sidebar-expanded')
.addClass('right-sidebar-collapsed');
$('.layout-page')
.removeClass('right-sidebar-expanded')
.addClass('right-sidebar-collapsed');
$('.layout-page').removeClass('right-sidebar-expanded').addClass('right-sidebar-collapsed');
} else {
$toggleContainer.data('is-expanded', true);
$expandIcon.addClass('hidden');
......@@ -70,9 +68,7 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) {
$('aside.right-sidebar')
.removeClass('right-sidebar-collapsed')
.addClass('right-sidebar-expanded');
$('.layout-page')
.removeClass('right-sidebar-collapsed')
.addClass('right-sidebar-expanded');
$('.layout-page').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded');
}
$this.attr('data-original-title', tooltipLabel);
......@@ -82,16 +78,14 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) {
}
};
Sidebar.prototype.toggleTodo = function(e) {
Sidebar.prototype.toggleTodo = function (e) {
const $this = $(e.currentTarget);
const ajaxType = $this.data('deletePath') ? 'delete' : 'post';
const url = String($this.data('deletePath') || $this.data('createPath'));
hide($this);
$('.js-issuable-todo')
.disable()
.addClass('is-loading');
$('.js-issuable-todo').disable().addClass('is-loading');
axios[ajaxType](url, {
issuable_id: $this.data('issuableId'),
......@@ -110,7 +104,7 @@ Sidebar.prototype.toggleTodo = function(e) {
);
};
Sidebar.prototype.todoUpdateDone = function(data) {
Sidebar.prototype.todoUpdateDone = function (data) {
const deletePath = data.delete_path ? data.delete_path : null;
const attrPrefix = deletePath ? 'mark' : 'todo';
const $todoBtns = $('.js-issuable-todo');
......@@ -140,7 +134,7 @@ Sidebar.prototype.todoUpdateDone = function(data) {
});
};
Sidebar.prototype.sidebarCollapseClicked = function(e) {
Sidebar.prototype.sidebarCollapseClicked = function (e) {
if ($(e.currentTarget).hasClass('dont-change-state')) {
return;
}
......@@ -150,7 +144,7 @@ Sidebar.prototype.sidebarCollapseClicked = function(e) {
return sidebar.openDropdown($block);
};
Sidebar.prototype.openDropdown = function(blockOrName) {
Sidebar.prototype.openDropdown = function (blockOrName) {
const $block = typeof blockOrName === 'string' ? this.getBlock(blockOrName) : blockOrName;
if (!this.isOpen()) {
this.setCollapseAfterUpdate($block);
......@@ -164,19 +158,19 @@ Sidebar.prototype.openDropdown = function(blockOrName) {
});
};
Sidebar.prototype.setCollapseAfterUpdate = function($block) {
Sidebar.prototype.setCollapseAfterUpdate = function ($block) {
$block.addClass('collapse-after-update');
return $('.layout-page').addClass('with-overlay');
};
Sidebar.prototype.onSidebarDropdownHidden = function(e) {
Sidebar.prototype.onSidebarDropdownHidden = function (e) {
const sidebar = e.data;
e.preventDefault();
const $block = $(e.target).closest('.block');
return sidebar.sidebarDropdownHidden($block);
};
Sidebar.prototype.sidebarDropdownHidden = function($block) {
Sidebar.prototype.sidebarDropdownHidden = function ($block) {
if ($block.hasClass('collapse-after-update')) {
$block.removeClass('collapse-after-update');
$('.layout-page').removeClass('with-overlay');
......@@ -184,11 +178,11 @@ Sidebar.prototype.sidebarDropdownHidden = function($block) {
}
};
Sidebar.prototype.triggerOpenSidebar = function() {
Sidebar.prototype.triggerOpenSidebar = function () {
return this.sidebar.find('.js-sidebar-toggle').trigger('click');
};
Sidebar.prototype.toggleSidebar = function(action) {
Sidebar.prototype.toggleSidebar = function (action) {
if (action == null) {
action = 'toggle';
}
......@@ -207,11 +201,11 @@ Sidebar.prototype.toggleSidebar = function(action) {
}
};
Sidebar.prototype.isOpen = function() {
Sidebar.prototype.isOpen = function () {
return this.sidebar.is('.right-sidebar-expanded');
};
Sidebar.prototype.getBlock = function(name) {
Sidebar.prototype.getBlock = function (name) {
return this.sidebar.find(`.block.${name}`);
};
......
......@@ -76,8 +76,8 @@ export class SearchAutocomplete {
this.wrap = wrap || $('.search');
this.optsEl = optsEl || this.wrap.find('.search-autocomplete-opts');
this.autocompletePath = autocompletePath || this.optsEl.data('autocompletePath');
this.projectId = projectId || (this.optsEl.data('autocompleteProjectId') || '');
this.projectRef = projectRef || (this.optsEl.data('autocompleteProjectRef') || '');
this.projectId = projectId || this.optsEl.data('autocompleteProjectId') || '';
this.projectRef = projectRef || this.optsEl.data('autocompleteProjectRef') || '';
this.dropdown = this.wrap.find('.dropdown');
this.dropdownToggle = this.wrap.find('.js-dropdown-search-toggle');
this.dropdownMenu = this.dropdown.find('.dropdown-menu');
......
......@@ -4,10 +4,7 @@ import { __ } from './locale';
function expandSection($section) {
$section.find('.js-settings-toggle:not(.js-settings-toggle-trigger-only)').text(__('Collapse'));
// eslint-disable-next-line @gitlab/no-global-event-off
$section
.find('.settings-content')
.off('scroll.expandSection')
.scrollTop(0);
$section.find('.settings-content').off('scroll.expandSection').scrollTop(0);
$section.addClass('expanded');
if (!$section.hasClass('no-animate')) {
$section
......
......@@ -29,17 +29,12 @@ export default class SingleFileDiff {
this.isOpen = !this.diffForPath;
if (this.diffForPath) {
this.collapsedContent = this.content;
this.loadingContent = $(WRAPPER)
.addClass('loading')
.html(LOADING_HTML)
.hide();
this.loadingContent = $(WRAPPER).addClass('loading').html(LOADING_HTML).hide();
this.content = null;
this.collapsedContent.after(this.loadingContent);
this.$chevronRightIcon.removeClass('gl-display-none');
} else {
this.collapsedContent = $(WRAPPER)
.html(COLLAPSED_HTML)
.hide();
this.collapsedContent = $(WRAPPER).html(COLLAPSED_HTML).hide();
this.content.after(this.collapsedContent);
this.$chevronDownIcon.removeClass('gl-display-none');
}
......
......@@ -96,9 +96,7 @@ export default class SmartInterval {
window.removeEventListener('focus', this.onWindowVisibilityChange);
this.cancel();
// eslint-disable-next-line @gitlab/no-global-event-off
$(document)
.off('visibilitychange')
.off('beforeunload');
$(document).off('visibilitychange').off('beforeunload');
}
/* private */
......
......@@ -53,9 +53,7 @@ export default {
},
provide() {
return {
blobHash: Math.random()
.toString()
.split('.')[1],
blobHash: Math.random().toString().split('.')[1],
};
},
data() {
......
......@@ -16,10 +16,7 @@ export default class Star {
.post($this.data('endpoint'))
.then(({ data }) => {
const isStarred = $starSpan.hasClass('starred');
$this
.parent()
.find('.count')
.text(data.star_count);
$this.parent().find('.count').text(data.star_count);
if (isStarred) {
$starSpan.removeClass('starred').text(s__('StarProject|Star'));
......
......@@ -56,7 +56,7 @@ exports[`Registry Project Empty state to match the default snapshot 1`] = `
</p>
<gl-form-input-group-stub
class="gl-mb-4 "
class="gl-mb-4"
predefinedoptions="[object Object]"
value=""
>
......
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