Commit 26b68c70 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 30 files: 1 of 8

Mandatory not to break master. Automatically created with prettier.
parent 03b77c3f
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
) )
" "
> >
<template #docLink="{content}"> <template #docLink="{ content }">
<gl-link :href="docsLink" target="_blank">{{ content }}</gl-link> <gl-link :href="docsLink" target="_blank">{{ content }}</gl-link>
</template> </template>
<template #strong="{ content }" <template #strong="{ content }"
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
) )
" "
> >
<template #docLink="{content}"> <template #docLink="{ content }">
<gl-link :href="docsLink" target="_blank">{{ content }}</gl-link> <gl-link :href="docsLink" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import StatisticsPanelApp from './components/app.vue'; import StatisticsPanelApp from './components/app.vue';
import createStore from './store'; import createStore from './store';
export default function(el) { export default function (el) {
if (!el) { if (!el) {
return false; return false;
} }
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import AdminUsersApp from './components/app.vue'; import AdminUsersApp from './components/app.vue';
export default function(el = document.querySelector('#js-admin-users-app')) { export default function (el = document.querySelector('#js-admin-users-app')) {
if (!el) { if (!el) {
return false; return false;
} }
......
...@@ -194,14 +194,20 @@ export default { ...@@ -194,14 +194,20 @@ export default {
projectPath: this.projectPath, projectPath: this.projectPath,
}, },
}) })
.then(({ data: { createAlertIssue: { errors, issue } } }) => { .then(
({
data: {
createAlertIssue: { errors, issue },
},
}) => {
if (errors?.length) { if (errors?.length) {
[this.createIncidentError] = errors; [this.createIncidentError] = errors;
this.incidentCreationInProgress = false; this.incidentCreationInProgress = false;
} else if (issue) { } else if (issue) {
visitUrl(this.incidentPath(issue.iid)); visitUrl(this.incidentPath(issue.iid));
} }
}) },
)
.catch(error => { .catch(error => {
this.createIncidentError = error; this.createIncidentError = error;
this.incidentCreationInProgress = false; this.incidentCreationInProgress = false;
......
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
</script> </script>
<template> <template>
<div class="block alert-assignees "> <div class="block alert-assignees">
<div ref="assignees" class="sidebar-collapsed-icon" @click="$emit('toggle-sidebar')"> <div ref="assignees" class="sidebar-collapsed-icon" @click="$emit('toggle-sidebar')">
<gl-icon name="user" :size="14" /> <gl-icon name="user" :size="14" />
<gl-loading-icon v-if="isUpdating" /> <gl-loading-icon v-if="isUpdating" />
......
...@@ -98,10 +98,7 @@ export class AwardsHandler { ...@@ -98,10 +98,7 @@ export class AwardsHandler {
showEmojiMenu($addBtn) { showEmojiMenu($addBtn) {
if ($addBtn.hasClass('js-note-emoji')) { if ($addBtn.hasClass('js-note-emoji')) {
$addBtn $addBtn.closest('.note').find('.js-awards-block').addClass('current');
.closest('.note')
.find('.js-awards-block')
.addClass('current');
} else { } else {
$addBtn.closest('.js-awards-block').addClass('current'); $addBtn.closest('.js-awards-block').addClass('current');
} }
...@@ -531,9 +528,7 @@ export class AwardsHandler { ...@@ -531,9 +528,7 @@ export class AwardsHandler {
const $search = $('.js-emoji-menu-search'); const $search = $('.js-emoji-menu-search');
this.registerEventListener('on', $search, 'input', e => { this.registerEventListener('on', $search, 'input', e => {
const term = $(e.target) const term = $(e.target).val().trim();
.val()
.trim();
this.searchEmojis(term); this.searchEmojis(term);
}); });
...@@ -556,17 +551,11 @@ export class AwardsHandler { ...@@ -556,17 +551,11 @@ export class AwardsHandler {
// Generate a search result block // Generate a search result block
const h5 = $('<h5 class="emoji-search-title"/>').text('Search results'); const h5 = $('<h5 class="emoji-search-title"/>').text('Search results');
const foundEmojis = this.findMatchingEmojiElements(term).show(); const foundEmojis = this.findMatchingEmojiElements(term).show();
const ul = $('<ul>') const ul = $('<ul>').addClass('emoji-menu-list emoji-menu-search').append(foundEmojis);
.addClass('emoji-menu-list emoji-menu-search')
.append(foundEmojis);
$('.emoji-menu-content ul, .emoji-menu-content h5').hide(); $('.emoji-menu-content ul, .emoji-menu-content h5').hide();
$('.emoji-menu-content') $('.emoji-menu-content').append(h5).append(ul);
.append(h5)
.append(ul);
} else { } else {
$('.emoji-menu-content') $('.emoji-menu-content').children().show();
.children()
.show();
} }
} }
......
...@@ -98,9 +98,7 @@ export default { ...@@ -98,9 +98,7 @@ export default {
{{ titleText }} {{ titleText }}
</span> </span>
<template v-if="showLinePosition"> <template v-if="showLinePosition">
<template v-if="!glFeatures.multilineComments" <template v-if="!glFeatures.multilineComments">:{{ linePosition }}</template>
>:{{ linePosition }}</template
>
<template v-else-if="startLineNumber === endLineNumber"> <template v-else-if="startLineNumber === endLineNumber">
:<span :class="getLineClasses(startLineNumber)">{{ startLineNumber }}</span> :<span :class="getLineClasses(startLineNumber)">{{ startLineNumber }}</span>
</template> </template>
......
...@@ -23,7 +23,7 @@ MarkdownPreview.prototype.emptyMessage = __('Nothing to preview.'); ...@@ -23,7 +23,7 @@ MarkdownPreview.prototype.emptyMessage = __('Nothing to preview.');
MarkdownPreview.prototype.ajaxCache = {}; MarkdownPreview.prototype.ajaxCache = {};
MarkdownPreview.prototype.showPreview = function($form) { MarkdownPreview.prototype.showPreview = function ($form) {
const preview = $form.find('.js-md-preview'); const preview = $form.find('.js-md-preview');
const url = preview.data('url'); const url = preview.data('url');
if (preview.hasClass('md-preview-loading')) { if (preview.hasClass('md-preview-loading')) {
...@@ -60,7 +60,7 @@ MarkdownPreview.prototype.showPreview = function($form) { ...@@ -60,7 +60,7 @@ MarkdownPreview.prototype.showPreview = function($form) {
} }
}; };
MarkdownPreview.prototype.fetchMarkdownPreview = function(text, url, success) { MarkdownPreview.prototype.fetchMarkdownPreview = function (text, url, success) {
if (!url) { if (!url) {
return; return;
} }
...@@ -82,11 +82,11 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function(text, url, success) { ...@@ -82,11 +82,11 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function(text, url, success) {
.catch(() => flash(__('An error occurred while fetching markdown preview'))); .catch(() => flash(__('An error occurred while fetching markdown preview')));
}; };
MarkdownPreview.prototype.hideReferencedUsers = function($form) { MarkdownPreview.prototype.hideReferencedUsers = function ($form) {
$form.find('.referenced-users').hide(); $form.find('.referenced-users').hide();
}; };
MarkdownPreview.prototype.renderReferencedUsers = function(users, $form) { MarkdownPreview.prototype.renderReferencedUsers = function (users, $form) {
const referencedUsers = $form.find('.referenced-users'); const referencedUsers = $form.find('.referenced-users');
if (referencedUsers.length) { if (referencedUsers.length) {
if (users.length >= this.referenceThreshold) { if (users.length >= this.referenceThreshold) {
...@@ -98,11 +98,11 @@ MarkdownPreview.prototype.renderReferencedUsers = function(users, $form) { ...@@ -98,11 +98,11 @@ MarkdownPreview.prototype.renderReferencedUsers = function(users, $form) {
} }
}; };
MarkdownPreview.prototype.hideReferencedCommands = function($form) { MarkdownPreview.prototype.hideReferencedCommands = function ($form) {
$form.find('.referenced-commands').hide(); $form.find('.referenced-commands').hide();
}; };
MarkdownPreview.prototype.renderReferencedCommands = function(commands, $form) { MarkdownPreview.prototype.renderReferencedCommands = function (commands, $form) {
const referencedCommands = $form.find('.referenced-commands'); const referencedCommands = $form.find('.referenced-commands');
if (commands.length > 0) { if (commands.length > 0) {
referencedCommands.html(commands); referencedCommands.html(commands);
...@@ -120,7 +120,7 @@ const writeButtonSelector = '.js-md-write-button'; ...@@ -120,7 +120,7 @@ const writeButtonSelector = '.js-md-write-button';
lastTextareaPreviewed = null; lastTextareaPreviewed = null;
const markdownToolbar = $('.md-header-toolbar'); const markdownToolbar = $('.md-header-toolbar');
$.fn.setupMarkdownPreview = function() { $.fn.setupMarkdownPreview = function () {
const $form = $(this); const $form = $(this);
$form.find('textarea.markdown-area').on('input', () => { $form.find('textarea.markdown-area').on('input', () => {
markdownPreview.hideReferencedUsers($form); markdownPreview.hideReferencedUsers($form);
...@@ -136,14 +136,8 @@ $(document).on('markdown-preview:show', (e, $form) => { ...@@ -136,14 +136,8 @@ $(document).on('markdown-preview:show', (e, $form) => {
lastTextareaHeight = lastTextareaPreviewed.height(); lastTextareaHeight = lastTextareaPreviewed.height();
// toggle tabs // toggle tabs
$form $form.find(writeButtonSelector).parent().removeClass('active');
.find(writeButtonSelector) $form.find(previewButtonSelector).parent().addClass('active');
.parent()
.removeClass('active');
$form
.find(previewButtonSelector)
.parent()
.addClass('active');
// toggle content // toggle content
$form.find('.md-write-holder').hide(); $form.find('.md-write-holder').hide();
...@@ -163,14 +157,8 @@ $(document).on('markdown-preview:hide', (e, $form) => { ...@@ -163,14 +157,8 @@ $(document).on('markdown-preview:hide', (e, $form) => {
} }
// toggle tabs // toggle tabs
$form $form.find(writeButtonSelector).parent().addClass('active');
.find(writeButtonSelector) $form.find(previewButtonSelector).parent().removeClass('active');
.parent()
.addClass('active');
$form
.find(previewButtonSelector)
.parent()
.removeClass('active');
// toggle content // toggle content
$form.find('.md-write-holder').show(); $form.find('.md-write-holder').show();
...@@ -194,13 +182,13 @@ $(document).on('markdown-preview:toggle', (e, keyboardEvent) => { ...@@ -194,13 +182,13 @@ $(document).on('markdown-preview:toggle', (e, keyboardEvent) => {
} }
}); });
$(document).on('click', previewButtonSelector, function(e) { $(document).on('click', previewButtonSelector, function (e) {
e.preventDefault(); e.preventDefault();
const $form = $(this).closest('form'); const $form = $(this).closest('form');
$(document).triggerHandler('markdown-preview:show', [$form]); $(document).triggerHandler('markdown-preview:show', [$form]);
}); });
$(document).on('click', writeButtonSelector, function(e) { $(document).on('click', writeButtonSelector, function (e) {
e.preventDefault(); e.preventDefault();
const $form = $(this).closest('form'); const $form = $(this).closest('form');
$(document).triggerHandler('markdown-preview:hide', [$form]); $(document).triggerHandler('markdown-preview:hide', [$form]);
......
...@@ -98,9 +98,7 @@ export default class Shortcuts { ...@@ -98,9 +98,7 @@ export default class Shortcuts {
}); });
// eslint-disable-next-line @gitlab/no-global-event-off // eslint-disable-next-line @gitlab/no-global-event-off
$('.js-shortcuts-modal-trigger') $('.js-shortcuts-modal-trigger').off('click').on('click', this.onToggleHelp);
.off('click')
.on('click', this.onToggleHelp);
if (shouldDisableShortcuts()) { if (shouldDisableShortcuts()) {
disableShortcuts(); disableShortcuts();
......
...@@ -43,16 +43,14 @@ export default class BlobFileDropzone { ...@@ -43,16 +43,14 @@ export default class BlobFileDropzone {
previewsContainer: '.dropzone-previews', previewsContainer: '.dropzone-previews',
headers: csrf.headers, headers: csrf.headers,
init() { init() {
this.on('processing', function() { this.on('processing', function () {
this.options.url = form.attr('action'); this.options.url = form.attr('action');
}); });
this.on('addedfile', () => { this.on('addedfile', () => {
toggleLoading(submitButton, submitButtonLoadingIcon, false); toggleLoading(submitButton, submitButtonLoadingIcon, false);
dropzoneMessage.addClass(HIDDEN_CLASS); dropzoneMessage.addClass(HIDDEN_CLASS);
$('.dropzone-alerts') $('.dropzone-alerts').html('').hide();
.html('')
.hide();
}); });
this.on('removedfile', () => { this.on('removedfile', () => {
toggleLoading(submitButton, submitButtonLoadingIcon, false); toggleLoading(submitButton, submitButtonLoadingIcon, false);
...@@ -62,7 +60,7 @@ export default class BlobFileDropzone { ...@@ -62,7 +60,7 @@ export default class BlobFileDropzone {
$('#modal-upload-blob').modal('hide'); $('#modal-upload-blob').modal('hide');
visitUrl(response.filePath); visitUrl(response.filePath);
}); });
this.on('maxfilesexceeded', function(file) { this.on('maxfilesexceeded', function (file) {
dropzoneMessage.addClass(HIDDEN_CLASS); dropzoneMessage.addClass(HIDDEN_CLASS);
this.removeFile(file); this.removeFile(file);
}); });
...@@ -74,9 +72,7 @@ export default class BlobFileDropzone { ...@@ -74,9 +72,7 @@ export default class BlobFileDropzone {
}, },
// Override behavior of adding error underneath preview // Override behavior of adding error underneath preview
error(file, errorMessage) { error(file, errorMessage) {
const stripped = $('<div/>') const stripped = $('<div/>').html(errorMessage).text();
.html(errorMessage)
.text();
$('.dropzone-alerts') $('.dropzone-alerts')
.html(sprintf(__('Error uploading file: %{stripped}'), { stripped })) .html(sprintf(__('Error uploading file: %{stripped}'), { stripped }))
.show(); .show();
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
</template> </template>
<p> <p>
<gl-sprintf :message="$options.i18n.bodyMessage"> <gl-sprintf :message="$options.i18n.bodyMessage">
<template #codeQualityLink="{content}"> <template #codeQualityLink="{ content }">
<gl-link :href="codeQualityLink" target="_blank" class="font-size-inherit">{{ <gl-link :href="codeQualityLink" target="_blank" class="font-size-inherit">{{
content content
}}</gl-link> }}</gl-link>
...@@ -106,12 +106,12 @@ export default { ...@@ -106,12 +106,12 @@ export default {
</gl-sprintf> </gl-sprintf>
</p> </p>
<gl-sprintf :message="$options.i18n.helpMessage"> <gl-sprintf :message="$options.i18n.helpMessage">
<template #beginnerLink="{content}"> <template #beginnerLink="{ content }">
<gl-link :href="$options.beginnerLink" target="_blank"> <gl-link :href="$options.beginnerLink" target="_blank">
{{ content }} {{ content }}
</gl-link> </gl-link>
</template> </template>
<template #exampleLink="{content}"> <template #exampleLink="{ content }">
<gl-link :href="exampleLink" target="_blank"> <gl-link :href="exampleLink" target="_blank">
{{ content }} {{ content }}
</gl-link> </gl-link>
......
...@@ -82,9 +82,7 @@ export default Vue.extend({ ...@@ -82,9 +82,7 @@ export default Vue.extend({
}); });
$('.js-issue-board-sidebar', this.$el).each((i, el) => { $('.js-issue-board-sidebar', this.$el).each((i, el) => {
$(el) $(el).data('deprecatedJQueryDropdown').clearMenu();
.data('deprecatedJQueryDropdown')
.clearMenu();
}); });
} }
......
...@@ -65,9 +65,7 @@ export default { ...@@ -65,9 +65,7 @@ export default {
this.loading = false; this.loading = false;
}; };
this.loadIssues() this.loadIssues().then(loadingDone).catch(loadingDone);
.then(loadingDone)
.catch(loadingDone);
} else if (!this.showAddIssuesModal) { } else if (!this.showAddIssuesModal) {
this.issues = []; this.issues = [];
this.selectedIssues = []; this.selectedIssues = [];
...@@ -83,9 +81,7 @@ export default { ...@@ -83,9 +81,7 @@ export default {
this.filterLoading = false; this.filterLoading = false;
}; };
this.loadIssues(true) this.loadIssues(true).then(loadingDone).catch(loadingDone);
.then(loadingDone)
.catch(loadingDone);
} }
}, },
deep: true, deep: true,
......
...@@ -40,7 +40,7 @@ $(document) ...@@ -40,7 +40,7 @@ $(document)
}); });
export default function initNewListDropdown() { export default function initNewListDropdown() {
$('.js-new-board-list').each(function() { $('.js-new-board-list').each(function () {
const $dropdownToggle = $(this); const $dropdownToggle = $(this);
const $dropdown = $dropdownToggle.closest('.dropdown'); const $dropdown = $dropdownToggle.closest('.dropdown');
new CreateLabelDropdown( new CreateLabelDropdown(
......
...@@ -212,11 +212,17 @@ export default { ...@@ -212,11 +212,17 @@ export default {
listId, listId,
}, },
}) })
.then(({ data: { destroyBoardList: { errors } } }) => { .then(
({
data: {
destroyBoardList: { errors },
},
}) => {
if (errors.length > 0) { if (errors.length > 0) {
commit(types.REMOVE_LIST_FAILURE, listsBackup); commit(types.REMOVE_LIST_FAILURE, listsBackup);
} }
}) },
)
.catch(() => { .catch(() => {
commit(types.REMOVE_LIST_FAILURE, listsBackup); commit(types.REMOVE_LIST_FAILURE, listsBackup);
}); });
......
...@@ -24,7 +24,7 @@ export default class BuildArtifacts { ...@@ -24,7 +24,7 @@ export default class BuildArtifacts {
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
setupEntryClick() { setupEntryClick() {
return $('.tree-holder').on('click', 'tr[data-link]', function() { return $('.tree-holder').on('click', 'tr[data-link]', function () {
visitUrl(this.dataset.link, parseBoolean(this.dataset.externalLink)); visitUrl(this.dataset.link, parseBoolean(this.dataset.externalLink));
}); });
} }
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
<gl-form-checkbox v-model="dryRun" <gl-form-checkbox v-model="dryRun"
>{{ __('Simulate a pipeline created for the default branch') }} >{{ __('Simulate a pipeline created for the default branch') }}
<gl-link :href="pipelineSimulationHelpPagePath" target="_blank" <gl-link :href="pipelineSimulationHelpPagePath" target="_blank"
><gl-icon class="gl-text-blue-600" name="question-o"/></gl-link ><gl-icon class="gl-text-blue-600" name="question-o" /></gl-link
></gl-form-checkbox> ></gl-form-checkbox>
</div> </div>
<gl-button data-testid="ci-lint-clear" @click="clear">{{ __('Clear') }}</gl-button> <gl-button data-testid="ci-lint-clear" @click="clear">{{ __('Clear') }}</gl-button>
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
class="triggers-list" class="triggers-list"
responsive responsive
> >
<template #cell(token)="{item}"> <template #cell(token)="{ item }">
{{ item.token }} {{ item.token }}
<clipboard-button <clipboard-button
v-if="item.hasTokenExposed" v-if="item.hasTokenExposed"
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
</gl-badge> </gl-badge>
</div> </div>
</template> </template>
<template #cell(description)="{item}"> <template #cell(description)="{ item }">
<tooltip-on-truncate <tooltip-on-truncate
:title="item.description" :title="item.description"
truncate-target="child" truncate-target="child"
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
<div class="gl-flex-fill-1 gl-text-truncate">{{ item.description }}</div> <div class="gl-flex-fill-1 gl-text-truncate">{{ item.description }}</div>
</tooltip-on-truncate> </tooltip-on-truncate>
</template> </template>
<template #cell(owner)="{item}"> <template #cell(owner)="{ item }">
<span class="trigger-owner sr-only">{{ item.owner.name }}</span> <span class="trigger-owner sr-only">{{ item.owner.name }}</span>
<user-avatar-link <user-avatar-link
v-if="item.owner" v-if="item.owner"
...@@ -102,11 +102,11 @@ export default { ...@@ -102,11 +102,11 @@ export default {
:img-alt="item.owner.name" :img-alt="item.owner.name"
/> />
</template> </template>
<template #cell(lastUsed)="{item}"> <template #cell(lastUsed)="{ item }">
<time-ago-tooltip v-if="item.lastUsed" :time="item.lastUsed" /> <time-ago-tooltip v-if="item.lastUsed" :time="item.lastUsed" />
<span v-else>{{ __('Never') }}</span> <span v-else>{{ __('Never') }}</span>
</template> </template>
<template #cell(actions)="{item}"> <template #cell(actions)="{ item }">
<gl-button <gl-button
:title="s__('Pipelines|Edit')" :title="s__('Pipelines|Edit')"
icon="pencil" icon="pencil"
......
...@@ -223,10 +223,7 @@ export default class VariableList { ...@@ -223,10 +223,7 @@ export default class VariableList {
getAllData() { getAllData() {
// Ignore the last empty row because we don't want to try persist // Ignore the last empty row because we don't want to try persist
// a blank variable and run into validation problems. // a blank variable and run into validation problems.
const validRows = this.$container const validRows = this.$container.find('.js-row').toArray().slice(0, -1);
.find('.js-row')
.toArray()
.slice(0, -1);
return validRows.map(rowEl => { return validRows.map(rowEl => {
const resultant = {}; const resultant = {};
......
...@@ -461,7 +461,7 @@ export default { ...@@ -461,7 +461,7 @@ export default {
) )
" "
> >
<template #code="{content}"> <template #code="{ content }">
<code>{{ content }}</code> <code>{{ content }}</code>
</template> </template>
<template #link="{ content }"> <template #link="{ content }">
......
...@@ -254,9 +254,7 @@ export default { ...@@ -254,9 +254,7 @@ export default {
<template #freeSpacePercentage>{{ <template #freeSpacePercentage>{{
totalCpuAndUsage(item.nodes).freeSpacePercentage totalCpuAndUsage(item.nodes).freeSpacePercentage
}}</template> }}</template>
<template #percentSymbol <template #percentSymbol>%</template>
>%</template
>
</gl-sprintf> </gl-sprintf>
</span> </span>
...@@ -277,9 +275,7 @@ export default { ...@@ -277,9 +275,7 @@ export default {
<template #freeSpacePercentage>{{ <template #freeSpacePercentage>{{
totalMemoryAndUsage(item.nodes).freeSpacePercentage totalMemoryAndUsage(item.nodes).freeSpacePercentage
}}</template> }}</template>
<template #percentSymbol <template #percentSymbol>%</template>
>%</template
>
</gl-sprintf> </gl-sprintf>
</span> </span>
...@@ -293,7 +289,7 @@ export default { ...@@ -293,7 +289,7 @@ export default {
/> />
</template> </template>
<template #cell(cluster_type)="{value}"> <template #cell(cluster_type)="{ value }">
<gl-badge variant="muted"> <gl-badge variant="muted">
{{ value }} {{ value }}
</gl-badge> </gl-badge>
......
...@@ -56,15 +56,15 @@ export default class ImageFile { ...@@ -56,15 +56,15 @@ export default class ImageFile {
let dragging = false; let dragging = false;
const $body = $('body'); const $body = $('body');
const $offsetEl = $el.parent(); const $offsetEl = $el.parent();
const dragStart = function() { const dragStart = function () {
dragging = true; dragging = true;
$body.css('user-select', 'none'); $body.css('user-select', 'none');
}; };
const dragStop = function() { const dragStop = function () {
dragging = false; dragging = false;
$body.css('user-select', ''); $body.css('user-select', '');
}; };
const dragMove = function(e) { const dragMove = function (e) {
const moveX = e.pageX || e.touches[0].pageX; const moveX = e.pageX || e.touches[0].pageX;
const left = moveX - ($offsetEl.offset().left + padding); const left = moveX - ($offsetEl.offset().left + padding);
if (!dragging) return; if (!dragging) return;
...@@ -73,11 +73,7 @@ export default class ImageFile { ...@@ -73,11 +73,7 @@ export default class ImageFile {
}; };
// eslint-disable-next-line @gitlab/no-global-event-off // eslint-disable-next-line @gitlab/no-global-event-off
$el $el.off('mousedown').off('touchstart').on('mousedown', dragStart).on('touchstart', dragStart);
.off('mousedown')
.off('touchstart')
.on('mousedown', dragStart)
.on('touchstart', dragStart);
// eslint-disable-next-line @gitlab/no-global-event-off // eslint-disable-next-line @gitlab/no-global-event-off
$body $body
...@@ -109,9 +105,9 @@ export default class ImageFile { ...@@ -109,9 +105,9 @@ export default class ImageFile {
} }
views = { views = {
'two-up': function() { 'two-up': function () {
return $('.two-up.view .wrap', this.file).each((index, wrap) => { return $('.two-up.view .wrap', this.file).each((index, wrap) => {
$('img', wrap).each(function() { $('img', wrap).each(function () {
const currentWidth = $(this).width(); const currentWidth = $(this).width();
if (currentWidth > availWidth / 2) { if (currentWidth > availWidth / 2) {
return $(this).width(availWidth / 2); return $(this).width(availWidth / 2);
...@@ -157,7 +153,7 @@ export default class ImageFile { ...@@ -157,7 +153,7 @@ export default class ImageFile {
}); });
}); });
}, },
'onion-skin': function() { 'onion-skin': function () {
let maxHeight, maxWidth; let maxHeight, maxWidth;
maxWidth = 0; maxWidth = 0;
maxHeight = 0; maxHeight = 0;
......
...@@ -85,10 +85,7 @@ export default class CommitsList { ...@@ -85,10 +85,7 @@ export default class CommitsList {
// Update commits count in the previous commits header. // Update commits count in the previous commits header.
commitsCount += Number( commitsCount += Number(
$(processedData) $(processedData).nextUntil('li.js-commit-header').first().find('li.commit').length,
.nextUntil('li.js-commit-header')
.first()
.find('li.commit').length,
); );
$commitsHeadersLast $commitsHeadersLast
......
...@@ -13,14 +13,10 @@ import 'bootstrap/js/dist/tab'; ...@@ -13,14 +13,10 @@ import 'bootstrap/js/dist/tab';
// custom jQuery functions // custom jQuery functions
$.fn.extend({ $.fn.extend({
disable() { disable() {
return $(this) return $(this).prop('disabled', true).addClass('disabled');
.prop('disabled', true)
.addClass('disabled');
}, },
enable() { enable() {
return $(this) return $(this).prop('disabled', false).removeClass('disabled');
.prop('disabled', false)
.removeClass('disabled');
}, },
}); });
......
...@@ -9,7 +9,7 @@ import { fixTitle } from '~/tooltips'; ...@@ -9,7 +9,7 @@ import { fixTitle } from '~/tooltips';
import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown';
export default function initCompareAutocomplete(limitTo = null, clickHandler = () => {}) { export default function initCompareAutocomplete(limitTo = null, clickHandler = () => {}) {
$('.js-compare-dropdown').each(function() { $('.js-compare-dropdown').each(function () {
const $dropdown = $(this); const $dropdown = $(this);
const selected = $dropdown.data('selected'); const selected = $dropdown.data('selected');
const $dropdownContainer = $dropdown.closest('.dropdown'); const $dropdownContainer = $dropdown.closest('.dropdown');
...@@ -51,9 +51,7 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = ( ...@@ -51,9 +51,7 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = (
.text(ref) .text(ref)
.attr('data-ref', ref); .attr('data-ref', ref);
if (ref.header != null) { if (ref.header != null) {
return $('<li />') return $('<li />').addClass('dropdown-header').text(ref.header);
.addClass('dropdown-header')
.text(ref.header);
} }
return $('<li />').append(link); return $('<li />').append(link);
}, },
......
...@@ -43,7 +43,10 @@ export default class ContextualSidebar { ...@@ -43,7 +43,10 @@ export default class ContextualSidebar {
$(document).trigger('content.resize'); $(document).trigger('content.resize');
}); });
$(window).on('resize', debounce(() => this.render(), 100)); $(window).on(
'resize',
debounce(() => this.render(), 100),
);
} }
// See documentation: https://design.gitlab.com/regions/navigation#contextual-navigation // See documentation: https://design.gitlab.com/regions/navigation#contextual-navigation
......
...@@ -57,9 +57,7 @@ export default { ...@@ -57,9 +57,7 @@ export default {
if (this.hasZone) { if (this.hasZone) {
this.isLoading = true; this.isLoading = true;
this.fetchMachineTypes() this.fetchMachineTypes().then(this.fetchSuccessHandler).catch(this.fetchFailureHandler);
.then(this.fetchSuccessHandler)
.catch(this.fetchFailureHandler);
} }
}, },
}, },
......
...@@ -99,9 +99,7 @@ export default { ...@@ -99,9 +99,7 @@ export default {
created() { created() {
this.isLoading = true; this.isLoading = true;
this.fetchProjects() this.fetchProjects().then(this.fetchSuccessHandler).catch(this.fetchFailureHandler);
.then(this.fetchSuccessHandler)
.catch(this.fetchFailureHandler);
}, },
methods: { methods: {
...mapActions(['fetchProjects', 'setIsValidatingProjectBilling', 'validateProjectBilling']), ...mapActions(['fetchProjects', 'setIsValidatingProjectBilling', 'validateProjectBilling']),
...@@ -175,9 +173,7 @@ export default { ...@@ -175,9 +173,7 @@ export default {
<gl-sprintf :message="helpText"> <gl-sprintf :message="helpText">
<template #linkToBilling="{ content }"> <template #linkToBilling="{ content }">
<gl-link <gl-link
:href=" :href="'https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral'"
'https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral'
"
target="_blank" target="_blank"
>{{ content }} <gl-icon name="external-link" >{{ content }} <gl-icon name="external-link"
/></gl-link> /></gl-link>
......
...@@ -46,9 +46,7 @@ export default { ...@@ -46,9 +46,7 @@ export default {
if (!isValidating && this.projectHasBillingEnabled) { if (!isValidating && this.projectHasBillingEnabled) {
this.isLoading = true; this.isLoading = true;
this.fetchZones() this.fetchZones().then(this.fetchSuccessHandler).catch(this.fetchFailureHandler);
.then(this.fetchSuccessHandler)
.catch(this.fetchFailureHandler);
} }
}, },
}, },
......
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