diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 15:10:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 15:10:26 +0300 |
commit | 5c9f6c66fabf22927e862b2b60362e4ea25b250b (patch) | |
tree | 6ff391dcb7fdd3126f71af9fa4ca5e776a9ecbe3 /app/assets/javascripts | |
parent | 65fdda8d39a9af414dbe5aa3a385b9bcba00960b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
168 files changed, 456 insertions, 789 deletions
diff --git a/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue b/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue index bc2d96832fa..5da38495010 100644 --- a/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue +++ b/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue @@ -36,7 +36,7 @@ export default { ) " > - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="docsLink" target="_blank">{{ content }}</gl-link> </template> <template #strong="{ content }" diff --git a/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue b/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue index 316827e1b07..c0ad814172d 100644 --- a/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue +++ b/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue @@ -35,7 +35,7 @@ export default { ) " > - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="docsLink" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/admin/statistics_panel/index.js b/app/assets/javascripts/admin/statistics_panel/index.js index 39112e3ddc0..8c49fffe630 100644 --- a/app/assets/javascripts/admin/statistics_panel/index.js +++ b/app/assets/javascripts/admin/statistics_panel/index.js @@ -2,7 +2,7 @@ import Vue from 'vue'; import StatisticsPanelApp from './components/app.vue'; import createStore from './store'; -export default function(el) { +export default function (el) { if (!el) { return false; } diff --git a/app/assets/javascripts/admin/users/index.js b/app/assets/javascripts/admin/users/index.js index 21780ee9984..6f8446221a3 100644 --- a/app/assets/javascripts/admin/users/index.js +++ b/app/assets/javascripts/admin/users/index.js @@ -2,7 +2,7 @@ import Vue from 'vue'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; 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) { return false; } diff --git a/app/assets/javascripts/alert_management/components/alert_details.vue b/app/assets/javascripts/alert_management/components/alert_details.vue index 1f3fdd5eef2..ad29f5833e4 100644 --- a/app/assets/javascripts/alert_management/components/alert_details.vue +++ b/app/assets/javascripts/alert_management/components/alert_details.vue @@ -194,14 +194,20 @@ export default { projectPath: this.projectPath, }, }) - .then(({ data: { createAlertIssue: { errors, issue } } }) => { - if (errors?.length) { - [this.createIncidentError] = errors; - this.incidentCreationInProgress = false; - } else if (issue) { - visitUrl(this.incidentPath(issue.iid)); - } - }) + .then( + ({ + data: { + createAlertIssue: { errors, issue }, + }, + }) => { + if (errors?.length) { + [this.createIncidentError] = errors; + this.incidentCreationInProgress = false; + } else if (issue) { + visitUrl(this.incidentPath(issue.iid)); + } + }, + ) .catch(error => { this.createIncidentError = error; this.incidentCreationInProgress = false; diff --git a/app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue b/app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue index 3af68d42ddf..3b9a730e5e1 100644 --- a/app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue +++ b/app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue @@ -192,7 +192,7 @@ export default { </script> <template> - <div class="block alert-assignees "> + <div class="block alert-assignees"> <div ref="assignees" class="sidebar-collapsed-icon" @click="$emit('toggle-sidebar')"> <gl-icon name="user" :size="14" /> <gl-loading-icon v-if="isUpdating" /> diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index d937060536a..6e13261accc 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -98,10 +98,7 @@ export class AwardsHandler { showEmojiMenu($addBtn) { if ($addBtn.hasClass('js-note-emoji')) { - $addBtn - .closest('.note') - .find('.js-awards-block') - .addClass('current'); + $addBtn.closest('.note').find('.js-awards-block').addClass('current'); } else { $addBtn.closest('.js-awards-block').addClass('current'); } @@ -531,9 +528,7 @@ export class AwardsHandler { const $search = $('.js-emoji-menu-search'); this.registerEventListener('on', $search, 'input', e => { - const term = $(e.target) - .val() - .trim(); + const term = $(e.target).val().trim(); this.searchEmojis(term); }); @@ -556,17 +551,11 @@ export class AwardsHandler { // Generate a search result block const h5 = $('<h5 class="emoji-search-title"/>').text('Search results'); const foundEmojis = this.findMatchingEmojiElements(term).show(); - const ul = $('<ul>') - .addClass('emoji-menu-list emoji-menu-search') - .append(foundEmojis); + const ul = $('<ul>').addClass('emoji-menu-list emoji-menu-search').append(foundEmojis); $('.emoji-menu-content ul, .emoji-menu-content h5').hide(); - $('.emoji-menu-content') - .append(h5) - .append(ul); + $('.emoji-menu-content').append(h5).append(ul); } else { - $('.emoji-menu-content') - .children() - .show(); + $('.emoji-menu-content').children().show(); } } diff --git a/app/assets/javascripts/batch_comments/components/preview_item.vue b/app/assets/javascripts/batch_comments/components/preview_item.vue index dca6d90fbcb..cae1157e57c 100644 --- a/app/assets/javascripts/batch_comments/components/preview_item.vue +++ b/app/assets/javascripts/batch_comments/components/preview_item.vue @@ -98,9 +98,7 @@ export default { {{ titleText }} </span> <template v-if="showLinePosition"> - <template v-if="!glFeatures.multilineComments" - >:{{ linePosition }}</template - > + <template v-if="!glFeatures.multilineComments">:{{ linePosition }}</template> <template v-else-if="startLineNumber === endLineNumber"> :<span :class="getLineClasses(startLineNumber)">{{ startLineNumber }}</span> </template> diff --git a/app/assets/javascripts/behaviors/preview_markdown.js b/app/assets/javascripts/behaviors/preview_markdown.js index 84bf22586a9..3a8ba7be667 100644 --- a/app/assets/javascripts/behaviors/preview_markdown.js +++ b/app/assets/javascripts/behaviors/preview_markdown.js @@ -23,7 +23,7 @@ MarkdownPreview.prototype.emptyMessage = __('Nothing to preview.'); MarkdownPreview.prototype.ajaxCache = {}; -MarkdownPreview.prototype.showPreview = function($form) { +MarkdownPreview.prototype.showPreview = function ($form) { const preview = $form.find('.js-md-preview'); const url = preview.data('url'); if (preview.hasClass('md-preview-loading')) { @@ -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) { return; } @@ -82,11 +82,11 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function(text, url, success) { .catch(() => flash(__('An error occurred while fetching markdown preview'))); }; -MarkdownPreview.prototype.hideReferencedUsers = function($form) { +MarkdownPreview.prototype.hideReferencedUsers = function ($form) { $form.find('.referenced-users').hide(); }; -MarkdownPreview.prototype.renderReferencedUsers = function(users, $form) { +MarkdownPreview.prototype.renderReferencedUsers = function (users, $form) { const referencedUsers = $form.find('.referenced-users'); if (referencedUsers.length) { if (users.length >= this.referenceThreshold) { @@ -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(); }; -MarkdownPreview.prototype.renderReferencedCommands = function(commands, $form) { +MarkdownPreview.prototype.renderReferencedCommands = function (commands, $form) { const referencedCommands = $form.find('.referenced-commands'); if (commands.length > 0) { referencedCommands.html(commands); @@ -120,7 +120,7 @@ const writeButtonSelector = '.js-md-write-button'; lastTextareaPreviewed = null; const markdownToolbar = $('.md-header-toolbar'); -$.fn.setupMarkdownPreview = function() { +$.fn.setupMarkdownPreview = function () { const $form = $(this); $form.find('textarea.markdown-area').on('input', () => { markdownPreview.hideReferencedUsers($form); @@ -136,14 +136,8 @@ $(document).on('markdown-preview:show', (e, $form) => { lastTextareaHeight = lastTextareaPreviewed.height(); // toggle tabs - $form - .find(writeButtonSelector) - .parent() - .removeClass('active'); - $form - .find(previewButtonSelector) - .parent() - .addClass('active'); + $form.find(writeButtonSelector).parent().removeClass('active'); + $form.find(previewButtonSelector).parent().addClass('active'); // toggle content $form.find('.md-write-holder').hide(); @@ -163,14 +157,8 @@ $(document).on('markdown-preview:hide', (e, $form) => { } // toggle tabs - $form - .find(writeButtonSelector) - .parent() - .addClass('active'); - $form - .find(previewButtonSelector) - .parent() - .removeClass('active'); + $form.find(writeButtonSelector).parent().addClass('active'); + $form.find(previewButtonSelector).parent().removeClass('active'); // toggle content $form.find('.md-write-holder').show(); @@ -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(); const $form = $(this).closest('form'); $(document).triggerHandler('markdown-preview:show', [$form]); }); -$(document).on('click', writeButtonSelector, function(e) { +$(document).on('click', writeButtonSelector, function (e) { e.preventDefault(); const $form = $(this).closest('form'); $(document).triggerHandler('markdown-preview:hide', [$form]); diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js index c0f67923191..766e99fd5a6 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js @@ -98,9 +98,7 @@ export default class Shortcuts { }); // eslint-disable-next-line @gitlab/no-global-event-off - $('.js-shortcuts-modal-trigger') - .off('click') - .on('click', this.onToggleHelp); + $('.js-shortcuts-modal-trigger').off('click').on('click', this.onToggleHelp); if (shouldDisableShortcuts()) { disableShortcuts(); diff --git a/app/assets/javascripts/blob/blob_file_dropzone.js b/app/assets/javascripts/blob/blob_file_dropzone.js index e8772b7240a..77565902ea3 100644 --- a/app/assets/javascripts/blob/blob_file_dropzone.js +++ b/app/assets/javascripts/blob/blob_file_dropzone.js @@ -43,16 +43,14 @@ export default class BlobFileDropzone { previewsContainer: '.dropzone-previews', headers: csrf.headers, init() { - this.on('processing', function() { + this.on('processing', function () { this.options.url = form.attr('action'); }); this.on('addedfile', () => { toggleLoading(submitButton, submitButtonLoadingIcon, false); dropzoneMessage.addClass(HIDDEN_CLASS); - $('.dropzone-alerts') - .html('') - .hide(); + $('.dropzone-alerts').html('').hide(); }); this.on('removedfile', () => { toggleLoading(submitButton, submitButtonLoadingIcon, false); @@ -62,7 +60,7 @@ export default class BlobFileDropzone { $('#modal-upload-blob').modal('hide'); visitUrl(response.filePath); }); - this.on('maxfilesexceeded', function(file) { + this.on('maxfilesexceeded', function (file) { dropzoneMessage.addClass(HIDDEN_CLASS); this.removeFile(file); }); @@ -74,9 +72,7 @@ export default class BlobFileDropzone { }, // Override behavior of adding error underneath preview error(file, errorMessage) { - const stripped = $('<div/>') - .html(errorMessage) - .text(); + const stripped = $('<div/>').html(errorMessage).text(); $('.dropzone-alerts') .html(sprintf(__('Error uploading file: %{stripped}'), { stripped })) .show(); diff --git a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue index 02a522dda9d..fdaa4b082f7 100644 --- a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue +++ b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue @@ -98,7 +98,7 @@ export default { </template> <p> <gl-sprintf :message="$options.i18n.bodyMessage"> - <template #codeQualityLink="{content}"> + <template #codeQualityLink="{ content }"> <gl-link :href="codeQualityLink" target="_blank" class="font-size-inherit">{{ content }}</gl-link> @@ -106,12 +106,12 @@ export default { </gl-sprintf> </p> <gl-sprintf :message="$options.i18n.helpMessage"> - <template #beginnerLink="{content}"> + <template #beginnerLink="{ content }"> <gl-link :href="$options.beginnerLink" target="_blank"> {{ content }} </gl-link> </template> - <template #exampleLink="{content}"> + <template #exampleLink="{ content }"> <gl-link :href="exampleLink" target="_blank"> {{ content }} </gl-link> diff --git a/app/assets/javascripts/boards/components/board_sidebar.js b/app/assets/javascripts/boards/components/board_sidebar.js index d26f15c1723..a0dd7f4d898 100644 --- a/app/assets/javascripts/boards/components/board_sidebar.js +++ b/app/assets/javascripts/boards/components/board_sidebar.js @@ -82,9 +82,7 @@ export default Vue.extend({ }); $('.js-issue-board-sidebar', this.$el).each((i, el) => { - $(el) - .data('deprecatedJQueryDropdown') - .clearMenu(); + $(el).data('deprecatedJQueryDropdown').clearMenu(); }); } diff --git a/app/assets/javascripts/boards/components/modal/index.vue b/app/assets/javascripts/boards/components/modal/index.vue index 817b3bdddb0..67885993d86 100644 --- a/app/assets/javascripts/boards/components/modal/index.vue +++ b/app/assets/javascripts/boards/components/modal/index.vue @@ -65,9 +65,7 @@ export default { this.loading = false; }; - this.loadIssues() - .then(loadingDone) - .catch(loadingDone); + this.loadIssues().then(loadingDone).catch(loadingDone); } else if (!this.showAddIssuesModal) { this.issues = []; this.selectedIssues = []; @@ -83,9 +81,7 @@ export default { this.filterLoading = false; }; - this.loadIssues(true) - .then(loadingDone) - .catch(loadingDone); + this.loadIssues(true).then(loadingDone).catch(loadingDone); } }, deep: true, diff --git a/app/assets/javascripts/boards/components/new_list_dropdown.js b/app/assets/javascripts/boards/components/new_list_dropdown.js index d1011c24977..2bc54155163 100644 --- a/app/assets/javascripts/boards/components/new_list_dropdown.js +++ b/app/assets/javascripts/boards/components/new_list_dropdown.js @@ -40,7 +40,7 @@ $(document) }); export default function initNewListDropdown() { - $('.js-new-board-list').each(function() { + $('.js-new-board-list').each(function () { const $dropdownToggle = $(this); const $dropdown = $dropdownToggle.closest('.dropdown'); new CreateLabelDropdown( diff --git a/app/assets/javascripts/boards/stores/actions.js b/app/assets/javascripts/boards/stores/actions.js index 4aa2869795f..1774f4d640f 100644 --- a/app/assets/javascripts/boards/stores/actions.js +++ b/app/assets/javascripts/boards/stores/actions.js @@ -212,11 +212,17 @@ export default { listId, }, }) - .then(({ data: { destroyBoardList: { errors } } }) => { - if (errors.length > 0) { - commit(types.REMOVE_LIST_FAILURE, listsBackup); - } - }) + .then( + ({ + data: { + destroyBoardList: { errors }, + }, + }) => { + if (errors.length > 0) { + commit(types.REMOVE_LIST_FAILURE, listsBackup); + } + }, + ) .catch(() => { commit(types.REMOVE_LIST_FAILURE, listsBackup); }); diff --git a/app/assets/javascripts/build_artifacts.js b/app/assets/javascripts/build_artifacts.js index 8324c649538..34731e749d2 100644 --- a/app/assets/javascripts/build_artifacts.js +++ b/app/assets/javascripts/build_artifacts.js @@ -24,7 +24,7 @@ export default class BuildArtifacts { // eslint-disable-next-line class-methods-use-this 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)); }); } diff --git a/app/assets/javascripts/ci_lint/components/ci_lint.vue b/app/assets/javascripts/ci_lint/components/ci_lint.vue index 731ed2ddd01..fc47fe8c333 100644 --- a/app/assets/javascripts/ci_lint/components/ci_lint.vue +++ b/app/assets/javascripts/ci_lint/components/ci_lint.vue @@ -111,7 +111,7 @@ export default { <gl-form-checkbox v-model="dryRun" >{{ __('Simulate a pipeline created for the default branch') }} <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> </div> <gl-button data-testid="ci-lint-clear" @click="clear">{{ __('Clear') }}</gl-button> diff --git a/app/assets/javascripts/ci_settings_pipeline_triggers/components/triggers_list.vue b/app/assets/javascripts/ci_settings_pipeline_triggers/components/triggers_list.vue index ad07052a298..b84c188cd08 100644 --- a/app/assets/javascripts/ci_settings_pipeline_triggers/components/triggers_list.vue +++ b/app/assets/javascripts/ci_settings_pipeline_triggers/components/triggers_list.vue @@ -61,7 +61,7 @@ export default { class="triggers-list" responsive > - <template #cell(token)="{item}"> + <template #cell(token)="{ item }"> {{ item.token }} <clipboard-button v-if="item.hasTokenExposed" @@ -82,7 +82,7 @@ export default { </gl-badge> </div> </template> - <template #cell(description)="{item}"> + <template #cell(description)="{ item }"> <tooltip-on-truncate :title="item.description" truncate-target="child" @@ -92,7 +92,7 @@ export default { <div class="gl-flex-fill-1 gl-text-truncate">{{ item.description }}</div> </tooltip-on-truncate> </template> - <template #cell(owner)="{item}"> + <template #cell(owner)="{ item }"> <span class="trigger-owner sr-only">{{ item.owner.name }}</span> <user-avatar-link v-if="item.owner" @@ -102,11 +102,11 @@ export default { :img-alt="item.owner.name" /> </template> - <template #cell(lastUsed)="{item}"> + <template #cell(lastUsed)="{ item }"> <time-ago-tooltip v-if="item.lastUsed" :time="item.lastUsed" /> <span v-else>{{ __('Never') }}</span> </template> - <template #cell(actions)="{item}"> + <template #cell(actions)="{ item }"> <gl-button :title="s__('Pipelines|Edit')" icon="pencil" diff --git a/app/assets/javascripts/ci_variable_list/ci_variable_list.js b/app/assets/javascripts/ci_variable_list/ci_variable_list.js index cb1935c863d..53ef0f7098a 100644 --- a/app/assets/javascripts/ci_variable_list/ci_variable_list.js +++ b/app/assets/javascripts/ci_variable_list/ci_variable_list.js @@ -223,10 +223,7 @@ export default class VariableList { getAllData() { // Ignore the last empty row because we don't want to try persist // a blank variable and run into validation problems. - const validRows = this.$container - .find('.js-row') - .toArray() - .slice(0, -1); + const validRows = this.$container.find('.js-row').toArray().slice(0, -1); return validRows.map(rowEl => { const resultant = {}; diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index fdffaa24d03..e096a29ce7f 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -461,7 +461,7 @@ export default { ) " > - <template #code="{content}"> + <template #code="{ content }"> <code>{{ content }}</code> </template> <template #link="{ content }"> diff --git a/app/assets/javascripts/clusters_list/components/clusters.vue b/app/assets/javascripts/clusters_list/components/clusters.vue index 08fd7db40a1..71564086a43 100644 --- a/app/assets/javascripts/clusters_list/components/clusters.vue +++ b/app/assets/javascripts/clusters_list/components/clusters.vue @@ -254,9 +254,7 @@ export default { <template #freeSpacePercentage>{{ totalCpuAndUsage(item.nodes).freeSpacePercentage }}</template> - <template #percentSymbol - >%</template - > + <template #percentSymbol>%</template> </gl-sprintf> </span> @@ -277,9 +275,7 @@ export default { <template #freeSpacePercentage>{{ totalMemoryAndUsage(item.nodes).freeSpacePercentage }}</template> - <template #percentSymbol - >%</template - > + <template #percentSymbol>%</template> </gl-sprintf> </span> @@ -293,7 +289,7 @@ export default { /> </template> - <template #cell(cluster_type)="{value}"> + <template #cell(cluster_type)="{ value }"> <gl-badge variant="muted"> {{ value }} </gl-badge> diff --git a/app/assets/javascripts/commit/image_file.js b/app/assets/javascripts/commit/image_file.js index b70f8d6e736..9ddf11533c2 100644 --- a/app/assets/javascripts/commit/image_file.js +++ b/app/assets/javascripts/commit/image_file.js @@ -56,15 +56,15 @@ export default class ImageFile { let dragging = false; const $body = $('body'); const $offsetEl = $el.parent(); - const dragStart = function() { + const dragStart = function () { dragging = true; $body.css('user-select', 'none'); }; - const dragStop = function() { + const dragStop = function () { dragging = false; $body.css('user-select', ''); }; - const dragMove = function(e) { + const dragMove = function (e) { const moveX = e.pageX || e.touches[0].pageX; const left = moveX - ($offsetEl.offset().left + padding); if (!dragging) return; @@ -73,11 +73,7 @@ export default class ImageFile { }; // eslint-disable-next-line @gitlab/no-global-event-off - $el - .off('mousedown') - .off('touchstart') - .on('mousedown', dragStart) - .on('touchstart', dragStart); + $el.off('mousedown').off('touchstart').on('mousedown', dragStart).on('touchstart', dragStart); // eslint-disable-next-line @gitlab/no-global-event-off $body @@ -109,9 +105,9 @@ export default class ImageFile { } views = { - 'two-up': function() { + 'two-up': function () { return $('.two-up.view .wrap', this.file).each((index, wrap) => { - $('img', wrap).each(function() { + $('img', wrap).each(function () { const currentWidth = $(this).width(); if (currentWidth > availWidth / 2) { return $(this).width(availWidth / 2); @@ -157,7 +153,7 @@ export default class ImageFile { }); }); }, - 'onion-skin': function() { + 'onion-skin': function () { let maxHeight, maxWidth; maxWidth = 0; maxHeight = 0; diff --git a/app/assets/javascripts/commits.js b/app/assets/javascripts/commits.js index b18c109937d..f82bea134a3 100644 --- a/app/assets/javascripts/commits.js +++ b/app/assets/javascripts/commits.js @@ -85,10 +85,7 @@ export default class CommitsList { // Update commits count in the previous commits header. commitsCount += Number( - $(processedData) - .nextUntil('li.js-commit-header') - .first() - .find('li.commit').length, + $(processedData).nextUntil('li.js-commit-header').first().find('li.commit').length, ); $commitsHeadersLast diff --git a/app/assets/javascripts/commons/bootstrap.js b/app/assets/javascripts/commons/bootstrap.js index 2a1244149ff..f750c62103e 100644 --- a/app/assets/javascripts/commons/bootstrap.js +++ b/app/assets/javascripts/commons/bootstrap.js @@ -13,14 +13,10 @@ import 'bootstrap/js/dist/tab'; // custom jQuery functions $.fn.extend({ disable() { - return $(this) - .prop('disabled', true) - .addClass('disabled'); + return $(this).prop('disabled', true).addClass('disabled'); }, enable() { - return $(this) - .prop('disabled', false) - .removeClass('disabled'); + return $(this).prop('disabled', false).removeClass('disabled'); }, }); diff --git a/app/assets/javascripts/compare_autocomplete.js b/app/assets/javascripts/compare_autocomplete.js index 1c1f0664885..d0d4d9038ce 100644 --- a/app/assets/javascripts/compare_autocomplete.js +++ b/app/assets/javascripts/compare_autocomplete.js @@ -9,7 +9,7 @@ import { fixTitle } from '~/tooltips'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; export default function initCompareAutocomplete(limitTo = null, clickHandler = () => {}) { - $('.js-compare-dropdown').each(function() { + $('.js-compare-dropdown').each(function () { const $dropdown = $(this); const selected = $dropdown.data('selected'); const $dropdownContainer = $dropdown.closest('.dropdown'); @@ -51,9 +51,7 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = ( .text(ref) .attr('data-ref', ref); if (ref.header != null) { - return $('<li />') - .addClass('dropdown-header') - .text(ref.header); + return $('<li />').addClass('dropdown-header').text(ref.header); } return $('<li />').append(link); }, diff --git a/app/assets/javascripts/contextual_sidebar.js b/app/assets/javascripts/contextual_sidebar.js index 41988f321e5..f7d24c70864 100644 --- a/app/assets/javascripts/contextual_sidebar.js +++ b/app/assets/javascripts/contextual_sidebar.js @@ -43,7 +43,10 @@ export default class ContextualSidebar { $(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 diff --git a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue index d6deda25752..6b18455bfcc 100644 --- a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue +++ b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue @@ -57,9 +57,7 @@ export default { if (this.hasZone) { this.isLoading = true; - this.fetchMachineTypes() - .then(this.fetchSuccessHandler) - .catch(this.fetchFailureHandler); + this.fetchMachineTypes().then(this.fetchSuccessHandler).catch(this.fetchFailureHandler); } }, }, diff --git a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue index 522fef423af..8a3e6cf93fd 100644 --- a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue +++ b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue @@ -99,9 +99,7 @@ export default { created() { this.isLoading = true; - this.fetchProjects() - .then(this.fetchSuccessHandler) - .catch(this.fetchFailureHandler); + this.fetchProjects().then(this.fetchSuccessHandler).catch(this.fetchFailureHandler); }, methods: { ...mapActions(['fetchProjects', 'setIsValidatingProjectBilling', 'validateProjectBilling']), @@ -175,9 +173,7 @@ export default { <gl-sprintf :message="helpText"> <template #linkToBilling="{ content }"> <gl-link - :href=" - 'https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral' - " + :href="'https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral'" target="_blank" >{{ content }} <gl-icon name="external-link" /></gl-link> diff --git a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_zone_dropdown.vue b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_zone_dropdown.vue index b60a5be2e63..daab42c7e60 100644 --- a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_zone_dropdown.vue +++ b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_zone_dropdown.vue @@ -46,9 +46,7 @@ export default { if (!isValidating && this.projectHasBillingEnabled) { this.isLoading = true; - this.fetchZones() - .then(this.fetchSuccessHandler) - .catch(this.fetchFailureHandler); + this.fetchZones().then(this.fetchSuccessHandler).catch(this.fetchFailureHandler); } }, }, diff --git a/app/assets/javascripts/create_label.js b/app/assets/javascripts/create_label.js index 0d53efe8689..92060e19dec 100644 --- a/app/assets/javascripts/create_label.js +++ b/app/assets/javascripts/create_label.js @@ -46,7 +46,7 @@ export default class CreateLabelDropdown { addBinding() { const self = this; - this.$colorSuggestions.on('click', function(e) { + this.$colorSuggestions.on('click', function (e) { const $this = $(this); self.addColorValue(e, $this); }); @@ -72,10 +72,7 @@ export default class CreateLabelDropdown { e.stopPropagation(); this.$newColorField.val($this.data('color')).trigger('change'); - this.$colorPreview - .css('background-color', $this.data('color')) - .parent() - .addClass('is-active'); + this.$colorPreview.css('background-color', $this.data('color')).parent().addClass('is-active'); } enableLabelCreateButton() { @@ -94,10 +91,7 @@ export default class CreateLabelDropdown { this.$addList.prop('checked', this.addListDefault); - this.$colorPreview - .css('background-color', '') - .parent() - .removeClass('is-active'); + this.$colorPreview.css('background-color', '').parent().removeClass('is-active'); } saveLabel(e) { diff --git a/app/assets/javascripts/cycle_analytics/components/total_time_component.vue b/app/assets/javascripts/cycle_analytics/components/total_time_component.vue index b93a7d3c4f9..f52438ca2cb 100644 --- a/app/assets/javascripts/cycle_analytics/components/total_time_component.vue +++ b/app/assets/javascripts/cycle_analytics/components/total_time_component.vue @@ -30,8 +30,6 @@ export default { {{ time.seconds }} <span> {{ s__('Time|s') }} </span> </template> </template> - <template v-else> - -- - </template> + <template v-else> -- </template> </span> </template> diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js index fe57dd2dc8f..3d35ab2432f 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js @@ -123,10 +123,7 @@ export class GitLabDropdown { if ($(this.el).is('input')) { currentIndex = -1; } else { - $(selector, this.dropdown) - .first() - .find('a') - .addClass('is-focused'); + $(selector, this.dropdown).first().find('a').addClass('is-focused'); currentIndex = 0; } } @@ -493,10 +490,7 @@ export class GitLabDropdown { if (!this.options.multiSelect || el.hasClass('dropdown-clear-active')) { this.dropdown.find(`.${ACTIVE_CLASS}`).removeClass(ACTIVE_CLASS); if (!isInput) { - this.dropdown - .parent() - .find(`input[name='${fieldName}']`) - .remove(); + this.dropdown.parent().find(`input[name='${fieldName}']`).remove(); } } if (field && field.length && value == null) { @@ -536,10 +530,7 @@ export class GitLabDropdown { $(`input[name="${fieldName}"]`).remove(); } - const $input = $('<input>') - .attr('type', 'hidden') - .attr('name', fieldName) - .val(value); + const $input = $('<input>').attr('type', 'hidden').attr('name', fieldName).val(value); if (this.options.inputId != null) { $input.attr('id', this.options.inputId); } @@ -678,9 +669,7 @@ export class GitLabDropdown { toggleText = this.options.updateLabel; } - return $(this.el) - .find('.dropdown-toggle-text') - .text(toggleText); + return $(this.el).find('.dropdown-toggle-text').text(toggleText); } // eslint-disable-next-line class-methods-use-this diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js index 89ffb5f5f79..7b69a5f6308 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js @@ -22,10 +22,7 @@ export class GitLabDropdownFilter { // Clear click e.preventDefault(); e.stopPropagation(); - return this.input - .val('') - .trigger('input') - .focus(); + return this.input.val('').trigger('input').focus(); }); // Key events timeout = ''; @@ -113,7 +110,7 @@ export class GitLabDropdownFilter { const elements = this.options.elements(); if (searchText) { // eslint-disable-next-line func-names - elements.each(function() { + elements.each(function () { const $el = $(this); const matches = fuzzaldrinPlus.match($el.text().trim(), searchText); if (!$el.is('.dropdown-header')) { diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js index d857071d05f..29185bb5a4d 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js @@ -9,10 +9,7 @@ export class GitLabDropdownInput { // Clear click e.preventDefault(); e.stopPropagation(); - return this.input - .val('') - .trigger('input') - .focus(); + return this.input.val('').trigger('input').focus(); }); this.input @@ -31,10 +28,7 @@ export class GitLabDropdownInput { .toLowerCase() // replace non alphanumeric .replace(/(-)\1+/g, '-'); // replace repeated dashes this.cb(this.options.fieldName, val, {}, true); - this.input - .closest('.dropdown') - .find('.dropdown-toggle-text') - .text(val); + this.input.closest('.dropdown').find('.dropdown-toggle-text').text(val); }); } diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/index.js b/app/assets/javascripts/deprecated_jquery_dropdown/index.js index 90e7f15b5b7..6a3d2026192 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/index.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/index.js @@ -3,7 +3,7 @@ import { GitLabDropdown } from './gl_dropdown'; export default function initDeprecatedJQueryDropdown($el, opts) { // eslint-disable-next-line func-names - return $el.each(function() { + return $el.each(function () { if (!$.data(this, 'deprecatedJQueryDropdown')) { $.data(this, 'deprecatedJQueryDropdown', new GitLabDropdown(this, opts)); } diff --git a/app/assets/javascripts/design_management/components/design_destroyer.vue b/app/assets/javascripts/design_management/components/design_destroyer.vue index 5d32bfd4a73..a231f6c5e3b 100644 --- a/app/assets/javascripts/design_management/components/design_destroyer.vue +++ b/app/assets/javascripts/design_management/components/design_destroyer.vue @@ -32,12 +32,7 @@ export default { }, }, methods: { - updateStoreAfterDelete( - store, - { - data: { designManagementDelete }, - }, - ) { + updateStoreAfterDelete(store, { data: { designManagementDelete } }) { updateStoreAfterDesignsDelete( store, designManagementDelete, diff --git a/app/assets/javascripts/design_management/components/design_todo_button.vue b/app/assets/javascripts/design_management/components/design_todo_button.vue index aff4f348d15..96c417561ac 100644 --- a/app/assets/javascripts/design_management/components/design_todo_button.vue +++ b/app/assets/javascripts/design_management/components/design_todo_button.vue @@ -116,12 +116,7 @@ export default { variables: { id, }, - update( - store, - { - data: { todoMarkDone }, - }, - ) { + update(store, { data: { todoMarkDone } }) { const todoMarkDoneFirstError = (todoMarkDone.errors || [])[0]; if (todoMarkDoneFirstError) { this.$emit('error', Error(todoMarkDoneFirstError)); diff --git a/app/assets/javascripts/design_management/pages/design/index.vue b/app/assets/javascripts/design_management/pages/design/index.vue index fb86568c304..fd1dca914ed 100644 --- a/app/assets/javascripts/design_management/pages/design/index.vue +++ b/app/assets/javascripts/design_management/pages/design/index.vue @@ -167,12 +167,7 @@ export default { next(); }, methods: { - addImageDiffNoteToStore( - store, - { - data: { createImageDiffNote }, - }, - ) { + addImageDiffNoteToStore(store, { data: { createImageDiffNote } }) { updateStoreAfterAddImageDiffNote( store, createImageDiffNote, @@ -180,12 +175,7 @@ export default { this.designVariables, ); }, - updateImageDiffNoteInStore( - store, - { - data: { repositionImageDiffNote }, - }, - ) { + updateImageDiffNoteInStore(store, { data: { repositionImageDiffNote } }) { return updateStoreAfterRepositionImageDiffNote( store, repositionImageDiffNote, diff --git a/app/assets/javascripts/design_management/pages/index.vue b/app/assets/javascripts/design_management/pages/index.vue index ea404692840..b151dbf8a96 100644 --- a/app/assets/javascripts/design_management/pages/index.vue +++ b/app/assets/javascripts/design_management/pages/index.vue @@ -187,12 +187,7 @@ export default { .then(res => this.onUploadDesignDone(res)) .catch(() => this.onUploadDesignError()); }, - afterUploadDesign( - store, - { - data: { designManagementUpload }, - }, - ) { + afterUploadDesign(store, { data: { designManagementUpload } }) { updateStoreAfterUploadDesign(store, designManagementUpload, this.projectQueryBody); }, onUploadDesignDone(res) { diff --git a/app/assets/javascripts/design_management/router/routes.js b/app/assets/javascripts/design_management/router/routes.js index d888b856611..1b07d8aeb76 100644 --- a/app/assets/javascripts/design_management/router/routes.js +++ b/app/assets/javascripts/design_management/router/routes.js @@ -13,13 +13,7 @@ export default [ name: DESIGN_ROUTE_NAME, path: '/designs/:id', component: DesignDetail, - beforeEnter( - { - params: { id }, - }, - _, - next, - ) { + beforeEnter({ params: { id } }, _, next) { if (typeof id === 'string') { next(); } diff --git a/app/assets/javascripts/diff.js b/app/assets/javascripts/diff.js index 9497ea7bb4f..34667d6fa31 100644 --- a/app/assets/javascripts/diff.js +++ b/app/assets/javascripts/diff.js @@ -24,9 +24,7 @@ export default class Diff { if (!tab || (tab && tab.dataset && tab.dataset.isLocked !== '')) FilesCommentButton.init($diffFile); - const firstFile = $('.files') - .first() - .get(0); + const firstFile = $('.files').first().get(0); const canCreateNote = firstFile && firstFile.hasAttribute('data-can-create-note'); $diffFile.each((index, file) => initImageDiffHelper.initImageDiff(file, canCreateNote)); diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 1825e118575..66540311014 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -281,12 +281,7 @@ export default { const id = window?.location?.hash; if (id && id.indexOf('#note') !== 0) { - this.setHighlightedRow( - id - .split('diff-content') - .pop() - .slice(1), - ); + this.setHighlightedRow(id.split('diff-content').pop().slice(1)); } }, beforeCreate() { @@ -404,10 +399,7 @@ export default { }, setDiscussions() { requestIdleCallback( - () => - this.assignDiscussionsToDiff() - .then(this.$nextTick) - .then(this.startTaskList), + () => this.assignDiscussionsToDiff().then(this.$nextTick).then(this.startTaskList), { timeout: 1000 }, ); }, diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index 343cee7ad83..11940301819 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -139,7 +139,7 @@ export default { return !this.isCollapsed || this.automaticallyCollapsed; }, showWarning() { - return this.isCollapsed && (this.automaticallyCollapsed && !this.viewDiffsFileByFile); + return this.isCollapsed && this.automaticallyCollapsed && !this.viewDiffsFileByFile; }, showContent() { return !this.isCollapsed && !this.isFileTooLarge; diff --git a/app/assets/javascripts/diffs/components/inline_diff_view.vue b/app/assets/javascripts/diffs/components/inline_diff_view.vue index 05f5461054f..28485a2fdac 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_view.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_view.vue @@ -58,9 +58,9 @@ export default { class="code diff-wrap-lines js-syntax-highlight text-file js-diff-inline-view" > <colgroup> - <col style="width: 50px;" /> - <col style="width: 50px;" /> - <col style="width: 8px;" /> + <col style="width: 50px" /> + <col style="width: 50px" /> + <col style="width: 8px" /> <col /> </colgroup> <tbody> diff --git a/app/assets/javascripts/diffs/components/parallel_diff_view.vue b/app/assets/javascripts/diffs/components/parallel_diff_view.vue index 67b599fe163..21e0bf18dbf 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_view.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_view.vue @@ -57,11 +57,11 @@ export default { class="code diff-wrap-lines js-syntax-highlight text-file" > <colgroup> - <col style="width: 50px;" /> - <col style="width: 8px;" /> + <col style="width: 50px" /> + <col style="width: 8px" /> <col /> - <col style="width: 50px;" /> - <col style="width: 8px;" /> + <col style="width: 50px" /> + <col style="width: 8px" /> <col /> </colgroup> <tbody> diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index f2d9d86997d..9e331393ffa 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -307,7 +307,8 @@ export const startRenderDiffsQueue = ({ state, commit }) => { const nextFile = state.diffFiles.find( file => !file.renderIt && - (file.viewer && (!isCollapsed(file) || file.viewer.name !== diffViewerModes.text)), + file.viewer && + (!isCollapsed(file) || file.viewer.name !== diffViewerModes.text), ); if (nextFile) { diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index 6afc6f91fec..7b6db0ec706 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -138,7 +138,10 @@ export const fileLineCoverage = state => (file, line) => { * @returns {number} */ export const currentDiffIndex = state => - Math.max(0, state.diffFiles.findIndex(diff => diff.file_hash === state.currentDiffFileId)); + Math.max( + 0, + state.diffFiles.findIndex(diff => diff.file_hash === state.currentDiffFileId), + ); export const diffLines = state => (file, unifiedDiffComponents) => { if (!unifiedDiffComponents && state.diffViewType === INLINE_DIFF_VIEW_TYPE) { diff --git a/app/assets/javascripts/droplab/keyboard.js b/app/assets/javascripts/droplab/keyboard.js index 40837ffdf8f..fe1ea2fa6b0 100644 --- a/app/assets/javascripts/droplab/keyboard.js +++ b/app/assets/javascripts/droplab/keyboard.js @@ -2,7 +2,7 @@ import { ACTIVE_CLASS } from './constants'; -const Keyboard = function() { +const Keyboard = function () { var currentKey; var currentFocus; var isUpArrow = false; diff --git a/app/assets/javascripts/droplab/plugins/ajax.js b/app/assets/javascripts/droplab/plugins/ajax.js index 48b2a90c459..fce29649c7b 100644 --- a/app/assets/javascripts/droplab/plugins/ajax.js +++ b/app/assets/javascripts/droplab/plugins/ajax.js @@ -46,7 +46,7 @@ const Ajax = { .then(data => self._loadData(data, config, self)) .catch(config.onError); }, - destroy: function() { + destroy: function () { this.destroyed = true; }, }; diff --git a/app/assets/javascripts/droplab/plugins/ajax_filter.js b/app/assets/javascripts/droplab/plugins/ajax_filter.js index 66a52548417..94ccae1a442 100644 --- a/app/assets/javascripts/droplab/plugins/ajax_filter.js +++ b/app/assets/javascripts/droplab/plugins/ajax_filter.js @@ -2,7 +2,7 @@ import AjaxCache from '../../lib/utils/ajax_cache'; const AjaxFilter = { - init: function(hook) { + init: function (hook) { this.destroyed = false; this.hook = hook; this.notLoading(); @@ -93,9 +93,9 @@ const AjaxFilter = { list.currentIndex = 0; }, - buildParams: function(params) { + buildParams: function (params) { if (!params) return ''; - var paramsArray = Object.keys(params).map(function(param) { + var paramsArray = Object.keys(params).map(function (param) { return param + '=' + (params[param] || ''); }); return '?' + paramsArray.join('&'); diff --git a/app/assets/javascripts/droplab/plugins/filter.js b/app/assets/javascripts/droplab/plugins/filter.js index 6f1dc252d24..06391668928 100644 --- a/app/assets/javascripts/droplab/plugins/filter.js +++ b/app/assets/javascripts/droplab/plugins/filter.js @@ -1,7 +1,7 @@ /* eslint-disable */ const Filter = { - keydown: function(e) { + keydown: function (e) { if (this.destroyed) return; var hiddenCount = 0; @@ -21,22 +21,22 @@ const Filter = { if (config && config.filterFunction && typeof config.filterFunction === 'function') { filterFunction = config.filterFunction; } else { - filterFunction = function(o) { + filterFunction = function (o) { // cheap string search o.droplab_hidden = o[config.template].toLowerCase().indexOf(value) === -1; return o; }; } - dataHiddenCount = data.filter(function(o) { + dataHiddenCount = data.filter(function (o) { return !o.droplab_hidden; }).length; - matches = data.map(function(o) { + matches = data.map(function (o) { return filterFunction(o, value); }); - hiddenCount = matches.filter(function(o) { + hiddenCount = matches.filter(function (o) { return !o.droplab_hidden; }).length; diff --git a/app/assets/javascripts/droplab/utils.js b/app/assets/javascripts/droplab/utils.js index df3c5c2132a..d7f49bf19d8 100644 --- a/app/assets/javascripts/droplab/utils.js +++ b/app/assets/javascripts/droplab/utils.js @@ -5,12 +5,7 @@ import { DATA_TRIGGER, DATA_DROPDOWN, TEMPLATE_REGEX } from './constants'; const utils = { toCamelCase(attr) { - return this.camelize( - attr - .split('-') - .slice(1) - .join(' '), - ); + return this.camelize(attr.split('-').slice(1).join(' ')); }, template(templateString, data) { diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 69961d2e07a..49f54261983 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -219,12 +219,8 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { const caretStart = textarea.selectionStart; const caretEnd = textarea.selectionEnd; const textEnd = $(child).val().length; - const beforeSelection = $(child) - .val() - .substring(0, caretStart); - const afterSelection = $(child) - .val() - .substring(caretEnd, textEnd); + const beforeSelection = $(child).val().substring(0, caretStart); + const afterSelection = $(child).val().substring(caretEnd, textEnd); $(child).val(beforeSelection + formattedText + afterSelection); textarea.setSelectionRange(caretStart + formattedText.length, caretEnd + formattedText.length); textarea.style.height = `${textarea.scrollHeight}px`; @@ -289,10 +285,7 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { form.find('.markdown-selector').click(function onMarkdownClick(e) { e.preventDefault(); - $(this) - .closest('.gfm-form') - .find('.div-dropzone') - .click(); + $(this).closest('.gfm-form').find('.div-dropzone').click(); formTextarea.focus(); }); diff --git a/app/assets/javascripts/due_date_select.js b/app/assets/javascripts/due_date_select.js index ffb5232ca75..25520c7edde 100644 --- a/app/assets/javascripts/due_date_select.js +++ b/app/assets/javascripts/due_date_select.js @@ -197,9 +197,7 @@ export default class DueDateSelectors { $('.js-clear-due-date,.js-clear-start-date').on('click', e => { e.preventDefault(); - const calendar = $(e.target) - .siblings('.datepicker') - .data('pikaday'); + const calendar = $(e.target).siblings('.datepicker').data('pikaday'); calendar.setDate(null); }); } diff --git a/app/assets/javascripts/editor/editor_ci_schema_ext.js b/app/assets/javascripts/editor/editor_ci_schema_ext.js index 1946be997a7..36e2fe22718 100644 --- a/app/assets/javascripts/editor/editor_ci_schema_ext.js +++ b/app/assets/javascripts/editor/editor_ci_schema_ext.js @@ -22,9 +22,7 @@ export class CiSchemaExtension extends EditorLiteExtension { .replace(':project_path', projectPath) .replace(':ref', ref) .replace(':filename', EXTENSION_CI_SCHEMA_FILE_NAME_MATCH); - const modelFileName = this.getModel() - .uri.path.split('/') - .pop(); + const modelFileName = this.getModel().uri.path.split('/').pop(); registerSchema({ uri: ciSchemaUri, diff --git a/app/assets/javascripts/emoji/index.js b/app/assets/javascripts/emoji/index.js index 4a56843c0b5..b7ea972b643 100644 --- a/app/assets/javascripts/emoji/index.js +++ b/app/assets/javascripts/emoji/index.js @@ -242,8 +242,9 @@ export function getEmojiInfo(query) { export function emojiFallbackImageSrc(inputName) { const { name } = getEmojiInfo(inputName); - return `${gon.asset_host || ''}${gon.relative_url_root || - ''}/-/emojis/${EMOJI_VERSION}/${name}.png`; + return `${gon.asset_host || ''}${ + gon.relative_url_root || '' + }/-/emojis/${EMOJI_VERSION}/${name}.png`; } export function emojiImageTag(name, src) { diff --git a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue index c3471346a63..dd320676e98 100644 --- a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue +++ b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue @@ -100,7 +100,7 @@ export default { /> <gl-sprintf v-if="errorFn" :message="__('%{spanStart}in%{spanEnd} %{errorFn}')"> - <template #span="{content}"> + <template #span="{ content }"> <span class="gl-text-gray-200">{{ content }} </span> </template> <template #errorFn> @@ -109,7 +109,7 @@ export default { </gl-sprintf> <gl-sprintf :message="__('%{spanStart}at line%{spanEnd} %{errorLine}%{errorColumn}')"> - <template #span="{content}"> + <template #span="{ content }"> <span class="gl-text-gray-200">{{ content }} </span> </template> <template #errorLine> diff --git a/app/assets/javascripts/feature_flags/components/strategy_parameters.vue b/app/assets/javascripts/feature_flags/components/strategy_parameters.vue index b6e06880315..a22f081bb92 100644 --- a/app/assets/javascripts/feature_flags/components/strategy_parameters.vue +++ b/app/assets/javascripts/feature_flags/components/strategy_parameters.vue @@ -30,7 +30,7 @@ export default { }, computed: { strategyComponent() { - return STRATEGIES[(this.strategy?.name)]; + return STRATEGIES[this.strategy?.name]; }, }, methods: { diff --git a/app/assets/javascripts/feature_flags/store/index/mutations.js b/app/assets/javascripts/feature_flags/store/index/mutations.js index bdc23e66214..3daa204f560 100644 --- a/app/assets/javascripts/feature_flags/store/index/mutations.js +++ b/app/assets/javascripts/feature_flags/store/index/mutations.js @@ -74,12 +74,7 @@ export default { state.isRotating = true; state.hasRotateError = false; }, - [types.RECEIVE_ROTATE_INSTANCE_ID_SUCCESS]( - state, - { - data: { token }, - }, - ) { + [types.RECEIVE_ROTATE_INSTANCE_ID_SUCCESS](state, { data: { token } }) { state.isRotating = false; state.instanceId = token; state.hasRotateError = false; diff --git a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js index 77491d1556b..f6930e811f5 100644 --- a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js +++ b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js @@ -200,8 +200,9 @@ export default class AvailableDropdownMappings { } getMergeRequestTargetBranchesEndpoint() { - const endpoint = `${gon.relative_url_root || - ''}/autocomplete/merge_request_target_branches.json`; + const endpoint = `${ + gon.relative_url_root || '' + }/autocomplete/merge_request_target_branches.json`; const params = { group_id: this.getGroupId(), diff --git a/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js b/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js index f0951f6b177..d797e6ecf1d 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js +++ b/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js @@ -193,7 +193,8 @@ export default class FilteredSearchVisualTokens { }); } else if ( !isLastVisualTokenValid && - (lastVisualToken && !lastVisualToken.querySelector('.operator')) + lastVisualToken && + !lastVisualToken.querySelector('.operator') ) { const tokensContainer = FilteredSearchContainer.container.querySelector('.tokens-container'); tokensContainer.removeChild(lastVisualToken); diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index dcb27434a07..2e055f350a6 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -285,10 +285,7 @@ class GfmAutoComplete { ...this.getDefaultCallbacks(), beforeSave: membersBeforeSave, matcher(flag, subtext) { - const subtextNodes = subtext - .split(/\n+/g) - .pop() - .split(GfmAutoComplete.regexSubtext); + const subtextNodes = subtext.split(/\n+/g).pop().split(GfmAutoComplete.regexSubtext); // Check if @ is followed by '/assign', '/reassign', '/unassign' or '/cc' commands. command = subtextNodes.find(node => { @@ -465,10 +462,7 @@ class GfmAutoComplete { })); }, matcher(flag, subtext) { - const subtextNodes = subtext - .split(/\n+/g) - .pop() - .split(GfmAutoComplete.regexSubtext); + const subtextNodes = subtext.split(/\n+/g).pop().split(GfmAutoComplete.regexSubtext); // Check if ~ is followed by '/label', '/relabel' or '/unlabel' commands. command = subtextNodes.find(node => { diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js index 4a3755f39cc..f056ce989f8 100644 --- a/app/assets/javascripts/gl_form.js +++ b/app/assets/javascripts/gl_form.js @@ -108,14 +108,10 @@ export default class GLForm { addEventListeners() { this.textarea.on('focus', function focusTextArea() { - $(this) - .closest('.md-area') - .addClass('is-focused'); + $(this).closest('.md-area').addClass('is-focused'); }); this.textarea.on('blur', function blurTextArea() { - $(this) - .closest('.md-area') - .removeClass('is-focused'); + $(this).closest('.md-area').removeClass('is-focused'); }); } diff --git a/app/assets/javascripts/groups/components/group_item.vue b/app/assets/javascripts/groups/components/group_item.vue index ef58b93c049..d65ad974c73 100644 --- a/app/assets/javascripts/groups/components/group_item.vue +++ b/app/assets/javascripts/groups/components/group_item.vue @@ -126,7 +126,7 @@ export default { /> <div :class="{ 'd-sm-flex': !group.isChildrenLoading }" - class="avatar-container rect-avatar s32 d-none flex-grow-0 flex-shrink-0 " + class="avatar-container rect-avatar s32 d-none flex-grow-0 flex-shrink-0" > <a :href="group.relativePath" class="no-expand"> <img diff --git a/app/assets/javascripts/groups/groups_filterable_list.js b/app/assets/javascripts/groups/groups_filterable_list.js index 693519729ac..c33ad8b6ecb 100644 --- a/app/assets/javascripts/groups/groups_filterable_list.js +++ b/app/assets/javascripts/groups/groups_filterable_list.js @@ -65,10 +65,7 @@ export default class GroupFilterableList extends FilterableList { setDefaultFilterOption() { const defaultOption = $.trim( - this.$dropdown - .find('.dropdown-menu li.js-filter-sort-order a') - .first() - .text(), + this.$dropdown.find('.dropdown-menu li.js-filter-sort-order a').first().text(), ); this.$dropdown.find('.dropdown-label').text(defaultOption); } diff --git a/app/assets/javascripts/ide/components/nav_dropdown.vue b/app/assets/javascripts/ide/components/nav_dropdown.vue index 8cea8655461..6ff77e556c0 100644 --- a/app/assets/javascripts/ide/components/nav_dropdown.vue +++ b/app/assets/javascripts/ide/components/nav_dropdown.vue @@ -31,9 +31,7 @@ export default { }, removeDropdownListeners() { // eslint-disable-next-line @gitlab/no-global-event-off - $(this.$refs.dropdown) - .off('show.bs.dropdown') - .off('hide.bs.dropdown'); + $(this.$refs.dropdown).off('show.bs.dropdown').off('hide.bs.dropdown'); }, showDropdown() { this.isVisibleDropdown = true; diff --git a/app/assets/javascripts/ide/lib/editorconfig/parser.js b/app/assets/javascripts/ide/lib/editorconfig/parser.js index 1597e4a8bfa..838302c327f 100644 --- a/app/assets/javascripts/ide/lib/editorconfig/parser.js +++ b/app/assets/javascripts/ide/lib/editorconfig/parser.js @@ -50,5 +50,10 @@ export function getRulesWithTraversal(filePath, getFileContent) { return Promise.all( editorconfigPaths.map(path => getFileContent(path).then(content => ({ path, content }))), - ).then(results => getRulesWithConfigs(filePath, results.filter(x => x.content))); + ).then(results => + getRulesWithConfigs( + filePath, + results.filter(x => x.content), + ), + ); } diff --git a/app/assets/javascripts/ide/lib/languages/hcl.js b/app/assets/javascripts/ide/lib/languages/hcl.js index 4539719b1f2..d7a6491297b 100644 --- a/app/assets/javascripts/ide/lib/languages/hcl.js +++ b/app/assets/javascripts/ide/lib/languages/hcl.js @@ -11,7 +11,11 @@ const conf = { lineComment: '//', blockComment: ['/*', '*/'], }, - brackets: [['{', '}'], ['[', ']'], ['(', ')']], + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ], autoClosingPairs: [ { open: '{', close: '}' }, { open: '[', close: ']' }, @@ -161,7 +165,11 @@ const language = { [/\/\/.*$/, 'comment'], [/#.*$/, 'comment'], ], - comment: [[/[^\/*]+/, 'comment'], [/\*\//, 'comment', '@pop'], [/[\/*]/, 'comment']], + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'], + ], string: [ [/\$\{/, { token: 'delimiter', next: '@stringExpression' }], [/[^\\"\$]+/, 'string'], diff --git a/app/assets/javascripts/ide/lib/languages/vue.js b/app/assets/javascripts/ide/lib/languages/vue.js index b9ff5c5d776..f2f81307981 100644 --- a/app/assets/javascripts/ide/lib/languages/vue.js +++ b/app/assets/javascripts/ide/lib/languages/vue.js @@ -37,7 +37,13 @@ const conf = { blockComment: ['{{!--', '--}}'], }, - brackets: [['<!--', '-->'], ['<', '>'], ['{{', '}}'], ['{', '}'], ['(', ')']], + brackets: [ + ['<!--', '-->'], + ['<', '>'], + ['{{', '}}'], + ['{', '}'], + ['(', ')'], + ], autoClosingPairs: [ { open: '{', close: '}' }, diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js index c79ecd70e94..ef09f118431 100644 --- a/app/assets/javascripts/ide/stores/utils.js +++ b/app/assets/javascripts/ide/stores/utils.js @@ -254,12 +254,7 @@ export function extractMarkdownImagesFromEntries(mdFile, entries) { const imageContent = entries[imagePath]?.content || entries[imagePath]?.raw; if (!isAbsolute(path) && imageContent) { - const ext = path.includes('.') - ? path - .split('.') - .pop() - .trim() - : 'jpeg'; + const ext = path.includes('.') ? path.split('.').pop().trim() : 'jpeg'; const src = `data:image/${ext};base64,${imageContent}`; i += 1; const key = `{{${prefix}${i}}}`; diff --git a/app/assets/javascripts/ide/utils.js b/app/assets/javascripts/ide/utils.js index 43276f32322..2c966d9c27c 100644 --- a/app/assets/javascripts/ide/utils.js +++ b/app/assets/javascripts/ide/utils.js @@ -154,12 +154,7 @@ export function getFileEOL(content = '') { */ export function addNumericSuffix(filename, randomize = false) { return filename.replace(/([ _-]?)(\d*)(\..+?$|$)/, (_, before, number, after) => { - const n = randomize - ? Math.random() - .toString() - .substring(2, 7) - .slice(-5) - : Number(number) + 1; + const n = randomize ? Math.random().toString().substring(2, 7).slice(-5) : Number(number) + 1; return `${before || '-'}${n}${after}`; }); } diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue index 0e3839deaf5..7d44a28b4bb 100644 --- a/app/assets/javascripts/incidents/components/incidents_list.vue +++ b/app/assets/javascripts/incidents/components/incidents_list.vue @@ -265,9 +265,7 @@ export default { if (field?.sortKey) { sortKey = field.sortKey; } else { - sortKey = convertToSnakeCase(sortBy) - .replace(/_.*/, '') - .toUpperCase(); + sortKey = convertToSnakeCase(sortBy).replace(/_.*/, '').toUpperCase(); } this.pagination = initialPaginationState; diff --git a/app/assets/javascripts/invite_members/components/invite_members_modal.vue b/app/assets/javascripts/invite_members/components/invite_members_modal.vue index b55ef77ae5d..7dbbe072ba6 100644 --- a/app/assets/javascripts/invite_members/components/invite_members_modal.vue +++ b/app/assets/javascripts/invite_members/components/invite_members_modal.vue @@ -195,7 +195,7 @@ export default { <div class="gl-mt-2"> <gl-sprintf :message="$options.labels.readMoreText"> - <template #link="{content}"> + <template #link="{ content }"> <gl-link :href="helpLink" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/issuable/auto_width_dropdown_select.js b/app/assets/javascripts/issuable/auto_width_dropdown_select.js index 12f03873958..243d82f55aa 100644 --- a/app/assets/javascripts/issuable/auto_width_dropdown_select.js +++ b/app/assets/javascripts/issuable/auto_width_dropdown_select.js @@ -37,10 +37,7 @@ class AutoWidthDropdownSelect { // We have to look at the parent because // `offsetParent` on a `display: none;` is `null` - const offsetParentWidth = $(this) - .parent() - .offsetParent() - .width(); + const offsetParentWidth = $(this).parent().offsetParent().width(); // Reset any width to let it naturally flow $dropdown.css('width', 'auto'); if ($dropdown.outerWidth(false) > offsetParentWidth) { diff --git a/app/assets/javascripts/issuable_form.js b/app/assets/javascripts/issuable_form.js index 791b5fef699..5ebd2caf130 100644 --- a/app/assets/javascripts/issuable_form.js +++ b/app/assets/javascripts/issuable_form.js @@ -52,12 +52,12 @@ export default class IssuableForm { /* eslint-disable @gitlab/require-i18n-strings */ this.wipRegex = new RegExp( '^\\s*(' + // Line start, then any amount of leading whitespace - 'draft\\s-\\s' + // Draft_-_ where "_" are *exactly* one whitespace - '|\\[(draft|wip)\\]\\s*' + // [Draft] or [WIP] and any following whitespace - '|(draft|wip):\\s*' + // Draft: or WIP: and any following whitespace - '|(draft|wip)\\s+' + // Draft_ or WIP_ where "_" is at least one whitespace - '|\\(draft\\)\\s*' + // (Draft) and any following whitespace - ')+' + // At least one repeated match of the preceding parenthetical + 'draft\\s-\\s' + // Draft_-_ where "_" are *exactly* one whitespace + '|\\[(draft|wip)\\]\\s*' + // [Draft] or [WIP] and any following whitespace + '|(draft|wip):\\s*' + // Draft: or WIP: and any following whitespace + '|(draft|wip)\\s+' + // Draft_ or WIP_ where "_" is at least one whitespace + '|\\(draft\\)\\s*' + // (Draft) and any following whitespace + ')+' + // At least one repeated match of the preceding parenthetical '\\s*', // Any amount of trailing whitespace 'i', // Match any case(s) ); diff --git a/app/assets/javascripts/issuable_index.js b/app/assets/javascripts/issuable_index.js index e888e481fe5..92158c42de3 100644 --- a/app/assets/javascripts/issuable_index.js +++ b/app/assets/javascripts/issuable_index.js @@ -21,9 +21,7 @@ export default class IssuableIndex { axios .put($resetToken.attr('href')) .then(({ data }) => { - $('#issuable_email') - .val(data.new_address) - .focus(); + $('#issuable_email').val(data.new_address).focus(); $resetToken.text(s__('EmailToken|reset it')); }) diff --git a/app/assets/javascripts/issuable_show/components/issuable_edit_form.vue b/app/assets/javascripts/issuable_show/components/issuable_edit_form.vue index 93e4db8b99c..830a740ff78 100644 --- a/app/assets/javascripts/issuable_show/components/issuable_edit_form.vue +++ b/app/assets/javascripts/issuable_show/components/issuable_edit_form.vue @@ -141,8 +141,7 @@ export default { :data-supports-quick-actions="enableAutocomplete" :aria-label="__('Description')" :placeholder="__('Write a comment or drag your files here…')" - class="note-textarea js-gfm-input js-autosize markdown-area - qa-description-textarea" + class="note-textarea js-gfm-input js-autosize markdown-area qa-description-textarea" dir="auto" @keydown="handleKeydown($event, 'description')" ></textarea> diff --git a/app/assets/javascripts/issuable_suggestions/index.js b/app/assets/javascripts/issuable_suggestions/index.js index 40916c9d27f..9949527106b 100644 --- a/app/assets/javascripts/issuable_suggestions/index.js +++ b/app/assets/javascripts/issuable_suggestions/index.js @@ -5,7 +5,7 @@ import App from './components/app.vue'; Vue.use(VueApollo); -export default function() { +export default function () { const el = document.getElementById('js-suggestions'); const issueTitle = document.getElementById('issue_title'); const { projectPath } = el.dataset; diff --git a/app/assets/javascripts/issue.js b/app/assets/javascripts/issue.js index 5d2880c3c10..66462937ef5 100644 --- a/app/assets/javascripts/issue.js +++ b/app/assets/javascripts/issue.js @@ -54,11 +54,7 @@ export default class Issue { $(document).trigger('issuable:change', isClosed); let numProjectIssues = Number( - projectIssuesCounter - .first() - .text() - .trim() - .replace(/[^\d]/, ''), + projectIssuesCounter.first().text().trim().replace(/[^\d]/, ''), ); numProjectIssues = isClosed ? numProjectIssues - 1 : numProjectIssues + 1; projectIssuesCounter.text(addDelimiter(numProjectIssues)); diff --git a/app/assets/javascripts/issue_show/components/fields/description.vue b/app/assets/javascripts/issue_show/components/fields/description.vue index 83ab4106802..8d417e32d62 100644 --- a/app/assets/javascripts/issue_show/components/fields/description.vue +++ b/app/assets/javascripts/issue_show/components/fields/description.vue @@ -53,8 +53,7 @@ export default { id="issue-description" ref="textarea" v-model="formState.description" - class="note-textarea js-gfm-input js-autosize markdown-area - qa-description-textarea" + class="note-textarea js-gfm-input js-autosize markdown-area qa-description-textarea" dir="auto" :data-supports-quick-actions="!glFeatures.tributeAutocomplete" :aria-label="__('Description')" diff --git a/app/assets/javascripts/jobs/components/manual_variables_form.vue b/app/assets/javascripts/jobs/components/manual_variables_form.vue index bf1930c9a37..9189c88c1c7 100644 --- a/app/assets/javascripts/jobs/components/manual_variables_form.vue +++ b/app/assets/javascripts/jobs/components/manual_variables_form.vue @@ -93,7 +93,10 @@ export default { this.secretValue = ''; }, deleteVariable(id) { - this.variables.splice(this.variables.findIndex(el => el.id === id), 1); + this.variables.splice( + this.variables.findIndex(el => el.id === id), + 1, + ); }, }, }; diff --git a/app/assets/javascripts/label_manager.js b/app/assets/javascripts/label_manager.js index 469f7ce94b0..92dffb87e1a 100644 --- a/app/assets/javascripts/label_manager.js +++ b/app/assets/javascripts/label_manager.js @@ -135,7 +135,7 @@ export default class LabelManager { getSortedLabelsIds() { const sortedIds = []; - this.prioritizedLabels.find('> li').each(function() { + this.prioritizedLabels.find('> li').each(function () { const id = $(this).data('id'); if (id) { diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index ac5aa24d5d8..2928a64b7e8 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -49,7 +49,7 @@ export default class LabelsSelect { const fieldName = $dropdown.data('fieldName'); let initialSelected = $selectbox .find(`input[name="${$dropdown.data('fieldName')}"]`) - .map(function() { + .map(function () { return this.value; }) .get(); @@ -64,11 +64,11 @@ export default class LabelsSelect { ); } - const saveLabelData = function() { + const saveLabelData = function () { const selected = $dropdown .closest('.selectbox') .find(`input[name='${fieldName}']`) - .map(function() { + .map(function () { return this.value; }) .get(); @@ -210,9 +210,7 @@ export default class LabelsSelect { } } else { if (this.id(label)) { - const dropdownValue = this.id(label) - .toString() - .replace(/'/g, "\\'"); + const dropdownValue = this.id(label).toString().replace(/'/g, "\\'"); if ( $form.find( @@ -346,10 +344,7 @@ export default class LabelsSelect { const isMRIndex = page === 'projects:merge_requests:index'; if ($dropdown.parent().find('.is-active:not(.dropdown-clear-active)').length) { - $dropdown - .parent() - .find('.dropdown-clear-active') - .removeClass('is-active'); + $dropdown.parent().find('.dropdown-clear-active').removeClass('is-active'); } if ($dropdown.hasClass('js-issuable-form-dropdown')) { @@ -559,7 +554,7 @@ export default class LabelsSelect { // eslint-disable-next-line class-methods-use-this setOriginalDropdownData($container, $dropdown) { const labels = []; - $container.find('[name="label_name[]"]').map(function() { + $container.find('[name="label_name[]"]').map(function () { return labels.push(this.value); }); $dropdown.data('marked', labels); diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index f88a0433535..9e52de4b959 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -68,7 +68,7 @@ export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventNa closestSubmit.disable(); } // eslint-disable-next-line func-names - return field.on(eventName, function() { + return field.on(eventName, function () { if (rstrip($(this).val()) === '') { return closestSubmit.disable(); } diff --git a/app/assets/javascripts/lib/utils/text_markdown.js b/app/assets/javascripts/lib/utils/text_markdown.js index c711c0bd163..edff057997a 100644 --- a/app/assets/javascripts/lib/utils/text_markdown.js +++ b/app/assets/javascripts/lib/utils/text_markdown.js @@ -14,18 +14,12 @@ function addBlockTags(blockTag, selected) { } function lineBefore(text, textarea) { - const split = text - .substring(0, textarea.selectionStart) - .trim() - .split('\n'); + const split = text.substring(0, textarea.selectionStart).trim().split('\n'); return split[split.length - 1]; } function lineAfter(text, textarea) { - return text - .substring(textarea.selectionEnd) - .trim() - .split('\n')[0]; + return text.substring(textarea.selectionEnd).trim().split('\n')[0]; } function convertMonacoSelectionToAceFormat(sel) { @@ -342,7 +336,7 @@ export function addMarkdownListeners(form) { // eslint-disable-next-line @gitlab/no-global-event-off const $allToolbarBtns = $('.js-md', form) .off('click') - .on('click', function() { + .on('click', function () { const $toolbarBtn = $(this); return updateTextForToolbarBtn($toolbarBtn); diff --git a/app/assets/javascripts/line_highlighter.js b/app/assets/javascripts/line_highlighter.js index 8621a133776..3760dc60d0f 100644 --- a/app/assets/javascripts/line_highlighter.js +++ b/app/assets/javascripts/line_highlighter.js @@ -32,7 +32,7 @@ import 'vendor/jquery.scrollTo'; // </div> // -const LineHighlighter = function(options = {}) { +const LineHighlighter = function (options = {}) { options.highlightLineClass = options.highlightLineClass || 'hll'; options.fileHolderSelector = options.fileHolderSelector || '.file-holder'; options.scrollFileHolder = options.scrollFileHolder || false; @@ -50,7 +50,7 @@ const LineHighlighter = function(options = {}) { this.highlightHash(); }; -LineHighlighter.prototype.bindEvents = function() { +LineHighlighter.prototype.bindEvents = function () { const $fileHolder = $(this.options.fileHolderSelector); $fileHolder.on('click', 'a[data-line-number]', this.clickHandler); @@ -58,7 +58,7 @@ LineHighlighter.prototype.bindEvents = function() { window.addEventListener('hashchange', e => this.highlightHash(e.target.location.hash)); }; -LineHighlighter.prototype.highlightHash = function(newHash) { +LineHighlighter.prototype.highlightHash = function (newHash) { let range; if (newHash && typeof newHash === 'string') this._hash = newHash; @@ -83,13 +83,11 @@ LineHighlighter.prototype.highlightHash = function(newHash) { } }; -LineHighlighter.prototype.clickHandler = function(event) { +LineHighlighter.prototype.clickHandler = function (event) { let range; event.preventDefault(); this.clearHighlight(); - const lineNumber = $(event.target) - .closest('a') - .data('lineNumber'); + const lineNumber = $(event.target).closest('a').data('lineNumber'); const current = this.hashToRange(this._hash); if (!(current[0] && event.shiftKey)) { // If there's no current selection, or there is but Shift wasn't held, @@ -107,7 +105,7 @@ LineHighlighter.prototype.clickHandler = function(event) { } }; -LineHighlighter.prototype.clearHighlight = function() { +LineHighlighter.prototype.clearHighlight = function () { return $(`.${this.highlightLineClass}`).removeClass(this.highlightLineClass); }; @@ -122,7 +120,7 @@ LineHighlighter.prototype.clearHighlight = function() { // hashToRange('#foo') # => [null, null] // // Returns an Array -LineHighlighter.prototype.hashToRange = function(hash) { +LineHighlighter.prototype.hashToRange = function (hash) { // ?L(\d+)(?:-(\d+))?$/) const matches = hash.match(/^#?L(\d+)(?:-(\d+))?$/); if (matches && matches.length) { @@ -136,14 +134,14 @@ LineHighlighter.prototype.hashToRange = function(hash) { // Highlight a single line // // lineNumber - Line number to highlight -LineHighlighter.prototype.highlightLine = function(lineNumber) { +LineHighlighter.prototype.highlightLine = function (lineNumber) { return $(`#LC${lineNumber}`).addClass(this.highlightLineClass); }; // Highlight all lines within a range // // range - Array containing the starting and ending line numbers -LineHighlighter.prototype.highlightRange = function(range) { +LineHighlighter.prototype.highlightRange = function (range) { if (range[1]) { const results = []; const ref = range[0] <= range[1] ? range : range.reverse(); @@ -158,7 +156,7 @@ LineHighlighter.prototype.highlightRange = function(range) { }; // Set the URL hash string -LineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) { +LineHighlighter.prototype.setHash = function (firstLineNumber, lastLineNumber) { let hash; if (lastLineNumber) { hash = `#L${firstLineNumber}-${lastLineNumber}`; @@ -172,7 +170,7 @@ LineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) { // Make the actual hash change in the browser // // This method is stubbed in tests. -LineHighlighter.prototype.__setLocationHash__ = function(value) { +LineHighlighter.prototype.__setLocationHash__ = function (value) { return window.history.pushState( { url: value, diff --git a/app/assets/javascripts/logs/components/environment_logs.vue b/app/assets/javascripts/logs/components/environment_logs.vue index f7c0bd5ae13..a114b3c7d4d 100644 --- a/app/assets/javascripts/logs/components/environment_logs.vue +++ b/app/assets/javascripts/logs/components/environment_logs.vue @@ -246,9 +246,7 @@ export default { </div>{{trace}} </code></pre> </template> - <template #default - ><div></div - ></template> + <template #default><div></div></template> </gl-infinite-scroll> <div ref="logFooter" class="py-2 px-3 text-white bg-secondary-900"> @@ -262,9 +260,7 @@ export default { > <template #fetched>{{ logs.lines.length }}</template> </gl-sprintf> - <template v-else> - {{ s__('Environments|Currently showing all results.') }}</template - > + <template v-else> {{ s__('Environments|Currently showing all results.') }}</template> </div> </div> </template> diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index de7648c31b1..c74a25f39fe 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -53,7 +53,7 @@ window.$ = jQuery; jQuery.ajaxSetup({ converters: { // eslint-disable-next-line @gitlab/require-i18n-strings, func-names - 'text script': function(text) { + 'text script': function (text) { jQuery.globalEval(text, { nonce: getCspNonceValue() }); return text; }, @@ -137,9 +137,7 @@ function deferredInitialisation() { $('.remove-row').on('ajax:success', function removeRowAjaxSuccessCallback() { tooltips.dispose(this); - $(this) - .closest('li') - .addClass('gl-display-none!'); + $(this).closest('li').addClass('gl-display-none!'); }); $('.js-remove-tr').on('ajax:before', function removeTRAjaxBeforeCallback() { @@ -147,9 +145,7 @@ function deferredInitialisation() { }); $('.js-remove-tr').on('ajax:success', function removeTRAjaxSuccessCallback() { - $(this) - .closest('tr') - .addClass('gl-display-none!'); + $(this).closest('tr').addClass('gl-display-none!'); }); const glTooltipDelay = localStorage.getItem('gl-tooltip-delay'); @@ -278,15 +274,9 @@ document.addEventListener('DOMContentLoaded', () => { $this.toggleClass('active'); if ($this.hasClass('active')) { - notesHolders - .show() - .find('.hide, .content') - .show(); + notesHolders.show().find('.hide, .content').show(); } else { - notesHolders - .hide() - .find('.content') - .hide(); + notesHolders.hide().find('.content').hide(); } $(document).trigger('toggle.comments'); diff --git a/app/assets/javascripts/member_expiration_date.js b/app/assets/javascripts/member_expiration_date.js index ef7d8cc9efe..de33a68ebf1 100644 --- a/app/assets/javascripts/member_expiration_date.js +++ b/app/assets/javascripts/member_expiration_date.js @@ -41,9 +41,7 @@ export default function memberExpirationDate(selector = '.js-access-expiration-d inputs.next('.js-clear-input').on('click', function clicked(event) { event.preventDefault(); - const input = $(this) - .closest('.clearable-input') - .find(selector); + const input = $(this).closest('.clearable-input').find(selector); const calendar = input.data('pikaday'); calendar.setDate(null); diff --git a/app/assets/javascripts/members.js b/app/assets/javascripts/members.js index 5bd228496da..ab8ed1f4d11 100644 --- a/app/assets/javascripts/members.js +++ b/app/assets/javascripts/members.js @@ -12,13 +12,9 @@ export default class Members { addListeners() { // eslint-disable-next-line @gitlab/no-global-event-off - $('.js-member-update-control') - .off('change') - .on('change', this.formSubmit.bind(this)); + $('.js-member-update-control').off('change').on('change', this.formSubmit.bind(this)); // eslint-disable-next-line @gitlab/no-global-event-off - $('.js-edit-member-form') - .off('ajax:success') - .on('ajax:success', this.formSuccess.bind(this)); + $('.js-edit-member-form').off('ajax:success').on('ajax:success', this.formSuccess.bind(this)); disableButtonIfEmptyField('#user_ids', 'input[name=commit]', 'change'); } diff --git a/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js b/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js index 356d8619fed..8cb4d77dc19 100644 --- a/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js +++ b/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js @@ -60,19 +60,28 @@ import { __ } from '~/locale'; const DataPromise = axios.get(this.file.content_path); Promise.all([EditorPromise, DataPromise]) - .then(([{ default: EditorLite }, { data: { content, new_path: path } }]) => { - const contentEl = this.$el.querySelector('.editor'); + .then( + ([ + { default: EditorLite }, + { + data: { content, new_path: path }, + }, + ]) => { + const contentEl = this.$el.querySelector('.editor'); - this.originalContent = content; - this.fileLoaded = true; + this.originalContent = content; + this.fileLoaded = true; - this.editor = new EditorLite().createInstance({ - el: contentEl, - blobPath: path, - blobContent: content, - }); - this.editor.onDidChangeModelContent(debounce(this.saveDiffResolution.bind(this), 250)); - }) + this.editor = new EditorLite().createInstance({ + el: contentEl, + blobPath: path, + blobContent: content, + }); + this.editor.onDidChangeModelContent( + debounce(this.saveDiffResolution.bind(this), 250), + ); + }, + ) .catch(() => { flash(__('An error occurred while loading the file')); }); diff --git a/app/assets/javascripts/merge_request.js b/app/assets/javascripts/merge_request.js index 344f8dee5ea..f708ec82b5d 100644 --- a/app/assets/javascripts/merge_request.js +++ b/app/assets/javascripts/merge_request.js @@ -47,11 +47,11 @@ function MergeRequest(opts) { } // Local jQuery finder -MergeRequest.prototype.$ = function(selector) { +MergeRequest.prototype.$ = function (selector) { return this.$el.find(selector); }; -MergeRequest.prototype.initTabs = function() { +MergeRequest.prototype.initTabs = function () { if (window.mrTabs) { window.mrTabs.unbindEvents(); } @@ -59,12 +59,12 @@ MergeRequest.prototype.initTabs = function() { window.mrTabs = new MergeRequestTabs(this.opts); }; -MergeRequest.prototype.showAllCommits = function() { +MergeRequest.prototype.showAllCommits = function () { this.$('.first-commits').remove(); return this.$('.all-commits').removeClass('hide'); }; -MergeRequest.prototype.initMRBtnListeners = function() { +MergeRequest.prototype.initMRBtnListeners = function () { const _this = this; const draftToggles = document.querySelectorAll('.js-draft-toggle-button'); @@ -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 shouldSubmit = $this.hasClass('btn-comment'); if (shouldSubmit && $this.data('submitted')) { @@ -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(); if (noteText.trim().length > 0) { form.submit(); @@ -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 => { const textarea = $('textarea.js-commit-message'); e.preventDefault(); @@ -146,7 +146,7 @@ MergeRequest.prototype.initCommitMessageListeners = function() { }); }; -MergeRequest.setStatusBoxToMerged = function() { +MergeRequest.setStatusBoxToMerged = function () { $('.detail-page-header .status-box') .removeClass('status-box-open') .addClass('status-box-mr-merged') @@ -154,20 +154,20 @@ MergeRequest.setStatusBoxToMerged = function() { .text(__('Merged')); }; -MergeRequest.decreaseCounter = function(by = 1) { +MergeRequest.decreaseCounter = function (by = 1) { const $el = $('.js-merge-counter'); const count = Math.max(parseInt($el.text().replace(/[^\d]/, ''), 10) - by, 0); $el.text(addDelimiter(count)); }; -MergeRequest.hideCloseButton = function() { +MergeRequest.hideCloseButton = function () { const el = document.querySelector('.merge-request .js-issuable-actions'); // Dropdown for mobile screen el.querySelector('li.js-close-item').classList.add('hidden'); }; -MergeRequest.toggleDraftStatus = function(title, isReady) { +MergeRequest.toggleDraftStatus = function (title, isReady) { if (isReady) { createFlash(__('The merge request can now be merged.'), 'notice'); } diff --git a/app/assets/javascripts/mini_pipeline_graph_dropdown.js b/app/assets/javascripts/mini_pipeline_graph_dropdown.js index d4283701367..5e805f857aa 100644 --- a/app/assets/javascripts/mini_pipeline_graph_dropdown.js +++ b/app/assets/javascripts/mini_pipeline_graph_dropdown.js @@ -92,11 +92,7 @@ export default class MiniPipelineGraph { }) .catch(() => { this.toggleLoading(button); - if ( - $(button) - .parent() - .hasClass('open') - ) { + if ($(button).parent().hasClass('open')) { $(button).dropdown('toggle'); } flash(__('An error occurred while fetching the builds.'), 'alert'); diff --git a/app/assets/javascripts/monitoring/components/dashboard_panel_builder.vue b/app/assets/javascripts/monitoring/components/dashboard_panel_builder.vue index 0a1b1cd2c08..bcfa1b04322 100644 --- a/app/assets/javascripts/monitoring/components/dashboard_panel_builder.vue +++ b/app/assets/javascripts/monitoring/components/dashboard_panel_builder.vue @@ -146,7 +146,7 @@ export default { ) " > - <template #code="{content}"> + <template #code="{ content }"> <code>{{ content }}</code> </template> </gl-sprintf> diff --git a/app/assets/javascripts/network/branch_graph.js b/app/assets/javascripts/network/branch_graph.js index 3ea597a08d3..9539f1c52c7 100644 --- a/app/assets/javascripts/network/branch_graph.js +++ b/app/assets/javascripts/network/branch_graph.js @@ -243,11 +243,11 @@ export default class BranchGraph { }) .click(() => window.open(options.commit_url.replace('%s', commit.id), '_blank')) .hover( - function() { + function () { this.tooltip = r.commitTooltip(x + 5, y, commit); return top.push(this.tooltip.insertBefore(this)); }, - function() { + function () { return this.tooltip && this.tooltip.remove() && delete this.tooltip; }, ); diff --git a/app/assets/javascripts/new_branch_form.js b/app/assets/javascripts/new_branch_form.js index 9d064894433..dd820f1adae 100644 --- a/app/assets/javascripts/new_branch_form.js +++ b/app/assets/javascripts/new_branch_form.js @@ -53,13 +53,13 @@ export default class NewBranchForm { const { indexOf } = []; this.branchNameError.empty(); - const unique = function(values, value) { + const unique = function (values, value) { if (indexOf.call(values, value) === -1) { values.push(value); } return values; }; - const formatter = function(values, restriction) { + const formatter = function (values, restriction) { const formatted = values.map(value => { switch (false) { case !/\s/.test(value): diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 9a887021e5d..eb09468ca49 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -108,10 +108,7 @@ export default class Notes { // We are in the Merge Requests page so we need another edit form for Changes tab if (getPagePath(1) === 'merge_requests') { - $('.note-edit-form') - .clone() - .addClass('mr-note-edit-form') - .insertAfter('.note-edit-form'); + $('.note-edit-form').clone().addClass('mr-note-edit-form').insertAfter('.note-edit-form'); } const hash = getLocationHash(); @@ -427,12 +424,7 @@ export default class Notes { } 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. const isEditing = $note.hasClass('is-editing'); - const initialContent = normalizeNewlines( - $note - .find('.original-note-content') - .text() - .trim(), - ); + const initialContent = normalizeNewlines($note.find('.original-note-content').text().trim()); const $textarea = $note.find('.js-note-text'); const currentContent = $textarea.val(); // 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 { form.find('.js-errors').remove(); // reset text and preview form.find('.js-md-write-button').click(); - form - .find('.js-note-text') - .val('') - .trigger('input'); - form - .find('.js-note-text') - .data('autosave') - .reset(); + form.find('.js-note-text').val('').trigger('input'); + form.find('.js-note-text').data('autosave').reset(); const event = document.createEvent('Event'); event.initEvent('autosize:update', true, false); @@ -690,10 +676,7 @@ export default class Notes { } checkContentToAllowEditing($el) { - const initialContent = $el - .find('.original-note-content') - .text() - .trim(); + const initialContent = $el.find('.original-note-content').text().trim(); const currentContent = $el.find('.js-note-text').val(); let isAllowed = true; @@ -877,10 +860,7 @@ export default class Notes { const form = this.cleanForm(this.formClone.clone()); const replyLink = $(target).closest('.js-discussion-reply-button'); // insert the form after the button - replyLink - .closest('.discussion-reply-holder') - .hide() - .after(form); + replyLink.closest('.discussion-reply-holder').hide().after(form); // show the form return this.setupDiscussionNoteForm(replyLink, form); } @@ -1069,10 +1049,7 @@ export default class Notes { const row = form.closest('tr'); const glForm = form.data('glForm'); glForm.destroy(); - form - .find('.js-note-text') - .data('autosave') - .reset(); + form.find('.js-note-text').data('autosave').reset(); // show the reply button (will only work for replies) form.prev('.discussion-reply-holder').show(); if (row.is('.js-temp-notes-holder')) { @@ -1181,16 +1158,10 @@ export default class Notes { this.glForm = new GLForm($editForm.find('form'), this.enableGFM); - $editForm - .find('form') - .attr('action', `${postUrl}?html=true`) - .attr('data-remote', 'true'); + $editForm.find('form').attr('action', `${postUrl}?html=true`).attr('data-remote', 'true'); $editForm.find('.js-form-target-id').val(targetId); $editForm.find('.js-form-target-type').val(targetType); - $editForm - .find('.js-note-text') - .focus() - .val(originalContent); + $editForm.find('.js-note-text').focus().val(originalContent); $editForm.find('.js-md-write-button').trigger('click'); $editForm.find('.referenced-users').hide(); } @@ -1306,9 +1277,7 @@ export default class Notes { * intrusive. */ collapseLongCommitList() { - const systemNotes = $('#notes-list') - .find('li.system-note') - .has('ul'); + const systemNotes = $('#notes-list').find('li.system-note').has('ul'); $.each(systemNotes, (index, systemNote) => { const $systemNote = $(systemNote); @@ -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 const sanitizedNoteEntityText = normalizeNewlines(noteEntity.note.trim()); const currentNoteText = normalizeNewlines( - $note - .find('.original-note-content') - .first() - .text() - .trim(), + $note.find('.original-note-content').first().text().trim(), ); return sanitizedNoteEntityText !== currentNoteText; } @@ -1545,10 +1510,7 @@ export default class Notes { let $form = $submitBtn.parents('form'); const $closeBtn = $form.find('.js-note-target-close'); const isDiscussionNote = - $submitBtn - .parent() - .find('li.droplab-item-selected') - .attr('id') === 'discussion'; + $submitBtn.parent().find('li.droplab-item-selected').attr('id') === 'discussion'; const isMainForm = $form.hasClass('js-main-target-form'); const isDiscussionForm = $form.hasClass('js-discussion-note-form'); const isDiscussionResolve = $submitBtn.hasClass('js-comment-resolve-button'); diff --git a/app/assets/javascripts/notes/components/discussion_actions.vue b/app/assets/javascripts/notes/components/discussion_actions.vue index 0272790a75d..21ce608becb 100644 --- a/app/assets/javascripts/notes/components/discussion_actions.vue +++ b/app/assets/javascripts/notes/components/discussion_actions.vue @@ -77,8 +77,8 @@ export default { <div v-if=" !hideJumpToNextUnresolvedInThreads && - discussion.resolvable && - shouldShowJumpToNextDiscussion + discussion.resolvable && + shouldShowJumpToNextDiscussion " class="btn-group discussion-actions ml-sm-2" > diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index 8b9fdf53e3c..87082a64400 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -193,8 +193,7 @@ export default { }, canSuggest() { return ( - this.getNoteableData.can_receive_suggestion && - (this.line && this.line.can_receive_suggestion) + this.getNoteableData.can_receive_suggestion && this.line && this.line.can_receive_suggestion ); }, changedCommentText() { diff --git a/app/assets/javascripts/notifications_dropdown.js b/app/assets/javascripts/notifications_dropdown.js index ae992dd5dc5..4ad0af693fb 100644 --- a/app/assets/javascripts/notifications_dropdown.js +++ b/app/assets/javascripts/notifications_dropdown.js @@ -12,9 +12,7 @@ export default function notificationsDropdown() { } const notificationLevel = $(this).data('notificationLevel'); - const form = $(this) - .parents('.notification-form') - .first(); + const form = $(this).parents('.notification-form').first(); form.find('.js-notification-loading').toggleClass('spinner'); if (form.hasClass('no-label')) { @@ -29,9 +27,7 @@ export default function notificationsDropdown() { const data = e.detail[0]; if (data.saved) { - $(e.currentTarget) - .closest('.js-notification-dropdown') - .replaceWith(data.html); + $(e.currentTarget).closest('.js-notification-dropdown').replaceWith(data.html); } else { Flash(__('Failed to save new settings'), 'alert'); } diff --git a/app/assets/javascripts/packages/details/components/package_files.vue b/app/assets/javascripts/packages/details/components/package_files.vue index ab46dd0114d..dec443ca19d 100644 --- a/app/assets/javascripts/packages/details/components/package_files.vue +++ b/app/assets/javascripts/packages/details/components/package_files.vue @@ -90,7 +90,7 @@ export default { </gl-link> </template> - <template #cell(commit)="{item}"> + <template #cell(commit)="{ item }"> <gl-link :href="item.pipeline.project.commit_url" class="gl-text-gray-500" diff --git a/app/assets/javascripts/packages/list/components/packages_list_app.vue b/app/assets/javascripts/packages/list/components/packages_list_app.vue index cbb3bfd35ac..9439da3349d 100644 --- a/app/assets/javascripts/packages/list/components/packages_list_app.vue +++ b/app/assets/javascripts/packages/list/components/packages_list_app.vue @@ -110,7 +110,7 @@ export default { <template #description> <gl-sprintf v-if="filterQuery" :message="$options.i18n.widenFilters" /> <gl-sprintf v-else :message="$options.i18n.noResults"> - <template #noPackagesLink="{content}"> + <template #noPackagesLink="{ content }"> <gl-link :href="emptyListHelpUrl" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/pages/profiles/index.js b/app/assets/javascripts/pages/profiles/index.js index 883be18b336..d2b00d0ef45 100644 --- a/app/assets/javascripts/pages/profiles/index.js +++ b/app/assets/javascripts/pages/profiles/index.js @@ -4,7 +4,7 @@ import Profile from '~/profile/profile'; document.addEventListener('DOMContentLoaded', () => { // 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 comment = $(this) .val() diff --git a/app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue b/app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue index 6dd50958fa4..5d3ce30f9d9 100644 --- a/app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue +++ b/app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue @@ -161,9 +161,7 @@ export default { <template #coveragePercentage> {{ coveragePercentage }} </template> - <template #percentSymbol> - % - </template> + <template #percentSymbol> % </template> </gl-sprintf> </template> </gl-area-chart> diff --git a/app/assets/javascripts/pages/projects/init_form.js b/app/assets/javascripts/pages/projects/init_form.js index 019efe077f7..9f20a3e4e46 100644 --- a/app/assets/javascripts/pages/projects/init_form.js +++ b/app/assets/javascripts/pages/projects/init_form.js @@ -1,7 +1,7 @@ import ZenMode from '~/zen_mode'; import GLForm from '~/gl_form'; -export default function($formEl) { +export default function ($formEl) { new ZenMode(); // eslint-disable-line no-new new GLForm($formEl); // eslint-disable-line no-new } diff --git a/app/assets/javascripts/pages/projects/issues/show.js b/app/assets/javascripts/pages/projects/issues/show.js index 614f8262e5b..5162023a111 100644 --- a/app/assets/javascripts/pages/projects/issues/show.js +++ b/app/assets/javascripts/pages/projects/issues/show.js @@ -16,7 +16,7 @@ import initInviteMemberModal from '~/invite_member/init_invite_member_modal'; import { IssuableType } from '~/issuable_show/constants'; -export default function() { +export default function () { const initialDataEl = document.getElementById('js-issuable-app'); const { issueType, ...issuableData } = parseIssuableData(initialDataEl); diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js b/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js index 46f3f55a400..4c766f94fba 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/new/compare.js @@ -29,9 +29,7 @@ export default mrNewCompareNode => { $(mrNewCompareNode).find('.js-source-loading'), $(mrNewCompareNode).find('.mr_source_commit'), { - ref: $(mrNewCompareNode) - .find("input[name='merge_request[source_branch]']") - .val(), + ref: $(mrNewCompareNode).find("input[name='merge_request[source_branch]']").val(), }, ); const updateTargetBranchCommitList = () => @@ -43,9 +41,7 @@ export default mrNewCompareNode => { target_project_id: $(mrNewCompareNode) .find("input[name='merge_request[target_project_id]']") .val(), - ref: $(mrNewCompareNode) - .find("input[name='merge_request[target_branch]']") - .val(), + ref: $(mrNewCompareNode).find("input[name='merge_request[target_branch]']").val(), }, ); initCompareAutocomplete('branches', $dropdown => { diff --git a/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js b/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js index 0714fc21b17..27e10367a48 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js +++ b/app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js @@ -8,7 +8,7 @@ import loadAwardsHandler from '~/awards_handler'; import initInviteMemberTrigger from '~/invite_member/init_invite_member_trigger'; import initInviteMemberModal from '~/invite_member/init_invite_member_modal'; -export default function() { +export default function () { new ZenMode(); // eslint-disable-line no-new initIssuableSidebar(); initPipelines(); diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue index 5ef1f959b2c..aa7414f3ae7 100644 --- a/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue +++ b/app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue @@ -125,7 +125,7 @@ export default { :data-testid="option.value" > <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"> {{ content }} </gl-link> diff --git a/app/assets/javascripts/pages/projects/project.js b/app/assets/javascripts/pages/projects/project.js index 8c7aa04a0b6..807063be463 100644 --- a/app/assets/javascripts/pages/projects/project.js +++ b/app/assets/javascripts/pages/projects/project.js @@ -18,34 +18,26 @@ export default class Project { // Ref switcher if (document.querySelector('.js-project-refs-dropdown')) { Project.initRefSwitcher(); - $('.project-refs-select').on('change', function() { - return $(this) - .parents('form') - .trigger('submit'); + $('.project-refs-select').on('change', function () { + return $(this).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'); - $(this) - .parents('.no-ssh-key-message') - .remove(); + $(this).parents('.no-ssh-key-message').remove(); 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'); - $(this) - .parents('.no-password-message') - .remove(); + $(this).parents('.no-password-message').remove(); 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 cookieKey = `hide_auto_devops_implicitly_enabled_banner_${projectId}`; Cookies.set(cookieKey, 'false'); - $(this) - .parents('.auto-devops-implicitly-enabled-banner') - .remove(); + $(this).parents('.auto-devops-implicitly-enabled-banner').remove(); return e.preventDefault(); }); @@ -67,7 +59,7 @@ export default class Project { refLink.href = '#'; - return $('.js-project-refs-dropdown').each(function() { + return $('.js-project-refs-dropdown').each(function () { const $dropdown = $(this); const selected = $dropdown.data('selected'); const fieldName = $dropdown.data('fieldName'); diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue index 5227964572f..f5a10266ed2 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue +++ b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue @@ -354,18 +354,21 @@ export default { <option :value="visibilityOptions.PRIVATE" :disabled="!visibilityAllowed(visibilityOptions.PRIVATE)" - >{{ s__('ProjectSettings|Private') }}</option > + {{ s__('ProjectSettings|Private') }} + </option> <option :value="visibilityOptions.INTERNAL" :disabled="!visibilityAllowed(visibilityOptions.INTERNAL)" - >{{ s__('ProjectSettings|Internal') }}</option > + {{ s__('ProjectSettings|Internal') }} + </option> <option :value="visibilityOptions.PUBLIC" :disabled="!visibilityAllowed(visibilityOptions.PUBLIC)" - >{{ s__('ProjectSettings|Public') }}</option > + {{ s__('ProjectSettings|Public') }} + </option> </select> <gl-icon name="chevron-down" diff --git a/app/assets/javascripts/pages/projects/tags/index/index.js b/app/assets/javascripts/pages/projects/tags/index/index.js index ec56fa3e075..7f85d84a2e8 100644 --- a/app/assets/javascripts/pages/projects/tags/index/index.js +++ b/app/assets/javascripts/pages/projects/tags/index/index.js @@ -3,10 +3,7 @@ import { initRemoveTag } from '../remove_tag'; document.addEventListener('DOMContentLoaded', () => { initRemoveTag({ onDelete: path => { - document - .querySelector(`[data-path="${path}"]`) - .closest('.js-tag-list') - .remove(); + document.querySelector(`[data-path="${path}"]`).closest('.js-tag-list').remove(); }, }); }); diff --git a/app/assets/javascripts/pages/search/show/search.js b/app/assets/javascripts/pages/search/show/search.js index b411b637f36..cbef5ab1bbc 100644 --- a/app/assets/javascripts/pages/search/show/search.js +++ b/app/assets/javascripts/pages/search/show/search.js @@ -16,16 +16,12 @@ export default class Search { } eventListeners() { - $(document) - .off('keyup', this.searchInput) - .on('keyup', this.searchInput, this.searchKeyUp); + $(document).off('keyup', this.searchInput).on('keyup', this.searchInput, this.searchKeyUp); $(document) .off('click', this.searchClear) .on('click', this.searchClear, this.clearSearchField.bind(this)); - $('a.js-search-clear') - .off('click', this.clearSearchFilter) - .on('click', this.clearSearchFilter); + $('a.js-search-clear').off('click', this.clearSearchFilter).on('click', this.clearSearchFilter); } static submitSearch() { @@ -42,10 +38,7 @@ export default class Search { } clearSearchField() { - return $(this.searchInput) - .val('') - .trigger('keyup') - .focus(); + return $(this.searchInput).val('').trigger('keyup').focus(); } // We need to manually follow the link on the anchors diff --git a/app/assets/javascripts/pages/users/activity_calendar.js b/app/assets/javascripts/pages/users/activity_calendar.js index 54666af540e..1322dd0e4c8 100644 --- a/app/assets/javascripts/pages/users/activity_calendar.js +++ b/app/assets/javascripts/pages/users/activity_calendar.js @@ -42,11 +42,7 @@ function formatTooltipText({ date, count }) { return `${contribText}<br />${dateDayName} ${dateText}`; } -const initColorKey = () => - d3 - .scaleLinear() - .range(['#acd5f2', '#254e77']) - .domain([0, 3]); +const initColorKey = () => d3.scaleLinear().range(['#acd5f2', '#254e77']).domain([0, 3]); export default class ActivityCalendar { constructor( @@ -291,10 +287,7 @@ export default class ActivityCalendar { this.colorKey(2), this.colorKey(3), ]; - return d3 - .scaleThreshold() - .domain([0, 10, 20, 30]) - .range(colorRange); + return d3.scaleThreshold().domain([0, 10, 20, 30]).range(colorRange); } clickDay(stamp) { diff --git a/app/assets/javascripts/pages/users/index.js b/app/assets/javascripts/pages/users/index.js index 8adbc2a8168..40574785879 100644 --- a/app/assets/javascripts/pages/users/index.js +++ b/app/assets/javascripts/pages/users/index.js @@ -11,9 +11,7 @@ function initUserProfile(action) { $('.hide-project-limit-message').on('click', e => { e.preventDefault(); Cookies.set('hide_project_limit_message', 'false'); - $(this) - .parents('.project-limit-message') - .remove(); + $(this).parents('.project-limit-message').remove(); }); } diff --git a/app/assets/javascripts/pipeline_editor/components/lint/ci_lint_results.vue b/app/assets/javascripts/pipeline_editor/components/lint/ci_lint_results.vue index 14b0a38da58..58a96c3f725 100644 --- a/app/assets/javascripts/pipeline_editor/components/lint/ci_lint_results.vue +++ b/app/assets/javascripts/pipeline_editor/components/lint/ci_lint_results.vue @@ -103,7 +103,7 @@ export default { data-testid="ci-lint-status" >{{ status.text }} <gl-sprintf :message="$options.includesText"> - <template #code="{content}"> + <template #code="{ content }"> <code> {{ content }} </code> diff --git a/app/assets/javascripts/pipelines/components/graph/job_item.vue b/app/assets/javascripts/pipelines/components/graph/job_item.vue index 93ebe02d4e8..2d3cac88eab 100644 --- a/app/assets/javascripts/pipelines/components/graph/job_item.vue +++ b/app/assets/javascripts/pipelines/components/graph/job_item.vue @@ -151,8 +151,7 @@ export default { :href="detailsPath" :title="tooltipText" :class="jobClasses" - 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" + 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" data-testid="job-with-link" @click.stop="hideTooltips" @mouseout="hideTooltips" diff --git a/app/assets/javascripts/pipelines/components/pipeline_graph/drawing_utils.js b/app/assets/javascripts/pipelines/components/pipeline_graph/drawing_utils.js index 35230e1511b..a31f3068d5e 100644 --- a/app/assets/javascripts/pipelines/components/pipeline_graph/drawing_utils.js +++ b/app/assets/javascripts/pipelines/components/pipeline_graph/drawing_utils.js @@ -36,16 +36,10 @@ export const generateLinksData = ({ links }, containerID) => { // positioned in the center of the job node by adding half the height // of the job pill. const paddingLeft = Number( - window - .getComputedStyle(containerEl, null) - .getPropertyValue('padding-left') - .replace('px', ''), + window.getComputedStyle(containerEl, null).getPropertyValue('padding-left').replace('px', ''), ); const paddingTop = Number( - window - .getComputedStyle(containerEl, null) - .getPropertyValue('padding-top') - .replace('px', ''), + window.getComputedStyle(containerEl, null).getPropertyValue('padding-top').replace('px', ''), ); const sourceNodeX = sourceNodeCoordinates.right - containerCoordinates.x - paddingLeft; diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_url.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_url.vue index bde0dd53aac..048b83b2347 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_url.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_url.vue @@ -113,7 +113,7 @@ export default { ) " > - <template #strong="{content}"> + <template #strong="{ content }"> <b>{{ content }}</b> </template> </gl-sprintf> diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue b/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue index ae5758233bc..c4f744de458 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/tokens/pipeline_trigger_author_token.vue @@ -80,7 +80,7 @@ export default { v-on="$listeners" @input="searchAuthors" > - <template #view="{inputValue}"> + <template #view="{ inputValue }"> <gl-avatar v-if="activeUser" :size="16" diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js index 27f71d2b878..c5a1159c8ce 100644 --- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js +++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js @@ -125,7 +125,7 @@ const createTestDetails = () => { }); }; -export default async function() { +export default async function () { createTestDetails(); createDagApp(); diff --git a/app/assets/javascripts/pipelines/stores/pipeline_store.js b/app/assets/javascripts/pipelines/stores/pipeline_store.js index c6f65277c8d..e34c847457b 100644 --- a/app/assets/javascripts/pipelines/stores/pipeline_store.js +++ b/app/assets/javascripts/pipelines/stores/pipeline_store.js @@ -198,6 +198,9 @@ export default class PipelineStore { } removeExpandedPipelineToRequestData(id) { - this.state.expandedPipelines.splice(this.state.expandedPipelines.findIndex(el => el === id), 1); + this.state.expandedPipelines.splice( + this.state.expandedPipelines.findIndex(el => el === id), + 1, + ); } } diff --git a/app/assets/javascripts/profile/gl_crop.js b/app/assets/javascripts/profile/gl_crop.js index ecb69422287..afc78cbe78a 100644 --- a/app/assets/javascripts/profile/gl_crop.js +++ b/app/assets/javascripts/profile/gl_crop.js @@ -61,7 +61,7 @@ import { loadCSSFile } from '../lib/utils/css_utils'; bindEvents() { const _this = this; - this.fileInput.on('change', function(e) { + this.fileInput.on('change', function (e) { _this.onFileInputChange(e, this); this.value = null; }); @@ -69,7 +69,7 @@ import { loadCSSFile } from '../lib/utils/css_utils'; this.modalCrop.on('shown.bs.modal', this.onModalShow); this.modalCrop.on('hidden.bs.modal', this.onModalHide); this.uploadImageBtn.on('click', this.onUploadImageBtnClick); - this.cropActionsBtn.on('click', function() { + this.cropActionsBtn.on('click', function () { const btn = this; return _this.onActionBtnClick(btn); }); @@ -184,8 +184,8 @@ import { loadCSSFile } from '../lib/utils/css_utils'; const cropModal = document.querySelector('.modal-profile-crop'); if (cropModal) loadCSSFile(cropModal.dataset.cropperCssPath); - $.fn.glCrop = function(opts) { - return this.each(function() { + $.fn.glCrop = function (opts) { + return this.each(function () { return $(this).data('glcrop', new GitLabCrop(this, opts)); }); }; diff --git a/app/assets/javascripts/profile/profile.js b/app/assets/javascripts/profile/profile.js index 4755a4aa9ba..ef3b38095b4 100644 --- a/app/assets/javascripts/profile/profile.js +++ b/app/assets/javascripts/profile/profile.js @@ -33,9 +33,7 @@ export default class Profile { uploadImageBtn: '.js-upload-user-avatar', modalCropImg: '.modal-profile-crop-image', }; - this.avatarGlCrop = $('.js-user-avatar-input') - .glCrop(cropOpts) - .data('glcrop'); + this.avatarGlCrop = $('.js-user-avatar-input').glCrop(cropOpts).data('glcrop'); } bindEvents() { diff --git a/app/assets/javascripts/project_find_file.js b/app/assets/javascripts/project_find_file.js index 0e12c219e45..2ba07a2af27 100644 --- a/app/assets/javascripts/project_find_file.js +++ b/app/assets/javascripts/project_find_file.js @@ -10,7 +10,7 @@ import { deprecatedCreateFlash as flash } from '~/flash'; import { __ } from '~/locale'; // highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> ) -const highlighter = function(element, text, matches) { +const highlighter = function (element, text, matches) { let j = 0; let len = 0; let lastIndex = 0; @@ -65,11 +65,7 @@ export default class ProjectFindFile { if (value !== oldValue) { target.data('oldValue', value); this.findFile(); - return this.element - .find('tr.tree-item') - .eq(0) - .addClass('selected') - .focus(); + return this.element.find('tr.tree-item').eq(0).addClass('selected').focus(); } }); } @@ -90,11 +86,7 @@ export default class ProjectFindFile { this.element.find('.loading').hide(); this.filePaths = data; this.findFile(); - this.element - .find('.files-slider tr.tree-item') - .eq(0) - .addClass('selected') - .focus(); + this.element.find('.files-slider tr.tree-item').eq(0).addClass('selected').focus(); }) .catch(() => flash(__('An error occurred while loading filenames'))); } diff --git a/app/assets/javascripts/project_select.js b/app/assets/javascripts/project_select.js index f7d823802b6..f7818a457d2 100644 --- a/app/assets/javascripts/project_select.js +++ b/app/assets/javascripts/project_select.js @@ -9,7 +9,7 @@ import { loadCSSFile } from './lib/utils/css_utils'; const projectSelect = () => { loadCSSFile(gon.select2_css_path) .then(() => { - $('.ajax-project-select').each(function(i, select) { + $('.ajax-project-select').each(function (i, select) { let placeholder; const simpleFilter = $(select).data('simpleFilter') || false; const isInstantiated = $(select).data('select2'); @@ -35,15 +35,15 @@ const projectSelect = () => { minimumInputLength: 0, query: query => { let projectsCallback; - const finalCallback = function(projects) { + const finalCallback = function (projects) { const data = { results: projects, }; return query.callback(data); }; if (this.includeGroups) { - projectsCallback = function(projects) { - const groupsCallback = function(groups) { + projectsCallback = function (projects) { + const groupsCallback = function (groups) { const data = groups.concat(projects); return finalCallback(data); }; diff --git a/app/assets/javascripts/project_select_combo_button.js b/app/assets/javascripts/project_select_combo_button.js index 865dd23bd80..6e41a268c5f 100644 --- a/app/assets/javascripts/project_select_combo_button.js +++ b/app/assets/javascripts/project_select_combo_button.js @@ -50,9 +50,7 @@ export default class ProjectSelectComboButton { // eslint-disable-next-line promise/no-nesting loadCSSFile(gon.select2_css_path) .then(() => { - $(event.currentTarget) - .siblings('.project-item-select') - .select2('open'); + $(event.currentTarget).siblings('.project-item-select').select2('open'); }) .catch(() => {}); }) @@ -104,14 +102,8 @@ export default class ProjectSelectComboButton { const defaultTextPrefix = this.resourceLabel; // the trailing slice call depluralizes each of these strings (e.g. new-issues -> new-issue) - const localStorageItemType = `new-${this.resourceType - .split('_') - .join('-') - .slice(0, -1)}`; - const presetTextSuffix = this.resourceType - .split('_') - .join(' ') - .slice(0, -1); + const localStorageItemType = `new-${this.resourceType.split('_').join('-').slice(0, -1)}`; + const presetTextSuffix = this.resourceType.split('_').join(' ').slice(0, -1); return { localStorageItemType, // new-issue / new-merge-request diff --git a/app/assets/javascripts/projects/commit_box/info/init_details_button.js b/app/assets/javascripts/projects/commit_box/info/init_details_button.js index 032fbf5316a..833e946af5c 100644 --- a/app/assets/javascripts/projects/commit_box/info/init_details_button.js +++ b/app/assets/javascripts/projects/commit_box/info/init_details_button.js @@ -3,9 +3,7 @@ import $ from 'jquery'; export const initDetailsButton = () => { $('body').on('click', '.js-details-expand', function expand(e) { e.preventDefault(); - $(this) - .next('.js-details-content') - .removeClass('hide'); + $(this).next('.js-details-content').removeClass('hide'); $(this).hide(); }); }; diff --git a/app/assets/javascripts/projects/experiment_new_project_creation/index.js b/app/assets/javascripts/projects/experiment_new_project_creation/index.js index 3715c52b6b9..06920a5ab19 100644 --- a/app/assets/javascripts/projects/experiment_new_project_creation/index.js +++ b/app/assets/javascripts/projects/experiment_new_project_creation/index.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import NewProjectCreationApp from './components/app.vue'; -export default function(el, props) { +export default function (el, props) { return new Vue({ el, components: { diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js index d54a48cc444..36021c5ca20 100644 --- a/app/assets/javascripts/projects/project_new.js +++ b/app/assets/javascripts/projects/project_new.js @@ -91,9 +91,7 @@ const bindEvents = () => { $('.how_to_import_link').on('click', e => { e.preventDefault(); - $(e.currentTarget) - .next('.modal') - .show(); + $(e.currentTarget).next('.modal').show(); }); $('.modal-header .close').on('click', () => { @@ -151,10 +149,7 @@ const bindEvents = () => { const selectedTemplate = DEFAULT_PROJECT_TEMPLATES[value]; $selectedTemplateText.text(selectedTemplate.text); - $(selectedTemplate.icon) - .clone() - .addClass('d-block') - .appendTo($selectedIcon); + $(selectedTemplate.icon).clone().addClass('d-block').appendTo($selectedIcon); const $activeTabProjectName = $('.tab-pane.active #project_name'); const $activeTabProjectPath = $('.tab-pane.active #project_path'); diff --git a/app/assets/javascripts/projects/tree/components/commit_pipeline_status_component.vue b/app/assets/javascripts/projects/tree/components/commit_pipeline_status_component.vue index e582d5c3e47..9788a32dcbd 100644 --- a/app/assets/javascripts/projects/tree/components/commit_pipeline_status_component.vue +++ b/app/assets/javascripts/projects/tree/components/commit_pipeline_status_component.vue @@ -83,10 +83,7 @@ export default { }); }, fetchPipelineCommitData() { - this.service - .fetchData() - .then(this.successCallback) - .catch(this.errorCallback); + this.service.fetchData().then(this.successCallback).catch(this.errorCallback); }, }, }; diff --git a/app/assets/javascripts/registry/explorer/components/details_page/delete_alert.vue b/app/assets/javascripts/registry/explorer/components/details_page/delete_alert.vue index 8bdf043a106..56d2ff86fb7 100644 --- a/app/assets/javascripts/registry/explorer/components/details_page/delete_alert.vue +++ b/app/assets/javascripts/registry/explorer/components/details_page/delete_alert.vue @@ -60,7 +60,7 @@ export default { @dismiss="$emit('change', null)" > <gl-sprintf :message="deleteAlertConfig.message"> - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="garbageCollectionHelpPagePath" target="_blank"> {{ content }} </gl-link> diff --git a/app/assets/javascripts/registry/explorer/components/details_page/partial_cleanup_alert.vue b/app/assets/javascripts/registry/explorer/components/details_page/partial_cleanup_alert.vue index d13d815a59e..12095655126 100644 --- a/app/assets/javascripts/registry/explorer/components/details_page/partial_cleanup_alert.vue +++ b/app/assets/javascripts/registry/explorer/components/details_page/partial_cleanup_alert.vue @@ -23,12 +23,12 @@ export default { <template> <gl-alert variant="warning" :title="$options.i18n.DELETE_ALERT_TITLE" @dismiss="$emit('dismiss')"> <gl-sprintf :message="$options.i18n.DELETE_ALERT_LINK_TEXT"> - <template #adminLink="{content}"> + <template #adminLink="{ content }"> <gl-link data-testid="run-link" :href="runCleanupPoliciesHelpPagePath" target="_blank">{{ content }}</gl-link> </template> - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link data-testid="help-link" :href="cleanupPoliciesHelpPagePath" target="_blank">{{ content }}</gl-link> diff --git a/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue b/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue index 5aeafd318aa..2fac02768bc 100644 --- a/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue +++ b/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue @@ -138,9 +138,7 @@ export default { <template #left-secondary> <span data-testid="size"> {{ formattedSize }} - <template v-if="formattedSize && layers" - >·</template - > + <template v-if="formattedSize && layers">·</template> {{ layers }} </span> </template> diff --git a/app/assets/javascripts/registry/explorer/components/list_page/group_empty_state.vue b/app/assets/javascripts/registry/explorer/components/list_page/group_empty_state.vue index 26e9fee63af..4f8f376db58 100644 --- a/app/assets/javascripts/registry/explorer/components/list_page/group_empty_state.vue +++ b/app/assets/javascripts/registry/explorer/components/list_page/group_empty_state.vue @@ -25,7 +25,7 @@ export default { ) " > - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="config.helpPagePath" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/registry/explorer/components/list_page/project_empty_state.vue b/app/assets/javascripts/registry/explorer/components/list_page/project_empty_state.vue index 5308b025cc0..5aa04419ca0 100644 --- a/app/assets/javascripts/registry/explorer/components/list_page/project_empty_state.vue +++ b/app/assets/javascripts/registry/explorer/components/list_page/project_empty_state.vue @@ -45,7 +45,7 @@ export default { <template #description> <p> <gl-sprintf :message="$options.i18n.introText"> - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="config.helpPagePath" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> @@ -53,10 +53,10 @@ export default { <h5>{{ $options.i18n.quickStart }}</h5> <p> <gl-sprintf :message="$options.i18n.notLoggedInMessage"> - <template #twofaDocLink="{content}"> + <template #twofaDocLink="{ content }"> <gl-link :href="config.twoFactorAuthHelpLink" target="_blank">{{ content }}</gl-link> </template> - <template #personalAccessTokensDocLink="{content}"> + <template #personalAccessTokensDocLink="{ content }"> <gl-link :href="config.personalAccessTokensHelpLink" target="_blank">{{ content }}</gl-link> @@ -81,7 +81,7 @@ export default { <p class="gl-mb-4"> {{ $options.i18n.addImageText }} </p> - <gl-form-input-group class="gl-mb-4 "> + <gl-form-input-group class="gl-mb-4"> <gl-form-input :value="dockerBuildCommand" readonly diff --git a/app/assets/javascripts/registry/explorer/pages/list.vue b/app/assets/javascripts/registry/explorer/pages/list.vue index 3192ba82db8..d4c052c02cd 100644 --- a/app/assets/javascripts/registry/explorer/pages/list.vue +++ b/app/assets/javascripts/registry/explorer/pages/list.vue @@ -230,7 +230,7 @@ export default { <template #description> <p> <gl-sprintf :message="$options.i18n.CONNECTION_ERROR_MESSAGE"> - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="`${config.helpPagePath}#docker-connection-error`" target="_blank"> {{ content }} </gl-link> diff --git a/app/assets/javascripts/registry/settings/components/expiration_input.vue b/app/assets/javascripts/registry/settings/components/expiration_input.vue index 2dbd9d26f60..42b7c7918a5 100644 --- a/app/assets/javascripts/registry/settings/components/expiration_input.vue +++ b/app/assets/javascripts/registry/settings/components/expiration_input.vue @@ -83,7 +83,7 @@ export default { <template #label> <span data-testid="label"> <gl-sprintf :message="label"> - <template #italic="{content}"> + <template #italic="{ content }"> <i>{{ content }}</i> </template> </gl-sprintf> @@ -100,7 +100,7 @@ export default { <template #description> <span data-testid="description" class="gl-text-gray-400"> <gl-sprintf :message="description"> - <template #link="{content}"> + <template #link="{ content }"> <gl-link :href="tagsRegexHelpPagePath" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/registry/settings/components/expiration_toggle.vue b/app/assets/javascripts/registry/settings/components/expiration_toggle.vue index 7f045244926..0ffd8216ab1 100644 --- a/app/assets/javascripts/registry/settings/components/expiration_toggle.vue +++ b/app/assets/javascripts/registry/settings/components/expiration_toggle.vue @@ -42,7 +42,7 @@ export default { <gl-toggle id="expiration-policy-toggle" v-model="enabled" :disabled="disabled" /> <span class="gl-ml-5 gl-line-height-24" data-testid="description"> <gl-sprintf :message="toggleText"> - <template #strong="{content}"> + <template #strong="{ content }"> <strong>{{ content }}</strong> </template> </gl-sprintf> diff --git a/app/assets/javascripts/registry/settings/components/settings_form.vue b/app/assets/javascripts/registry/settings/components/settings_form.vue index 1f374c7b60e..1ef0170a7f6 100644 --- a/app/assets/javascripts/registry/settings/components/settings_form.vue +++ b/app/assets/javascripts/registry/settings/components/settings_form.vue @@ -214,10 +214,10 @@ export default { <div> <p> <gl-sprintf :message="$options.i18n.KEEP_INFO_TEXT"> - <template #strong="{content}"> + <template #strong="{ content }"> <strong>{{ content }}</strong> </template> - <template #secondStrong="{content}"> + <template #secondStrong="{ content }"> <strong>{{ content }}</strong> </template> </gl-sprintf> @@ -253,10 +253,10 @@ export default { <div> <p> <gl-sprintf :message="$options.i18n.REMOVE_INFO_TEXT"> - <template #strong="{content}"> + <template #strong="{ content }"> <strong>{{ content }}</strong> </template> - <template #secondStrong="{content}"> + <template #secondStrong="{ content }"> <strong>{{ content }}</strong> </template> </gl-sprintf> diff --git a/app/assets/javascripts/reports/components/report_link.vue b/app/assets/javascripts/reports/components/report_link.vue index f285b526a54..1f68f79e487 100644 --- a/app/assets/javascripts/reports/components/report_link.vue +++ b/app/assets/javascripts/reports/components/report_link.vue @@ -21,16 +21,10 @@ export default { rel="noopener noreferrer nofollow" class="break-link" > - {{ issue.path - }}<template v-if="issue.line" - >:{{ issue.line }}</template - > + {{ issue.path }}<template v-if="issue.line">:{{ issue.line }}</template> </a> <template v-else> - {{ issue.path - }}<template v-if="issue.line" - >:{{ issue.line }}</template - > + {{ issue.path }}<template v-if="issue.line">:{{ issue.line }}</template> </template> </div> </template> diff --git a/app/assets/javascripts/repository/components/table/parent_row.vue b/app/assets/javascripts/repository/components/table/parent_row.vue index b4095e00884..3014088146a 100644 --- a/app/assets/javascripts/repository/components/table/parent_row.vue +++ b/app/assets/javascripts/repository/components/table/parent_row.vue @@ -48,9 +48,7 @@ export default { inline class="d-inline-block align-text-bottom" /> - <router-link v-else :to="parentRoute" :aria-label="__('Go to parent')"> - .. - </router-link> + <router-link v-else :to="parentRoute" :aria-label="__('Go to parent')"> .. </router-link> </td> </tr> </template> diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js index 6f43f837374..b9bc799fb0b 100644 --- a/app/assets/javascripts/right_sidebar.js +++ b/app/assets/javascripts/right_sidebar.js @@ -15,13 +15,13 @@ function Sidebar() { this.addEventListeners(); } -Sidebar.initialize = function() { +Sidebar.initialize = function () { if (!this.instance) { this.instance = new Sidebar(); } }; -Sidebar.prototype.removeListeners = function() { +Sidebar.prototype.removeListeners = function () { this.sidebar.off('click', '.sidebar-collapsed-icon'); // eslint-disable-next-line @gitlab/no-global-event-off this.sidebar.off('hidden.gl.dropdown'); @@ -32,7 +32,7 @@ Sidebar.prototype.removeListeners = function() { $(document).off('click', '.js-sidebar-toggle'); }; -Sidebar.prototype.addEventListeners = function() { +Sidebar.prototype.addEventListeners = function () { const $document = $(document); this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked); @@ -44,7 +44,7 @@ Sidebar.prototype.addEventListeners = function() { .on('click', '.js-issuable-todo', this.toggleTodo); }; -Sidebar.prototype.sidebarToggleClicked = function(e, triggered) { +Sidebar.prototype.sidebarToggleClicked = function (e, triggered) { const $this = $(this); const $collapseIcon = $('.js-sidebar-collapse'); const $expandIcon = $('.js-sidebar-expand'); @@ -60,9 +60,7 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) { $('aside.right-sidebar') .removeClass('right-sidebar-expanded') .addClass('right-sidebar-collapsed'); - $('.layout-page') - .removeClass('right-sidebar-expanded') - .addClass('right-sidebar-collapsed'); + $('.layout-page').removeClass('right-sidebar-expanded').addClass('right-sidebar-collapsed'); } else { $toggleContainer.data('is-expanded', true); $expandIcon.addClass('hidden'); @@ -70,9 +68,7 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) { $('aside.right-sidebar') .removeClass('right-sidebar-collapsed') .addClass('right-sidebar-expanded'); - $('.layout-page') - .removeClass('right-sidebar-collapsed') - .addClass('right-sidebar-expanded'); + $('.layout-page').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded'); } $this.attr('data-original-title', tooltipLabel); @@ -82,16 +78,14 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) { } }; -Sidebar.prototype.toggleTodo = function(e) { +Sidebar.prototype.toggleTodo = function (e) { const $this = $(e.currentTarget); const ajaxType = $this.data('deletePath') ? 'delete' : 'post'; const url = String($this.data('deletePath') || $this.data('createPath')); hide($this); - $('.js-issuable-todo') - .disable() - .addClass('is-loading'); + $('.js-issuable-todo').disable().addClass('is-loading'); axios[ajaxType](url, { issuable_id: $this.data('issuableId'), @@ -110,7 +104,7 @@ Sidebar.prototype.toggleTodo = function(e) { ); }; -Sidebar.prototype.todoUpdateDone = function(data) { +Sidebar.prototype.todoUpdateDone = function (data) { const deletePath = data.delete_path ? data.delete_path : null; const attrPrefix = deletePath ? 'mark' : 'todo'; const $todoBtns = $('.js-issuable-todo'); @@ -140,7 +134,7 @@ Sidebar.prototype.todoUpdateDone = function(data) { }); }; -Sidebar.prototype.sidebarCollapseClicked = function(e) { +Sidebar.prototype.sidebarCollapseClicked = function (e) { if ($(e.currentTarget).hasClass('dont-change-state')) { return; } @@ -150,7 +144,7 @@ Sidebar.prototype.sidebarCollapseClicked = function(e) { return sidebar.openDropdown($block); }; -Sidebar.prototype.openDropdown = function(blockOrName) { +Sidebar.prototype.openDropdown = function (blockOrName) { const $block = typeof blockOrName === 'string' ? this.getBlock(blockOrName) : blockOrName; if (!this.isOpen()) { this.setCollapseAfterUpdate($block); @@ -164,19 +158,19 @@ Sidebar.prototype.openDropdown = function(blockOrName) { }); }; -Sidebar.prototype.setCollapseAfterUpdate = function($block) { +Sidebar.prototype.setCollapseAfterUpdate = function ($block) { $block.addClass('collapse-after-update'); return $('.layout-page').addClass('with-overlay'); }; -Sidebar.prototype.onSidebarDropdownHidden = function(e) { +Sidebar.prototype.onSidebarDropdownHidden = function (e) { const sidebar = e.data; e.preventDefault(); const $block = $(e.target).closest('.block'); return sidebar.sidebarDropdownHidden($block); }; -Sidebar.prototype.sidebarDropdownHidden = function($block) { +Sidebar.prototype.sidebarDropdownHidden = function ($block) { if ($block.hasClass('collapse-after-update')) { $block.removeClass('collapse-after-update'); $('.layout-page').removeClass('with-overlay'); @@ -184,11 +178,11 @@ Sidebar.prototype.sidebarDropdownHidden = function($block) { } }; -Sidebar.prototype.triggerOpenSidebar = function() { +Sidebar.prototype.triggerOpenSidebar = function () { return this.sidebar.find('.js-sidebar-toggle').trigger('click'); }; -Sidebar.prototype.toggleSidebar = function(action) { +Sidebar.prototype.toggleSidebar = function (action) { if (action == null) { action = 'toggle'; } @@ -207,11 +201,11 @@ Sidebar.prototype.toggleSidebar = function(action) { } }; -Sidebar.prototype.isOpen = function() { +Sidebar.prototype.isOpen = function () { return this.sidebar.is('.right-sidebar-expanded'); }; -Sidebar.prototype.getBlock = function(name) { +Sidebar.prototype.getBlock = function (name) { return this.sidebar.find(`.block.${name}`); }; diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js index 97674348436..32559242225 100644 --- a/app/assets/javascripts/search_autocomplete.js +++ b/app/assets/javascripts/search_autocomplete.js @@ -76,8 +76,8 @@ export class SearchAutocomplete { this.wrap = wrap || $('.search'); this.optsEl = optsEl || this.wrap.find('.search-autocomplete-opts'); this.autocompletePath = autocompletePath || this.optsEl.data('autocompletePath'); - this.projectId = projectId || (this.optsEl.data('autocompleteProjectId') || ''); - this.projectRef = projectRef || (this.optsEl.data('autocompleteProjectRef') || ''); + this.projectId = projectId || this.optsEl.data('autocompleteProjectId') || ''; + this.projectRef = projectRef || this.optsEl.data('autocompleteProjectRef') || ''; this.dropdown = this.wrap.find('.dropdown'); this.dropdownToggle = this.wrap.find('.js-dropdown-search-toggle'); this.dropdownMenu = this.dropdown.find('.dropdown-menu'); diff --git a/app/assets/javascripts/settings_panels.js b/app/assets/javascripts/settings_panels.js index 18160421136..ac5a7cfc4ba 100644 --- a/app/assets/javascripts/settings_panels.js +++ b/app/assets/javascripts/settings_panels.js @@ -4,10 +4,7 @@ import { __ } from './locale'; function expandSection($section) { $section.find('.js-settings-toggle:not(.js-settings-toggle-trigger-only)').text(__('Collapse')); // eslint-disable-next-line @gitlab/no-global-event-off - $section - .find('.settings-content') - .off('scroll.expandSection') - .scrollTop(0); + $section.find('.settings-content').off('scroll.expandSection').scrollTop(0); $section.addClass('expanded'); if (!$section.hasClass('no-animate')) { $section diff --git a/app/assets/javascripts/single_file_diff.js b/app/assets/javascripts/single_file_diff.js index f751df6367e..bd3f89050e6 100644 --- a/app/assets/javascripts/single_file_diff.js +++ b/app/assets/javascripts/single_file_diff.js @@ -29,17 +29,12 @@ export default class SingleFileDiff { this.isOpen = !this.diffForPath; if (this.diffForPath) { this.collapsedContent = this.content; - this.loadingContent = $(WRAPPER) - .addClass('loading') - .html(LOADING_HTML) - .hide(); + this.loadingContent = $(WRAPPER).addClass('loading').html(LOADING_HTML).hide(); this.content = null; this.collapsedContent.after(this.loadingContent); this.$chevronRightIcon.removeClass('gl-display-none'); } else { - this.collapsedContent = $(WRAPPER) - .html(COLLAPSED_HTML) - .hide(); + this.collapsedContent = $(WRAPPER).html(COLLAPSED_HTML).hide(); this.content.after(this.collapsedContent); this.$chevronDownIcon.removeClass('gl-display-none'); } diff --git a/app/assets/javascripts/smart_interval.js b/app/assets/javascripts/smart_interval.js index c4655d35cf0..2a0ac2b25f1 100644 --- a/app/assets/javascripts/smart_interval.js +++ b/app/assets/javascripts/smart_interval.js @@ -96,9 +96,7 @@ export default class SmartInterval { window.removeEventListener('focus', this.onWindowVisibilityChange); this.cancel(); // eslint-disable-next-line @gitlab/no-global-event-off - $(document) - .off('visibilitychange') - .off('beforeunload'); + $(document).off('visibilitychange').off('beforeunload'); } /* private */ diff --git a/app/assets/javascripts/snippets/components/snippet_blob_view.vue b/app/assets/javascripts/snippets/components/snippet_blob_view.vue index b965c15306d..5a9ac0af060 100644 --- a/app/assets/javascripts/snippets/components/snippet_blob_view.vue +++ b/app/assets/javascripts/snippets/components/snippet_blob_view.vue @@ -53,9 +53,7 @@ export default { }, provide() { return { - blobHash: Math.random() - .toString() - .split('.')[1], + blobHash: Math.random().toString().split('.')[1], }; }, data() { diff --git a/app/assets/javascripts/star.js b/app/assets/javascripts/star.js index 64842ae7f8d..232c97ecae0 100644 --- a/app/assets/javascripts/star.js +++ b/app/assets/javascripts/star.js @@ -16,10 +16,7 @@ export default class Star { .post($this.data('endpoint')) .then(({ data }) => { const isStarred = $starSpan.hasClass('starred'); - $this - .parent() - .find('.count') - .text(data.star_count); + $this.parent().find('.count').text(data.star_count); if (isStarred) { $starSpan.removeClass('starred').text(s__('StarProject|Star')); diff --git a/app/assets/javascripts/tree.js b/app/assets/javascripts/tree.js index 947246b2fbb..25a14107bbc 100644 --- a/app/assets/javascripts/tree.js +++ b/app/assets/javascripts/tree.js @@ -8,7 +8,7 @@ export default class TreeView { this.initKeyNav(); // Code browser tree slider // Make the entire tree-item row clickable, but not if clicking another link (like a commit message) - $('.tree-content-holder .tree-item').on('click', function(e) { + $('.tree-content-holder .tree-item').on('click', function (e) { const $clickedEl = $(e.target); const path = $('.tree-item-file-name a', this).attr('href'); if (!$clickedEl.is('a') && !$clickedEl.is('.str-truncated')) { @@ -20,9 +20,7 @@ export default class TreeView { } }); // Show the "Loading commit data" for only the first element - $('span.log_loading') - .first() - .removeClass('hide'); + $('span.log_loading').first().removeClass('hide'); } initKeyNav() { diff --git a/app/assets/javascripts/users_select/index.js b/app/assets/javascripts/users_select/index.js index 9278e0c5859..9288af0bbf7 100644 --- a/app/assets/javascripts/users_select/index.js +++ b/app/assets/javascripts/users_select/index.js @@ -75,7 +75,7 @@ function UsersSelect(currentUser, els, options = {}) { selectedId = selectedIdDefault; } - const assignYourself = function() { + const assignYourself = function () { const unassignedSelected = $dropdown .closest('.selectbox') .find(`input[name='${$dropdown.data('fieldName')}'][value=0]`); @@ -108,17 +108,17 @@ function UsersSelect(currentUser, els, options = {}) { $block[0].addEventListener('assignYourself', assignYourself); } - const getSelectedUserInputs = function() { + const getSelectedUserInputs = function () { return $selectbox.find(`input[name="${$dropdown.data('fieldName')}"]`); }; - const getSelected = function() { + const getSelected = function () { return getSelectedUserInputs() .map((index, input) => parseInt(input.value, 10)) .get(); }; - const checkMaxSelect = function() { + const checkMaxSelect = function () { const maxSelect = $dropdown.data('maxSelect'); if (maxSelect) { const selected = getSelected(); @@ -144,7 +144,7 @@ function UsersSelect(currentUser, els, options = {}) { } }; - const getMultiSelectDropdownTitle = function(selectedUser, isSelected) { + const getMultiSelectDropdownTitle = function (selectedUser, isSelected) { const selectedUsers = getSelected().filter(u => u !== 0); const firstUser = getSelectedUserInputs() @@ -201,7 +201,7 @@ function UsersSelect(currentUser, els, options = {}) { return assignTo(userSelect.currentUser.id); }); - assignTo = function(selected) { + assignTo = function (selected) { const data = {}; data[abilityName] = {}; data[abilityName].assignee_id = selected != null ? selected : null; @@ -694,7 +694,7 @@ function UsersSelect(currentUser, els, options = {}) { } } -UsersSelect.prototype.initSelection = function(element, callback) { +UsersSelect.prototype.initSelection = function (element, callback) { const id = $(element).val(); if (id === '0') { const nullUser = { @@ -706,7 +706,7 @@ UsersSelect.prototype.initSelection = function(element, callback) { } }; -UsersSelect.prototype.formatResult = function(user) { +UsersSelect.prototype.formatResult = function (user) { let avatar = gon.default_avatar_url; if (user.avatar_url) { avatar = user.avatar_url; @@ -728,11 +728,11 @@ UsersSelect.prototype.formatResult = function(user) { `; }; -UsersSelect.prototype.formatSelection = function(user) { +UsersSelect.prototype.formatSelection = function (user) { return escape(user.name); }; -UsersSelect.prototype.user = function(user_id, callback) { +UsersSelect.prototype.user = function (user_id, callback) { if (!/^\d+$/.test(user_id)) { return false; } @@ -746,7 +746,7 @@ UsersSelect.prototype.user = function(user_id, callback) { // Return users list. Filtered by query // Only active users retrieved -UsersSelect.prototype.users = function(query, options, callback) { +UsersSelect.prototype.users = function (query, options, callback) { const url = this.buildUrl(this.usersPath); const params = { search: query, @@ -755,8 +755,8 @@ UsersSelect.prototype.users = function(query, options, callback) { }; const isMergeRequest = options.issuableType === 'merge_request'; - const isEditMergeRequest = !options.issuableType && (options.iid && options.targetBranch); - const isNewMergeRequest = !options.issuableType && (!options.iid && options.targetBranch); + const isEditMergeRequest = !options.issuableType && options.iid && options.targetBranch; + const isNewMergeRequest = !options.issuableType && !options.iid && options.targetBranch; if (isMergeRequest || isEditMergeRequest || isNewMergeRequest) { params.merge_request_iid = options.iid || null; @@ -772,14 +772,14 @@ UsersSelect.prototype.users = function(query, options, callback) { }); }; -UsersSelect.prototype.buildUrl = function(url) { +UsersSelect.prototype.buildUrl = function (url) { if (gon.relative_url_root != null) { url = gon.relative_url_root.replace(/\/$/, '') + url; } return url; }; -UsersSelect.prototype.renderRow = function( +UsersSelect.prototype.renderRow = function ( issuableType, user, selected, @@ -815,7 +815,7 @@ UsersSelect.prototype.renderRow = function( `; }; -UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) { +UsersSelect.prototype.renderRowAvatar = function (issuableType, user, img) { if (user.beforeDivider) { return img; } @@ -831,7 +831,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) { </span>`; }; -UsersSelect.prototype.renderApprovalRules = function(elsClassName, approvalRules = []) { +UsersSelect.prototype.renderApprovalRules = function (elsClassName, approvalRules = []) { const count = approvalRules.length; if (!gon.features?.reviewerApprovalRules || !elsClassName?.includes('reviewer') || !count) { diff --git a/app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue b/app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue index 9b2cd41092e..322444ce14b 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue @@ -145,7 +145,7 @@ export default { <template #metricsLink="{ content }"> <gl-link :href="metricsMonitoringUrl">{{ content }}</gl-link> </template> - <template #emphasis="{content}"> + <template #emphasis="{ content }"> <strong>{{ content }}</strong> </template> <template #memoryFrom>{{ memoryFrom }}</template> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue index 5066a88b52b..9db53ae97a7 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue @@ -142,7 +142,7 @@ export default { data-testid="ci-error-message" > <gl-sprintf :message="$options.errorText"> - <template #link="{content}"> + <template #link="{ content }"> <gl-link :href="mrTroubleshootingDocsPath">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue index a9d148505e1..7acdd695cc2 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue @@ -86,12 +86,12 @@ export default { to create one.`) " > - <template #prefixToLink="{content}"> + <template #prefixToLink="{ content }"> <strong> {{ content }} </strong> </template> - <template #addPipelineLink="{content}"> + <template #addPipelineLink="{ content }"> <gl-link :href="pipelinePath" class="gl-ml-1" diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue index 1d591168a17..322d4124935 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue @@ -113,10 +113,18 @@ export default { }, }, }) - .then(({ data: { mergeRequestSetWip: { mergeRequest: { title } } } }) => { - createFlash(__('The merge request can now be merged.'), 'notice'); - $('.merge-request .detail-page-description .title').text(title); - }) + .then( + ({ + data: { + mergeRequestSetWip: { + mergeRequest: { title }, + }, + }, + }) => { + createFlash(__('The merge request can now be merged.'), 'notice'); + $('.merge-request .detail-page-description .title').text(title); + }, + ) .catch(() => createFlash(__('Something went wrong. Please try again.'))) .finally(() => { this.isMakingRequest = false; diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index 3f1f2144d8e..fc9a73f991c 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -166,7 +166,8 @@ export default { return ( !this.mr.canRemoveSourceBranch && this.mr.shouldRemoveSourceBranch && - (!this.mr.isNothingToMergeState && !this.mr.isMergedState) + !this.mr.isNothingToMergeState && + !this.mr.isMergedState ); }, shouldRenderCollaborationStatus() { diff --git a/app/assets/javascripts/vue_shared/components/content_viewer/viewers/download_viewer.vue b/app/assets/javascripts/vue_shared/components/content_viewer/viewers/download_viewer.vue index 8d55701f499..12078cdc16d 100644 --- a/app/assets/javascripts/vue_shared/components/content_viewer/viewers/download_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/content_viewer/viewers/download_viewer.vue @@ -39,9 +39,7 @@ export default { <div class="file-content"> <p class="gl-mt-3 file-info"> {{ fileName }} - <template v-if="fileSize > 0"> - ({{ fileSizeReadable }}) - </template> + <template v-if="fileSize > 0"> ({{ fileSizeReadable }}) </template> </p> <a :href="path" class="btn btn-default" rel="nofollow" :download="fileName" target="_blank"> <gl-icon :size="16" name="download" class="float-left gl-mr-3" /> diff --git a/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue b/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue index eb7e24734ce..4c3dd6cd229 100644 --- a/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue @@ -95,9 +95,7 @@ export default { <template v-if="hasFileSize"> {{ fileSizeReadable }} </template> - <template v-if="hasFileSize && hasDimensions"> - | - </template> + <template v-if="hasFileSize && hasDimensions"> | </template> <template v-if="hasDimensions"> <strong>{{ s__('ImageViewerDimensions|W') }}</strong >: {{ width }} | <strong>{{ s__('ImageViewerDimensions|H') }}</strong diff --git a/app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue b/app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue index c4bce860ae4..65768487e9b 100644 --- a/app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue +++ b/app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue @@ -46,14 +46,10 @@ export default { }, }, mounted() { - $(this.$el) - .on('shown.bs.modal', this.opened) - .on('hidden.bs.modal', this.closed); + $(this.$el).on('shown.bs.modal', this.opened).on('hidden.bs.modal', this.closed); }, beforeDestroy() { - $(this.$el) - .off('shown.bs.modal', this.opened) - .off('hidden.bs.modal', this.closed); + $(this.$el).off('shown.bs.modal', this.opened).off('hidden.bs.modal', this.closed); }, methods: { emitCancel(event) { diff --git a/app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js b/app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js index 91a0ac3aa92..f7cfb59be01 100644 --- a/app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js +++ b/app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js @@ -593,15 +593,6 @@ const fileNameIcons = { export default function getIconForFile(name) { return ( - fileNameIcons[name] || - fileExtensionIcons[ - name - ? name - .split('.') - .pop() - .toLowerCase() - : '' - ] || - '' + fileNameIcons[name] || fileExtensionIcons[name ? name.split('.').pop().toLowerCase() : ''] || '' ); } diff --git a/app/assets/javascripts/vue_shared/components/markdown/toolbar.vue b/app/assets/javascripts/vue_shared/components/markdown/toolbar.vue index 5824cb9438f..15c5b9d6733 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/toolbar.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/toolbar.vue @@ -49,10 +49,10 @@ export default { ) " > - <template #markdownDocsLink="{content}"> + <template #markdownDocsLink="{ content }"> <gl-link :href="markdownDocsPath" target="_blank">{{ content }}</gl-link> </template> - <template #quickActionsDocsLink="{content}"> + <template #quickActionsDocsLink="{ content }"> <gl-link :href="quickActionsDocsPath" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> @@ -81,7 +81,7 @@ export default { ) " > - <template #retryButton="{content}"> + <template #retryButton="{ content }"> <gl-button variant="link" category="primary" @@ -90,7 +90,7 @@ export default { {{ content }} </gl-button> </template> - <template #newFileButton="{content}"> + <template #newFileButton="{ content }"> <gl-button variant="link" category="primary" diff --git a/app/assets/javascripts/vue_shared/components/notes/system_note.vue b/app/assets/javascripts/vue_shared/components/notes/system_note.vue index f30676e8ef3..cc1203f83f0 100644 --- a/app/assets/javascripts/vue_shared/components/notes/system_note.vue +++ b/app/assets/javascripts/vue_shared/components/notes/system_note.vue @@ -78,16 +78,10 @@ export default { }, // following 2 methods taken from code in `collapseLongCommitList` of notes.js: actionTextHtml() { - return $(this.note.note_html) - .unwrap() - .html(); + return $(this.note.note_html).unwrap().html(); }, hasMoreCommits() { - return ( - $(this.note.note_html) - .filter('ul') - .children().length > MAX_VISIBLE_COMMIT_LIST_COUNT - ); + return $(this.note.note_html).filter('ul').children().length > MAX_VISIBLE_COMMIT_LIST_COUNT; }, descriptionVersion() { return this.descriptionVersions[this.note.description_version_id]; diff --git a/app/assets/javascripts/vue_shared/components/registry/title_area.vue b/app/assets/javascripts/vue_shared/components/registry/title_area.vue index 4d47a34c9a3..4d82a954ced 100644 --- a/app/assets/javascripts/vue_shared/components/registry/title_area.vue +++ b/app/assets/javascripts/vue_shared/components/registry/title_area.vue @@ -89,7 +89,7 @@ export default { data-testid="info-message" > <gl-sprintf :message="message.text"> - <template #docLink="{content}"> + <template #docLink="{ content }"> <gl-link :href="message.link" target="_blank">{{ content }}</gl-link> </template> </gl-sprintf> diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue index 1ef3d5627ae..22d86ee25d1 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue @@ -143,7 +143,7 @@ export default { > <slot></slot> </dropdown-value> - <div v-if="canEdit" class="selectbox js-selectbox" style="display: none;"> + <div v-if="canEdit" class="selectbox js-selectbox" style="display: none"> <dropdown-hidden-input v-for="label in context.labels" :key="label.id" diff --git a/app/assets/javascripts/vue_shared/directives/validation.js b/app/assets/javascripts/vue_shared/directives/validation.js index 09bec78edcc..772c4b3a082 100644 --- a/app/assets/javascripts/vue_shared/directives/validation.js +++ b/app/assets/javascripts/vue_shared/directives/validation.js @@ -86,7 +86,7 @@ const createValidator = (context, feedbackMap) => ({ el, reportInvalidInput = fa * @param {Object<string, { message: string, isValid: ?function}>} customFeedbackMap * @returns {{ inserted: function, update: function }} validateDirective */ -export default function(customFeedbackMap = {}) { +export default function (customFeedbackMap = {}) { const feedbackMap = merge(defaultFeedbackMap, customFeedbackMap); const elDataMap = new WeakMap(); diff --git a/app/assets/javascripts/vue_shared/security_reports/components/security_summary.vue b/app/assets/javascripts/vue_shared/security_reports/components/security_summary.vue index babb9fddcf6..e3aa25a294e 100644 --- a/app/assets/javascripts/vue_shared/security_reports/components/security_summary.vue +++ b/app/assets/javascripts/vue_shared/security_reports/components/security_summary.vue @@ -34,13 +34,13 @@ export default { <template> <span> <gl-sprintf :message="message.message"> - <template #total="{content}"> + <template #total="{ content }"> <strong>{{ content }}</strong> </template> </gl-sprintf> <span v-if="shouldShowCountMessage" class="gl-font-sm"> <gl-sprintf :message="message.countMessage"> - <template v-for="slotName in $options.slotNames" #[slotName]="{content}"> + <template v-for="slotName in $options.slotNames" #[slotName]="{ content }"> <span :key="slotName"> <strong v-if="message[slotName] > 0" diff --git a/app/assets/javascripts/zen_mode.js b/app/assets/javascripts/zen_mode.js index ab0b0b02aa8..260ee972783 100644 --- a/app/assets/javascripts/zen_mode.js +++ b/app/assets/javascripts/zen_mode.js @@ -48,11 +48,7 @@ export default class ZenMode { return $(e.currentTarget).trigger('zen_mode:leave'); }); $(document).on('zen_mode:enter', e => { - this.enter( - $(e.target) - .closest('.md-area') - .find('.zen-backdrop'), - ); + this.enter($(e.target).closest('.md-area').find('.zen-backdrop')); }); $(document).on('zen_mode:leave', () => { this.exit(); |