diff --git a/.eslintrc.yml b/.eslintrc.yml index dfb9e8f97eb9554709ba0216a593c4de0d8c1dad..f98f7acc0ad0dff57eb34c0c766f79ce6bafa98f 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -33,10 +33,6 @@ rules: # consider. See # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89831. - '^(ee|jh)_component/' - # Disabled for now, to make the airbnb-base 12.1.0 -> 13.1.0 update smoother - no-else-return: - - error - - allowElseIf: true lines-between-class-members: off # all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() ) no-jquery/no-animate-toggle: off diff --git a/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue b/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue index c1ec46cfc509e668888100d4fea25fad9b441d0a..9bcdcec8b788c7d3e73780a18b5c3cb449fd2115 100644 --- a/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue +++ b/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue @@ -267,7 +267,8 @@ export default { }); } }); - } else if (this.uniqueCommits.length > 0) { + } + if (this.uniqueCommits.length > 0) { return this.createContextCommits({ commits: this.uniqueCommits, forceReload: true }); } diff --git a/app/assets/javascripts/admin/abuse_report/components/labels_select.vue b/app/assets/javascripts/admin/abuse_report/components/labels_select.vue index 9e0c5e25f20fad73c4f9125a3ec4b27ebc761d4b..747c9a1a947d83e670e2be78c29b0c6348a095de 100644 --- a/app/assets/javascripts/admin/abuse_report/components/labels_select.vue +++ b/app/assets/javascripts/admin/abuse_report/components/labels_select.vue @@ -74,7 +74,8 @@ export default { selectText() { if (!this.selected.length) { return this.$options.i18n.labelsListTitle; - } else if (this.selected.length > 1) { + } + if (this.selected.length > 1) { return sprintf(s__('LabelSelect|%{firstLabelName} +%{remainingLabelCount} more'), { firstLabelName: this.selected[0].title, remainingLabelCount: this.selected.length - 1, diff --git a/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue b/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue index 109df943c423cb44eea64daf5d8609e71695cc02..2c555aca3c033351ea7af4aa993465c6b83baef0 100644 --- a/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue +++ b/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue @@ -234,7 +234,8 @@ export default { initialTarget() { if (this.targetAccessLevels.length > 0) { return TARGET_ROLES; - } else if (this.targetPath !== '') { + } + if (this.targetPath !== '') { return TARGET_ALL_MATCHING_PATH; } return TARGET_ALL; diff --git a/app/assets/javascripts/analytics/cycle_analytics/components/formatted_stage_count.vue b/app/assets/javascripts/analytics/cycle_analytics/components/formatted_stage_count.vue index b622b0441e29a133ea00f35841af21dab177551e..724e9c91305ef5588d9408bc4bc5015141ab25fc 100644 --- a/app/assets/javascripts/analytics/cycle_analytics/components/formatted_stage_count.vue +++ b/app/assets/javascripts/analytics/cycle_analytics/components/formatted_stage_count.vue @@ -13,7 +13,8 @@ export default { formattedStageCount() { if (!this.stageCount) { return '-'; - } else if (this.stageCount > 1000) { + } + if (this.stageCount > 1000) { return sprintf(s__('ValueStreamAnalytics|%{stageCount}+ items'), { stageCount: formatNumber(1000), }); diff --git a/app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue b/app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue index f881c924ae5fc78d96df2b67aacfbc124496167b..ddfc6baafa9134d29437cd270d946dece2c613a1 100644 --- a/app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue +++ b/app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue @@ -69,7 +69,8 @@ export default { selectedProjectsLabel() { if (this.selectedProjects.length === 1) { return this.selectedProjects[0].name; - } else if (this.selectedProjects.length > 1) { + } + if (this.selectedProjects.length > 1) { return n__( 'CycleAnalytics|Project selected', 'CycleAnalytics|%d projects selected', diff --git a/app/assets/javascripts/authentication/webauthn/error.js b/app/assets/javascripts/authentication/webauthn/error.js index 40dbecd8bc909525493b3853f12080e8f20516af..ce6c79a1f11a98a8c34eb64c581512024e234bd6 100644 --- a/app/assets/javascripts/authentication/webauthn/error.js +++ b/app/assets/javascripts/authentication/webauthn/error.js @@ -14,11 +14,14 @@ export default class WebAuthnError { message() { if (this.errorName === 'NotSupportedError') { return __('Your device is not compatible with GitLab. Please try another device'); - } else if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_AUTHENTICATE) { + } + if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_AUTHENTICATE) { return __('This device has not been registered with us.'); - } else if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_REGISTER) { + } + if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_REGISTER) { return __('This device has already been registered with us.'); - } else if (this.errorName === 'SecurityError' && this.httpsDisabled) { + } + if (this.errorName === 'SecurityError' && this.httpsDisabled) { return __( 'WebAuthn only works with HTTPS-enabled websites. Contact your administrator for more details.', ); diff --git a/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js b/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js index 095634340c110fbce7c0a12f98d6a0588edb9ed7..e1c1bd58ee2e992c3fd0b673edeafe7cd24c43a6 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js @@ -20,7 +20,8 @@ export default () => ({ const checkbox = el.querySelector('input[type=checkbox].task-list-item-checkbox'); if (checkbox?.matches('[data-inapplicable]')) { return { state: 'inapplicable' }; - } else if (checkbox?.checked) { + } + if (checkbox?.checked) { return { state: 'done' }; } diff --git a/app/assets/javascripts/blob/line_highlighter.js b/app/assets/javascripts/blob/line_highlighter.js index 4e97d0aa9154dfde7760db8c15ff46055a4d7a09..9c6a5958e1fe22efc4a0b008e6461ecf1e0b6041 100644 --- a/app/assets/javascripts/blob/line_highlighter.js +++ b/app/assets/javascripts/blob/line_highlighter.js @@ -96,7 +96,8 @@ LineHighlighter.prototype.clickHandler = function (event) { // treat this like a single-line selection. this.setHash(lineNumber); return this.highlightLine(lineNumber); - } else if (event.shiftKey) { + } + if (event.shiftKey) { if (lineNumber < current[0]) { range = [lineNumber, current[0]]; } else { diff --git a/app/assets/javascripts/boards/components/issue_due_date.vue b/app/assets/javascripts/boards/components/issue_due_date.vue index 1f28974afd19b950921b4c9e788188a8800094dc..46009df2bd3a281ffcf98237e746ead907651ddd 100644 --- a/app/assets/javascripts/boards/components/issue_due_date.vue +++ b/app/assets/javascripts/boards/components/issue_due_date.vue @@ -52,11 +52,14 @@ export default { if (timeDifference === 0) { return __('Today'); - } else if (timeDifference === 1) { + } + if (timeDifference === 1) { return __('Tomorrow'); - } else if (timeDifference === -1) { + } + if (timeDifference === -1) { return __('Yesterday'); - } else if (timeDifference > 0 && timeDifference < 7) { + } + if (timeDifference > 0 && timeDifference < 7) { return dateFormat(issueDueDate, 'dddd'); } diff --git a/app/assets/javascripts/ci/pipeline_details/graph/components/linked_pipeline.vue b/app/assets/javascripts/ci/pipeline_details/graph/components/linked_pipeline.vue index cc52ff57c132d001e4faf67bd15f8c8f1a6c236b..d6adaf78da4cded9e6aaa98f7dbb2a153dbe75c0 100644 --- a/app/assets/javascripts/ci/pipeline_details/graph/components/linked_pipeline.vue +++ b/app/assets/javascripts/ci/pipeline_details/graph/components/linked_pipeline.vue @@ -72,7 +72,8 @@ export default { method: this.cancelPipeline, ariaLabel: __('Cancel downstream pipeline'), }; - } else if (this.isRetryable) { + } + if (this.isRetryable) { return { icon: 'retry', method: this.retryPipeline, @@ -141,7 +142,8 @@ export default { label() { if (this.parentPipeline) { return __('Parent'); - } else if (this.childPipeline) { + } + if (this.childPipeline) { return __('Child'); } return __('Multi-project'); diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js index a604d79259d3bc16ffe809f5068ca5e15a06fb16..32eda355e66a42a640786c81065e69ff2d7ab625 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js @@ -10,7 +10,8 @@ const trimText = (val) => (isString(val) ? trim(val) : val); export const removeEmptyObj = (obj) => { if (isArray(obj)) { return reject(map(obj, removeEmptyObj), isEmptyValue); - } else if (isObject(obj)) { + } + if (isObject(obj)) { return omitBy(mapValues(obj, removeEmptyObj), isEmptyValue); } return obj; @@ -19,7 +20,8 @@ export const removeEmptyObj = (obj) => { export const trimFields = (data) => { if (isArray(data)) { return data.map(trimFields); - } else if (isObject(data)) { + } + if (isObject(data)) { return mapValues(data, trimFields); } return trimText(data); diff --git a/app/assets/javascripts/ci/reports/components/issue_status_icon.vue b/app/assets/javascripts/ci/reports/components/issue_status_icon.vue index bd41b8d23f1ae37a18e8681b83dad1112a2e08f1..56010a5f588c20e522d056569902c52fdcfbeb18 100644 --- a/app/assets/javascripts/ci/reports/components/issue_status_icon.vue +++ b/app/assets/javascripts/ci/reports/components/issue_status_icon.vue @@ -22,7 +22,8 @@ export default { iconName() { if (this.isStatusFailed) { return 'status_failed_borderless'; - } else if (this.isStatusSuccess) { + } + if (this.isStatusSuccess) { return 'status_success_borderless'; } diff --git a/app/assets/javascripts/ci/reports/components/report_section.vue b/app/assets/javascripts/ci/reports/components/report_section.vue index a4ec7b6a325bcd496c0130373cb30f884fe96f69..fd6c6cca6b7ffc326892b220cb6bfbb49e62d3ff 100644 --- a/app/assets/javascripts/ci/reports/components/report_section.vue +++ b/app/assets/javascripts/ci/reports/components/report_section.vue @@ -159,7 +159,8 @@ export default { slotName() { if (this.isSuccess) { return SLOT_SUCCESS; - } else if (this.isLoading) { + } + if (this.isLoading) { return SLOT_LOADING; } diff --git a/app/assets/javascripts/ci/runner/components/stat/runner_count.vue b/app/assets/javascripts/ci/runner/components/stat/runner_count.vue index c33c42f3afe8779dfa7cb923138edc4e94304068..cee1088d90b51081b1b746b7a09363ef85c47023 100644 --- a/app/assets/javascripts/ci/runner/components/stat/runner_count.vue +++ b/app/assets/javascripts/ci/runner/components/stat/runner_count.vue @@ -55,7 +55,8 @@ export default { query() { if (this.scope === INSTANCE_TYPE) { return allRunnersCountQuery; - } else if (this.scope === GROUP_TYPE) { + } + if (this.scope === GROUP_TYPE) { return groupRunnersCountQuery; } return null; @@ -74,7 +75,8 @@ export default { update(data) { if (this.scope === INSTANCE_TYPE) { return data?.runners?.count; - } else if (this.scope === GROUP_TYPE) { + } + if (this.scope === GROUP_TYPE) { return data?.group?.runners?.count; } return null; diff --git a/app/assets/javascripts/ci/runner/runner_search_utils.js b/app/assets/javascripts/ci/runner/runner_search_utils.js index 3dc99baa329078fb6fbe0869c13900065b2d2978..8915198350f2e4247b1b09eaa6d0c3c72c3c4f20 100644 --- a/app/assets/javascripts/ci/runner/runner_search_utils.js +++ b/app/assets/javascripts/ci/runner/runner_search_utils.js @@ -97,7 +97,8 @@ const outdatedStatusParams = (status) => { [PARAM_KEY_PAUSED]: ['false'], [PARAM_KEY_STATUS]: [], // Important! clear PARAM_KEY_STATUS to avoid a redirection loop! }; - } else if (status === STATUS_PAUSED) { + } + if (status === STATUS_PAUSED) { return { [PARAM_KEY_PAUSED]: ['true'], [PARAM_KEY_STATUS]: [], // Important! clear PARAM_KEY_STATUS to avoid a redirection loop! diff --git a/app/assets/javascripts/ci_secure_files/components/metadata/modal.vue b/app/assets/javascripts/ci_secure_files/components/metadata/modal.vue index fdf720a5f94490e99dc81b7a431a00bfd085597a..cbb9c31b54b62e8bcac460fdbb973770b3ce4f21 100644 --- a/app/assets/javascripts/ci_secure_files/components/metadata/modal.vue +++ b/app/assets/javascripts/ci_secure_files/components/metadata/modal.vue @@ -101,10 +101,12 @@ export default { if (this.fileExtension === 'cer') { this.track('load_secure_file_metadata_cer'); return this.cerItems(); - } else if (this.fileExtension === 'p12') { + } + if (this.fileExtension === 'p12') { this.track('load_secure_file_metadata_p12'); return this.p12Items(); - } else if (this.fileExtension === 'mobileprovision') { + } + if (this.fileExtension === 'mobileprovision') { this.track('load_secure_file_metadata_mobileprovision'); return this.mobileprovisionItems(this.metadata); } diff --git a/app/assets/javascripts/clusters_list/components/agent_table.vue b/app/assets/javascripts/clusters_list/components/agent_table.vue index 529be7169db65084bbb45fb48108e5319371defc..7482aaca36eaa26c4a4e70fe5c26f12ad94a8199 100644 --- a/app/assets/javascripts/clusters_list/components/agent_table.vue +++ b/app/assets/javascripts/clusters_list/components/agent_table.vue @@ -191,9 +191,11 @@ export default { getVersionPopoverTitle(agent) { if (this.isVersionMismatch(agent) && this.isVersionOutdated(agent)) { return this.$options.i18n.versionMismatchOutdatedTitle; - } else if (this.isVersionMismatch(agent)) { + } + if (this.isVersionMismatch(agent)) { return this.$options.i18n.versionMismatchTitle; - } else if (this.isVersionOutdated(agent)) { + } + if (this.isVersionOutdated(agent)) { return this.$options.i18n.versionOutdatedTitle; } diff --git a/app/assets/javascripts/clusters_list/components/available_agents_dropdown.vue b/app/assets/javascripts/clusters_list/components/available_agents_dropdown.vue index 75850cbb10851df6b5937dcfa1b8c7af04df86b5..96ecbe9fa121c8a24af6ac5dd19e9d35b85d150d 100644 --- a/app/assets/javascripts/clusters_list/components/available_agents_dropdown.vue +++ b/app/assets/javascripts/clusters_list/components/available_agents_dropdown.vue @@ -30,7 +30,8 @@ export default { dropdownText() { if (this.isRegistering) { return this.$options.i18n.registeringAgent; - } else if (this.selectedAgent === null) { + } + if (this.selectedAgent === null) { return this.$options.i18n.selectAgent; } diff --git a/app/assets/javascripts/clusters_list/components/clusters.vue b/app/assets/javascripts/clusters_list/components/clusters.vue index 590fdb947b340bf65b173ceaf65a42f1e0c12756..0258d8e0da06b6915b8e364ddbfe8e45f45958e8 100644 --- a/app/assets/javascripts/clusters_list/components/clusters.vue +++ b/app/assets/javascripts/clusters_list/components/clusters.vue @@ -125,9 +125,11 @@ export default { k8sQuantityToGb(quantity) { if (!quantity) { return 0; - } else if (quantity.endsWith(__('Ki'))) { + } + if (quantity.endsWith(__('Ki'))) { return parseInt(quantity.substr(0, quantity.length - 2), 10) * 0.000001024; - } else if (quantity.endsWith(__('Mi'))) { + } + if (quantity.endsWith(__('Mi'))) { return parseInt(quantity.substr(0, quantity.length - 2), 10) * 0.001048576; } @@ -138,9 +140,11 @@ export default { k8sQuantityToCpu(quantity) { if (!quantity) { return 0; - } else if (quantity.endsWith('m')) { + } + if (quantity.endsWith('m')) { return parseInt(quantity.substr(0, quantity.length - 1), 10) / 1000.0; - } else if (quantity.endsWith('n')) { + } + if (quantity.endsWith('n')) { return parseInt(quantity.substr(0, quantity.length - 1), 10) / 1000000000.0; } diff --git a/app/assets/javascripts/clusters_list/components/clusters_actions.vue b/app/assets/javascripts/clusters_list/components/clusters_actions.vue index c388d3fee7111ec6d48b568a8500fef42543d04b..e92b98946d0e47e247e1ffc8c9b84fc23470884c 100644 --- a/app/assets/javascripts/clusters_list/components/clusters_actions.vue +++ b/app/assets/javascripts/clusters_list/components/clusters_actions.vue @@ -37,7 +37,8 @@ export default { if (!this.displayClusterAgents) { return connectClusterDeprecated; - } else if (!this.certificateBasedClustersEnabled) { + } + if (!this.certificateBasedClustersEnabled) { return connectCluster; } return connectWithAgent; diff --git a/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_pushed.vue b/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_pushed.vue index 557f2912f175f37dac459c82567f94637b541e6d..a2516f37c92fefce79306eef30e716f5145b9bfc 100644 --- a/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_pushed.vue +++ b/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_pushed.vue @@ -53,7 +53,8 @@ export default { message() { if (this.ref.is_new) { return this.$options.i18n.new[this.ref.type]; - } else if (this.ref.is_removed) { + } + if (this.ref.is_removed) { return this.$options.i18n.removed[this.ref.type]; } diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js index ae5d3298b624fea3e81951ef09741838c1206f76..bacd84048af7394926fed3b8ef420e47e1c73348 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js @@ -11,7 +11,8 @@ export class GitLabDropdownRemote { execute() { if (typeof this.dataEndpoint === 'string') { return this.fetchData(); - } else if (typeof this.dataEndpoint === 'function') { + } + if (typeof this.dataEndpoint === 'function') { if (this.options.beforeSend) { this.options.beforeSend(); } diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/render.js b/app/assets/javascripts/deprecated_jquery_dropdown/render.js index 97698d55011077fd186b7361a7b53434f0cf4d87..1b133c57302ec67d488f9180e7327b9b4aab0852 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/render.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/render.js @@ -89,7 +89,8 @@ function checkSelected(data, options) { if (!options.parent) { return !data.id; - } else if (value) { + } + if (value) { return ( options.parent.querySelector(`input[name='${options.fieldName}'][value='${value}']`) != null ); diff --git a/app/assets/javascripts/deprecated_notes.js b/app/assets/javascripts/deprecated_notes.js index 4e5e07c57e45fdb70161f29b2829887bc815303b..008e12abbcdd3175ad81abc6d043ef021db5aa34 100644 --- a/app/assets/javascripts/deprecated_notes.js +++ b/app/assets/javascripts/deprecated_notes.js @@ -458,7 +458,8 @@ export default class Notes { this.setupNewNote($newNote); this.refresh(); return this.updateNotesCount(1); - } else if (Notes.isUpdatedNote(noteEntity, $note)) { + } + 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()); diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue index 88ea4e155527f686b77b6346bde0eaf9914c07f8..641616a34f5302afc3e4db21d09a3b75522c6f9a 100644 --- a/app/assets/javascripts/diffs/components/diff_view.vue +++ b/app/assets/javascripts/diffs/components/diff_view.vue @@ -186,7 +186,8 @@ export default { getCountBetweenIndex(index) { if (index === 0) { return -1; - } else if (!this.diffLines[index + 1]) { + } + if (!this.diffLines[index + 1]) { return -1; } diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index bbc602aedf615d5070ccfff5cc63b6033cc0491f..7c68b5f69f1ac42c398be6efc63d6a136a85e80e 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -910,7 +910,8 @@ export const setSuggestPopoverDismissed = ({ commit, state }) => export function changeCurrentCommit({ dispatch, commit, state }, { commitId }) { if (!commitId) { return Promise.reject(new Error('`commitId` is a required argument')); - } else if (!state.commit) { + } + if (!state.commit) { return Promise.reject(new Error('`state` must already contain a valid `commit`')); // eslint-disable-line @gitlab/require-i18n-strings } diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index d82959daa9d4b7c8f6280f74dfb49e873e3ca278..bfafb4d281d0a929329f293aba8fe49600852665 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -139,7 +139,8 @@ export const fileLineCoverage = (state) => (file, line) => { if (lineCoverage === 0) { return { text: __('No test coverage'), class: 'no-coverage' }; - } else if (lineCoverage >= 0) { + } + if (lineCoverage >= 0) { return { text: n__('Test coverage: %d hit', 'Test coverage: %d hits', lineCoverage), class: 'coverage', diff --git a/app/assets/javascripts/environments/components/kubernetes_status_bar.vue b/app/assets/javascripts/environments/components/kubernetes_status_bar.vue index e8857dfe459d28960379445d9e1f6431f6be8465..c603d83db9cfb2011d45d5ce3af6eede89f50122 100644 --- a/app/assets/javascripts/environments/components/kubernetes_status_bar.vue +++ b/app/assets/javascripts/environments/components/kubernetes_status_bar.vue @@ -145,15 +145,20 @@ export default { syncStatusBadge() { if (!this.fluxCRD.length && this.fluxApiError) { return { ...SYNC_STATUS_BADGES.unavailable, popoverText: this.fluxApiError }; - } else if (!this.fluxCRD.length) { + } + if (!this.fluxCRD.length) { return SYNC_STATUS_BADGES.unavailable; - } else if (this.fluxAnyFailed) { + } + if (this.fluxAnyFailed) { return { ...SYNC_STATUS_BADGES.failed, popoverText: this.fluxAnyFailed.message }; - } else if (this.fluxAnyStalled) { + } + if (this.fluxAnyStalled) { return { ...SYNC_STATUS_BADGES.stalled, popoverText: this.fluxAnyStalled.message }; - } else if (this.fluxAnyReconciling) { + } + if (this.fluxAnyReconciling) { return SYNC_STATUS_BADGES.reconciling; - } else if (this.fluxAnyReconciled) { + } + if (this.fluxAnyReconciled) { return SYNC_STATUS_BADGES.reconciled; } return SYNC_STATUS_BADGES.unknown; diff --git a/app/assets/javascripts/frequent_items/utils.js b/app/assets/javascripts/frequent_items/utils.js index 1c33c8b10845d360756fe8d43a8f2c8ec6577ed0..f71405a5bc46519238c5c8cda4b358a251925a6a 100644 --- a/app/assets/javascripts/frequent_items/utils.js +++ b/app/assets/javascripts/frequent_items/utils.js @@ -24,7 +24,8 @@ export const getTopFrequentItems = (items) => { // and then by lastAccessedOn with recent most first if (itemA.frequency !== itemB.frequency) { return itemB.frequency - itemA.frequency; - } else if (itemA.lastAccessedOn !== itemB.lastAccessedOn) { + } + if (itemA.lastAccessedOn !== itemB.lastAccessedOn) { return itemB.lastAccessedOn - itemA.lastAccessedOn; } diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 9e7006bb6e7535a2a2825933dd4cd7cb5df4f311..a9e7b853cd260be19a2b5326dc6054f85701209f 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -393,13 +393,16 @@ class GfmAutoComplete { if (command === MEMBER_COMMAND.ASSIGN) { // Only include members which are not assigned to Issuable currently return data.filter((member) => !assignees.includes(member.search)); - } else if (command === MEMBER_COMMAND.UNASSIGN) { + } + if (command === MEMBER_COMMAND.UNASSIGN) { // Only include members which are assigned to Issuable currently return data.filter((member) => assignees.includes(member.search)); - } else if (command === MEMBER_COMMAND.ASSIGN_REVIEWER) { + } + if (command === MEMBER_COMMAND.ASSIGN_REVIEWER) { // Only include members which are not assigned as a reviewer to Issuable currently return data.filter((member) => !reviewers.includes(member.search)); - } else if (command === MEMBER_COMMAND.UNASSIGN_REVIEWER) { + } + if (command === MEMBER_COMMAND.UNASSIGN_REVIEWER) { // Only include members which are not assigned as a reviewer to Issuable currently return data.filter((member) => reviewers.includes(member.search)); } @@ -642,7 +645,8 @@ class GfmAutoComplete { if (command === LABEL_COMMAND.LABEL || command === LABEL_COMMAND.LABELS) { // Return labels with set: undefined. return data.filter((label) => !label.set); - } else if (command === LABEL_COMMAND.UNLABEL) { + } + if (command === LABEL_COMMAND.UNLABEL) { // Return labels with set: true. return data.filter((label) => label.set); } @@ -751,7 +755,8 @@ class GfmAutoComplete { if (command === CONTACTS_ADD_COMMAND) { // Return contacts that are active and not already on the issue return data.filter((contact) => contact.state === CONTACT_STATE_ACTIVE && !contact.set); - } else if (command === CONTACTS_REMOVE_COMMAND) { + } + if (command === CONTACTS_REMOVE_COMMAND) { // Return contacts already on the issue return data.filter((contact) => contact.set); } @@ -779,10 +784,8 @@ class GfmAutoComplete { if (GfmAutoComplete.isLoading(data)) { self.fetchData(this.$inputor, this.at); return data; - } else if ( - GfmAutoComplete.isTypeWithBackendFiltering(this.at) && - self.previousQuery !== query - ) { + } + if (GfmAutoComplete.isTypeWithBackendFiltering(this.at) && self.previousQuery !== query) { self.fetchData(this.$inputor, this.at, query); self.previousQuery = query; return data; diff --git a/app/assets/javascripts/gitlab_version_check/components/gitlab_version_check_badge.vue b/app/assets/javascripts/gitlab_version_check/components/gitlab_version_check_badge.vue index 1536a9a525b72abfec94b9b62dd539daf7058f00..25ddfc911f36ae410636ae5a6c7ab4f777f8228f 100644 --- a/app/assets/javascripts/gitlab_version_check/components/gitlab_version_check_badge.vue +++ b/app/assets/javascripts/gitlab_version_check/components/gitlab_version_check_badge.vue @@ -30,9 +30,11 @@ export default { title() { if (this.status === STATUS_TYPES.SUCCESS) { return s__('VersionCheck|Up to date'); - } else if (this.status === STATUS_TYPES.WARNING) { + } + if (this.status === STATUS_TYPES.WARNING) { return s__('VersionCheck|Update available'); - } else if (this.status === STATUS_TYPES.DANGER) { + } + if (this.status === STATUS_TYPES.DANGER) { return s__('VersionCheck|Update ASAP'); } diff --git a/app/assets/javascripts/google_cloud/deployments/service_table.vue b/app/assets/javascripts/google_cloud/deployments/service_table.vue index 26c9fd14dc64eafcc37534c73eb5aac224b31e9b..9388b41127e410645a7233426f2a21c6f5972f1d 100644 --- a/app/assets/javascripts/google_cloud/deployments/service_table.vue +++ b/app/assets/javascripts/google_cloud/deployments/service_table.vue @@ -34,7 +34,7 @@ export default { methods: { actionUrl(key) { if (key === cloudRun) return this.cloudRunUrl; - else if (key === cloudStorage) return this.cloudStorageUrl; + if (key === cloudStorage) return this.cloudStorageUrl; return '#'; }, }, diff --git a/app/assets/javascripts/ide/commit_icon.js b/app/assets/javascripts/ide/commit_icon.js index 70ee9cff22b4043e18edc96f729322077d7e03de..07eef897910711714eccb5d1f164e9b837d24b75 100644 --- a/app/assets/javascripts/ide/commit_icon.js +++ b/app/assets/javascripts/ide/commit_icon.js @@ -3,7 +3,8 @@ import { commitItemIconMap } from './constants'; export default (file) => { if (file.deleted) { return commitItemIconMap.deleted; - } else if (file.tempFile && !file.prevPath) { + } + if (file.tempFile && !file.prevPath) { return commitItemIconMap.addition; } diff --git a/app/assets/javascripts/ide/components/new_dropdown/modal.vue b/app/assets/javascripts/ide/components/new_dropdown/modal.vue index 854daa20628c93efe63ef3e4a7c686fd1137bca6..741845e332514dcfbadf7070fbff496d68e16bf2 100644 --- a/app/assets/javascripts/ide/components/new_dropdown/modal.vue +++ b/app/assets/javascripts/ide/components/new_dropdown/modal.vue @@ -32,7 +32,8 @@ export default { if (this.modalType === modalTypes.tree) { return __('Create new directory'); - } else if (this.modalType === modalTypes.rename) { + } + if (this.modalType === modalTypes.rename) { return entry.type === modalTypes.tree ? __('Rename folder') : __('Rename file'); } @@ -43,7 +44,8 @@ export default { if (this.modalType === modalTypes.tree) { return __('Create directory'); - } else if (this.modalType === modalTypes.rename) { + } + if (this.modalType === modalTypes.rename) { return entry.type === modalTypes.tree ? __('Rename folder') : __('Rename file'); } diff --git a/app/assets/javascripts/ide/components/terminal/terminal.vue b/app/assets/javascripts/ide/components/terminal/terminal.vue index 9e8b3d8739746c569208760fdbb9339fa28348bf..b2e90a64758dfc8dab91c749b7750d538b35a7ab 100644 --- a/app/assets/javascripts/ide/components/terminal/terminal.vue +++ b/app/assets/javascripts/ide/components/terminal/terminal.vue @@ -37,7 +37,8 @@ export default { loadingText() { if (isStartingStatus(this.status)) { return __('Starting...'); - } else if (this.status === STOPPING) { + } + if (this.status === STOPPING) { return __('Stopping...'); } diff --git a/app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue b/app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue index 38e53b645039b5aa4651599bea72bedc9214c073..332408b9ecfbf32606c52ce7bd4c5743df8aee05 100644 --- a/app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue +++ b/app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue @@ -31,12 +31,14 @@ export default { icon: '', text: this.isStarted ? MSG_TERMINAL_SYNC_UPLOADING : MSG_TERMINAL_SYNC_CONNECTING, }; - } else if (this.isError) { + } + if (this.isError) { return { icon: 'warning', text: this.message, }; - } else if (this.isStarted) { + } + if (this.isStarted) { return { icon: 'mobile-issue-close', text: MSG_TERMINAL_SYNC_RUNNING, diff --git a/app/assets/javascripts/ide/lib/diff/controller.js b/app/assets/javascripts/ide/lib/diff/controller.js index 7595a1cedf1b458b8a1c71937b2e26c7704b59f1..ec28845d8050b6825b82b61a2dc338a7b7283b2c 100644 --- a/app/assets/javascripts/ide/lib/diff/controller.js +++ b/app/assets/javascripts/ide/lib/diff/controller.js @@ -7,9 +7,11 @@ import DirtyDiffWorker from './diff_worker?worker'; export const getDiffChangeType = (change) => { if (change.modified) { return 'modified'; - } else if (change.added) { + } + if (change.added) { return 'added'; - } else if (change.removed) { + } + if (change.removed) { return 'removed'; } diff --git a/app/assets/javascripts/ide/lib/errors.js b/app/assets/javascripts/ide/lib/errors.js index a8a048e588f47bc10e796b7b470d831b1b239584..5063cf5fd4fe7d247aaa21b796cd1322e566080d 100644 --- a/app/assets/javascripts/ide/lib/errors.js +++ b/app/assets/javascripts/ide/lib/errors.js @@ -55,9 +55,11 @@ export const parseCommitError = (e) => { if (CODEOWNERS_REGEX.test(message)) { return createCodeownersCommitError(message); - } else if (BRANCH_CHANGED_REGEX.test(message)) { + } + if (BRANCH_CHANGED_REGEX.test(message)) { return createBranchChangedCommitError(message); - } else if (BRANCH_ALREADY_EXISTS.test(message)) { + } + if (BRANCH_ALREADY_EXISTS.test(message)) { return branchAlreadyExistsCommitError(message); } diff --git a/app/assets/javascripts/ide/lib/files.js b/app/assets/javascripts/ide/lib/files.js index 3fdf012bbb2a851eb5b68aa76b10a0a47e9f4a15..415e34f56b82b7114e428fe98e50adedbd3475df 100644 --- a/app/assets/javascripts/ide/lib/files.js +++ b/app/assets/javascripts/ide/lib/files.js @@ -35,7 +35,8 @@ export const decorateFiles = ({ const insertParent = (path) => { if (!path) { return null; - } else if (entries[path]) { + } + if (entries[path]) { return entries[path]; } diff --git a/app/assets/javascripts/ide/lib/mirror.js b/app/assets/javascripts/ide/lib/mirror.js index f437965b25a40fa01486f5a73a92726ec5773d1a..286798d756051c514b6e27bec324d514d600d02c 100644 --- a/app/assets/javascripts/ide/lib/mirror.js +++ b/app/assets/javascripts/ide/lib/mirror.js @@ -32,7 +32,8 @@ const isErrorPayload = (payload) => payload && payload.status_code !== HTTP_STAT const getErrorFromResponse = (data) => { if (isErrorResponse(data.error)) { return { message: data.error.Message }; - } else if (isErrorPayload(data.payload)) { + } + if (isErrorPayload(data.payload)) { return { message: data.payload.error_message }; } diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js index f4fa52b2d4d5433000c2b964b31c1b8d9c6bcd13..11e3d8260f7aac87a3f8ab3ac72eeaf7b888eeb6 100644 --- a/app/assets/javascripts/ide/stores/actions/project.js +++ b/app/assets/javascripts/ide/stores/actions/project.js @@ -133,7 +133,8 @@ export const loadBranch = ({ dispatch, getters, state }, { projectId, branchId } if (currentProject?.branches?.[branchId]) { return Promise.resolve(); - } else if (getters.emptyRepo) { + } + if (getters.emptyRepo) { return dispatch('loadEmptyBranch', { projectId, branchId }); } diff --git a/app/assets/javascripts/ide/stores/getters.js b/app/assets/javascripts/ide/stores/getters.js index c0f666c6652e1fe93e9d28a1b36247e2e7b140b0..74fe61b6e2f28c55d634fe57fd5a64db499b1d68 100644 --- a/app/assets/javascripts/ide/stores/getters.js +++ b/app/assets/javascripts/ide/stores/getters.js @@ -30,7 +30,8 @@ const getCannotPushCodeViewModel = (state) => { text: MSG_GO_TO_FORK, }, }; - } else if (forkPath) { + } + if (forkPath) { return { message: MSG_CANNOT_PUSH_CODE_SHOULD_FORK, action: { diff --git a/app/assets/javascripts/ide/stores/modules/terminal/messages.js b/app/assets/javascripts/ide/stores/modules/terminal/messages.js index ad7ad35a98cf2fb703fc8dca09be37ab09bdbb4d..a2b45f9dc62aa22f8c8a64b434a59761f386efe7 100644 --- a/app/assets/javascripts/ide/stores/modules/terminal/messages.js +++ b/app/assets/javascripts/ide/stores/modules/terminal/messages.js @@ -39,7 +39,8 @@ export const configCheckError = (status, helpUrl) => { }, false, ); - } else if (status === HTTP_STATUS_FORBIDDEN) { + } + if (status === HTTP_STATUS_FORBIDDEN) { return ERROR_PERMISSION; } diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js index ec661fdb0d6be38ade2648ea4c6f1abb582f8e5f..bac3803e68f23bef26382310a5f97810a3292f88 100644 --- a/app/assets/javascripts/ide/stores/utils.js +++ b/app/assets/javascripts/ide/stores/utils.js @@ -81,9 +81,11 @@ export const setPageTitleForFile = (state, file) => { export const commitActionForFile = (file) => { if (file.prevPath) { return commitActionTypes.move; - } else if (file.deleted) { + } + if (file.deleted) { return commitActionTypes.delete; - } else if (file.tempFile) { + } + if (file.tempFile) { return commitActionTypes.create; } @@ -131,7 +133,8 @@ export const createNewMergeRequestUrl = (projectUrl, source, target) => const sortTreesByTypeAndName = (a, b) => { if (a.type === 'tree' && b.type === 'blob') { return -1; - } else if (a.type === 'blob' && b.type === 'tree') { + } + if (a.type === 'blob' && b.type === 'tree') { return 1; } if (a.name < b.name) return -1; diff --git a/app/assets/javascripts/import_entities/components/import_status.vue b/app/assets/javascripts/import_entities/components/import_status.vue index 94c041231129e75ca1b717046c8f0ae725a73f3b..91436457b034689b29d06707eeb5480d563019f3 100644 --- a/app/assets/javascripts/import_entities/components/import_status.vue +++ b/app/assets/javascripts/import_entities/components/import_status.vue @@ -133,9 +133,11 @@ export default { if (fetched === imported) { return { name: 'status-success', class: 'gl-text-green-400' }; - } else if (imported === 0) { + } + if (imported === 0) { return { name: 'status-scheduled', class: 'gl-text-gray-400' }; - } else if (this.status === STATUSES.FINISHED) { + } + if (this.status === STATUSES.FINISHED) { return { name: 'status-alert', class: 'gl-text-orange-400' }; } diff --git a/app/assets/javascripts/issuable/components/issue_milestone.vue b/app/assets/javascripts/issuable/components/issue_milestone.vue index c7da3e59098bcc43517566d45063e83618f673d3..3340ef2338c302dd377940aff247f6bf491be655 100644 --- a/app/assets/javascripts/issuable/components/issue_milestone.vue +++ b/app/assets/javascripts/issuable/components/issue_milestone.vue @@ -42,7 +42,8 @@ export default { milestoneDatesAbsolute() { if (this.milestoneDue) { return `(${dateInWords(this.milestoneDue)})`; - } else if (this.milestoneStart) { + } + if (this.milestoneStart) { return `(${dateInWords(this.milestoneStart)})`; } return ''; diff --git a/app/assets/javascripts/issues/list/components/issue_card_time_info.vue b/app/assets/javascripts/issues/list/components/issue_card_time_info.vue index 06c2e29a90485f0ab924dc4139ae50e5e7dd08ec..22c0984ebdb91b871bd205cadd462258ae782f94 100644 --- a/app/assets/javascripts/issues/list/components/issue_card_time_info.vue +++ b/app/assets/javascripts/issues/list/components/issue_card_time_info.vue @@ -66,11 +66,14 @@ export default { if (dueDate && isInPast(due)) { return __('Past due'); - } else if (dueDate && isToday(due)) { + } + if (dueDate && isToday(due)) { return __('Today'); - } else if (startDate && isInFuture(start)) { + } + if (startDate && isInFuture(start)) { return __('Upcoming'); - } else if (dueDate) { + } + if (dueDate) { return getTimeRemainingInWords(due); } return ''; diff --git a/app/assets/javascripts/issues/service_desk/components/empty_state_with_any_issues.vue b/app/assets/javascripts/issues/service_desk/components/empty_state_with_any_issues.vue index a15c8ee2e9f64743a16ad979c086f76e497badd7..ab9e70ae2237d295890f54719ffcfeeac7e2d196 100644 --- a/app/assets/javascripts/issues/service_desk/components/empty_state_with_any_issues.vue +++ b/app/assets/javascripts/issues/service_desk/components/empty_state_with_any_issues.vue @@ -38,7 +38,8 @@ export default { description: noSearchResultsDescription, svgHeight: 150, }; - } else if (this.isOpenTab) { + } + if (this.isOpenTab) { return { title: noOpenIssuesTitle, description: infoBannerUserNote }; } diff --git a/app/assets/javascripts/jobs/components/job/sidebar/stages_dropdown.vue b/app/assets/javascripts/jobs/components/job/sidebar/stages_dropdown.vue index 220b13277d25c89b428c06686dceb797e40e85e5..3fee14272565deea1e0946bb8a16d66a650c5060 100644 --- a/app/assets/javascripts/jobs/components/job/sidebar/stages_dropdown.vue +++ b/app/assets/javascripts/jobs/components/job/sidebar/stages_dropdown.vue @@ -52,9 +52,11 @@ export default { pipelineInfo() { if (!this.hasRef) { return s__('Job|%{boldStart}Pipeline%{boldEnd} %{id}'); - } else if (!this.isTriggeredByMergeRequest) { + } + if (!this.isTriggeredByMergeRequest) { return s__('Job|%{boldStart}Pipeline%{boldEnd} %{id} for %{ref}'); - } else if (!this.isMergeRequestPipeline) { + } + if (!this.isMergeRequestPipeline) { return s__('Job|%{boldStart}Pipeline%{boldEnd} %{id} for %{mrId} with %{source}'); } @@ -78,7 +80,8 @@ export default { if (!this.hasRef) { return; - } else if (!this.isTriggeredByMergeRequest) { + } + if (!this.isTriggeredByMergeRequest) { button = this.$refs['copy-source-ref-link']; } else { button = this.$refs['copy-source-branch-link']; diff --git a/app/assets/javascripts/jobs/components/job/stuck_block.vue b/app/assets/javascripts/jobs/components/job/stuck_block.vue index 1a678ce69a8bf5ff0541bcb54c51e433edfe9331..8c73f09daea4dbbad282ffbba61a2d9edf429fd8 100644 --- a/app/assets/javascripts/jobs/components/job/stuck_block.vue +++ b/app/assets/javascripts/jobs/components/job/stuck_block.vue @@ -43,7 +43,8 @@ export default { dataTestId: 'job-stuck-with-tags', showTags: true, }; - } else if (this.hasOfflineRunnersForProject) { + } + if (this.hasOfflineRunnersForProject) { return { text: s__(`Job|This job is stuck because the project doesn't have any runners online assigned to it.`), diff --git a/app/assets/javascripts/labels/labels_select.js b/app/assets/javascripts/labels/labels_select.js index 587cc82f0fa393a44ca4eca7932864e385563229..db1dbc7262485104320242059a9232cec8c8c83b 100644 --- a/app/assets/javascripts/labels/labels_select.js +++ b/app/assets/javascripts/labels/labels_select.js @@ -276,7 +276,8 @@ export default class LabelsSelect { if (selected && selected.id === 0) { this.selected = []; return __('No label'); - } else if (isSelected) { + } + if (isSelected) { this.selected.push(title); } else if (!isSelected && title) { const index = this.selected.indexOf(title); @@ -285,7 +286,8 @@ export default class LabelsSelect { if (selectedLabels.length === 1) { return selectedLabels; - } else if (selectedLabels.length) { + } + if (selectedLabels.length) { return sprintf(__('%{firstLabel} +%{labelCount} more'), { firstLabel: selectedLabels[0], labelCount: selectedLabels.length - 1, diff --git a/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js b/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js index d52672b9d0806c28281105c1b66a3d88ad19049a..4e0d19f2c2ad8954a1dc303f5d4509664627cd72 100644 --- a/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js +++ b/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js @@ -133,7 +133,8 @@ export const dayInQuarter = (date, quarter) => { return quarter.reduce((acc, month) => { if (dateValues.month > month.getMonth()) { return acc + totalDaysInMonth(month); - } else if (dateValues.month === month.getMonth()) { + } + if (dateValues.month === month.getMonth()) { return acc + dateValues.date; } return acc + 0; @@ -562,9 +563,11 @@ export const approximateDuration = (seconds = 0) => { if (seconds < 30) { return __('less than a minute'); - } else if (seconds < MINUTES_LIMIT) { + } + if (seconds < MINUTES_LIMIT) { return n__('1 minute', '%d minutes', seconds < ONE_MINUTE_LIMIT ? 1 : minutes); - } else if (seconds < HOURS_LIMIT) { + } + if (seconds < HOURS_LIMIT) { return n__('about 1 hour', 'about %d hours', seconds < ONE_HOUR_LIMIT ? 1 : hours); } return n__('1 day', '%d days', seconds < ONE_DAY_LIMIT ? 1 : days); diff --git a/app/assets/javascripts/lib/utils/datetime/date_format_utility.js b/app/assets/javascripts/lib/utils/datetime/date_format_utility.js index b0264796d90ca29762dfc2258c6f2add639cc296..c4b8f95e99fe7b8f3168c673c389ae14e57313f0 100644 --- a/app/assets/javascripts/lib/utils/datetime/date_format_utility.js +++ b/app/assets/javascripts/lib/utils/datetime/date_format_utility.js @@ -93,10 +93,12 @@ export const humanizeTimeInterval = (intervalInSeconds) => { if (intervalInSeconds < 60 /* = 1 minute */) { const seconds = Math.round(intervalInSeconds * 10) / 10; return n__('%d second', '%d seconds', seconds); - } else if (intervalInSeconds < 3600 /* = 1 hour */) { + } + if (intervalInSeconds < 3600 /* = 1 hour */) { const minutes = Math.round(intervalInSeconds / 6) / 10; return n__('%d minute', '%d minutes', minutes); - } else if (intervalInSeconds < 86400 /* = 1 day */) { + } + if (intervalInSeconds < 86400 /* = 1 day */) { const hours = Math.round(intervalInSeconds / 360) / 10; return n__('%d hour', '%d hours', hours); } @@ -378,19 +380,24 @@ export const formatTimeAsSummary = ({ seconds, hours, days, minutes, weeks, mont return sprintf(s__('ValueStreamAnalytics|%{value}M'), { value: roundToNearestHalf(months), }); - } else if (weeks) { + } + if (weeks) { return sprintf(s__('ValueStreamAnalytics|%{value}w'), { value: roundToNearestHalf(weeks), }); - } else if (days) { + } + if (days) { return sprintf(s__('ValueStreamAnalytics|%{value}d'), { value: roundToNearestHalf(days), }); - } else if (hours) { + } + if (hours) { return sprintf(s__('ValueStreamAnalytics|%{value}h'), { value: hours }); - } else if (minutes) { + } + if (minutes) { return sprintf(s__('ValueStreamAnalytics|%{value}m'), { value: minutes }); - } else if (seconds) { + } + if (seconds) { return unescape(sanitize(s__('ValueStreamAnalytics|<1m'), { ALLOWED_TAGS: [] })); } return '-'; @@ -441,11 +448,13 @@ export const humanTimeframe = (startDate, dueDate) => { startDate: startDateInWords, dueDate: dueDateInWords, }); - } else if (startDate && !dueDate) { + } + if (startDate && !dueDate) { return sprintf(__('%{startDate} – No due date'), { startDate: dateInWords(start, true, false), }); - } else if (!startDate && dueDate) { + } + if (!startDate && dueDate) { return sprintf(__('No start date – %{dueDate}'), { dueDate: dateInWords(due, true, false), }); diff --git a/app/assets/javascripts/lib/utils/grammar.js b/app/assets/javascripts/lib/utils/grammar.js index 6d6361d19b645960b786449e824e1793d1f516c1..64ba151d829bd995b6d1a360a98498e1d0fde8b5 100644 --- a/app/assets/javascripts/lib/utils/grammar.js +++ b/app/assets/javascripts/lib/utils/grammar.js @@ -19,9 +19,11 @@ import { sprintf, s__ } from '~/locale'; export const toNounSeriesText = (items, { onlyCommas = false } = {}) => { if (items.length === 0) { return ''; - } else if (items.length === 1) { + } + if (items.length === 1) { return sprintf(s__(`nounSeries|%{item}`), { item: items[0] }, false); - } else if (items.length === 2 && !onlyCommas) { + } + if (items.length === 2 && !onlyCommas) { return sprintf( s__('nounSeries|%{firstItem} and %{lastItem}'), { diff --git a/app/assets/javascripts/lib/utils/number_utils.js b/app/assets/javascripts/lib/utils/number_utils.js index 0e943cdb623d4b3dc4c10b30f9d588a7628fd6c8..d17719c0bc0c63512c393d360f82508964ac1b21 100644 --- a/app/assets/javascripts/lib/utils/number_utils.js +++ b/app/assets/javascripts/lib/utils/number_utils.js @@ -84,9 +84,11 @@ export function numberToHumanSizeSplit(size, digits = 2) { if (abs < BYTES_IN_KIB) { return [size.toString(), BYTES_FORMAT_BYTES]; - } else if (abs < BYTES_IN_KIB ** 2) { + } + if (abs < BYTES_IN_KIB ** 2) { return [bytesToKiB(size).toFixed(digits), BYTES_FORMAT_KIB]; - } else if (abs < BYTES_IN_KIB ** 3) { + } + if (abs < BYTES_IN_KIB ** 3) { return [bytesToMiB(size).toFixed(digits), BYTES_FORMAT_MIB]; } return [bytesToGiB(size).toFixed(digits), BYTES_FORMAT_GIB]; diff --git a/app/assets/javascripts/lib/utils/text_markdown.js b/app/assets/javascripts/lib/utils/text_markdown.js index e6eb74834c0d5f7f0c856c919df8bceed7004cbe..d48e0217fd89d44735d8f0992169c34fc92c1d36 100644 --- a/app/assets/javascripts/lib/utils/text_markdown.js +++ b/app/assets/javascripts/lib/utils/text_markdown.js @@ -202,7 +202,8 @@ function moveCursor({ const startPosition = textArea.selectionStart - (tag.length - tag.indexOf(select)); const endPosition = startPosition + select.length; return textArea.setSelectionRange(startPosition, endPosition); - } else if (editor) { + } + if (editor) { editor.selectWithinSelection(select, tag); return; } diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js index 31e16f7b4db4cf46b251aecdb82ea2fe18525159..ce8b304e104c35708a323cfb02ec92c4100133bc 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js +++ b/app/assets/javascripts/lib/utils/text_utility.js @@ -529,9 +529,11 @@ export const humanizeBranchValidationErrors = (invalidChars = []) => { if (chars.length && !chars.includes(' ')) { return sprintf(__("Can't contain %{chars}"), { chars: chars.join(', ') }); - } else if (chars.includes(' ') && chars.length <= 1) { + } + if (chars.includes(' ') && chars.length <= 1) { return __("Can't contain spaces"); - } else if (chars.includes(' ') && chars.length > 1) { + } + if (chars.includes(' ') && chars.length > 1) { return sprintf(__("Can't contain spaces, %{chars}"), { chars: chars.filter((c) => c !== ' ').join(', '), }); diff --git a/app/assets/javascripts/members/components/modals/remove_member_modal.vue b/app/assets/javascripts/members/components/modals/remove_member_modal.vue index c7bd152555872c999fa8ba2a82cd54d986378a30..ecc769174f479127db1abaaaffafe038c8bf8f8a 100644 --- a/app/assets/javascripts/members/components/modals/remove_member_modal.vue +++ b/app/assets/javascripts/members/components/modals/remove_member_modal.vue @@ -56,7 +56,8 @@ export default { actionText() { if (this.isAccessRequest) { return __('Deny access request'); - } else if (this.isInvite) { + } + if (this.isInvite) { return s__('Member|Revoke invite'); } diff --git a/app/assets/javascripts/members/components/table/members_table_cell.vue b/app/assets/javascripts/members/components/table/members_table_cell.vue index 407cbc55dd355f278bfa7668986ebe42d97d66a3..cac8c9fb4db060daab2dff9d1e08156770589198 100644 --- a/app/assets/javascripts/members/components/table/members_table_cell.vue +++ b/app/assets/javascripts/members/components/table/members_table_cell.vue @@ -32,9 +32,11 @@ export default { memberType() { if (this.isGroup) { return MEMBER_TYPES.group; - } else if (this.isInvite) { + } + if (this.isInvite) { return MEMBER_TYPES.invite; - } else if (this.isAccessRequest) { + } + if (this.isAccessRequest) { return MEMBER_TYPES.accessRequest; } diff --git a/app/assets/javascripts/notebook/cells/output/index.vue b/app/assets/javascripts/notebook/cells/output/index.vue index c8268b1a9ae292d44a43da9edbaf2d95ff4a5f02..a7b753b7ca88449e5b9098498b681d244ae446e1 100644 --- a/app/assets/javascripts/notebook/cells/output/index.vue +++ b/app/assets/javascripts/notebook/cells/output/index.vue @@ -33,19 +33,26 @@ export default { outputType(output) { if (output.text) { return 'text/plain'; - } else if (output.output_type === ERROR_OUTPUT_TYPE) { + } + if (output.output_type === ERROR_OUTPUT_TYPE) { return 'error'; - } else if (output.data['image/png']) { + } + if (output.data['image/png']) { return 'image/png'; - } else if (output.data['image/jpeg']) { + } + if (output.data['image/jpeg']) { return 'image/jpeg'; - } else if (output.data['text/html']) { + } + if (output.data['text/html']) { return 'text/html'; - } else if (output.data['text/latex']) { + } + if (output.data['text/latex']) { return 'text/latex'; - } else if (output.data['image/svg+xml']) { + } + if (output.data['image/svg+xml']) { return 'image/svg+xml'; - } else if (output.data[TEXT_MARKDOWN]) { + } + if (output.data[TEXT_MARKDOWN]) { return TEXT_MARKDOWN; } @@ -63,21 +70,29 @@ export default { getComponent(output) { if (output.text) { return CodeOutput; - } else if (output.output_type === ERROR_OUTPUT_TYPE) { + } + if (output.output_type === ERROR_OUTPUT_TYPE) { return ErrorOutput; - } else if (output.data['image/png']) { + } + if (output.data['image/png']) { return ImageOutput; - } else if (output.data['image/jpeg']) { + } + if (output.data['image/jpeg']) { return ImageOutput; - } else if (isDataframe(output)) { + } + if (isDataframe(output)) { return DataframeOutput; - } else if (output.data['text/html']) { + } + if (output.data['text/html']) { return HtmlOutput; - } else if (output.data['text/latex']) { + } + if (output.data['text/latex']) { return LatexOutput; - } else if (output.data['image/svg+xml']) { + } + if (output.data['image/svg+xml']) { return HtmlOutput; - } else if (output.data[TEXT_MARKDOWN]) { + } + if (output.data[TEXT_MARKDOWN]) { return MarkdownOutput; } diff --git a/app/assets/javascripts/notes/components/discussion_filter.vue b/app/assets/javascripts/notes/components/discussion_filter.vue index 7266cdb64053c49c3c695ea81e1019efe1ddf877..90f7a6862f0562fe371eb0c8fdd4480f8425951c 100644 --- a/app/assets/javascripts/notes/components/discussion_filter.vue +++ b/app/assets/javascripts/notes/components/discussion_filter.vue @@ -137,7 +137,8 @@ export default { filterType(value) { if (value === 0) { return DISCUSSION_FILTER_TYPES.ALL; - } else if (value === 1) { + } + if (value === 1) { return DISCUSSION_FILTER_TYPES.COMMENTS; } return DISCUSSION_FILTER_TYPES.HISTORY; diff --git a/app/assets/javascripts/notes/components/mr_discussion_filter.vue b/app/assets/javascripts/notes/components/mr_discussion_filter.vue index 08d3670ae6ad448c0ca19b6832a7ee5c44bdbbf4..c2ac95ca56eb742ec8ed24a7ff6de62538c1f744 100644 --- a/app/assets/javascripts/notes/components/mr_discussion_filter.vue +++ b/app/assets/javascripts/notes/components/mr_discussion_filter.vue @@ -36,7 +36,8 @@ export default { if (length === MR_FILTER_OPTIONS.length) { return __('All activity'); - } else if (length > 1) { + } + if (length > 1) { return `%{strongStart}${firstSelected.text}%{strongEnd} +${length - 1} more`; } diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index 6c4e5f3227f369b7476de6cf01460dc8ead233a8..363383fd7adb175734724351690e2f2a87d6bab6 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -160,12 +160,14 @@ export default { filePath: this.diffFile.file_path, refs: this.diffFile.diff_refs, }; - } else if (this.note && this.note.position) { + } + if (this.note && this.note.position) { return { filePath: this.note.position.new_path, refs: this.note.position, }; - } else if (this.discussion && this.discussion.diff_file) { + } + if (this.discussion && this.discussion.diff_file) { return { filePath: this.discussion.diff_file.file_path, refs: this.discussion.diff_file.diff_refs, diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index a20bce2e53af0fc05d1752bf0d1ecb60dfb29a4c..7eb018972966c405b0bad05922e226c77ad1fb2d 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -376,7 +376,8 @@ export const resolveDiscussion = ({ state, dispatch, getters }, { discussionId } if (!discussion) { return Promise.reject(); - } else if (isResolved) { + } + if (isResolved) { return Promise.resolve(); } 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 5f6a73782c339a628c9b4ca548a411786c70f048..642fd56eab1548d0f7d18063132b066e0cb10f27 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 @@ -69,7 +69,8 @@ export default { formattedTime() { if (this.randomHour > 12) { return `${this.randomHour - 12}:00pm`; - } else if (this.randomHour === 12) { + } + if (this.randomHour === 12) { return `12:00pm`; } return `${this.randomHour}:00am`; diff --git a/app/assets/javascripts/performance_bar/components/detailed_metric.vue b/app/assets/javascripts/performance_bar/components/detailed_metric.vue index 5bef7e6e322c291a9b43de45c70e04c0b3b55a87..b53e2709f830060a18cfd5bd65e78dc901bce6cb 100644 --- a/app/assets/javascripts/performance_bar/components/detailed_metric.vue +++ b/app/assets/javascripts/performance_bar/components/detailed_metric.vue @@ -67,7 +67,8 @@ export default { metricDetailsLabel() { if (this.metricDetails.duration && this.metricDetails.calls) { return `${this.metricDetails.duration} / ${this.metricDetails.calls}`; - } else if (this.metricDetails.calls) { + } + if (this.metricDetails.calls) { return this.metricDetails.calls; } diff --git a/app/assets/javascripts/protected_branches/protected_branch_edit.js b/app/assets/javascripts/protected_branches/protected_branch_edit.js index b6c86750723e6566a0af875d3de81056d48d0f31..bbf10ef3b01ad48ae8d3f0a2cbdf229aff1d042e 100644 --- a/app/assets/javascripts/protected_branches/protected_branch_edit.js +++ b/app/assets/javascripts/protected_branches/protected_branch_edit.js @@ -164,7 +164,8 @@ export default class ProtectedBranchEdit { username: currentSelectedItem.username, avatar_url: currentSelectedItem.avatar_url, }; - } else if (currentItem.group_id) { + } + if (currentItem.group_id) { return { id: currentItem.id, group_id: currentItem.group_id, diff --git a/app/assets/javascripts/related_issues/components/add_issuable_form.vue b/app/assets/javascripts/related_issues/components/add_issuable_form.vue index b3033ddf3b658c6857655f11fb4e0b6d44379372..d36b29f69a551d4b312468146677187d0d177e25 100644 --- a/app/assets/javascripts/related_issues/components/add_issuable_form.vue +++ b/app/assets/javascripts/related_issues/components/add_issuable_form.vue @@ -115,7 +115,8 @@ export default { addRelatedErrorMessage() { if (this.itemAddFailureMessage) { return this.itemAddFailureMessage; - } else if (this.itemAddFailureType === itemAddFailureTypesMap.NOT_FOUND) { + } + if (this.itemAddFailureType === itemAddFailureTypesMap.NOT_FOUND) { return addRelatedIssueErrorMap[this.issuableType]; } // Only other failure is MAX_NUMBER_OF_CHILD_EPICS at the moment diff --git a/app/assets/javascripts/repository/components/table/row.vue b/app/assets/javascripts/repository/components/table/row.vue index 4f0907df7f2789b75368d33f390a444e9ba60830..a76d822317ac846004689a4398cde12b537085e2 100644 --- a/app/assets/javascripts/repository/components/table/row.vue +++ b/app/assets/javascripts/repository/components/table/row.vue @@ -123,7 +123,8 @@ export default { path: joinPaths('/-/blob', this.escapedRef, this.path), refType: this.refType, }); - } else if (this.isFolder) { + } + if (this.isFolder) { return buildURLwithRefType({ path: joinPaths('/-/tree', this.escapedRef, this.path), refType: this.refType, diff --git a/app/assets/javascripts/search/store/utils.js b/app/assets/javascripts/search/store/utils.js index 2f02ef3475c985f937439b4d0ffd1121fe607f33..b15f89fc6a21ce20fabc6ef326e0e5293d6b6a09 100644 --- a/app/assets/javascripts/search/store/utils.js +++ b/app/assets/javascripts/search/store/utils.js @@ -68,7 +68,8 @@ export const setFrequentItemToLS = (key, data, itemData) => { frequentItems.sort((a, b) => { if (a.frequency > b.frequency) { return -1; - } else if (a.frequency < b.frequency) { + } + if (a.frequency < b.frequency) { return 1; } return b.lastUsed - a.lastUsed; diff --git a/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue b/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue index 577c01c50ff4a7a2defa675cb85bb1daeb2f1d68..8a912b00df1fb808cb1e8a2938198c877e1ec472 100644 --- a/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue +++ b/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue @@ -84,7 +84,8 @@ export default { if (mergeLength === this.users.length) { return ''; - } else if (mergeLength > 0) { + } + if (mergeLength > 0) { return sprintf(__('%{mergeLength}/%{usersLength} can merge'), { mergeLength, usersLength: this.users.length, diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js index 03ace6286e08099857b06c5de13de919fcf788f5..3ab7757d34d5cf01daac1b554cfd53cbd6daf93e 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js @@ -19,7 +19,8 @@ export const dropdownButtonText = (state, getters) => { if (!selectedLabels.length) { return state.dropdownButtonText || __('Label'); - } else if (selectedLabels.length > 1) { + } + if (selectedLabels.length > 1) { return sprintf(s__('LabelSelect|%{firstLabelName} +%{remainingLabelCount} more'), { firstLabelName: selectedLabels[0].title, remainingLabelCount: selectedLabels.length - 1, diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue index 53582aacabdb95770ed9335a5a0d27a6a6da733c..a513c247be74cf1cc081dcb198c74d674a128267 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue @@ -101,7 +101,8 @@ export default { buttonText() { if (!this.localSelectedLabels.length) { return this.dropdownButtonText || __('Label'); - } else if (this.localSelectedLabels.length > 1) { + } + if (this.localSelectedLabels.length > 1) { return sprintf(s__('LabelSelect|%{firstLabelName} +%{remainingLabelCount} more'), { firstLabelName: this.localSelectedLabels[0].title, remainingLabelCount: this.localSelectedLabels.length - 1, diff --git a/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue b/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue index 88a74784dd2961f6021c2902c2953e74dd6974f4..415c40b47792bcd1631813259ab5d2f66f2ea764 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue @@ -52,7 +52,8 @@ export default { if (mergeLength === this.users.length) { return ''; - } else if (mergeLength > 0) { + } + if (mergeLength > 0) { return sprintf(__('%{mergeLength}/%{usersLength} can merge'), { mergeLength, usersLength: this.users.length, diff --git a/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue b/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue index 465f971717f6fe0020469a35607173e9dffc8404..ac05ae3896b2a9df27f4d0cd063ebe4abd976982 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue @@ -42,11 +42,14 @@ export default { divClass() { if (this.showComparisonState) { return 'compare'; - } else if (this.showEstimateOnlyState) { + } + if (this.showEstimateOnlyState) { return 'estimate-only'; - } else if (this.showSpentOnlyState) { + } + if (this.showSpentOnlyState) { return 'spend-only'; - } else if (this.showNoTimeTrackingState) { + } + if (this.showNoTimeTrackingState) { return 'no-tracking'; } @@ -55,9 +58,11 @@ export default { spanClass() { if (this.showComparisonState) { return ''; - } else if (this.showEstimateOnlyState || this.showSpentOnlyState) { + } + if (this.showEstimateOnlyState || this.showSpentOnlyState) { return 'bold'; - } else if (this.showNoTimeTrackingState) { + } + if (this.showNoTimeTrackingState) { return 'no-value collapse-truncated-title gl-pt-2 gl-px-3 gl-font-sm'; } @@ -66,11 +71,14 @@ export default { text() { if (this.showComparisonState) { return `${this.timeSpentHumanReadable} / ${this.timeEstimateHumanReadable}`; - } else if (this.showEstimateOnlyState) { + } + if (this.showEstimateOnlyState) { return `-- / ${this.timeEstimateHumanReadable}`; - } else if (this.showSpentOnlyState) { + } + if (this.showSpentOnlyState) { return `${this.timeSpentHumanReadable} / --`; - } else if (this.showNoTimeTrackingState) { + } + if (this.showNoTimeTrackingState) { return __('None'); } diff --git a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue index 91b23689f0d90b39349f72520d7843f7d38277d9..aff592d48e0755956cd967ee5a309a54847821ed 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue @@ -123,9 +123,11 @@ export default { // 3. issuableIid and fullPath are not provided if (!this.issuableType || !timeTrackingQueries[this.issuableType]) { return true; - } else if (this.initialTimeTracking) { + } + if (this.initialTimeTracking) { return true; - } else if (!this.issuableIid || !this.fullPath) { + } + if (!this.issuableIid || !this.fullPath) { return true; } return false; diff --git a/app/assets/javascripts/snippets/utils/blob.js b/app/assets/javascripts/snippets/utils/blob.js index a228d6111cea0051c817c3acbe756f43a76d4f6b..97f21654aaef731cbf1ff4878e5c3dd06d4b7198 100644 --- a/app/assets/javascripts/snippets/utils/blob.js +++ b/app/assets/javascripts/snippets/utils/blob.js @@ -34,7 +34,8 @@ const diff = ({ content, path }, origBlob) => { content, filePath: path, }; - } else if (origBlob.path !== path || origBlob.content !== content) { + } + if (origBlob.path !== path || origBlob.content !== content) { return { action: origBlob.path === path ? SNIPPET_BLOB_ACTION_UPDATE : SNIPPET_BLOB_ACTION_MOVE, previousPath: origBlob.path, diff --git a/app/assets/javascripts/super_sidebar/utils.js b/app/assets/javascripts/super_sidebar/utils.js index cbf93155fb6d8c5577f100ab2a24144f195fc55f..72a62ed6b71dcf39e2ce784cc11611dce4b85cf6 100644 --- a/app/assets/javascripts/super_sidebar/utils.js +++ b/app/assets/javascripts/super_sidebar/utils.js @@ -18,7 +18,8 @@ const sortItemsByFrequencyAndLastAccess = (items) => // and then by lastAccessedOn with recent most first if (itemA.frequency !== itemB.frequency) { return itemB.frequency - itemA.frequency; - } else if (itemA.lastAccessedOn !== itemB.lastAccessedOn) { + } + if (itemA.lastAccessedOn !== itemB.lastAccessedOn) { return itemB.lastAccessedOn - itemA.lastAccessedOn; } diff --git a/app/assets/javascripts/users_select/index.js b/app/assets/javascripts/users_select/index.js index 1b36f02226dacec88cfd1a738a401996623d5a81..aa68cf5a1614b16bf309a676f12168cfd2153d71 100644 --- a/app/assets/javascripts/users_select/index.js +++ b/app/assets/javascripts/users_select/index.js @@ -171,9 +171,11 @@ function UsersSelect(currentUser, els, options = {}) { if (selectedUsers.length === 0) { return s__('UsersSelect|Unassigned'); - } else if (selectedUsers.length === 1) { + } + if (selectedUsers.length === 1) { return firstUser.name; - } else if (isSelected) { + } + if (isSelected) { const otherSelected = selectedUsers.filter((s) => s !== selectedUser.id); return sprintf(s__('UsersSelect|%{name} + %{length} more'), { name: selectedUser.name, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue b/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue index 5090081d281303d84c4aad5c917330e844624609..3b62345b969939b6cbcbd9295af5d4dea8afaa38 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue @@ -70,7 +70,8 @@ export default { message() { if (this.state === STATUS_CLOSED) { return s__('mrWidgetCommitsAdded|The changes were not merged into %{targetBranch}.'); - } else if (this.isMerged) { + } + if (this.isMerged) { return s__( 'mrWidgetCommitsAdded|Changes merged into %{targetBranch} with %{mergeCommitSha}%{squashedCommits}.', ); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue index 95fa01c23f14a5373c5b1e93cd8c84ef732139cb..4ed470440cc4b4d53dec743f47b5f32afa15e393 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue @@ -131,7 +131,8 @@ export default { variant: 'confirm', action: () => this.approve(), }; - } else if (this.showUnapprove) { + } + if (this.showUnapprove) { return { text: s__('mrWidget|Revoke approval'), variant: 'default', 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 c7d34d45f06f62fa44ef0d62fdbf7386927eb1b1..efe71ed569ab3d47da22a1b2ee84f2246b115b84 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 @@ -58,7 +58,8 @@ export default { return s__( 'mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage %{emphasisStart} increased %{emphasisEnd} from %{memoryFrom}MB to %{memoryTo}MB', ); - } else if (memoryTo < memoryFrom) { + } + if (memoryTo < memoryFrom) { return s__( 'mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage %{emphasisStart} decreased %{emphasisEnd} from %{memoryFrom}MB to %{memoryTo}MB', ); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/utils.js b/app/assets/javascripts/vue_merge_request_widget/components/extensions/utils.js index 757178ee336c1458583a441c8668b5b4b56e9b93..83f5c1490e265b88b95ecf11822302c69336265b 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/utils.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/utils.js @@ -65,11 +65,8 @@ const createText = (text) => { export const generateText = (text) => { if (typeof text === 'string') { return createText(escapeText(text)); - } else if ( - typeof text === 'object' && - typeof text.text === 'string' && - typeof text.href === 'string' - ) { + } + if (typeof text === 'object' && typeof text.text === 'string' && typeof text.href === 'string') { return createText( `${ text.prependText ? `${escapeText(text.prependText)} ` : '' diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue index 400759aa0869d25cdc2e68e424883571713977c1..4f39bd1d972e8dcd2733c4a0bbb8d1c64da6b0bf 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue @@ -38,7 +38,7 @@ export default { }, modifyLinkMessage() { if (this.isFastForwardEnabled) return __('Modify commit message'); - else if (this.isSquashEnabled) return __('Modify commit messages'); + if (this.isSquashEnabled) return __('Modify commit messages'); return __('Modify merge commit'); }, ariaLabel() { diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/merge_checks_failed.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/merge_checks_failed.vue index 61eec503951e024a1deacb7027f191df7e17696c..bf2c5e521843df31d83aba4475a295e0755c3fd3 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/merge_checks_failed.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/merge_checks_failed.vue @@ -30,9 +30,11 @@ export default { failedText() { if (this.mr.approvals && !this.mr.isApproved) { return this.$options.i18n.approvalNeeded; - } else if (this.mr.detailedMergeStatus === DETAILED_MERGE_STATUS.BLOCKED_STATUS) { + } + if (this.mr.detailedMergeStatus === DETAILED_MERGE_STATUS.BLOCKED_STATUS) { return this.$options.i18n.blockingMergeRequests; - } else if (this.mr.detailedMergeStatus === DETAILED_MERGE_STATUS.EXTERNAL_STATUS_CHECKS) { + } + if (this.mr.detailedMergeStatus === DETAILED_MERGE_STATUS.EXTERNAL_STATUS_CHECKS) { return this.$options.i18n.externalStatusChecksFailed; } diff --git a/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.js b/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.js index 713c9e610b348a6b96a0834015450d4b0b46928b..3af984dcf6cc44db5fced5ab7cfa35b00441b6f1 100644 --- a/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.js +++ b/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.js @@ -23,14 +23,17 @@ export default { const { newErrors, resolvedErrors, parsingInProgress } = data; if (parsingInProgress) { return i18n.loading; - } else if (newErrors.length >= 1 && resolvedErrors.length >= 1) { + } + if (newErrors.length >= 1 && resolvedErrors.length >= 1) { return i18n.improvementAndDegradationCopy( i18n.findings(resolvedErrors, codeQualityPrefixes.fixed), i18n.findings(newErrors, codeQualityPrefixes.new), ); - } else if (resolvedErrors.length >= 1) { + } + if (resolvedErrors.length >= 1) { return i18n.singularCopy(i18n.findings(resolvedErrors, codeQualityPrefixes.fixed)); - } else if (newErrors.length >= 1) { + } + if (newErrors.length >= 1) { return i18n.singularCopy(i18n.findings(newErrors, codeQualityPrefixes.new)); } return i18n.noChanges; @@ -38,7 +41,8 @@ export default { statusIcon() { if (this.collapsedData.newErrors.length >= 1) { return EXTENSION_ICONS.warning; - } else if (this.collapsedData.resolvedErrors.length >= 1) { + } + if (this.collapsedData.resolvedErrors.length >= 1) { return EXTENSION_ICONS.success; } return EXTENSION_ICONS.neutral; diff --git a/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.vue b/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.vue index d30acf246847338b69c7d017e2730d6287e95836..cd3a98effa3267b1fbc101b383543c4f92fdd82a 100644 --- a/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.vue +++ b/app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.vue @@ -36,9 +36,11 @@ export default { if (!this.pollingFinished) { return { title: i18n.loading }; - } else if (this.hasError) { + } + if (this.hasError) { return { title: i18n.error }; - } else if ( + } + if ( this.collapsedData?.new_errors?.length >= 1 && this.collapsedData?.resolved_errors?.length >= 1 ) { @@ -48,11 +50,13 @@ export default { i18n.findings(new_errors, codeQualityPrefixes.new), ), }; - } else if (this.collapsedData?.resolved_errors?.length >= 1) { + } + if (this.collapsedData?.resolved_errors?.length >= 1) { return { title: i18n.singularCopy(i18n.findings(resolved_errors, codeQualityPrefixes.fixed)), }; - } else if (this.collapsedData?.new_errors?.length >= 1) { + } + if (this.collapsedData?.new_errors?.length >= 1) { return { title: i18n.singularCopy(i18n.findings(new_errors, codeQualityPrefixes.new)) }; } return { title: i18n.noChanges }; @@ -95,7 +99,8 @@ export default { statusIcon() { if (this.collapsedData?.new_errors?.length >= 1) { return EXTENSION_ICONS.warning; - } else if (this.collapsedData?.resolved_errors?.length >= 1) { + } + if (this.collapsedData?.resolved_errors?.length >= 1) { return EXTENSION_ICONS.success; } return EXTENSION_ICONS.neutral; diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js b/app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js index f90056a8e1aefe135c18834edf00b63cbc43eb4b..d6bab074f3f7730572b375580d5dc81130adbe9e 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js @@ -4,31 +4,44 @@ import { stateKey } from './state_maps'; export default function deviseState() { if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.PREPARING) { return stateKey.preparing; - } else if (!this.commitsCount) { + } + if (!this.commitsCount) { return stateKey.nothingToMerge; - } else if (this.projectArchived) { + } + if (this.projectArchived) { return stateKey.archived; - } else if (this.branchMissing) { + } + if (this.branchMissing) { return stateKey.missingBranch; - } else if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.CHECKING) { + } + if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.CHECKING) { return stateKey.checking; - } else if (this.hasConflicts) { + } + if (this.hasConflicts) { return stateKey.conflicts; - } else if (this.shouldBeRebased) { + } + if (this.shouldBeRebased) { return stateKey.rebase; - } else if (this.hasMergeChecksFailed && !this.autoMergeEnabled) { + } + if (this.hasMergeChecksFailed && !this.autoMergeEnabled) { return stateKey.mergeChecksFailed; - } else if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.CI_MUST_PASS) { + } + if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.CI_MUST_PASS) { return stateKey.pipelineFailed; - } else if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.DRAFT_STATUS) { + } + if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.DRAFT_STATUS) { return stateKey.draft; - } else if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.DISCUSSIONS_NOT_RESOLVED) { + } + if (this.detailedMergeStatus === DETAILED_MERGE_STATUS.DISCUSSIONS_NOT_RESOLVED) { return stateKey.unresolvedDiscussions; - } else if (this.canMerge && this.isSHAMismatch) { + } + if (this.canMerge && this.isSHAMismatch) { return stateKey.shaMismatch; - } else if (this.autoMergeEnabled && !this.mergeError) { + } + if (this.autoMergeEnabled && !this.mergeError) { return stateKey.autoMergeEnabled; - } else if ( + } + if ( this.detailedMergeStatus === DETAILED_MERGE_STATUS.MERGEABLE || this.detailedMergeStatus === DETAILED_MERGE_STATUS.CI_STILL_RUNNING ) { diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js index a74b7ed858778d660110793af53fef76afab6f0f..bb74f82145fbe848ed421699eacc401371f31cc9 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js @@ -351,11 +351,14 @@ export default class MergeRequestStore { if (availableAutoMergeStrategies.includes(MTWPS_MERGE_STRATEGY)) { return MTWPS_MERGE_STRATEGY; - } else if (availableAutoMergeStrategies.includes(MT_MERGE_STRATEGY)) { + } + if (availableAutoMergeStrategies.includes(MT_MERGE_STRATEGY)) { return MT_MERGE_STRATEGY; - } else if (availableAutoMergeStrategies.includes(MWCP_MERGE_STRATEGY)) { + } + if (availableAutoMergeStrategies.includes(MWCP_MERGE_STRATEGY)) { return MWCP_MERGE_STRATEGY; - } else if (availableAutoMergeStrategies.includes(MWPS_MERGE_STRATEGY)) { + } + if (availableAutoMergeStrategies.includes(MWPS_MERGE_STRATEGY)) { return MWPS_MERGE_STRATEGY; } diff --git a/app/assets/javascripts/vue_shared/components/changed_file_icon.vue b/app/assets/javascripts/vue_shared/components/changed_file_icon.vue index 14e99977a859504c9198633987e7ad1f30bd4a6d..2a47e96b2e22bad66fab35d2c976cae164b2ee50 100644 --- a/app/assets/javascripts/vue_shared/components/changed_file_icon.vue +++ b/app/assets/javascripts/vue_shared/components/changed_file_icon.vue @@ -50,11 +50,14 @@ export default { tooltipTitle() { if (!this.showTooltip) { return undefined; - } else if (this.file.deleted) { + } + if (this.file.deleted) { return __('Deleted'); - } else if (this.file.tempFile) { + } + if (this.file.tempFile) { return __('Added'); - } else if (this.file.changed) { + } + if (this.file.changed) { return __('Modified'); } diff --git a/app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue b/app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue index 7080e046b3075e24c1a0c009e5eb47f98ece753f..535f1c5f6455e0a72e16cde5ea24db71677259d9 100644 --- a/app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue @@ -65,7 +65,8 @@ export default { viewer() { if (this.diffViewerMode === diffViewerModes.renamed) { return RenamedFile; - } else if (this.diffMode === diffModes.mode_changed) { + } + if (this.diffMode === diffModes.mode_changed) { return ModeChanged; } diff --git a/app/assets/javascripts/vue_shared/components/file_finder/index.vue b/app/assets/javascripts/vue_shared/components/file_finder/index.vue index db0b0ea185b30932accf493c944801b9ab935371..226f44a1541e654862978d4430fd5529a3b03d82 100644 --- a/app/assets/javascripts/vue_shared/components/file_finder/index.vue +++ b/app/assets/javascripts/vue_shared/components/file_finder/index.vue @@ -145,7 +145,8 @@ export default { el.classList.contains('inputarea') ) { return true; - } else if (combo === 'mod+p') { + } + if (combo === 'mod+p') { return false; } diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue b/app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue index 007aae3f5a0fd9b2172b01cd6f9b2db7abd6ec9e..797a38d81719b3966d121d9176bc5db9d224d6fb 100644 --- a/app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue @@ -74,7 +74,8 @@ export default { if (this.blob.name && this.blob.name.endsWith(`.${SVELTE_LANGUAGE}`)) { // override for svelte files until https://github.com/rouge-ruby/rouge/issues/1717 is resolved return SVELTE_LANGUAGE; - } else if (this.isCodeownersFile) { + } + if (this.isCodeownersFile) { // override for codeowners files return this.$options.codeownersLanguage; } diff --git a/app/assets/javascripts/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue b/app/assets/javascripts/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue index bda88a48e48bdb9c5a1993047d7fd95684c32ded..9ba5e8724f963d477b8cf1f0f21592c1968b296f 100644 --- a/app/assets/javascripts/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue +++ b/app/assets/javascripts/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue @@ -70,7 +70,8 @@ export default { selectTarget() { if (isFunction(this.truncateTarget)) { return this.truncateTarget(this.$el); - } else if (this.truncateTarget === 'child') { + } + if (this.truncateTarget === 'child') { return this.$el.childNodes[0]; } return this.$el; diff --git a/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue b/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue index 446c8c97df092e3e6a382f70fbc310ed42ed8938..30f616dd8e15c3223b90ffccdbf5ba838b56a14a 100644 --- a/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue +++ b/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue @@ -83,9 +83,11 @@ export default { if (this.user.status.emoji && this.user.status.message_html) { return `${glEmojiTag(this.user.status.emoji)} ${this.user.status.message_html}`; - } else if (this.user.status.message_html) { + } + if (this.user.status.message_html) { return this.user.status.message_html; - } else if (this.user.status.emoji) { + } + if (this.user.status.emoji) { return glEmojiTag(this.user.status.emoji); } diff --git a/app/assets/javascripts/vue_shared/components/web_ide_link.vue b/app/assets/javascripts/vue_shared/components/web_ide_link.vue index 79d14b5f2d00de2fe4e51d5e7fd3282552eb7059..beb8321a27124b743d19ae86679c0b72ab8f2fac 100644 --- a/app/assets/javascripts/vue_shared/components/web_ide_link.vue +++ b/app/assets/javascripts/vue_shared/components/web_ide_link.vue @@ -195,9 +195,11 @@ export default { webIdeActionText() { if (this.webIdeText) { return this.webIdeText; - } else if (this.isBlob) { + } + if (this.isBlob) { return __('Open in Web IDE'); - } else if (this.isFork) { + } + if (this.isFork) { return __('Edit fork in Web IDE'); } diff --git a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue index ec3078cd5a9963f2442b580bd87b52761a9f3c19..324228111d42293cfd907c8a9aafb3c6e9609603 100644 --- a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue +++ b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue @@ -138,7 +138,8 @@ export default { return sprintf(__('closed %{timeago}'), { timeago: this.timeFormatted(this.issuable.closedAt), }); - } else if (this.issuable.updatedAt !== this.issuable.createdAt) { + } + if (this.issuable.updatedAt !== this.issuable.createdAt) { return sprintf(__('updated %{timeAgo}'), { timeAgo: this.timeFormatted(this.issuable.updatedAt), }); diff --git a/app/assets/javascripts/vuex_shared/bindings.js b/app/assets/javascripts/vuex_shared/bindings.js index bc3741a388097964fd78c4dac5ed3e99e0d77895..07b16a13e6884b761bd9c6194cd11b7815d8cd67 100644 --- a/app/assets/javascripts/vuex_shared/bindings.js +++ b/app/assets/javascripts/vuex_shared/bindings.js @@ -20,7 +20,8 @@ export const mapComputed = (list, defaultUpdateFn, root) => { get() { if (getter) { return this.$store.getters[getter]; - } else if (root) { + } + if (root) { if (typeof root === 'function') { return root(this.$store.state)[key]; } diff --git a/app/assets/javascripts/work_items/components/shared/work_item_link_child_metadata.vue b/app/assets/javascripts/work_items/components/shared/work_item_link_child_metadata.vue index ddeac2b92aeccaad531185f87fe7b6001c1b0ac7..38d8d239a7e676e9903d86b20e6fd30d1920d974 100644 --- a/app/assets/javascripts/work_items/components/shared/work_item_link_child_metadata.vue +++ b/app/assets/javascripts/work_items/components/shared/work_item_link_child_metadata.vue @@ -42,7 +42,8 @@ export default { assigneesContainerClass() { if (this.assignees.length === 2) { return 'fixed-width-avatars-2'; - } else if (this.assignees.length > 2) { + } + if (this.assignees.length > 2) { return 'fixed-width-avatars-3'; } return ''; diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue index a58752a861a4124c54ab92ff8b3bff19914aba15..55440e1603c39c7ea9d265ad065acfd0db47291f 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue @@ -151,7 +151,8 @@ export default { addOrCreateButtonLabel() { if (this.isCreateForm) { return sprintfWorkItem(I18N_WORK_ITEM_CREATE_BUTTON_LABEL, this.childrenTypeName); - } else if (this.workItemsToAdd.length > 1) { + } + if (this.workItemsToAdd.length > 1) { return sprintfWorkItem(I18N_WORK_ITEM_ADD_MULTIPLE_BUTTON_LABEL, this.childrenTypeName); } return sprintfWorkItem(I18N_WORK_ITEM_ADD_BUTTON_LABEL, this.childrenTypeName); diff --git a/app/assets/javascripts/work_items_hierarchy/hierarchy_util.js b/app/assets/javascripts/work_items_hierarchy/hierarchy_util.js index 61d93acdb91ee227c80acd0ea2b573bcda656285..57f4783955cb36b4398ba01cd76e8837b5bbad96 100644 --- a/app/assets/javascripts/work_items_hierarchy/hierarchy_util.js +++ b/app/assets/javascripts/work_items_hierarchy/hierarchy_util.js @@ -3,7 +3,8 @@ import { LICENSE_PLAN } from './constants'; export function inferLicensePlan({ hasSubEpics, hasEpics }) { if (hasSubEpics) { return LICENSE_PLAN.ULTIMATE; - } else if (hasEpics) { + } + if (hasEpics) { return LICENSE_PLAN.PREMIUM; } return LICENSE_PLAN.FREE; diff --git a/ee/app/assets/javascripts/analytics/code_review_analytics/components/merge_request_table.vue b/ee/app/assets/javascripts/analytics/code_review_analytics/components/merge_request_table.vue index 3c993298a69f0771670ba794387f45fa24a96e5a..84f01a49146e0e3712df1cc8acce03e1ade72f7d 100644 --- a/ee/app/assets/javascripts/analytics/code_review_analytics/components/merge_request_table.vue +++ b/ee/app/assets/javascripts/analytics/code_review_analytics/components/merge_request_table.vue @@ -43,7 +43,8 @@ export default { if (hours >= 24) { const days = Math.floor(hours / 24); return n__('1 day', '%d days', days); - } else if (hours >= 1 && hours < 24) { + } + if (hours >= 1 && hours < 24) { return n__('1 hour', '%d hours', hours); } diff --git a/ee/app/assets/javascripts/analytics/dashboards/utils.js b/ee/app/assets/javascripts/analytics/dashboards/utils.js index 571a663b5a55dc0f2ea5e76ea04668fb45a59a5d..94553e8a75402a4d56877e16d221c893605fb07b 100644 --- a/ee/app/assets/javascripts/analytics/dashboards/utils.js +++ b/ee/app/assets/javascripts/analytics/dashboards/utils.js @@ -47,11 +47,14 @@ export const fractionDigits = (value) => { const absVal = Math.abs(value); if (absVal === 0) { return 1; - } else if (absVal < 0.01) { + } + if (absVal < 0.01) { return 4; - } else if (absVal < 0.1) { + } + if (absVal < 0.1) { return 3; - } else if (absVal < 1) { + } + if (absVal < 1) { return 2; } diff --git a/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_overview_table.vue b/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_overview_table.vue index a1d1c2b4187c4939828954b1091d65b747cea7c3..cb4db46f068197e345f6684126a408118923023f 100644 --- a/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_overview_table.vue +++ b/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_overview_table.vue @@ -31,7 +31,8 @@ const thClass = ['gl-bg-white!', 'gl-text-gray-400']; const formatter = (value, key, item) => { if (key === OVERVIEW_TABLE_NAME_KEY) { return item.group?.namespace?.fullName; - } else if (item.adoption[key]) return item.adoption[key].adopted; + } + if (item.adoption[key]) return item.adoption[key].adopted; return 0; }; diff --git a/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_table.vue b/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_table.vue index 0788540add0833bf121f4bcd3340d48ca569e4d3..e834a7d8a5c8db052a4c1ad62b084552dc1b9b56 100644 --- a/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_table.vue +++ b/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/components/devops_adoption_table.vue @@ -30,7 +30,8 @@ const formatter = (value, key, item) => { if (item.latestSnapshot && item.latestSnapshot[key] === false) { return 1; - } else if (item.latestSnapshot && item.latestSnapshot[key]) { + } + if (item.latestSnapshot && item.latestSnapshot[key]) { return 2; } diff --git a/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/utils/helpers.js b/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/utils/helpers.js index d6ad82f3d26e428edcd64095bf987f74815c730f..c543523570b084236ccb5f63b02163b99225f452 100644 --- a/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/utils/helpers.js +++ b/ee/app/assets/javascripts/analytics/devops_reports/devops_adoption/utils/helpers.js @@ -12,7 +12,8 @@ import { GROUP_DEVOPS_PATH } from '../constants'; export const shouldPollTableData = ({ enabledNamespaces, openModal }) => { if (openModal) { return false; - } else if (!enabledNamespaces.length) { + } + if (!enabledNamespaces.length) { return true; } diff --git a/ee/app/assets/javascripts/analytics/productivity_analytics/components/metric_chart.vue b/ee/app/assets/javascripts/analytics/productivity_analytics/components/metric_chart.vue index 0cd3845654999fcbc028fa634eaeb9065664ebc3..5ba6694026fd7b9fff57c01b810bff68b859c74e 100644 --- a/ee/app/assets/javascripts/analytics/productivity_analytics/components/metric_chart.vue +++ b/ee/app/assets/javascripts/analytics/productivity_analytics/components/metric_chart.vue @@ -69,7 +69,8 @@ export default { return s__( 'MetricChart|There is too much data to calculate. Please change your selection.', ); - } else if (!this.hasChartData) { + } + if (!this.hasChartData) { return s__('MetricChart|There is no data available. Please change your selection.'); } diff --git a/ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_table.vue b/ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_table.vue index 372d78ffd337c8c8aae6f66180a26e5f205c1a5d..0788054e58bb846d788d7050ac59c8444a987636 100644 --- a/ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_table.vue +++ b/ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_table.vue @@ -129,7 +129,8 @@ export default { return [...this.selectedCoverageData].sort((a, b) => { if (a.codeCoverageSummary.lastUpdatedOn > b.codeCoverageSummary.lastUpdatedOn) { return -1; - } else if (a.codeCoverageSummary.lastUpdatedOn < b.codeCoverageSummary.lastUpdatedOn) { + } + if (a.codeCoverageSummary.lastUpdatedOn < b.codeCoverageSummary.lastUpdatedOn) { return 1; } return 0; diff --git a/ee/app/assets/javascripts/approvals/components/approval_settings.vue b/ee/app/assets/javascripts/approvals/components/approval_settings.vue index 9f1cb4712eef729576dc11bc7cc73c82e294d244..df08bddb817a6a710b8a52449d00b110e9138617 100644 --- a/ee/app/assets/javascripts/approvals/components/approval_settings.vue +++ b/ee/app/assets/javascripts/approvals/components/approval_settings.vue @@ -83,7 +83,8 @@ export default { whenCommitIsAddedRadioGroupValue() { if (this.removeApprovalsOnPush.value) { return this.$options.whenCommitIsAddedRadios.removeApprovalsOnPush; - } else if (this.selectiveCodeOwnerRemovals.value) { + } + if (this.selectiveCodeOwnerRemovals.value) { return this.$options.whenCommitIsAddedRadios.selectiveCodeOwnerRemovals; } diff --git a/ee/app/assets/javascripts/approvals/components/mr_edit/app.vue b/ee/app/assets/javascripts/approvals/components/mr_edit/app.vue index a37f8068f073eedf4f0d6f2584d983354225890e..630a53d6be4516c5dadee04ce24bba058554bee8 100644 --- a/ee/app/assets/javascripts/approvals/components/mr_edit/app.vue +++ b/ee/app/assets/javascripts/approvals/components/mr_edit/app.vue @@ -52,7 +52,8 @@ export default { if (this.hasOptionalRules) { return __('Approvals are optional.'); - } else if (rulesLength === 1 && firstRule.ruleType === 'any_approver') { + } + if (rulesLength === 1 && firstRule.ruleType === 'any_approver') { return sprintf( n__( '%{strong_start}%{count} member%{strong_end} must approve to merge. Anyone with role Developer or higher can approve.', @@ -66,7 +67,8 @@ export default { }, false, ); - } else if (rulesLength === 1 && firstRule.ruleType !== 'any_approver') { + } + if (rulesLength === 1 && firstRule.ruleType !== 'any_approver') { return sprintf( n__( '%{strong_start}%{count} eligible member%{strong_end} must approve to merge.', @@ -80,7 +82,8 @@ export default { }, false, ); - } else if (rulesLength > 1) { + } + if (rulesLength > 1) { return sprintf( n__( '%{strong_start}%{count} approval rule%{strong_end} requires eligible members to approve before merging.', diff --git a/ee/app/assets/javascripts/boards/components/labels_select.vue b/ee/app/assets/javascripts/boards/components/labels_select.vue index 56c1841408bf99689d2d5059b839af7e934c9d47..0b5d1d783690fe6869f294ce8bbfe66313724274 100644 --- a/ee/app/assets/javascripts/boards/components/labels_select.vue +++ b/ee/app/assets/javascripts/boards/components/labels_select.vue @@ -79,7 +79,8 @@ export default { selectText() { if (!this.selected.length) { return this.$options.i18n.selectLabel; - } else if (this.selected.length > 1) { + } + if (this.selected.length > 1) { return sprintf(s__('LabelSelect|%{firstLabelName} +%{remainingLabelCount} more'), { firstLabelName: this.selected[0].title, remainingLabelCount: this.selected.length - 1, diff --git a/ee/app/assets/javascripts/boards/components/weight_select.vue b/ee/app/assets/javascripts/boards/components/weight_select.vue index 5bd70589bf89de386360bbb2b4e4b0efa3b89042..e6ab16f7bb4c3acb365fb2e317bebcbcb1c0ed99 100644 --- a/ee/app/assets/javascripts/boards/components/weight_select.vue +++ b/ee/app/assets/javascripts/boards/components/weight_select.vue @@ -65,7 +65,8 @@ export default { weightInt(weight) { if (weight >= 0) { return weight; - } else if (weight === NO_WEIGHT) { + } + if (weight === NO_WEIGHT) { return -2; } return null; diff --git a/ee/app/assets/javascripts/codequality_report/codequality_report.vue b/ee/app/assets/javascripts/codequality_report/codequality_report.vue index aca8fdf70b3793c9ff2a838e5aba14a8204611e7..c0e0faaa26c19a1eb39fbb56620937fab5d64a2c 100644 --- a/ee/app/assets/javascripts/codequality_report/codequality_report.vue +++ b/ee/app/assets/javascripts/codequality_report/codequality_report.vue @@ -85,7 +85,8 @@ export default { if (count === 0) { return s__('ciReport|No code quality issues found'); - } else if (count > 0) { + } + if (count > 0) { return sprintf(s__('ciReport|Found %{issuesWithCount}'), { issuesWithCount: n__('%d code quality issue', '%d code quality issues', count), }); diff --git a/ee/app/assets/javascripts/environments/components/multiple_approval_rules_table.vue b/ee/app/assets/javascripts/environments/components/multiple_approval_rules_table.vue index c246feb86b47b1928e4130d9919543895fa8bec2..131276dc6c1007eebf62e2b6b84179d18014bc7b 100644 --- a/ee/app/assets/javascripts/environments/components/multiple_approval_rules_table.vue +++ b/ee/app/assets/javascripts/environments/components/multiple_approval_rules_table.vue @@ -51,7 +51,8 @@ export default { getRuleName(rule) { if (rule.group) { return { name: rule.group.name, link: rule.group.webUrl }; - } else if (rule.user) { + } + if (rule.user) { return { name: rule.user.name, link: rule.user.webUrl }; } diff --git a/ee/app/assets/javascripts/epics_list/components/epics_list_bulk_edit_sidebar.vue b/ee/app/assets/javascripts/epics_list/components/epics_list_bulk_edit_sidebar.vue index ae33c99ebaa386bfaf8c4b1fd915b60998964b58..c0df1545ee9f21a09c56a40e22fd91c1bb4e9ba4 100644 --- a/ee/app/assets/javascripts/epics_list/components/epics_list_bulk_edit_sidebar.vue +++ b/ee/app/assets/javascripts/epics_list/components/epics_list_bulk_edit_sidebar.vue @@ -69,17 +69,20 @@ export default { if (commonLabels.length === allLabels.length) { // Selected epics have same set of labels return commonLabels; - } else if (uncommonLabels.length === allLabels.length) { + } + if (uncommonLabels.length === allLabels.length) { // Selected epics have distinct set of labels return uncommonLabels; - } else if (commonLabels.length || uncommonLabels.length) { + } + if (commonLabels.length || uncommonLabels.length) { // Selected epics have only some labels in common return commonLabels.concat( xorBy(commonLabels, allLabels, 'id').map((label) => transformLabelFn(label, { indeterminate: true }), ), ); - } else if (hasEpicWithNoLabels || !commonLabels.length || !uncommonLabels.length) { + } + if (hasEpicWithNoLabels || !commonLabels.length || !uncommonLabels.length) { // Selected epics have no label in common return allLabels.map((label) => transformLabelFn(label, { indeterminate: true })); } diff --git a/ee/app/assets/javascripts/external_issues_list/components/external_issues_list_empty_state.vue b/ee/app/assets/javascripts/external_issues_list/components/external_issues_list_empty_state.vue index 89ce0bce0ad145d31ab81329dd8f0cca12883d3c..e38a8ef47c0dc8a49a921c5efe511ed3e7d747e5 100644 --- a/ee/app/assets/javascripts/external_issues_list/components/external_issues_list_empty_state.vue +++ b/ee/app/assets/javascripts/external_issues_list/components/external_issues_list_empty_state.vue @@ -36,7 +36,8 @@ export default { if (this.hasFiltersApplied) { return titleWhenFilters; - } else if (this.hasIssues) { + } + if (this.hasIssues) { return filterStateEmptyMessage[this.currentState]; } @@ -47,7 +48,8 @@ export default { if (this.hasFiltersApplied) { return descriptionWhenFilters; - } else if (!this.hasIssues) { + } + if (!this.hasIssues) { return descriptionWhenNoIssues; } diff --git a/ee/app/assets/javascripts/geo_settings/validations.js b/ee/app/assets/javascripts/geo_settings/validations.js index c41f2cbeae6f5e6364c3bf1ced57cc6ee734e0e6..18b04a750ce8e1e7df4db7506dcce28791b9f382 100644 --- a/ee/app/assets/javascripts/geo_settings/validations.js +++ b/ee/app/assets/javascripts/geo_settings/validations.js @@ -21,9 +21,11 @@ const validateIP = (data) => { export const validateTimeout = (data) => { if (!data && data !== 0) { return i18n.timeoutBlankError; - } else if (data && Number.isNaN(Number(data))) { + } + if (data && Number.isNaN(Number(data))) { return i18n.timeoutNanError; - } else if (data < 1 || data > 120) { + } + if (data < 1 || data > 120) { return i18n.timeoutLengthError; } @@ -33,9 +35,11 @@ export const validateTimeout = (data) => { export const validateAllowedIp = (data) => { if (!data) { return i18n.allowedIpBlankError; - } else if (data.length > 255) { + } + if (data.length > 255) { return i18n.allowedIpLengthError; - } else if (!validateIP(data)) { + } + if (!validateIP(data)) { return i18n.allowedIpFormatError; } diff --git a/ee/app/assets/javascripts/geo_site_form/validations.js b/ee/app/assets/javascripts/geo_site_form/validations.js index ab643f65997d4a31fbb9027de4b67cfbcec1e6ef..22d1162d62a98707df83e6bad76407386949a4e9 100644 --- a/ee/app/assets/javascripts/geo_site_form/validations.js +++ b/ee/app/assets/javascripts/geo_site_form/validations.js @@ -13,7 +13,8 @@ const i18n = { export const validateName = (data) => { if (!data) { return i18n.nameBlankError; - } else if (data.length > 255) { + } + if (data.length > 255) { return i18n.nameLengthError; } @@ -23,7 +24,8 @@ export const validateName = (data) => { export const validateUrl = (data) => { if (!data) { return i18n.urlBlankError; - } else if (!isSafeURL(data)) { + } + if (!isSafeURL(data)) { return i18n.urlFormatError; } @@ -33,7 +35,8 @@ export const validateUrl = (data) => { export const validateCapacity = ({ data, label }) => { if (!data && data !== 0) { return sprintf(i18n.capacityBlankError, { label }); - } else if (data < 1 || data > 999) { + } + if (data < 1 || data > 999) { return sprintf(i18n.capacityLengthError, { label }); } diff --git a/ee/app/assets/javascripts/geo_sites/components/app.vue b/ee/app/assets/javascripts/geo_sites/components/app.vue index 092eaa43ab2b76ee039267172337b250433381a7..f15d0b5e74058b4f0d77fa8b877be164d875f2e1 100644 --- a/ee/app/assets/javascripts/geo_sites/components/app.vue +++ b/ee/app/assets/javascripts/geo_sites/components/app.vue @@ -67,7 +67,8 @@ export default { showLearnMoreButton: true, }; // User has searched and returned nothing - } else if (this.filteredSites.length === 0) { + } + if (this.filteredSites.length === 0) { return { title: this.$options.i18n.noResultsTitle, description: this.$options.i18n.noResultsDescription, diff --git a/ee/app/assets/javascripts/linked_resources/components/utils.js b/ee/app/assets/javascripts/linked_resources/components/utils.js index 078fe9453125975c7b58ffc54ed04a35b4874288..401056b9e315a8f39477102d0fc574f9668af5a9 100644 --- a/ee/app/assets/javascripts/linked_resources/components/utils.js +++ b/ee/app/assets/javascripts/linked_resources/components/utils.js @@ -26,9 +26,11 @@ export const getLinkIcon = (type) => { export const identifyLinkType = (link) => { if (zoomRegex.test(link)) { return 'zoom'; - } else if (slackRegex.test(link)) { + } + if (slackRegex.test(link)) { return 'slack'; - } else if (pagerdutyRegex.test(link)) { + } + if (pagerdutyRegex.test(link)) { return 'pagerduty'; } return 'general'; diff --git a/ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_edit_rotation_modal.vue b/ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_edit_rotation_modal.vue index 4f26f4a2595cf49505d9270075242f4215b0437b..1c6f27295c478a16dac54e0eea7ed45e38c8fa77 100644 --- a/ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_edit_rotation_modal.vue +++ b/ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_edit_rotation_modal.vue @@ -187,9 +187,11 @@ export default { if (!startsAt || !endsAt) { // If start or end is not present, we consider the end date valid return true; - } else if (startsAt < endsAt) { + } + if (startsAt < endsAt) { return true; - } else if (startsAt === endsAt) { + } + if (startsAt === endsAt) { return this.form.startsAt.time < this.form.endsAt.time; } return false; diff --git a/ee/app/assets/javascripts/password/components/password_requirement_list.vue b/ee/app/assets/javascripts/password/components/password_requirement_list.vue index 1565912a68c329e67bb5856341f93787585709d1..d348b54a75606370b5836a2a25b44bb16894ba67 100644 --- a/ee/app/assets/javascripts/password/components/password_requirement_list.vue +++ b/ee/app/assets/javascripts/password/components/password_requirement_list.vue @@ -84,7 +84,8 @@ export default { getAriaLabel(reg) { if (this.checkValidity(reg)) { return I18N.PASSWORD_SATISFIED; - } else if (this.submitted) { + } + if (this.submitted) { return I18N.PASSWORD_NOT_SATISFIED; } return I18N.PASSWORD_TO_BE_SATISFIED; diff --git a/ee/app/assets/javascripts/protected_environments/store/edit/actions.js b/ee/app/assets/javascripts/protected_environments/store/edit/actions.js index 7ecc99d3995af3f5c4e39c8f125bbdafa8e7c001..2ec8d2ed8a93783c9b3ddbc067bc0a974af4cd99 100644 --- a/ee/app/assets/javascripts/protected_environments/store/edit/actions.js +++ b/ee/app/assets/javascripts/protected_environments/store/edit/actions.js @@ -15,7 +15,8 @@ const fetchUsersForRuleForProject = ( ) => { if (userId != null) { return getUser(userId).then(({ data }) => [data]); - } else if (groupId != null) { + } + if (groupId != null) { return getGroupMembers(groupId, groupInheritanceType?.toString() === INHERITED_GROUPS).then( ({ data }) => data, ); diff --git a/ee/app/assets/javascripts/remote_development/components/list/workspaces_table.vue b/ee/app/assets/javascripts/remote_development/components/list/workspaces_table.vue index 7149ce22bba5ff0d242ad4eed4551b998591450f..41e449ce39e49923c8d10c447b98793bd552e161 100644 --- a/ee/app/assets/javascripts/remote_development/components/list/workspaces_table.vue +++ b/ee/app/assets/javascripts/remote_development/components/list/workspaces_table.vue @@ -16,7 +16,8 @@ const sortWorkspacesByTerminatedState = (workspaceA, workspaceB) => { if (isWorkspaceATerminated === isWorkspaceBTerminated) { return 0; // Preserve default order when neither workspace is terminated, or both workspaces are terminated. - } else if (isWorkspaceATerminated) { + } + if (isWorkspaceATerminated) { return 1; // Place workspaceA after workspaceB since it is terminated. } diff --git a/ee/app/assets/javascripts/requirements/components/requirement_status_badge.vue b/ee/app/assets/javascripts/requirements/components/requirement_status_badge.vue index 7b44469c5c539b6071e9528d99023e0c22489d1c..5939138665d0aed002f2e2722b90ff36d3d66202 100644 --- a/ee/app/assets/javascripts/requirements/components/requirement_status_badge.vue +++ b/ee/app/assets/javascripts/requirements/components/requirement_status_badge.vue @@ -31,7 +31,8 @@ export default { text: __('satisfied'), tooltipTitle: __('Passed on'), }; - } else if (this.testReport.state === STATE_FAILED) { + } + if (this.testReport.state === STATE_FAILED) { return { variant: 'danger', icon: 'status-failed', diff --git a/ee/app/assets/javascripts/roadmap/components/epic_item_timeline.vue b/ee/app/assets/javascripts/roadmap/components/epic_item_timeline.vue index 1d793e8c03267c383f2a12f79db0a6b38db55ba5..10422382e31cd27758ae4168502dc265097b68db 100644 --- a/ee/app/assets/javascripts/roadmap/components/epic_item_timeline.vue +++ b/ee/app/assets/javascripts/roadmap/components/epic_item_timeline.vue @@ -67,7 +67,8 @@ export default { timelineBarWidth() { if (this.presetType === PRESET_TYPES.QUARTERS) { return this.getTimelineBarWidthForQuarters(this.epic); - } else if (this.presetType === PRESET_TYPES.MONTHS) { + } + if (this.presetType === PRESET_TYPES.MONTHS) { return this.getTimelineBarWidthForMonths(); } diff --git a/ee/app/assets/javascripts/roadmap/components/milestone_item.vue b/ee/app/assets/javascripts/roadmap/components/milestone_item.vue index 2c73ab32b8b992bc1c44ef54dcc5724016f7a741..55b0e019f805c4955b56e4f5e474e1ddaf7baffd 100644 --- a/ee/app/assets/javascripts/roadmap/components/milestone_item.vue +++ b/ee/app/assets/javascripts/roadmap/components/milestone_item.vue @@ -71,7 +71,8 @@ export default { const { subgroupMilestone, projectMilestone } = this.milestone; if (projectMilestone) { return __('Project milestone'); - } else if (subgroupMilestone) { + } + if (subgroupMilestone) { return __('Subgroup milestone'); } @@ -81,7 +82,8 @@ export default { const { subgroupMilestone, projectMilestone } = this.milestone; if (projectMilestone) { return 'project'; - } else if (subgroupMilestone) { + } + if (subgroupMilestone) { return 'subgroup'; } diff --git a/ee/app/assets/javascripts/roadmap/components/preset_months/months_header_sub_item.vue b/ee/app/assets/javascripts/roadmap/components/preset_months/months_header_sub_item.vue index 636772a26421a3f5268da19014575265e08eaa97..6882aae333b5408ff177d32c1a33c584a74d943c 100644 --- a/ee/app/assets/javascripts/roadmap/components/preset_months/months_header_sub_item.vue +++ b/ee/app/assets/javascripts/roadmap/components/preset_months/months_header_sub_item.vue @@ -53,7 +53,8 @@ export default { this.currentDate.getMonth() === subItem.getMonth() ) { return 'label-dark label-bold'; - } else if (subItem >= this.currentDate) { + } + if (subItem >= this.currentDate) { return 'label-dark'; } return ''; diff --git a/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_item.vue b/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_item.vue index 1af22e6f8d45366edb7e79fd640c21ba7ed702ab..00531472e88ae6c6577901f09a70a62b96bbd653 100644 --- a/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_item.vue +++ b/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_item.vue @@ -58,7 +58,8 @@ export default { currentDateTime <= lastDayOfCurrentWeekTime ) { return 'label-dark label-bold'; - } else if (currentDateTime < lastDayOfCurrentWeekTime) { + } + if (currentDateTime < lastDayOfCurrentWeekTime) { return 'label-dark'; } return ''; diff --git a/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_sub_item.vue b/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_sub_item.vue index e48e06a59b85ee73f9f0e310c530a5d574200cb2..e225a86eedaf16dbea64239ecfb27366ddd08a00 100644 --- a/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_sub_item.vue +++ b/ee/app/assets/javascripts/roadmap/components/preset_weeks/weeks_header_sub_item.vue @@ -47,7 +47,8 @@ export default { // Show dark color text only for current & upcoming dates if (subItem.getTime() === this.currentDate.getTime()) { return 'label-dark label-bold'; - } else if (subItem > this.currentDate) { + } + if (subItem > this.currentDate) { return 'label-dark'; } return ''; diff --git a/ee/app/assets/javascripts/roadmap/components/roadmap_daterange.vue b/ee/app/assets/javascripts/roadmap/components/roadmap_daterange.vue index 569abb227db854ab4b20b57ca34be3c9d7f8c0dc..b7c7e69980b4a55b0f161629f8e84f20a6e9ef9b 100644 --- a/ee/app/assets/javascripts/roadmap/components/roadmap_daterange.vue +++ b/ee/app/assets/javascripts/roadmap/components/roadmap_daterange.vue @@ -52,7 +52,8 @@ export default { if (this.selectedDaterange === DATE_RANGES.CURRENT_YEAR) { return [months, weeks]; - } else if (this.selectedDaterange === DATE_RANGES.THREE_YEARS) { + } + if (this.selectedDaterange === DATE_RANGES.THREE_YEARS) { return [quarters, months, weeks]; } return []; diff --git a/ee/app/assets/javascripts/roadmap/components/roadmap_timeline_section.vue b/ee/app/assets/javascripts/roadmap/components/roadmap_timeline_section.vue index 3f9da177815113445d24197ecf64ee5aab6a96e3..1d880496c80f3641d9f4f966ee797a6cb81748b7 100644 --- a/ee/app/assets/javascripts/roadmap/components/roadmap_timeline_section.vue +++ b/ee/app/assets/javascripts/roadmap/components/roadmap_timeline_section.vue @@ -38,9 +38,11 @@ export default { headerItemComponentForPreset() { if (this.presetTypeQuarters) { return 'quarters-header-item'; - } else if (this.presetTypeMonths) { + } + if (this.presetTypeMonths) { return 'months-header-item'; - } else if (this.presetTypeWeeks) { + } + if (this.presetTypeWeeks) { return 'weeks-header-item'; } return ''; diff --git a/ee/app/assets/javascripts/roadmap/mixins/common_mixin.js b/ee/app/assets/javascripts/roadmap/mixins/common_mixin.js index 3914cfa8edd54f9db98f15899866194a1c456a60..3cce99480907f66512bc3d874eb0f88bded65cbb 100644 --- a/ee/app/assets/javascripts/roadmap/mixins/common_mixin.js +++ b/ee/app/assets/javascripts/roadmap/mixins/common_mixin.js @@ -51,9 +51,11 @@ export default { hasStartDate() { if (this.presetTypeQuarters) { return this.hasStartDateForQuarter(this.timeframeItem); - } else if (this.presetTypeMonths) { + } + if (this.presetTypeMonths) { return this.hasStartDateForMonth(this.timeframeItem); - } else if (this.presetTypeWeeks) { + } + if (this.presetTypeWeeks) { return this.hasStartDateForWeek(this.timeframeItem); } return false; @@ -65,9 +67,11 @@ export default { return this.timeframe.findIndex((item) => { if (this.presetTypeQuarters) { return this.hasStartDateForQuarter(item); - } else if (this.presetTypeMonths) { + } + if (this.presetTypeMonths) { return this.hasStartDateForMonth(item); - } else if (this.presetTypeWeeks) { + } + if (this.presetTypeWeeks) { return this.hasStartDateForWeek(item); } return false; @@ -80,7 +84,8 @@ export default { return ( this.currentDate >= timeframeItem.range[0] && this.currentDate <= timeframeItem.range[2] ); - } else if (this.presetTypeMonths) { + } + if (this.presetTypeMonths) { return ( this.currentDate.getMonth() === timeframeItem.getMonth() && this.currentDate.getFullYear() === timeframeItem.getFullYear() @@ -127,11 +132,13 @@ export default { timeframeString(roadmapItem) { if (roadmapItem.startDateUndefined && roadmapItem.endDateUndefined) { return sprintf(s__('GroupRoadmap|No start and end date')); - } else if (roadmapItem.startDateUndefined) { + } + if (roadmapItem.startDateUndefined) { return sprintf(s__('GroupRoadmap|No start date – %{dateWord}'), { dateWord: dateInWords(this.endDate, true), }); - } else if (roadmapItem.endDateUndefined) { + } + if (roadmapItem.endDateUndefined) { return sprintf(s__('GroupRoadmap|%{dateWord} – No end date'), { dateWord: dateInWords(this.startDate, true), }); diff --git a/ee/app/assets/javascripts/roadmap/mixins/months_preset_mixin.js b/ee/app/assets/javascripts/roadmap/mixins/months_preset_mixin.js index 1f6e006b9df75a1411e85be766ed3677c208524e..101dcbf61ed9b5a57ec1edeb38230149b88def9e 100644 --- a/ee/app/assets/javascripts/roadmap/mixins/months_preset_mixin.js +++ b/ee/app/assets/javascripts/roadmap/mixins/months_preset_mixin.js @@ -53,7 +53,8 @@ export default { // Epic startDate is undefined AND Epic endDate is out of timeframe range // no offset is needed. return ''; - } else if (startDate === 1) { + } + if (startDate === 1) { // If Epic startDate is first day of the month // Set offset to 0. /* eslint-disable-next-line @gitlab/require-i18n-strings */ diff --git a/ee/app/assets/javascripts/roadmap/mixins/quarters_preset_mixin.js b/ee/app/assets/javascripts/roadmap/mixins/quarters_preset_mixin.js index 832cdb44d187d82b63e46eadd2d68ec357a07a4f..0bf8c1b623359ec7dfaa2139c805833149737070 100644 --- a/ee/app/assets/javascripts/roadmap/mixins/quarters_preset_mixin.js +++ b/ee/app/assets/javascripts/roadmap/mixins/quarters_preset_mixin.js @@ -54,7 +54,8 @@ export default { (roadmapItem.startDateUndefined && roadmapItem.endDateOutOfRange) ) { return ''; - } else if (startDay === 1) { + } + if (startDay === 1) { /* eslint-disable-next-line @gitlab/require-i18n-strings */ return 'left: 0;'; } diff --git a/ee/app/assets/javascripts/roadmap/mixins/weeks_preset_mixin.js b/ee/app/assets/javascripts/roadmap/mixins/weeks_preset_mixin.js index ab1195ba78d5b4a28530d1539eac2aef5cca2ab1..973773f676fb578fd02e0b63aa2358d6d17cf384 100644 --- a/ee/app/assets/javascripts/roadmap/mixins/weeks_preset_mixin.js +++ b/ee/app/assets/javascripts/roadmap/mixins/weeks_preset_mixin.js @@ -66,7 +66,8 @@ export default { (roadmapItem.startDateUndefined && roadmapItem.endDateOutOfRange) ) { return ''; - } else if (startDate === firstDayOfWeek) { + } + if (startDate === firstDayOfWeek) { /* eslint-disable-next-line @gitlab/require-i18n-strings */ return 'left: 0;'; } diff --git a/ee/app/assets/javascripts/roadmap/utils/roadmap_item_utils.js b/ee/app/assets/javascripts/roadmap/utils/roadmap_item_utils.js index 115a1b25fa7ddbc7f2c90c7bb35534360d2df008..21c2bc4314c887a88d994d7d0a144237692cc487 100644 --- a/ee/app/assets/javascripts/roadmap/utils/roadmap_item_utils.js +++ b/ee/app/assets/javascripts/roadmap/utils/roadmap_item_utils.js @@ -141,7 +141,8 @@ export const timeframeStartDate = (presetType, timeframe) => { export const timeframeEndDate = (presetType, timeframe) => { if (presetType === PRESET_TYPES.QUARTERS) { return timeframe[lastTimeframeIndex(timeframe)].range[2]; - } else if (presetType === PRESET_TYPES.MONTHS) { + } + if (presetType === PRESET_TYPES.MONTHS) { return timeframe[lastTimeframeIndex(timeframe)]; } const endDate = newDate(timeframe[lastTimeframeIndex(timeframe)]); diff --git a/ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js b/ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js index 88b41236a497d98c43b7364be5cf987de0930a63..77e6d04aaabf1d4ace39ec9c4564391b901c9e03 100644 --- a/ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js +++ b/ee/app/assets/javascripts/roadmap/utils/roadmap_utils.js @@ -236,7 +236,8 @@ export const sortEpics = (epics, sortedBy) => { // Sort in ascending or descending order if (aDate < bDate) { return sortOrderAsc ? -1 : 1; - } else if (aDate > bDate) { + } + if (aDate > bDate) { return sortOrderAsc ? 1 : -1; } return 0; diff --git a/ee/app/assets/javascripts/security_dashboard/utils/project_manager_utils.js b/ee/app/assets/javascripts/security_dashboard/utils/project_manager_utils.js index 7aa09b7a13d6cc3489ccd9809db83e85c4e46958..b9bda8c85e95e314208df17526eca35741b23b4a 100644 --- a/ee/app/assets/javascripts/security_dashboard/utils/project_manager_utils.js +++ b/ee/app/assets/javascripts/security_dashboard/utils/project_manager_utils.js @@ -20,7 +20,8 @@ export const createInvalidProjectMessage = (invalidProjects) => { s__('SecurityReports|%{firstProject}, %{secondProject}, and %{rest}'), translationValues, ); - } else if (secondProject) { + } + if (secondProject) { return sprintf(s__('SecurityReports|%{firstProject} and %{secondProject}'), translationValues); } return firstProject; diff --git a/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/policy_approvals.vue b/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/policy_approvals.vue index 1e0e61ca4b3d0c3038144c14805d0118af0bbe94..8c16287fbff0b13f1aaf8f51ba59ffd069a88e01 100644 --- a/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/policy_approvals.vue +++ b/ee/app/assets/javascripts/security_orchestration/components/policy_drawer/scan_result/policy_approvals.vue @@ -64,7 +64,8 @@ export default { return sprintf(this.$options.i18n.additional_approvers, { count: remainingApprovers, }); - } else if (index < this.displayedApprovers.length - 1) { + } + if (index < this.displayedApprovers.length - 1) { return this.$options.i18n.comma; } } else if (index === this.displayedApprovers.length - 2) { diff --git a/ee/app/assets/javascripts/sidebar/mount_sidebar.js b/ee/app/assets/javascripts/sidebar/mount_sidebar.js index 5910bdf938ef52a6865bc31377aed86e896cc298..2224a248b326f13f8d492a5b6a8808fd30354906 100644 --- a/ee/app/assets/javascripts/sidebar/mount_sidebar.js +++ b/ee/app/assets/javascripts/sidebar/mount_sidebar.js @@ -267,7 +267,8 @@ export function mountIterationDropdown() { if (iteration === null) { return noChangeIterationValue; - } else if (iteration.id === null) { + } + if (iteration.id === null) { return unSetIterationValue; } diff --git a/ee/app/assets/javascripts/subscriptions/new/store/getters.js b/ee/app/assets/javascripts/subscriptions/new/store/getters.js index 9a8e5c1e0ba96f6567f33258964039fa71aa5f4f..84085132a36cf6ea112c3d5ef7a26dc387b5ab1f 100644 --- a/ee/app/assets/javascripts/subscriptions/new/store/getters.js +++ b/ee/app/assets/javascripts/subscriptions/new/store/getters.js @@ -63,9 +63,11 @@ export const totalAmount = (state, getters) => { export const name = (state, getters) => { if (state.isSetupForCompany && state.organizationName) { return state.organizationName; - } else if (getters.isGroupSelected && getters.isSelectedGroupPresent) { + } + if (getters.isGroupSelected && getters.isSelectedGroupPresent) { return getters.selectedGroupName; - } else if (state.isSetupForCompany) { + } + if (state.isSetupForCompany) { return s__('Checkout|Your organization'); } diff --git a/ee/app/assets/javascripts/vue_merge_request_widget/extensions/license_compliance/index.js b/ee/app/assets/javascripts/vue_merge_request_widget/extensions/license_compliance/index.js index f1624dc3f843c2f9fd96456e3ae33fa084639f09..257912525ae479c587581ae8dd957b739b96f54e 100644 --- a/ee/app/assets/javascripts/vue_merge_request_widget/extensions/license_compliance/index.js +++ b/ee/app/assets/javascripts/vue_merge_request_widget/extensions/license_compliance/index.js @@ -78,13 +78,15 @@ export default { 'LicenseCompliance|License Compliance detected %d new licenses', this.licenseReportCount(), ); - } else if (this.hasBaseReportLicenses() && this.hasDeniedLicense()) { + } + if (this.hasBaseReportLicenses() && this.hasDeniedLicense()) { return n__( 'LicenseCompliance|License Compliance detected %d new license and policy violation', 'LicenseCompliance|License Compliance detected %d new licenses and policy violations', this.licenseReportCount(), ); - } else if (!this.hasBaseReportLicenses() && this.hasDeniedLicense()) { + } + if (!this.hasBaseReportLicenses() && this.hasDeniedLicense()) { return n__( 'LicenseCompliance|License Compliance detected %d license and policy violation for the source branch only', 'LicenseCompliance|License Compliance detected %d licenses and policy violations for the source branch only', diff --git a/ee/app/assets/javascripts/vue_merge_request_widget/mappers.js b/ee/app/assets/javascripts/vue_merge_request_widget/mappers.js index 8d0230e41dcf4d36d2c24f5920aa65e964df1bfa..a10b2ed5a349e4d56ac485a89d604da80affb25c 100644 --- a/ee/app/assets/javascripts/vue_merge_request_widget/mappers.js +++ b/ee/app/assets/javascripts/vue_merge_request_widget/mappers.js @@ -16,7 +16,8 @@ function mapApprovalRule(rule, settings) { name: __('All Members'), fallback: true, }; - } else if (rule.rule_type === RULE_TYPE_REGULAR && !settings.multiple_approval_rules_available) { + } + if (rule.rule_type === RULE_TYPE_REGULAR && !settings.multiple_approval_rules_available) { // Give a friendly name to the single rule return { ...rule, diff --git a/ee/app/assets/javascripts/vue_merge_request_widget/mixins/auto_merge.js b/ee/app/assets/javascripts/vue_merge_request_widget/mixins/auto_merge.js index e74c1c5c8167a15fc76a8a64b5987626dcdc3e72..e6ebc889f9b9cccae7f4094f3528632e6171763c 100644 --- a/ee/app/assets/javascripts/vue_merge_request_widget/mixins/auto_merge.js +++ b/ee/app/assets/javascripts/vue_merge_request_widget/mixins/auto_merge.js @@ -12,15 +12,18 @@ export default { if (autoMergeStrategy === MT_MERGE_STRATEGY) { return s__('mrWidget|Added to the merge train by %{merge_author}'); - } else if (autoMergeStrategy === MTWPS_MERGE_STRATEGY && mergeTrainsCount === 0) { + } + if (autoMergeStrategy === MTWPS_MERGE_STRATEGY && mergeTrainsCount === 0) { return s__( 'mrWidget|Set by %{merge_author} to start a merge train when the pipeline succeeds', ); - } else if (autoMergeStrategy === MTWPS_MERGE_STRATEGY && mergeTrainsCount !== 0) { + } + if (autoMergeStrategy === MTWPS_MERGE_STRATEGY && mergeTrainsCount !== 0) { return s__( 'mrWidget|Set by %{merge_author} to be added to the merge train when the pipeline succeeds', ); - } else if (autoMergeStrategy === MWCP_MERGE_STRATEGY) { + } + if (autoMergeStrategy === MWCP_MERGE_STRATEGY) { return s__( 'mrWidget|Set by %{merge_author} to be merged automatically when all merge checks pass', ); diff --git a/ee/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js b/ee/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js index 43c084258c38de25c867b2c540fa0bd4d49f148a..0fc7c46ffad90931b060f02a699fa6511d09165d 100644 --- a/ee/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js +++ b/ee/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js @@ -49,7 +49,8 @@ export default { mergeDisabledText() { if (this.mr.isApprovalNeeded) { return MERGE_DISABLED_TEXT_UNAPPROVED; - } else if (this.hasBlockingMergeRequests) { + } + if (this.hasBlockingMergeRequests) { return MERGE_DISABLED_DEPENDENCIES_TEXT; } diff --git a/ee/app/assets/javascripts/vue_shared/license_compliance/components/license_status_icon.vue b/ee/app/assets/javascripts/vue_shared/license_compliance/components/license_status_icon.vue index f77d81674a4c049024c1fe7a853bd22c4c1d78cd..139d0a33d052654beb891ef80c08b40e98f12ad0 100644 --- a/ee/app/assets/javascripts/vue_shared/license_compliance/components/license_status_icon.vue +++ b/ee/app/assets/javascripts/vue_shared/license_compliance/components/license_status_icon.vue @@ -22,7 +22,8 @@ export default { iconName() { if (this.isStatusFailed) { return 'status-failed'; - } else if (this.isStatusSuccess) { + } + if (this.isStatusSuccess) { return 'status-success'; } diff --git a/ee/app/assets/javascripts/vue_shared/license_compliance/store/utils.js b/ee/app/assets/javascripts/vue_shared/license_compliance/store/utils.js index 2750485968841665224aadf8264a78db51a393a8..171879cfd5ef6087f84b1b2b1795086bb1984110 100644 --- a/ee/app/assets/javascripts/vue_shared/license_compliance/store/utils.js +++ b/ee/app/assets/javascripts/vue_shared/license_compliance/store/utils.js @@ -22,7 +22,8 @@ export const normalizeLicense = (license) => { export const getStatusTranslationsFromLicenseStatus = (approvalStatus) => { if (approvalStatus === LICENSE_APPROVAL_STATUS.ALLOWED) { return s__('LicenseCompliance|Allowed'); - } else if (approvalStatus === LICENSE_APPROVAL_STATUS.DENIED) { + } + if (approvalStatus === LICENSE_APPROVAL_STATUS.DENIED) { return s__('LicenseCompliance|Denied'); } return ''; @@ -31,7 +32,8 @@ export const getStatusTranslationsFromLicenseStatus = (approvalStatus) => { export const getIssueStatusFromLicenseStatus = (approvalStatus) => { if (approvalStatus === LICENSE_APPROVAL_STATUS.ALLOWED) { return STATUS_SUCCESS; - } else if (approvalStatus === LICENSE_APPROVAL_STATUS.DENIED) { + } + if (approvalStatus === LICENSE_APPROVAL_STATUS.DENIED) { return STATUS_FAILED; } return STATUS_NEUTRAL; diff --git a/ee/app/assets/javascripts/vue_shared/survey_banner/survey_banner.vue b/ee/app/assets/javascripts/vue_shared/survey_banner/survey_banner.vue index 8f2b416cd18f75ea01c7db783834aa4a129c825e..b1b8c2c21313d1859c0d75a407f7ffdc68717497 100644 --- a/ee/app/assets/javascripts/vue_shared/survey_banner/survey_banner.vue +++ b/ee/app/assets/javascripts/vue_shared/survey_banner/survey_banner.vue @@ -57,7 +57,7 @@ export default { return false; } // Date is invalid, we should show the survey. - else if (Number.isNaN(date.getDate())) { + if (Number.isNaN(date.getDate())) { return true; } diff --git a/ee/spec/frontend/security_orchestration/components/policy_editor/utils_spec.js b/ee/spec/frontend/security_orchestration/components/policy_editor/utils_spec.js index 4779cf0cea90cd99c546a1916dcfad72127ab759..571148fc7b5d562e38eb36540116679317627f55 100644 --- a/ee/spec/frontend/security_orchestration/components/policy_editor/utils_spec.js +++ b/ee/spec/frontend/security_orchestration/components/policy_editor/utils_spec.js @@ -45,7 +45,8 @@ const mockApolloResponses = (shouldReject) => { }, }, }); - } else if (mutation === createScanExecutionPolicy) { + } + if (mutation === createScanExecutionPolicy) { return Promise.resolve({ data: { scanExecutionPolicyCommit: { @@ -54,7 +55,8 @@ const mockApolloResponses = (shouldReject) => { }, }, }); - } else if (mutation === createMergeRequestMutation) { + } + if (mutation === createMergeRequestMutation) { return Promise.resolve({ data: { mergeRequestCreate: { mergeRequest: { iid: '01' }, errors: [] } }, }); diff --git a/spec/frontend/__helpers__/dom_shims/get_client_rects.js b/spec/frontend/__helpers__/dom_shims/get_client_rects.js index 7ba60dd793663e63adaa2ed531c29d98e9a82e43..0ec3525f0ef3474fa4bf0d420ac99522bb1a1e7e 100644 --- a/spec/frontend/__helpers__/dom_shims/get_client_rects.js +++ b/spec/frontend/__helpers__/dom_shims/get_client_rects.js @@ -1,7 +1,8 @@ function hasHiddenStyle(node) { if (!node.style) { return false; - } else if (node.style.display === 'none' || node.style.visibility === 'hidden') { + } + if (node.style.display === 'none' || node.style.visibility === 'hidden') { return true; } diff --git a/spec/frontend/behaviors/markdown/paste_markdown_table_spec.js b/spec/frontend/behaviors/markdown/paste_markdown_table_spec.js index 7044618fd9eb78f01877ed7c75f3f9fcee0e3721..154347b08b587cea16afc46a82235d91c18fbc33 100644 --- a/spec/frontend/behaviors/markdown/paste_markdown_table_spec.js +++ b/spec/frontend/behaviors/markdown/paste_markdown_table_spec.js @@ -77,7 +77,8 @@ describe('PasteMarkdownTable', () => { data.getData = jest.fn().mockImplementation((type) => { if (type === 'text/html') { return '
FirstLast
JohnDoe
JaneDoe
'; - } else if (type === 'text/plain') { + } + if (type === 'text/plain') { return 'First\tLast\nJohn\tDoe\nJane\tDoe'; } @@ -102,7 +103,8 @@ describe('PasteMarkdownTable', () => { data.getData = jest.fn().mockImplementation((type) => { if (type === 'text/html') { return '
FirstLast
JohnDoe
Jane/td>
'; - } else if (type === 'text/plain') { + } + if (type === 'text/plain') { return 'First\tLast\nJohn\tDoe\nJane'; } diff --git a/spec/frontend/diffs/components/diff_row_spec.js b/spec/frontend/diffs/components/diff_row_spec.js index 8a67d7b152c3a4d706538f4ef13088b7ed34083a..30510958704c7a40116f9428f613702f37fbea1a 100644 --- a/spec/frontend/diffs/components/diff_row_spec.js +++ b/spec/frontend/diffs/components/diff_row_spec.js @@ -71,7 +71,8 @@ describe('DiffRow', () => { const hits = coverageFileData[file]?.[line]; if (hits) { return { text: `Test coverage: ${hits} hits`, class: 'coverage' }; - } else if (hits === 0) { + } + if (hits === 0) { return { text: 'No test coverage', class: 'no-coverage' }; } diff --git a/spec/frontend/nav/components/top_nav_new_dropdown_spec.js b/spec/frontend/nav/components/top_nav_new_dropdown_spec.js index 2cd65307b0b03d0f4063051cc3a13f2645a32cf6..432ee5e9ecd7f161fa5aa11f3d25705d835a65cc 100644 --- a/spec/frontend/nav/components/top_nav_new_dropdown_spec.js +++ b/spec/frontend/nav/components/top_nav_new_dropdown_spec.js @@ -57,7 +57,8 @@ describe('~/nav/components/top_nav_menu_sections.vue', () => { if (type === 'divider') { return { type }; - } else if (type === 'header') { + } + if (type === 'header') { return { type, text: child.text() }; } diff --git a/spec/frontend/users_select/test_helper.js b/spec/frontend/users_select/test_helper.js index b38400446a9074a47e83226314f9ba814d13d35c..5aae922fec23d78d2222a3fe1cff54efb30986fa 100644 --- a/spec/frontend/users_select/test_helper.js +++ b/spec/frontend/users_select/test_helper.js @@ -70,7 +70,8 @@ export const findDropdownItemsModel = () => return { type: 'divider', }; - } else if (el.classList.contains('dropdown-header')) { + } + if (el.classList.contains('dropdown-header')) { return { type: 'dropdown-header', text: el.textContent,