Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue3
-rw-r--r--app/assets/javascripts/admin/abuse_report/components/labels_select.vue3
-rw-r--r--app/assets/javascripts/admin/broadcast_messages/components/message_form.vue3
-rw-r--r--app/assets/javascripts/analytics/cycle_analytics/components/formatted_stage_count.vue3
-rw-r--r--app/assets/javascripts/analytics/shared/components/projects_dropdown_filter.vue3
-rw-r--r--app/assets/javascripts/authentication/webauthn/error.js9
-rw-r--r--app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js3
-rw-r--r--app/assets/javascripts/blob/line_highlighter.js3
-rw-r--r--app/assets/javascripts/boards/components/issue_due_date.vue9
-rw-r--r--app/assets/javascripts/ci/pipeline_details/graph/components/linked_pipeline.vue6
-rw-r--r--app/assets/javascripts/ci/pipeline_details/pipelines_list/components/pipeline_url.vue5
-rw-r--r--app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js6
-rw-r--r--app/assets/javascripts/ci/reports/components/issue_status_icon.vue3
-rw-r--r--app/assets/javascripts/ci/reports/components/report_section.vue3
-rw-r--r--app/assets/javascripts/ci/runner/components/stat/runner_count.vue6
-rw-r--r--app/assets/javascripts/ci/runner/runner_search_utils.js3
-rw-r--r--app/assets/javascripts/ci_secure_files/components/metadata/modal.vue6
-rw-r--r--app/assets/javascripts/clusters_list/components/agent_table.vue6
-rw-r--r--app/assets/javascripts/clusters_list/components/available_agents_dropdown.vue3
-rw-r--r--app/assets/javascripts/clusters_list/components/clusters.vue12
-rw-r--r--app/assets/javascripts/clusters_list/components/clusters_actions.vue3
-rw-r--r--app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_pushed.vue3
-rw-r--r--app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js3
-rw-r--r--app/assets/javascripts/deprecated_jquery_dropdown/render.js3
-rw-r--r--app/assets/javascripts/deprecated_notes.js3
-rw-r--r--app/assets/javascripts/diffs/components/diff_view.vue3
-rw-r--r--app/assets/javascripts/diffs/store/actions.js3
-rw-r--r--app/assets/javascripts/diffs/store/getters.js3
-rw-r--r--app/assets/javascripts/environments/components/kubernetes_status_bar.vue15
-rw-r--r--app/assets/javascripts/frequent_items/utils.js3
-rw-r--r--app/assets/javascripts/gfm_auto_complete.js21
-rw-r--r--app/assets/javascripts/gitlab_version_check/components/gitlab_version_check_badge.vue6
-rw-r--r--app/assets/javascripts/google_cloud/deployments/service_table.vue2
-rw-r--r--app/assets/javascripts/ide/commit_icon.js3
-rw-r--r--app/assets/javascripts/ide/components/new_dropdown/modal.vue6
-rw-r--r--app/assets/javascripts/ide/components/terminal/terminal.vue3
-rw-r--r--app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue6
-rw-r--r--app/assets/javascripts/ide/lib/diff/controller.js6
-rw-r--r--app/assets/javascripts/ide/lib/errors.js6
-rw-r--r--app/assets/javascripts/ide/lib/files.js3
-rw-r--r--app/assets/javascripts/ide/lib/mirror.js3
-rw-r--r--app/assets/javascripts/ide/stores/actions/project.js3
-rw-r--r--app/assets/javascripts/ide/stores/getters.js3
-rw-r--r--app/assets/javascripts/ide/stores/modules/terminal/messages.js3
-rw-r--r--app/assets/javascripts/ide/stores/utils.js9
-rw-r--r--app/assets/javascripts/import_entities/components/import_status.vue6
-rw-r--r--app/assets/javascripts/issuable/components/issue_milestone.vue3
-rw-r--r--app/assets/javascripts/issues/list/components/issue_card_time_info.vue9
-rw-r--r--app/assets/javascripts/issues/service_desk/components/empty_state_with_any_issues.vue3
-rw-r--r--app/assets/javascripts/jobs/components/job/sidebar/stages_dropdown.vue9
-rw-r--r--app/assets/javascripts/jobs/components/job/stuck_block.vue3
-rw-r--r--app/assets/javascripts/labels/labels_select.js6
-rw-r--r--app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js9
-rw-r--r--app/assets/javascripts/lib/utils/datetime/date_format_utility.js27
-rw-r--r--app/assets/javascripts/lib/utils/grammar.js6
-rw-r--r--app/assets/javascripts/lib/utils/number_utils.js6
-rw-r--r--app/assets/javascripts/lib/utils/text_markdown.js3
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js6
-rw-r--r--app/assets/javascripts/members/components/modals/remove_member_modal.vue3
-rw-r--r--app/assets/javascripts/members/components/table/members_table_cell.vue6
-rw-r--r--app/assets/javascripts/notebook/cells/output/index.vue45
-rw-r--r--app/assets/javascripts/notes/components/discussion_filter.vue3
-rw-r--r--app/assets/javascripts/notes/components/mr_discussion_filter.vue3
-rw-r--r--app/assets/javascripts/notes/components/note_form.vue6
-rw-r--r--app/assets/javascripts/notes/stores/actions.js3
-rw-r--r--app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input.vue3
-rw-r--r--app/assets/javascripts/performance_bar/components/detailed_metric.vue3
-rw-r--r--app/assets/javascripts/protected_branches/protected_branch_edit.js3
-rw-r--r--app/assets/javascripts/related_issues/components/add_issuable_form.vue3
-rw-r--r--app/assets/javascripts/repository/components/table/row.vue3
-rw-r--r--app/assets/javascripts/search/store/utils.js3
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js3
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue24
-rw-r--r--app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue6
-rw-r--r--app/assets/javascripts/snippets/utils/blob.js3
-rw-r--r--app/assets/javascripts/super_sidebar/utils.js3
-rw-r--r--app/assets/javascripts/users_select/index.js6
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/extensions/utils.js7
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue2
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/states/merge_checks_failed.vue6
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.js12
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/extensions/code_quality/index.vue15
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js39
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js9
-rw-r--r--app/assets/javascripts/vue_shared/components/changed_file_icon.vue9
-rw-r--r--app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue3
-rw-r--r--app/assets/javascripts/vue_shared/components/file_finder/index.vue3
-rw-r--r--app/assets/javascripts/vue_shared/components/source_viewer/source_viewer.vue3
-rw-r--r--app/assets/javascripts/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue3
-rw-r--r--app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue6
-rw-r--r--app/assets/javascripts/vue_shared/components/web_ide_link.vue6
-rw-r--r--app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue3
-rw-r--r--app/assets/javascripts/vuex_shared/bindings.js3
-rw-r--r--app/assets/javascripts/work_items/components/shared/work_item_link_child_metadata.vue3
-rw-r--r--app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue3
-rw-r--r--app/assets/javascripts/work_items_hierarchy/hierarchy_util.js3
-rw-r--r--app/assets/stylesheets/_page_specific_files.scss1
-rw-r--r--app/assets/stylesheets/page_bundles/projects.scss (renamed from app/assets/stylesheets/pages/projects.scss)6
-rw-r--r--app/helpers/application_settings_helper.rb1
-rw-r--r--app/models/application_setting_implementation.rb8
-rw-r--r--app/models/concerns/each_batch.rb4
-rw-r--r--app/models/group.rb2
-rw-r--r--app/models/integrations/base_slack_notification.rb5
-rw-r--r--app/models/label_link.rb2
-rw-r--r--app/services/issues/base_service.rb3
-rw-r--r--app/services/merge_requests/base_service.rb5
-rw-r--r--app/services/notes/post_process_service.rb2
-rw-r--r--app/views/admin/application_settings/_protected_paths.html.haml8
-rw-r--r--app/views/admin/projects/index.html.haml1
-rw-r--r--app/views/admin/projects/show.html.haml1
-rw-r--r--app/views/dashboard/projects/index.html.haml1
-rw-r--r--app/views/groups/projects.html.haml1
-rw-r--r--app/views/layouts/project_settings.html.haml1
-rw-r--r--app/views/projects/new.html.haml1
-rw-r--r--app/views/projects/tree/_tree_header.html.haml2
121 files changed, 433 insertions, 229 deletions
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 c1ec46cfc50..9bcdcec8b78 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 9e0c5e25f20..747c9a1a947 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 109df943c42..2c555aca3c0 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 b622b0441e2..724e9c91305 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 f881c924ae5..ddfc6baafa9 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 40dbecd8bc9..ce6c79a1f11 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 095634340c1..e1c1bd58ee2 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 4e97d0aa915..9c6a5958e1f 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 1f28974afd1..46009df2bd3 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 cc52ff57c13..d6adaf78da4 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_details/pipelines_list/components/pipeline_url.vue b/app/assets/javascripts/ci/pipeline_details/pipelines_list/components/pipeline_url.vue
index ff1a01d5037..10ed3decd2c 100644
--- a/app/assets/javascripts/ci/pipeline_details/pipelines_list/components/pipeline_url.vue
+++ b/app/assets/javascripts/ci/pipeline_details/pipelines_list/components/pipeline_url.vue
@@ -151,7 +151,10 @@ export default {
<div v-if="!pipelineName" class="commit-title gl-mb-2" data-testid="commit-title-container">
<span v-if="commitTitle" class="gl-display-flex">
- <tooltip-on-truncate :title="commitTitle" class="gl-flex-grow-1 gl-text-truncate">
+ <tooltip-on-truncate
+ :title="commitTitle"
+ class="gl-flex-grow-1 gl-text-truncate gl-p-3 gl-ml-n3 gl-mr-n3 gl-mt-n3 gl-mb-n3"
+ >
<gl-link
:href="commitUrl"
class="commit-row-message gl-text-blue-600!"
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 a604d79259d..32eda355e66 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 bd41b8d23f1..56010a5f588 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 a4ec7b6a325..fd6c6cca6b7 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 c33c42f3afe..cee1088d90b 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 3dc99baa329..8915198350f 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 fdf720a5f94..cbb9c31b54b 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 529be7169db..7482aaca36e 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 75850cbb108..96ecbe9fa12 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 590fdb947b3..0258d8e0da0 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 c388d3fee71..e92b98946d0 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 557f2912f17..a2516f37c92 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 ae5d3298b62..bacd84048af 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 97698d55011..1b133c57302 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 4e5e07c57e4..008e12abbcd 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 88ea4e15552..641616a34f5 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 bbc602aedf6..7c68b5f69f1 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 d82959daa9d..bfafb4d281d 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 e8857dfe459..c603d83db9c 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 1c33c8b1084..f71405a5bc4 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 9e7006bb6e7..a9e7b853cd2 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 1536a9a525b..25ddfc911f3 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 26c9fd14dc6..9388b41127e 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 70ee9cff22b..07eef897910 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 854daa20628..741845e3325 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 9e8b3d87397..b2e90a64758 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 38e53b64503..332408b9ecf 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 7595a1cedf1..ec28845d805 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 a8a048e588f..5063cf5fd4f 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 3fdf012bbb2..415e34f56b8 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 f437965b25a..286798d7560 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 f4fa52b2d4d..11e3d8260f7 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 c0f666c6652..74fe61b6e2f 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 ad7ad35a98c..a2b45f9dc62 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 ec661fdb0d6..bac3803e68f 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 94c04123112..91436457b03 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 c7da3e59098..3340ef2338c 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 06c2e29a904..22c0984ebdb 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 a15c8ee2e9f..ab9e70ae223 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 220b13277d2..3fee1427256 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 1a678ce69a8..8c73f09daea 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 587cc82f0fa..db1dbc72624 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 d52672b9d08..4e0d19f2c2a 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 b0264796d90..c4b8f95e99f 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|&lt;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 6d6361d19b6..64ba151d829 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 0e943cdb623..d17719c0bc0 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 e6eb74834c0..d48e0217fd8 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 31e16f7b4db..ce8b304e104 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 c7bd1525558..ecc769174f4 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 407cbc55dd3..cac8c9fb4db 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 c8268b1a9ae..a7b753b7ca8 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 7266cdb6405..90f7a6862f0 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 08d3670ae6a..c2ac95ca56e 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 6c4e5f3227f..363383fd7ad 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 a20bce2e53a..7eb01897296 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 5f6a73782c3..642fd56eab1 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 5bef7e6e322..b53e2709f83 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 b6c86750723..bbf10ef3b01 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 b3033ddf3b6..d36b29f69a5 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 4f0907df7f2..a76d822317a 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 2f02ef3475c..b15f89fc6a2 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 577c01c50ff..8a912b00df1 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 03ace6286e0..3ab7757d34d 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 53582aacabd..a513c247be7 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 88a74784dd2..415c40b4779 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 465f971717f..ac05ae3896b 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 91b23689f0d..aff592d48e0 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 a228d6111ce..97f21654aae 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 cbf93155fb6..72a62ed6b71 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 1b36f02226d..aa68cf5a161 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 5090081d281..3b62345b969 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 95fa01c23f1..4ed470440cc 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 c7d34d45f06..efe71ed569a 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 757178ee336..83f5c1490e2 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 400759aa086..4f39bd1d972 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 61eec503951..bf2c5e52184 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 713c9e610b3..3af984dcf6c 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 d30acf24684..cd3a98effa3 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 f90056a8e1a..d6bab074f3f 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 a74b7ed8587..bb74f82145f 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 14e99977a85..2a47e96b2e2 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 7080e046b30..535f1c5f645 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 db0b0ea185b..226f44a1541 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 007aae3f5a0..797a38d8171 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 bda88a48e48..9ba5e8724f9 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 446c8c97df0..30f616dd8e1 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 79d14b5f2d0..beb8321a271 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 ec3078cd5a9..324228111d4 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 bc3741a3880..07b16a13e68 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 ddeac2b92ae..38d8d239a7e 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 a58752a861a..55440e1603c 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 61d93acdb91..57f4783955c 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/app/assets/stylesheets/_page_specific_files.scss b/app/assets/stylesheets/_page_specific_files.scss
index 47701d0490a..72351f8ba0c 100644
--- a/app/assets/stylesheets/_page_specific_files.scss
+++ b/app/assets/stylesheets/_page_specific_files.scss
@@ -9,6 +9,5 @@
@import './pages/notes';
@import './pages/pipelines';
@import './pages/profile';
-@import './pages/projects';
@import './pages/registry';
@import './pages/settings';
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/page_bundles/projects.scss
index 9ce470dbcf2..68139c55f5a 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/page_bundles/projects.scss
@@ -1,3 +1,5 @@
+@import 'mixins_and_variables_and_functions';
+
.new_project,
.edit-project,
.import-project {
@@ -6,7 +8,7 @@
}
.project-path .form-control {
- border-radius: $border-radius-base;
+ border-radius: $gl-border-radius-base;
}
.input-group {
@@ -47,7 +49,7 @@
}
+ .btn-default {
- border-radius: 0 $border-radius-base $border-radius-base 0;
+ border-radius: 0 $gl-border-radius-base $gl-border-radius-base 0;
}
}
}
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 5605c3535f7..850d5e8d71a 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -413,6 +413,7 @@ module ApplicationSettingsHelper
:throttle_protected_paths_period_in_seconds,
:throttle_protected_paths_requests_per_period,
:protected_paths_raw,
+ :protected_paths_for_get_request_raw,
:time_tracking_limit_to_hours,
:two_factor_grace_period,
:update_runner_versions_enabled,
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index f1e6bb427c3..d441140cd4f 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -381,6 +381,14 @@ module ApplicationSettingImplementation
self.protected_paths = strings_to_array(values)
end
+ def protected_paths_for_get_request_raw
+ array_to_string(protected_paths_for_get_request)
+ end
+
+ def protected_paths_for_get_request_raw=(values)
+ self.protected_paths_for_get_request = strings_to_array(values)
+ end
+
def notes_create_limit_allowlist_raw
array_to_string(notes_create_limit_allowlist)
end
diff --git a/app/models/concerns/each_batch.rb b/app/models/concerns/each_batch.rb
index 945d286a2fd..0c8cf861c38 100644
--- a/app/models/concerns/each_batch.rb
+++ b/app/models/concerns/each_batch.rb
@@ -54,7 +54,7 @@ module EachBatch
'the column: argument must be set to a column name to use for ordering rows'
end
- start = except(:select)
+ start = except(:select, :includes, :preload)
.select(column)
.reorder(column => order)
@@ -69,7 +69,7 @@ module EachBatch
1.step do |index|
start_cond = arel_table[column].gteq(start_id)
start_cond = arel_table[column].lteq(start_id) if order == :desc
- stop = except(:select)
+ stop = except(:select, :includes, :preload)
.select(column)
.where(start_cond)
.reorder(column => order)
diff --git a/app/models/group.rb b/app/models/group.rb
index 7baf86b878b..9330ffef156 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -786,8 +786,6 @@ class Group < Namespace
end
def execute_integrations(data, hooks_scope)
- return unless Feature.enabled?(:group_mentions, self)
-
integrations.public_send(hooks_scope).each do |integration| # rubocop:disable GitlabSecurity/PublicSend
integration.async_execute(data)
end
diff --git a/app/models/integrations/base_slack_notification.rb b/app/models/integrations/base_slack_notification.rb
index 29a20419809..96c2c44c128 100644
--- a/app/models/integrations/base_slack_notification.rb
+++ b/app/models/integrations/base_slack_notification.rb
@@ -26,10 +26,7 @@ module Integrations
override :supported_events
def supported_events
additional = %w[alert]
-
- if group_level? && Feature.enabled?(:group_mentions, group)
- additional += %w[group_mention group_confidential_mention]
- end
+ additional += %w[group_mention group_confidential_mention] if group_level?
(super + additional).freeze
end
diff --git a/app/models/label_link.rb b/app/models/label_link.rb
index d326b07ad31..0c2d205c641 100644
--- a/app/models/label_link.rb
+++ b/app/models/label_link.rb
@@ -24,3 +24,5 @@ class LabelLink < ApplicationRecord
relation
end
end
+
+LabelLink.prepend_mod_with('LabelLink')
diff --git a/app/services/issues/base_service.rb b/app/services/issues/base_service.rb
index b9b7cd08b68..1b4e7583645 100644
--- a/app/services/issues/base_service.rb
+++ b/app/services/issues/base_service.rb
@@ -111,9 +111,6 @@ module Issues
issue.namespace.execute_integrations(issue_data, hooks_scope)
execute_incident_hooks(issue, issue_data) if issue.work_item_type&.incident?
-
- return unless Feature.enabled?(:group_mentions, issue.project)
-
execute_group_mention_hooks(issue, issue_data) if action == 'open'
end
diff --git a/app/services/merge_requests/base_service.rb b/app/services/merge_requests/base_service.rb
index 8a2ed4d08e6..f36cad7139a 100644
--- a/app/services/merge_requests/base_service.rb
+++ b/app/services/merge_requests/base_service.rb
@@ -36,10 +36,7 @@ module MergeRequests
merge_request.project.execute_integrations(merge_data, :merge_request_hooks)
execute_external_hooks(merge_request, merge_data)
-
- if action == 'open' && Feature.enabled?(:group_mentions, merge_request.project)
- execute_group_mention_hooks(merge_request, merge_data)
- end
+ execute_group_mention_hooks(merge_request, merge_data) if action == 'open'
enqueue_jira_connect_messages_for(merge_request)
end
diff --git a/app/services/notes/post_process_service.rb b/app/services/notes/post_process_service.rb
index 9465b5218b0..6e92a887cdd 100644
--- a/app/services/notes/post_process_service.rb
+++ b/app/services/notes/post_process_service.rb
@@ -42,8 +42,6 @@ module Notes
note.project.execute_hooks(note_data, hooks_scope)
note.project.execute_integrations(note_data, hooks_scope)
- return unless Feature.enabled?(:group_mentions, note.project)
-
execute_group_mention_hooks(note, note_data, is_confidential)
end
diff --git a/app/views/admin/application_settings/_protected_paths.html.haml b/app/views/admin/application_settings/_protected_paths.html.haml
index 3a7a951d137..ec8536320f7 100644
--- a/app/views/admin/application_settings/_protected_paths.html.haml
+++ b/app/views/admin/application_settings/_protected_paths.html.haml
@@ -4,7 +4,7 @@
%fieldset
.form-group
= f.gitlab_ui_checkbox_component :throttle_protected_paths_enabled,
- _('Enable rate limiting for POST requests to the specified paths'),
+ _('Enable rate limiting for requests to the specified paths'),
help_text: _('Helps reduce request volume for protected paths.')
.form-group
= f.label :throttle_protected_paths_requests_per_period, 'Maximum requests per period per user', class: 'label-bold'
@@ -14,8 +14,12 @@
= f.number_field :throttle_protected_paths_period_in_seconds, class: 'form-control gl-form-input'
.form-group
= f.label :protected_paths, class: 'label-bold' do
- = _('Paths to protect with rate limiting')
+ = _('Paths with rate limiting for POST requests')
= f.text_area :protected_paths_raw, placeholder: '/users/sign_in,/users/password', class: 'form-control gl-form-input', rows: 10
+ .form-group
+ = f.label :protected_paths_for_get_request, class: 'label-bold' do
+ = _('Paths with rate limiting for GET requests')
+ = f.text_area :protected_paths_for_get_request_raw, class: 'form-control gl-form-input', rows: 10
%span.form-text.text-muted
- relative_url_link = 'https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab'
- relative_url_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: relative_url_link }
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index 31ec4935f64..412d8e64e89 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -1,5 +1,6 @@
- page_title _('Projects')
- add_page_specific_style 'page_bundles/search'
+- add_page_specific_style 'page_bundles/projects'
- params[:visibility_level] ||= []
.top-area.gl-flex-direction-column-reverse
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 85dce00752b..6be5aa003fc 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -1,4 +1,5 @@
- add_page_specific_style 'page_bundles/members'
+- add_page_specific_style 'page_bundles/projects'
- add_to_breadcrumbs _("Projects"), admin_projects_path
- breadcrumb_title @project.full_name
- page_title @project.full_name, _("Projects")
diff --git a/app/views/dashboard/projects/index.html.haml b/app/views/dashboard/projects/index.html.haml
index 140bc6e06c3..c74a9f4cbe6 100644
--- a/app/views/dashboard/projects/index.html.haml
+++ b/app/views/dashboard/projects/index.html.haml
@@ -5,6 +5,7 @@
- page_title _("Projects")
- add_page_specific_style 'page_bundles/dashboard_projects'
+- add_page_specific_style 'page_bundles/projects'
= render "projects/last_push"
- if show_projects?(@projects, params)
diff --git a/app/views/groups/projects.html.haml b/app/views/groups/projects.html.haml
index 22e9f9f5071..76758769d01 100644
--- a/app/views/groups/projects.html.haml
+++ b/app/views/groups/projects.html.haml
@@ -1,5 +1,6 @@
- breadcrumb_title _("Projects")
- page_title _("Projects")
+- add_page_specific_style 'page_bundles/projects'
- @force_desktop_expanded_sidebar = true
= render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card js-search-settings-section' }, header_options: { class: 'gl-new-card-header gl-display-flex' }, body_options: { class: 'gl-new-card-body' }) do |c|
diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml
index 29e30c4434f..7e5dd0d37c9 100644
--- a/app/views/layouts/project_settings.html.haml
+++ b/app/views/layouts/project_settings.html.haml
@@ -1,6 +1,7 @@
- page_title _("Settings")
- nav "project"
- add_page_specific_style 'page_bundles/settings'
+- add_page_specific_style 'page_bundles/projects'
- enable_search_settings locals: { container_class: 'gl-my-5' }
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index 59a21cecd39..76e20dcc105 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -3,6 +3,7 @@
- page_title _('New Project')
- header_title _("Projects"), dashboard_projects_path
- add_page_specific_style 'page_bundles/new_namespace'
+- add_page_specific_style 'page_bundles/projects'
.project-edit-container
.project-edit-errors
diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml
index a4ed19c2fc9..c44499d69b5 100644
--- a/app/views/projects/tree/_tree_header.html.haml
+++ b/app/views/projects/tree/_tree_header.html.haml
@@ -1,3 +1,5 @@
+- add_page_specific_style 'page_bundles/projects'
+
.tree-ref-container.gl-display-flex.gl-flex-wrap.gl-gap-2.mb-2.mb-md-0
.tree-ref-holder.gl-max-w-26{ data: { qa_selector: 'ref_dropdown_container' } }
#js-tree-ref-switcher{ data: { project_id: @project.id, ref_type: @ref_type.to_s, project_root_path: project_path(@project) } }