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