Commit 07f5bc94 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 30 files: 4 of 8

Mandatory not to break master. Automatically created with prettier.
parent 888002a6
...@@ -12,13 +12,9 @@ export default class Members { ...@@ -12,13 +12,9 @@ export default class Members {
addListeners() { addListeners() {
// eslint-disable-next-line @gitlab/no-global-event-off // eslint-disable-next-line @gitlab/no-global-event-off
$('.js-member-update-control') $('.js-member-update-control').off('change').on('change', this.formSubmit.bind(this));
.off('change')
.on('change', this.formSubmit.bind(this));
// eslint-disable-next-line @gitlab/no-global-event-off // eslint-disable-next-line @gitlab/no-global-event-off
$('.js-edit-member-form') $('.js-edit-member-form').off('ajax:success').on('ajax:success', this.formSuccess.bind(this));
.off('ajax:success')
.on('ajax:success', this.formSuccess.bind(this));
disableButtonIfEmptyField('#user_ids', 'input[name=commit]', 'change'); disableButtonIfEmptyField('#user_ids', 'input[name=commit]', 'change');
} }
......
...@@ -60,19 +60,28 @@ import { __ } from '~/locale'; ...@@ -60,19 +60,28 @@ import { __ } from '~/locale';
const DataPromise = axios.get(this.file.content_path); const DataPromise = axios.get(this.file.content_path);
Promise.all([EditorPromise, DataPromise]) Promise.all([EditorPromise, DataPromise])
.then(([{ default: EditorLite }, { data: { content, new_path: path } }]) => { .then(
const contentEl = this.$el.querySelector('.editor'); ([
{ default: EditorLite },
{
data: { content, new_path: path },
},
]) => {
const contentEl = this.$el.querySelector('.editor');
this.originalContent = content; this.originalContent = content;
this.fileLoaded = true; this.fileLoaded = true;
this.editor = new EditorLite().createInstance({ this.editor = new EditorLite().createInstance({
el: contentEl, el: contentEl,
blobPath: path, blobPath: path,
blobContent: content, blobContent: content,
}); });
this.editor.onDidChangeModelContent(debounce(this.saveDiffResolution.bind(this), 250)); this.editor.onDidChangeModelContent(
}) debounce(this.saveDiffResolution.bind(this), 250),
);
},
)
.catch(() => { .catch(() => {
flash(__('An error occurred while loading the file')); flash(__('An error occurred while loading the file'));
}); });
......
...@@ -47,11 +47,11 @@ function MergeRequest(opts) { ...@@ -47,11 +47,11 @@ function MergeRequest(opts) {
} }
// Local jQuery finder // Local jQuery finder
MergeRequest.prototype.$ = function(selector) { MergeRequest.prototype.$ = function (selector) {
return this.$el.find(selector); return this.$el.find(selector);
}; };
MergeRequest.prototype.initTabs = function() { MergeRequest.prototype.initTabs = function () {
if (window.mrTabs) { if (window.mrTabs) {
window.mrTabs.unbindEvents(); window.mrTabs.unbindEvents();
} }
...@@ -59,12 +59,12 @@ MergeRequest.prototype.initTabs = function() { ...@@ -59,12 +59,12 @@ MergeRequest.prototype.initTabs = function() {
window.mrTabs = new MergeRequestTabs(this.opts); window.mrTabs = new MergeRequestTabs(this.opts);
}; };
MergeRequest.prototype.showAllCommits = function() { MergeRequest.prototype.showAllCommits = function () {
this.$('.first-commits').remove(); this.$('.first-commits').remove();
return this.$('.all-commits').removeClass('hide'); return this.$('.all-commits').removeClass('hide');
}; };
MergeRequest.prototype.initMRBtnListeners = function() { MergeRequest.prototype.initMRBtnListeners = function () {
const _this = this; const _this = this;
const draftToggles = document.querySelectorAll('.js-draft-toggle-button'); const draftToggles = document.querySelectorAll('.js-draft-toggle-button');
...@@ -99,7 +99,7 @@ MergeRequest.prototype.initMRBtnListeners = function() { ...@@ -99,7 +99,7 @@ MergeRequest.prototype.initMRBtnListeners = function() {
}); });
} }
return $('.btn-close, .btn-reopen').on('click', function(e) { return $('.btn-close, .btn-reopen').on('click', function (e) {
const $this = $(this); const $this = $(this);
const shouldSubmit = $this.hasClass('btn-comment'); const shouldSubmit = $this.hasClass('btn-comment');
if (shouldSubmit && $this.data('submitted')) { if (shouldSubmit && $this.data('submitted')) {
...@@ -117,7 +117,7 @@ MergeRequest.prototype.initMRBtnListeners = function() { ...@@ -117,7 +117,7 @@ MergeRequest.prototype.initMRBtnListeners = function() {
}); });
}; };
MergeRequest.prototype.submitNoteForm = function(form, $button) { MergeRequest.prototype.submitNoteForm = function (form, $button) {
const noteText = form.find('textarea.js-note-text').val(); const noteText = form.find('textarea.js-note-text').val();
if (noteText.trim().length > 0) { if (noteText.trim().length > 0) {
form.submit(); form.submit();
...@@ -126,7 +126,7 @@ MergeRequest.prototype.submitNoteForm = function(form, $button) { ...@@ -126,7 +126,7 @@ MergeRequest.prototype.submitNoteForm = function(form, $button) {
} }
}; };
MergeRequest.prototype.initCommitMessageListeners = function() { MergeRequest.prototype.initCommitMessageListeners = function () {
$(document).on('click', 'a.js-with-description-link', e => { $(document).on('click', 'a.js-with-description-link', e => {
const textarea = $('textarea.js-commit-message'); const textarea = $('textarea.js-commit-message');
e.preventDefault(); e.preventDefault();
...@@ -146,7 +146,7 @@ MergeRequest.prototype.initCommitMessageListeners = function() { ...@@ -146,7 +146,7 @@ MergeRequest.prototype.initCommitMessageListeners = function() {
}); });
}; };
MergeRequest.setStatusBoxToMerged = function() { MergeRequest.setStatusBoxToMerged = function () {
$('.detail-page-header .status-box') $('.detail-page-header .status-box')
.removeClass('status-box-open') .removeClass('status-box-open')
.addClass('status-box-mr-merged') .addClass('status-box-mr-merged')
...@@ -154,20 +154,20 @@ MergeRequest.setStatusBoxToMerged = function() { ...@@ -154,20 +154,20 @@ MergeRequest.setStatusBoxToMerged = function() {
.text(__('Merged')); .text(__('Merged'));
}; };
MergeRequest.decreaseCounter = function(by = 1) { MergeRequest.decreaseCounter = function (by = 1) {
const $el = $('.js-merge-counter'); const $el = $('.js-merge-counter');
const count = Math.max(parseInt($el.text().replace(/[^\d]/, ''), 10) - by, 0); const count = Math.max(parseInt($el.text().replace(/[^\d]/, ''), 10) - by, 0);
$el.text(addDelimiter(count)); $el.text(addDelimiter(count));
}; };
MergeRequest.hideCloseButton = function() { MergeRequest.hideCloseButton = function () {
const el = document.querySelector('.merge-request .js-issuable-actions'); const el = document.querySelector('.merge-request .js-issuable-actions');
// Dropdown for mobile screen // Dropdown for mobile screen
el.querySelector('li.js-close-item').classList.add('hidden'); el.querySelector('li.js-close-item').classList.add('hidden');
}; };
MergeRequest.toggleDraftStatus = function(title, isReady) { MergeRequest.toggleDraftStatus = function (title, isReady) {
if (isReady) { if (isReady) {
createFlash(__('The merge request can now be merged.'), 'notice'); createFlash(__('The merge request can now be merged.'), 'notice');
} }
......
...@@ -92,11 +92,7 @@ export default class MiniPipelineGraph { ...@@ -92,11 +92,7 @@ export default class MiniPipelineGraph {
}) })
.catch(() => { .catch(() => {
this.toggleLoading(button); this.toggleLoading(button);
if ( if ($(button).parent().hasClass('open')) {
$(button)
.parent()
.hasClass('open')
) {
$(button).dropdown('toggle'); $(button).dropdown('toggle');
} }
flash(__('An error occurred while fetching the builds.'), 'alert'); flash(__('An error occurred while fetching the builds.'), 'alert');
......
...@@ -146,7 +146,7 @@ export default { ...@@ -146,7 +146,7 @@ export default {
) )
" "
> >
<template #code="{content}"> <template #code="{ content }">
<code>{{ content }}</code> <code>{{ content }}</code>
</template> </template>
</gl-sprintf> </gl-sprintf>
......
...@@ -243,11 +243,11 @@ export default class BranchGraph { ...@@ -243,11 +243,11 @@ export default class BranchGraph {
}) })
.click(() => window.open(options.commit_url.replace('%s', commit.id), '_blank')) .click(() => window.open(options.commit_url.replace('%s', commit.id), '_blank'))
.hover( .hover(
function() { function () {
this.tooltip = r.commitTooltip(x + 5, y, commit); this.tooltip = r.commitTooltip(x + 5, y, commit);
return top.push(this.tooltip.insertBefore(this)); return top.push(this.tooltip.insertBefore(this));
}, },
function() { function () {
return this.tooltip && this.tooltip.remove() && delete this.tooltip; return this.tooltip && this.tooltip.remove() && delete this.tooltip;
}, },
); );
......
...@@ -53,13 +53,13 @@ export default class NewBranchForm { ...@@ -53,13 +53,13 @@ export default class NewBranchForm {
const { indexOf } = []; const { indexOf } = [];
this.branchNameError.empty(); this.branchNameError.empty();
const unique = function(values, value) { const unique = function (values, value) {
if (indexOf.call(values, value) === -1) { if (indexOf.call(values, value) === -1) {
values.push(value); values.push(value);
} }
return values; return values;
}; };
const formatter = function(values, restriction) { const formatter = function (values, restriction) {
const formatted = values.map(value => { const formatted = values.map(value => {
switch (false) { switch (false) {
case !/\s/.test(value): case !/\s/.test(value):
......
...@@ -108,10 +108,7 @@ export default class Notes { ...@@ -108,10 +108,7 @@ export default class Notes {
// We are in the Merge Requests page so we need another edit form for Changes tab // We are in the Merge Requests page so we need another edit form for Changes tab
if (getPagePath(1) === 'merge_requests') { if (getPagePath(1) === 'merge_requests') {
$('.note-edit-form') $('.note-edit-form').clone().addClass('mr-note-edit-form').insertAfter('.note-edit-form');
.clone()
.addClass('mr-note-edit-form')
.insertAfter('.note-edit-form');
} }
const hash = getLocationHash(); const hash = getLocationHash();
...@@ -427,12 +424,7 @@ export default class Notes { ...@@ -427,12 +424,7 @@ export default class Notes {
} else if (Notes.isUpdatedNote(noteEntity, $note)) { } else if (Notes.isUpdatedNote(noteEntity, $note)) {
// The server can send the same update multiple times so we need to make sure to only update once per actual update. // The server can send the same update multiple times so we need to make sure to only update once per actual update.
const isEditing = $note.hasClass('is-editing'); const isEditing = $note.hasClass('is-editing');
const initialContent = normalizeNewlines( const initialContent = normalizeNewlines($note.find('.original-note-content').text().trim());
$note
.find('.original-note-content')
.text()
.trim(),
);
const $textarea = $note.find('.js-note-text'); const $textarea = $note.find('.js-note-text');
const currentContent = $textarea.val(); const currentContent = $textarea.val();
// There can be CRLF vs LF mismatches if we don't sanitize and compare the same way // There can be CRLF vs LF mismatches if we don't sanitize and compare the same way
...@@ -541,14 +533,8 @@ export default class Notes { ...@@ -541,14 +533,8 @@ export default class Notes {
form.find('.js-errors').remove(); form.find('.js-errors').remove();
// reset text and preview // reset text and preview
form.find('.js-md-write-button').click(); form.find('.js-md-write-button').click();
form form.find('.js-note-text').val('').trigger('input');
.find('.js-note-text') form.find('.js-note-text').data('autosave').reset();
.val('')
.trigger('input');
form
.find('.js-note-text')
.data('autosave')
.reset();
const event = document.createEvent('Event'); const event = document.createEvent('Event');
event.initEvent('autosize:update', true, false); event.initEvent('autosize:update', true, false);
...@@ -690,10 +676,7 @@ export default class Notes { ...@@ -690,10 +676,7 @@ export default class Notes {
} }
checkContentToAllowEditing($el) { checkContentToAllowEditing($el) {
const initialContent = $el const initialContent = $el.find('.original-note-content').text().trim();
.find('.original-note-content')
.text()
.trim();
const currentContent = $el.find('.js-note-text').val(); const currentContent = $el.find('.js-note-text').val();
let isAllowed = true; let isAllowed = true;
...@@ -877,10 +860,7 @@ export default class Notes { ...@@ -877,10 +860,7 @@ export default class Notes {
const form = this.cleanForm(this.formClone.clone()); const form = this.cleanForm(this.formClone.clone());
const replyLink = $(target).closest('.js-discussion-reply-button'); const replyLink = $(target).closest('.js-discussion-reply-button');
// insert the form after the button // insert the form after the button
replyLink replyLink.closest('.discussion-reply-holder').hide().after(form);
.closest('.discussion-reply-holder')
.hide()
.after(form);
// show the form // show the form
return this.setupDiscussionNoteForm(replyLink, form); return this.setupDiscussionNoteForm(replyLink, form);
} }
...@@ -1069,10 +1049,7 @@ export default class Notes { ...@@ -1069,10 +1049,7 @@ export default class Notes {
const row = form.closest('tr'); const row = form.closest('tr');
const glForm = form.data('glForm'); const glForm = form.data('glForm');
glForm.destroy(); glForm.destroy();
form form.find('.js-note-text').data('autosave').reset();
.find('.js-note-text')
.data('autosave')
.reset();
// show the reply button (will only work for replies) // show the reply button (will only work for replies)
form.prev('.discussion-reply-holder').show(); form.prev('.discussion-reply-holder').show();
if (row.is('.js-temp-notes-holder')) { if (row.is('.js-temp-notes-holder')) {
...@@ -1181,16 +1158,10 @@ export default class Notes { ...@@ -1181,16 +1158,10 @@ export default class Notes {
this.glForm = new GLForm($editForm.find('form'), this.enableGFM); this.glForm = new GLForm($editForm.find('form'), this.enableGFM);
$editForm $editForm.find('form').attr('action', `${postUrl}?html=true`).attr('data-remote', 'true');
.find('form')
.attr('action', `${postUrl}?html=true`)
.attr('data-remote', 'true');
$editForm.find('.js-form-target-id').val(targetId); $editForm.find('.js-form-target-id').val(targetId);
$editForm.find('.js-form-target-type').val(targetType); $editForm.find('.js-form-target-type').val(targetType);
$editForm $editForm.find('.js-note-text').focus().val(originalContent);
.find('.js-note-text')
.focus()
.val(originalContent);
$editForm.find('.js-md-write-button').trigger('click'); $editForm.find('.js-md-write-button').trigger('click');
$editForm.find('.referenced-users').hide(); $editForm.find('.referenced-users').hide();
} }
...@@ -1306,9 +1277,7 @@ export default class Notes { ...@@ -1306,9 +1277,7 @@ export default class Notes {
* intrusive. * intrusive.
*/ */
collapseLongCommitList() { collapseLongCommitList() {
const systemNotes = $('#notes-list') const systemNotes = $('#notes-list').find('li.system-note').has('ul');
.find('li.system-note')
.has('ul');
$.each(systemNotes, (index, systemNote) => { $.each(systemNotes, (index, systemNote) => {
const $systemNote = $(systemNote); const $systemNote = $(systemNote);
...@@ -1365,11 +1334,7 @@ export default class Notes { ...@@ -1365,11 +1334,7 @@ export default class Notes {
// There can be CRLF vs LF mismatches if we don't sanitize and compare the same way // There can be CRLF vs LF mismatches if we don't sanitize and compare the same way
const sanitizedNoteEntityText = normalizeNewlines(noteEntity.note.trim()); const sanitizedNoteEntityText = normalizeNewlines(noteEntity.note.trim());
const currentNoteText = normalizeNewlines( const currentNoteText = normalizeNewlines(
$note $note.find('.original-note-content').first().text().trim(),
.find('.original-note-content')
.first()
.text()
.trim(),
); );
return sanitizedNoteEntityText !== currentNoteText; return sanitizedNoteEntityText !== currentNoteText;
} }
...@@ -1545,10 +1510,7 @@ export default class Notes { ...@@ -1545,10 +1510,7 @@ export default class Notes {
let $form = $submitBtn.parents('form'); let $form = $submitBtn.parents('form');
const $closeBtn = $form.find('.js-note-target-close'); const $closeBtn = $form.find('.js-note-target-close');
const isDiscussionNote = const isDiscussionNote =
$submitBtn $submitBtn.parent().find('li.droplab-item-selected').attr('id') === 'discussion';
.parent()
.find('li.droplab-item-selected')
.attr('id') === 'discussion';
const isMainForm = $form.hasClass('js-main-target-form'); const isMainForm = $form.hasClass('js-main-target-form');
const isDiscussionForm = $form.hasClass('js-discussion-note-form'); const isDiscussionForm = $form.hasClass('js-discussion-note-form');
const isDiscussionResolve = $submitBtn.hasClass('js-comment-resolve-button'); const isDiscussionResolve = $submitBtn.hasClass('js-comment-resolve-button');
......
...@@ -77,8 +77,8 @@ export default { ...@@ -77,8 +77,8 @@ export default {
<div <div
v-if=" v-if="
!hideJumpToNextUnresolvedInThreads && !hideJumpToNextUnresolvedInThreads &&
discussion.resolvable && discussion.resolvable &&
shouldShowJumpToNextDiscussion shouldShowJumpToNextDiscussion
" "
class="btn-group discussion-actions ml-sm-2" class="btn-group discussion-actions ml-sm-2"
> >
......
...@@ -193,8 +193,7 @@ export default { ...@@ -193,8 +193,7 @@ export default {
}, },
canSuggest() { canSuggest() {
return ( return (
this.getNoteableData.can_receive_suggestion && this.getNoteableData.can_receive_suggestion && this.line && this.line.can_receive_suggestion
(this.line && this.line.can_receive_suggestion)
); );
}, },
changedCommentText() { changedCommentText() {
......
...@@ -12,9 +12,7 @@ export default function notificationsDropdown() { ...@@ -12,9 +12,7 @@ export default function notificationsDropdown() {
} }
const notificationLevel = $(this).data('notificationLevel'); const notificationLevel = $(this).data('notificationLevel');
const form = $(this) const form = $(this).parents('.notification-form').first();
.parents('.notification-form')
.first();
form.find('.js-notification-loading').toggleClass('spinner'); form.find('.js-notification-loading').toggleClass('spinner');
if (form.hasClass('no-label')) { if (form.hasClass('no-label')) {
...@@ -29,9 +27,7 @@ export default function notificationsDropdown() { ...@@ -29,9 +27,7 @@ export default function notificationsDropdown() {
const data = e.detail[0]; const data = e.detail[0];
if (data.saved) { if (data.saved) {
$(e.currentTarget) $(e.currentTarget).closest('.js-notification-dropdown').replaceWith(data.html);
.closest('.js-notification-dropdown')
.replaceWith(data.html);
} else { } else {
Flash(__('Failed to save new settings'), 'alert'); Flash(__('Failed to save new settings'), 'alert');
} }
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
</gl-link> </gl-link>
</template> </template>
<template #cell(commit)="{item}"> <template #cell(commit)="{ item }">
<gl-link <gl-link
:href="item.pipeline.project.commit_url" :href="item.pipeline.project.commit_url"
class="gl-text-gray-500" class="gl-text-gray-500"
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
<template #description> <template #description>
<gl-sprintf v-if="filterQuery" :message="$options.i18n.widenFilters" /> <gl-sprintf v-if="filterQuery" :message="$options.i18n.widenFilters" />
<gl-sprintf v-else :message="$options.i18n.noResults"> <gl-sprintf v-else :message="$options.i18n.noResults">
<template #noPackagesLink="{content}"> <template #noPackagesLink="{ content }">
<gl-link :href="emptyListHelpUrl" target="_blank">{{ content }}</gl-link> <gl-link :href="emptyListHelpUrl" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
......
...@@ -4,7 +4,7 @@ import Profile from '~/profile/profile'; ...@@ -4,7 +4,7 @@ import Profile from '~/profile/profile';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
$(document).on('input.ssh_key', '#key_key', function() { $(document).on('input.ssh_key', '#key_key', function () {
const $title = $('#key_title'); const $title = $('#key_title');
const comment = $(this) const comment = $(this)
.val() .val()
......
...@@ -161,9 +161,7 @@ export default { ...@@ -161,9 +161,7 @@ export default {
<template #coveragePercentage> <template #coveragePercentage>
{{ coveragePercentage }} {{ coveragePercentage }}
</template> </template>
<template #percentSymbol> <template #percentSymbol> % </template>
%
</template>
</gl-sprintf> </gl-sprintf>
</template> </template>
</gl-area-chart> </gl-area-chart>
......
import ZenMode from '~/zen_mode'; import ZenMode from '~/zen_mode';
import GLForm from '~/gl_form'; import GLForm from '~/gl_form';
export default function($formEl) { export default function ($formEl) {
new ZenMode(); // eslint-disable-line no-new new ZenMode(); // eslint-disable-line no-new
new GLForm($formEl); // eslint-disable-line no-new new GLForm($formEl); // eslint-disable-line no-new
} }
...@@ -16,7 +16,7 @@ import initInviteMemberModal from '~/invite_member/init_invite_member_modal'; ...@@ -16,7 +16,7 @@ import initInviteMemberModal from '~/invite_member/init_invite_member_modal';
import { IssuableType } from '~/issuable_show/constants'; import { IssuableType } from '~/issuable_show/constants';
export default function() { export default function () {
const initialDataEl = document.getElementById('js-issuable-app'); const initialDataEl = document.getElementById('js-issuable-app');
const { issueType, ...issuableData } = parseIssuableData(initialDataEl); const { issueType, ...issuableData } = parseIssuableData(initialDataEl);
......
...@@ -29,9 +29,7 @@ export default mrNewCompareNode => { ...@@ -29,9 +29,7 @@ export default mrNewCompareNode => {
$(mrNewCompareNode).find('.js-source-loading'), $(mrNewCompareNode).find('.js-source-loading'),
$(mrNewCompareNode).find('.mr_source_commit'), $(mrNewCompareNode).find('.mr_source_commit'),
{ {
ref: $(mrNewCompareNode) ref: $(mrNewCompareNode).find("input[name='merge_request[source_branch]']").val(),
.find("input[name='merge_request[source_branch]']")
.val(),
}, },
); );
const updateTargetBranchCommitList = () => const updateTargetBranchCommitList = () =>
...@@ -43,9 +41,7 @@ export default mrNewCompareNode => { ...@@ -43,9 +41,7 @@ export default mrNewCompareNode => {
target_project_id: $(mrNewCompareNode) target_project_id: $(mrNewCompareNode)
.find("input[name='merge_request[target_project_id]']") .find("input[name='merge_request[target_project_id]']")
.val(), .val(),
ref: $(mrNewCompareNode) ref: $(mrNewCompareNode).find("input[name='merge_request[target_branch]']").val(),
.find("input[name='merge_request[target_branch]']")
.val(),
}, },
); );
initCompareAutocomplete('branches', $dropdown => { initCompareAutocomplete('branches', $dropdown => {
......
...@@ -8,7 +8,7 @@ import loadAwardsHandler from '~/awards_handler'; ...@@ -8,7 +8,7 @@ import loadAwardsHandler from '~/awards_handler';
import initInviteMemberTrigger from '~/invite_member/init_invite_member_trigger'; import initInviteMemberTrigger from '~/invite_member/init_invite_member_trigger';
import initInviteMemberModal from '~/invite_member/init_invite_member_modal'; import initInviteMemberModal from '~/invite_member/init_invite_member_modal';
export default function() { export default function () {
new ZenMode(); // eslint-disable-line no-new new ZenMode(); // eslint-disable-line no-new
initIssuableSidebar(); initIssuableSidebar();
initPipelines(); initPipelines();
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
:data-testid="option.value" :data-testid="option.value"
> >
<gl-sprintf v-if="option.link" :message="option.text"> <gl-sprintf v-if="option.link" :message="option.text">
<template #link="{content}"> <template #link="{ content }">
<gl-link :href="option.link" target="_blank" class="gl-font-sm"> <gl-link :href="option.link" target="_blank" class="gl-font-sm">
{{ content }} {{ content }}
</gl-link> </gl-link>
......
...@@ -18,34 +18,26 @@ export default class Project { ...@@ -18,34 +18,26 @@ export default class Project {
// Ref switcher // Ref switcher
if (document.querySelector('.js-project-refs-dropdown')) { if (document.querySelector('.js-project-refs-dropdown')) {
Project.initRefSwitcher(); Project.initRefSwitcher();
$('.project-refs-select').on('change', function() { $('.project-refs-select').on('change', function () {
return $(this) return $(this).parents('form').trigger('submit');
.parents('form')
.trigger('submit');
}); });
} }
$('.hide-no-ssh-message').on('click', function(e) { $('.hide-no-ssh-message').on('click', function (e) {
Cookies.set('hide_no_ssh_message', 'false'); Cookies.set('hide_no_ssh_message', 'false');
$(this) $(this).parents('.no-ssh-key-message').remove();
.parents('.no-ssh-key-message')
.remove();
return e.preventDefault(); return e.preventDefault();
}); });
$('.hide-no-password-message').on('click', function(e) { $('.hide-no-password-message').on('click', function (e) {
Cookies.set('hide_no_password_message', 'false'); Cookies.set('hide_no_password_message', 'false');
$(this) $(this).parents('.no-password-message').remove();
.parents('.no-password-message')
.remove();
return e.preventDefault(); return e.preventDefault();
}); });
$('.hide-auto-devops-implicitly-enabled-banner').on('click', function(e) { $('.hide-auto-devops-implicitly-enabled-banner').on('click', function (e) {
const projectId = $(this).data('project-id'); const projectId = $(this).data('project-id');
const cookieKey = `hide_auto_devops_implicitly_enabled_banner_${projectId}`; const cookieKey = `hide_auto_devops_implicitly_enabled_banner_${projectId}`;
Cookies.set(cookieKey, 'false'); Cookies.set(cookieKey, 'false');
$(this) $(this).parents('.auto-devops-implicitly-enabled-banner').remove();
.parents('.auto-devops-implicitly-enabled-banner')
.remove();
return e.preventDefault(); return e.preventDefault();
}); });
...@@ -67,7 +59,7 @@ export default class Project { ...@@ -67,7 +59,7 @@ export default class Project {
refLink.href = '#'; refLink.href = '#';
return $('.js-project-refs-dropdown').each(function() { return $('.js-project-refs-dropdown').each(function () {
const $dropdown = $(this); const $dropdown = $(this);
const selected = $dropdown.data('selected'); const selected = $dropdown.data('selected');
const fieldName = $dropdown.data('fieldName'); const fieldName = $dropdown.data('fieldName');
......
...@@ -354,18 +354,21 @@ export default { ...@@ -354,18 +354,21 @@ export default {
<option <option
:value="visibilityOptions.PRIVATE" :value="visibilityOptions.PRIVATE"
:disabled="!visibilityAllowed(visibilityOptions.PRIVATE)" :disabled="!visibilityAllowed(visibilityOptions.PRIVATE)"
>{{ s__('ProjectSettings|Private') }}</option
> >
{{ s__('ProjectSettings|Private') }}
</option>
<option <option
:value="visibilityOptions.INTERNAL" :value="visibilityOptions.INTERNAL"
:disabled="!visibilityAllowed(visibilityOptions.INTERNAL)" :disabled="!visibilityAllowed(visibilityOptions.INTERNAL)"
>{{ s__('ProjectSettings|Internal') }}</option
> >
{{ s__('ProjectSettings|Internal') }}
</option>
<option <option
:value="visibilityOptions.PUBLIC" :value="visibilityOptions.PUBLIC"
:disabled="!visibilityAllowed(visibilityOptions.PUBLIC)" :disabled="!visibilityAllowed(visibilityOptions.PUBLIC)"
>{{ s__('ProjectSettings|Public') }}</option
> >
{{ s__('ProjectSettings|Public') }}
</option>
</select> </select>
<gl-icon <gl-icon
name="chevron-down" name="chevron-down"
......
...@@ -3,10 +3,7 @@ import { initRemoveTag } from '../remove_tag'; ...@@ -3,10 +3,7 @@ import { initRemoveTag } from '../remove_tag';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
initRemoveTag({ initRemoveTag({
onDelete: path => { onDelete: path => {
document document.querySelector(`[data-path="${path}"]`).closest('.js-tag-list').remove();
.querySelector(`[data-path="${path}"]`)
.closest('.js-tag-list')
.remove();
}, },
}); });
}); });
...@@ -16,16 +16,12 @@ export default class Search { ...@@ -16,16 +16,12 @@ export default class Search {
} }
eventListeners() { eventListeners() {
$(document) $(document).off('keyup', this.searchInput).on('keyup', this.searchInput, this.searchKeyUp);
.off('keyup', this.searchInput)
.on('keyup', this.searchInput, this.searchKeyUp);
$(document) $(document)
.off('click', this.searchClear) .off('click', this.searchClear)
.on('click', this.searchClear, this.clearSearchField.bind(this)); .on('click', this.searchClear, this.clearSearchField.bind(this));
$('a.js-search-clear') $('a.js-search-clear').off('click', this.clearSearchFilter).on('click', this.clearSearchFilter);
.off('click', this.clearSearchFilter)
.on('click', this.clearSearchFilter);
} }
static submitSearch() { static submitSearch() {
...@@ -42,10 +38,7 @@ export default class Search { ...@@ -42,10 +38,7 @@ export default class Search {
} }
clearSearchField() { clearSearchField() {
return $(this.searchInput) return $(this.searchInput).val('').trigger('keyup').focus();
.val('')
.trigger('keyup')
.focus();
} }
// We need to manually follow the link on the anchors // We need to manually follow the link on the anchors
......
...@@ -42,11 +42,7 @@ function formatTooltipText({ date, count }) { ...@@ -42,11 +42,7 @@ function formatTooltipText({ date, count }) {
return `${contribText}<br />${dateDayName} ${dateText}`; return `${contribText}<br />${dateDayName} ${dateText}`;
} }
const initColorKey = () => const initColorKey = () => d3.scaleLinear().range(['#acd5f2', '#254e77']).domain([0, 3]);
d3
.scaleLinear()
.range(['#acd5f2', '#254e77'])
.domain([0, 3]);
export default class ActivityCalendar { export default class ActivityCalendar {
constructor( constructor(
...@@ -291,10 +287,7 @@ export default class ActivityCalendar { ...@@ -291,10 +287,7 @@ export default class ActivityCalendar {
this.colorKey(2), this.colorKey(2),
this.colorKey(3), this.colorKey(3),
]; ];
return d3 return d3.scaleThreshold().domain([0, 10, 20, 30]).range(colorRange);
.scaleThreshold()
.domain([0, 10, 20, 30])
.range(colorRange);
} }
clickDay(stamp) { clickDay(stamp) {
......
...@@ -11,9 +11,7 @@ function initUserProfile(action) { ...@@ -11,9 +11,7 @@ function initUserProfile(action) {
$('.hide-project-limit-message').on('click', e => { $('.hide-project-limit-message').on('click', e => {
e.preventDefault(); e.preventDefault();
Cookies.set('hide_project_limit_message', 'false'); Cookies.set('hide_project_limit_message', 'false');
$(this) $(this).parents('.project-limit-message').remove();
.parents('.project-limit-message')
.remove();
}); });
} }
......
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
data-testid="ci-lint-status" data-testid="ci-lint-status"
>{{ status.text }} >{{ status.text }}
<gl-sprintf :message="$options.includesText"> <gl-sprintf :message="$options.includesText">
<template #code="{content}"> <template #code="{ content }">
<code> <code>
{{ content }} {{ content }}
</code> </code>
......
...@@ -151,8 +151,7 @@ export default { ...@@ -151,8 +151,7 @@ export default {
:href="detailsPath" :href="detailsPath"
:title="tooltipText" :title="tooltipText"
:class="jobClasses" :class="jobClasses"
class="js-pipeline-graph-job-link qa-job-link menu-item gl-text-gray-900 gl-active-text-decoration-none class="js-pipeline-graph-job-link qa-job-link menu-item gl-text-gray-900 gl-active-text-decoration-none gl-focus-text-decoration-none gl-hover-text-decoration-none"
gl-focus-text-decoration-none gl-hover-text-decoration-none"
data-testid="job-with-link" data-testid="job-with-link"
@click.stop="hideTooltips" @click.stop="hideTooltips"
@mouseout="hideTooltips" @mouseout="hideTooltips"
......
...@@ -36,16 +36,10 @@ export const generateLinksData = ({ links }, containerID) => { ...@@ -36,16 +36,10 @@ export const generateLinksData = ({ links }, containerID) => {
// positioned in the center of the job node by adding half the height // positioned in the center of the job node by adding half the height
// of the job pill. // of the job pill.
const paddingLeft = Number( const paddingLeft = Number(
window window.getComputedStyle(containerEl, null).getPropertyValue('padding-left').replace('px', ''),
.getComputedStyle(containerEl, null)
.getPropertyValue('padding-left')
.replace('px', ''),
); );
const paddingTop = Number( const paddingTop = Number(
window window.getComputedStyle(containerEl, null).getPropertyValue('padding-top').replace('px', ''),
.getComputedStyle(containerEl, null)
.getPropertyValue('padding-top')
.replace('px', ''),
); );
const sourceNodeX = sourceNodeCoordinates.right - containerCoordinates.x - paddingLeft; const sourceNodeX = sourceNodeCoordinates.right - containerCoordinates.x - paddingLeft;
......
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
) )
" "
> >
<template #strong="{content}"> <template #strong="{ content }">
<b>{{ content }}</b> <b>{{ content }}</b>
</template> </template>
</gl-sprintf> </gl-sprintf>
......
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