diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index 06abbba3479..e8d7115badb 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -27,6 +27,7 @@ RUN_WITH_BUNDLE: "true" # instructs pipeline to install and run gitlab-qa gem via bundler QA_PATH: qa # sets the optional path for bundler to run from DYNAMIC_PIPELINE_YML: package-and-test-pipeline.yml # yml files are generated by scripts/generate-e2e-pipeline script + EXTRA_GITLAB_QA_OPTS: --set-feature-flags super_sidebar_nav_enrolled=enabled inherit: variables: - CHROME_VERSION @@ -117,17 +118,17 @@ e2e:package-and-test-ce: ALLURE_JOB_NAME: e2e-package-and-test-ce PIPELINE_NAME: E2E Omnibus GitLab CE -e2e:package-and-test-super-sidebar: +e2e:package-and-test-old-nav: extends: - - e2e:package-and-test-ee - - .qa:rules:package-and-test-sidebar - when: manual + - .e2e-trigger-base + - .qa:rules:package-and-test-old-nav variables: - QA_SUPER_SIDEBAR_ENABLED: "true" - EXTRA_GITLAB_QA_OPTS: --set-feature-flags super_sidebar_nav=enabled - QA_RUN_TYPE: e2e-package-and-test-super-sidebar - ALLURE_JOB_NAME: e2e-package-and-test-super-sidebar - PIPELINE_NAME: E2E Omnibus Super Sidebar + RELEASE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/build/omnibus-gitlab-mirror/gitlab-ee:${CI_COMMIT_SHA}" + QA_RUN_TYPE: e2e-package-and-test-old-nav + ALLURE_JOB_NAME: e2e-package-and-test-old-nav + PIPELINE_NAME: E2E Omnibus Old Navigation + QA_SUPER_SIDEBAR_ENABLED: "false" + EXTRA_GITLAB_QA_OPTS: "" e2e:package-and-test-nightly: extends: diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 62b12c564e3..4d03aebee02 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1385,7 +1385,7 @@ - <<: *if-force-ci allow_failure: true -.qa:rules:package-and-test-common: +.qa:rules:package-and-test-never-run: rules: - <<: *if-not-canonical-namespace when: never @@ -1393,6 +1393,10 @@ when: never - <<: *if-merge-request-labels-pipeline-expedite when: never + +.qa:rules:package-and-test-common: + rules: + - !reference [.qa:rules:package-and-test-never-run, rules] - <<: *if-merge-request-targeting-stable-branch allow_failure: true - <<: *if-ruby2-branch @@ -1459,12 +1463,7 @@ .qa:rules:package-and-test-ce: rules: - - <<: *if-not-canonical-namespace - when: never - - <<: *if-not-ee - when: never - - <<: *if-merge-request-labels-pipeline-expedite - when: never + - !reference [.qa:rules:package-and-test-never-run, rules] - <<: *if-dot-com-gitlab-org-and-security-merge-request changes: *ci-build-images-patterns when: manual @@ -1487,14 +1486,9 @@ - !reference [".qa:rules:package-and-test-common", rules] - !reference [".qa:rules:package-and-test-schedule", rules] -.qa:rules:package-and-test-sidebar: +.qa:rules:package-and-test-old-nav: rules: - - <<: *if-not-canonical-namespace - when: never - - <<: *if-not-ee - when: never - - <<: *if-merge-request-labels-pipeline-expedite - when: never + - !reference [.qa:rules:package-and-test-never-run, rules] - <<: *if-merge-request changes: *code-patterns when: manual diff --git a/app/assets/javascripts/super_sidebar/components/user_bar.vue b/app/assets/javascripts/super_sidebar/components/user_bar.vue index 0b71cb4341b..8cfdd8c8bf4 100644 --- a/app/assets/javascripts/super_sidebar/components/user_bar.vue +++ b/app/assets/javascripts/super_sidebar/components/user_bar.vue @@ -168,6 +168,7 @@ export default { category="tertiary" data-method="delete" data-testid="stop-impersonation-btn" + data-qa-selector="stop_impersonation_link" />
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index a2e0670d7e1..30d2925fa5b 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -167,7 +167,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController accept_pending_invitations(user: user) if new_user persist_accepted_terms_if_required(user) if new_user - store_after_sign_up_path_for_user if intent_to_register? + perform_registration_tasks(user, oauth['provider']) if intent_to_register? sign_in_and_redirect_or_verify_identity(user, auth_user, new_user) end else @@ -295,8 +295,12 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController Users::RespondToTermsService.new(user, terms).execute(accepted: true) end - def store_after_sign_up_path_for_user - store_location_for(:user, users_sign_up_welcome_path) + def perform_registration_tasks(_user, _provider) + store_location_for(:user, after_sign_up_path) + end + + def after_sign_up_path + users_sign_up_welcome_path end # overridden in EE diff --git a/app/helpers/registrations_helper.rb b/app/helpers/registrations_helper.rb index fcd560dbe8c..6f6a440ab13 100644 --- a/app/helpers/registrations_helper.rb +++ b/app/helpers/registrations_helper.rb @@ -14,6 +14,10 @@ module RegistrationsHelper def signup_box_template 'devise/shared/signup_box' end + + def register_omniauth_params(_local_assigns) + { intent: :register } + end end RegistrationsHelper.prepend_mod_with('RegistrationsHelper') diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index e75449bf320..18856e04eb8 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -7,6 +7,9 @@ = render "layouts/bizible" = render "layouts/google_tag_manager_body" +- content_for :omniauth_providers_bottom do + = render 'devise/shared/signup_omniauth_providers' + .signup-page = render signup_box_template, url: registration_path(resource_name, registration_path_params), diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 31c541eebde..178f320ea9f 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -1,11 +1,9 @@ - max_first_name_length = max_last_name_length = 127 -- omniauth_providers_placement ||= :bottom - borderless ||= false - form_resource_name = "new_#{resource_name}" .gl-mb-3.gl-p-4{ class: (borderless ? '' : 'gl-border-gray-100 gl-border-1 gl-border-solid gl-rounded-base') } - - if show_omniauth_providers && omniauth_providers_placement == :top - = render 'devise/shared/signup_omniauth_providers_top' + = yield :omniauth_providers_top if show_omniauth_providers = gitlab_ui_form_for(resource, as: form_resource_name, url: url, html: { class: 'new_user gl-show-field-errors js-arkose-labs-form', 'aria-live' => 'assertive' }, data: { testid: 'signup-form' }) do |f| .devise-errors @@ -77,5 +75,4 @@ .gl-pt-5 = markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text) = render 'devise/shared/terms_of_service_notice', button_text: button_text - - if show_omniauth_providers && omniauth_providers_placement == :bottom - = render 'devise/shared/signup_omniauth_providers' + = yield :omniauth_providers_bottom if show_omniauth_providers diff --git a/app/views/devise/shared/_signup_omniauth_provider_list.haml b/app/views/devise/shared/_signup_omniauth_provider_list.haml index 6294a93808b..cd0d43614de 100644 --- a/app/views/devise/shared/_signup_omniauth_provider_list.haml +++ b/app/views/devise/shared/_signup_omniauth_provider_list.haml @@ -1,11 +1,10 @@ -- register_omniauth_params = { intent: :register } - if Feature.enabled?(:restyle_login_page, @project) .gl-text-center.gl-pt-5 %label.gl-font-weight-normal = _("Register with:") .gl-text-center.gl-ml-auto.gl-mr-auto - providers.each do |provider| - = link_to omniauth_authorize_path(:user, provider, register_omniauth_params), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do + = link_to omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do - if provider_has_icon?(provider) = provider_image_tag(provider) %span.gl-button-text @@ -15,7 +14,7 @@ = _("Create an account using:") .gl-display-flex.gl-justify-content-between.gl-flex-wrap - providers.each do |provider| - = link_to omniauth_authorize_path(:user, provider, register_omniauth_params), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do + = link_to omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do - if provider_has_icon?(provider) = provider_image_tag(provider) %span.gl-button-text diff --git a/app/views/devise/shared/_signup_omniauth_providers_top.haml b/app/views/devise/shared/_signup_omniauth_providers_top.haml deleted file mode 100644 index 8eb22c0b023..00000000000 --- a/app/views/devise/shared/_signup_omniauth_providers_top.haml +++ /dev/null @@ -1,3 +0,0 @@ -= render 'devise/shared/signup_omniauth_provider_list', providers: popular_enabled_button_based_providers -.omniauth-divider.gl-display-flex.gl-align-items-center - = _("or") diff --git a/app/views/shared/_alert_info.html.haml b/app/views/shared/_alert_info.html.haml index 30dfc87b9bf..e6dbcfbff1c 100644 --- a/app/views/shared/_alert_info.html.haml +++ b/app/views/shared/_alert_info.html.haml @@ -1,3 +1,3 @@ = render Pajamas::AlertComponent.new(variant: :info, dismissible: true) do |c| - = c.body do + - c.with_body do = body diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml index c468b3a2001..6d8d4f4cab9 100644 --- a/app/views/shared/_auto_devops_callout.html.haml +++ b/app/views/shared/_auto_devops_callout.html.haml @@ -6,7 +6,7 @@ svg_path: 'illustrations/autodevops.svg', banner_options: { class: 'js-autodevops-banner auto-devops-callout', data: { uid: 'auto_devops_settings_dismissed', project_path: project_path(@project) } }, close_options: { 'aria-label' => s_('AutoDevOps|Dismiss Auto DevOps box'), class: 'js-close-callout' }) do |c| - - c.title do + - c.with_title do = s_('AutoDevOps|Auto DevOps') %p= s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') diff --git a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml index ac7d56520f7..f4af3ea70d4 100644 --- a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml +++ b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml @@ -2,11 +2,11 @@ = render Pajamas::AlertComponent.new(alert_options: { class: 'auto-devops-implicitly-enabled-banner', data: { qa_selector: 'auto_devops_banner_content' } }, close_button_options: { class: 'hide-auto-devops-implicitly-enabled-banner', data: { project_id: project.id }}) do |c| - = c.body do + - c.with_body do = s_("AutoDevOps|The Auto DevOps pipeline has been enabled and will be used if no alternative CI configuration file is found.") - unless Gitlab.config.registry.enabled %div = _('Container registry is not enabled on this GitLab instance. Ask an administrator to enable it in order for Auto DevOps to work.') - = c.actions do + - c.with_actions do = link_to _('Settings'), project_settings_ci_cd_path(project), class: 'alert-link btn gl-button btn-confirm' = link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank', class: 'alert-link btn gl-button btn-default gl-ml-3' diff --git a/app/views/shared/_custom_attributes.html.haml b/app/views/shared/_custom_attributes.html.haml index 6e5f1cb063c..be96e77dbd4 100644 --- a/app/views/shared/_custom_attributes.html.haml +++ b/app/views/shared/_custom_attributes.html.haml @@ -1,9 +1,9 @@ - return unless custom_attributes.present? = render Pajamas::CardComponent.new(body_options: { class: 'gl-py-0' }) do |c| - - c.header do + - c.with_header do = link_to(_('Custom Attributes'), help_page_path('api/custom_attributes.md')) - - c.body do + - c.with_body do %ul.content-list - custom_attributes.each do |custom_attribute| %li diff --git a/app/views/shared/_import_form.html.haml b/app/views/shared/_import_form.html.haml index d10f514dc58..668ac908703 100644 --- a/app/views/shared/_import_form.html.haml +++ b/app/views/shared/_import_form.html.haml @@ -25,7 +25,7 @@ alert_options: { class: 'gl-mt-3 js-import-url-error hide' }, dismissible: false, close_button_options: { class: 'js-close-2fa-enabled-success-alert' }) do |c| - = c.body do + - c.with_body do = s_('Import|There is not a valid Git repository at this URL. If your HTTP repository is not publicly accessible, verify your credentials.') = render_if_exists 'shared/ee/import_form', f: f, ci_cd_only: ci_cd_only .row diff --git a/app/views/shared/_model_version_conflict.html.haml b/app/views/shared/_model_version_conflict.html.haml index 134dcf8db7f..8ab821c0435 100644 --- a/app/views/shared/_model_version_conflict.html.haml +++ b/app/views/shared/_model_version_conflict.html.haml @@ -1,6 +1,6 @@ = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false, alert_options: { class: 'gl-mb-5' }) do |c| - = c.body do + - c.with_body do - link_to_model = link_to(model_name, link_path, target: '_blank', rel: 'noopener noreferrer') = _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs.").html_safe % { model_name: model_name, link_to_model: link_to_model } diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml index 76830230cf6..e0d385024cd 100644 --- a/app/views/shared/_no_password.html.haml +++ b/app/views/shared/_no_password.html.haml @@ -2,8 +2,8 @@ = render Pajamas::AlertComponent.new(variant: :warning, alert_options: { class: 'js-no-password-message' }, close_button_options: { class: 'js-hide-no-password-message' }) do |c| - = c.body do + - c.with_body do = no_password_message - = c.actions do + - c.with_actions do = link_to _('Remind later'), '#', class: 'js-hide-no-password-message gl-alert-action btn btn-confirm btn-md gl-button' = link_to _("Don't show again"), profile_path(user: { hide_no_password: true }), method: :put, role: 'button', class: 'gl-alert-action btn btn-default btn-md gl-button' diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index be1df54a432..e9c0858e090 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -2,8 +2,8 @@ = render Pajamas::AlertComponent.new(variant: :warning, alert_options: { class: 'js-no-ssh-message' }, close_button_options: { class: 'js-hide-no-ssh-message'}) do |c| - = c.body do + - c.with_body do = s_("MissingSSHKeyWarningLink|You can't push or pull repositories using SSH until you add an SSH key to your profile.") - = c.actions do + - c.with_actions do = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "gl-alert-action btn btn-confirm btn-md gl-button" = link_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: { hide_no_ssh_key: true }), method: :put, role: 'button', class: 'gl-alert-action btn btn-default btn-md gl-button' diff --git a/app/views/shared/_outdated_browser.html.haml b/app/views/shared/_outdated_browser.html.haml index 0af378cb883..79d0231536b 100644 --- a/app/views/shared/_outdated_browser.html.haml +++ b/app/views/shared/_outdated_browser.html.haml @@ -1,6 +1,6 @@ - if outdated_browser? = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false) do |c| - = c.body do + - c.with_body do = s_('OutdatedBrowser|GitLab may not work properly, because you are using an outdated web browser.') %br - browser_link_start = ''.html_safe % { url: help_page_path('install/requirements', anchor: 'supported-web-browsers') } diff --git a/app/views/shared/_project_limit.html.haml b/app/views/shared/_project_limit.html.haml index 60be03c6631..ce49193e27b 100644 --- a/app/views/shared/_project_limit.html.haml +++ b/app/views/shared/_project_limit.html.haml @@ -2,8 +2,8 @@ = render Pajamas::AlertComponent.new(variant: :warning, dismissible: false, alert_options: { class: 'project-limit-message' }) do |c| - = c.body do + - c.with_body do = _("You won't be able to create new projects because you have reached your project limit.") - = c.actions do + - c.with_actions do = link_to _('Remind later'), '#', class: 'alert-link hide-project-limit-message btn gl-button btn-confirm' = link_to _("Don't show again"), profile_path(user: {hide_project_limit: true}), method: :put, class: 'alert-link btn gl-button btn-default gl-ml-3' diff --git a/app/views/shared/_service_ping_consent.html.haml b/app/views/shared/_service_ping_consent.html.haml index 700ffa7aa12..108d846e3ee 100644 --- a/app/views/shared/_service_ping_consent.html.haml +++ b/app/views/shared/_service_ping_consent.html.haml @@ -1,10 +1,10 @@ - if session[:ask_for_usage_stats_consent] = render Pajamas::AlertComponent.new(alert_options: { class: 'service-ping-consent-message' }) do |c| - = c.body do + - c.with_body do - docs_link = link_to _('collect usage information'), help_page_path('user/admin_area/settings/usage_statistics.md'), class: 'gl-link' - settings_link = link_to _('your settings'), metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'gl-link' = s_('To help improve GitLab, we would like to periodically %{docs_link}. This can be changed at any time in %{settings_link}.').html_safe % { docs_link: docs_link, settings_link: settings_link } - = c.actions do + - c.with_actions do - send_service_data_path = admin_application_settings_path(application_setting: { version_check_enabled: 1, usage_ping_enabled: 1 }) - not_now_path = admin_application_settings_path(application_setting: { version_check_enabled: 0, usage_ping_enabled: 0 }) = link_to _("Send service data"), send_service_data_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': true, 'data-service-ping-enabled': true, class: 'js-service-ping-consent-action alert-link btn gl-button btn-confirm' diff --git a/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml b/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml index ff4b2de2286..290152d5803 100644 --- a/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml +++ b/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml @@ -4,9 +4,9 @@ dismiss_endpoint: callouts_path, defer_links: 'true' }}, close_button_options: { data: { testid: 'close-account-recovery-regular-check-callout' }}) do |c| - = c.body do + - c.with_body do = s_('Profiles|Ensure you have two-factor authentication recovery codes stored in a safe place.') = link_to _('Learn more.'), help_page_path('user/profile/account/two_factor_authentication', anchor: 'recovery-codes'), target: '_blank', rel: 'noopener noreferrer' - = c.actions do + - c.with_actions do = link_to profile_two_factor_auth_path, class: 'deferred-link btn gl-alert-action btn-confirm btn-md gl-button' do = s_('Profiles|Manage two-factor authentication') diff --git a/app/views/shared/admin/_admin_note.html.haml b/app/views/shared/admin/_admin_note.html.haml index 2bf6baaf608..77854439bbb 100644 --- a/app/views/shared/admin/_admin_note.html.haml +++ b/app/views/shared/admin/_admin_note.html.haml @@ -1,7 +1,7 @@ - if @group.admin_note&.note? - text = @group.admin_note.note = render Pajamas::CardComponent.new(card_options: { class: 'gl-border-blue-500 gl-mb-5' }, header_options: { class: 'gl-bg-blue-500 gl-text-white' }) do |c| - - c.header do + - c.with_header do = s_('Admin|Admin notes') - - c.body do + - c.with_body do %p= text diff --git a/app/views/shared/errors/_gitaly_unavailable.html.haml b/app/views/shared/errors/_gitaly_unavailable.html.haml index ba3293a3f75..9b60071cb91 100644 --- a/app/views/shared/errors/_gitaly_unavailable.html.haml +++ b/app/views/shared/errors/_gitaly_unavailable.html.haml @@ -2,5 +2,5 @@ variant: :danger, dismissible: false, title: reason) do |c| - = c.body do + - c.with_body do = s_('The git server, Gitaly, is not available at this time. Please contact your administrator.') diff --git a/app/views/shared/file_hooks/_index.html.haml b/app/views/shared/file_hooks/_index.html.haml index 16e89463a4b..ba968c6b2d2 100644 --- a/app/views/shared/file_hooks/_index.html.haml +++ b/app/views/shared/file_hooks/_index.html.haml @@ -12,9 +12,9 @@ .col-lg-8.gl-mb-3 - if file_hooks.any? = render Pajamas::CardComponent.new do |c| - - c.header do + - c.with_header do = _('File Hooks (%{count})') % { count: file_hooks.count } - - c.body do + - c.with_body do %ul.content-list - file_hooks.each do |file| %li @@ -22,5 +22,5 @@ = File.basename(file) - else = render Pajamas::CardComponent.new do |c| - - c.body do + - c.with_body do .nothing-here-block= _('No file hooks found.') diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml index 8b5b4b6e5fa..1971c2da913 100644 --- a/app/views/shared/hook_logs/_content.html.haml +++ b/app/views/shared/hook_logs/_content.html.haml @@ -13,7 +13,7 @@ = render Pajamas::AlertComponent.new(title: _('Internal error occurred while delivering this webhook.'), variant: :danger, dismissible: false) do |c| - = c.body do + - c.with_body do = _('Error: %{error}') % { error: hook_log.internal_error_message } %h4= _('Response') @@ -41,6 +41,3 @@ - hook_log.request_headers.each do |k, v| #{k}: #{v} %br - - - diff --git a/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml b/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml index de4439a8fde..c77cc687e4f 100644 --- a/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml +++ b/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml @@ -3,7 +3,7 @@ variant: :warning, dismissible: false, alert_options: { class: 'gl-mt-5', data: { testid: "slack-notifications-deprecation" } }) do |c| - = c.body do + - c.with_body do - help_page_link = help_page_url('user/project/integrations/gitlab_slack_application') - learn_more_link = ''.html_safe % { url: help_page_link } @@ -13,7 +13,7 @@ variant: :warning, dismissible: false, alert_options: { class: 'gl-mt-5', data: { testid: "slack-notifications-deprecation" } }) do |c| - = c.body do + - c.with_body do - help_page_link = help_page_url('user/project/integrations/gitlab_slack_application') - learn_more_link = ''.html_safe % { url: help_page_link } diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml index beeb328aedf..0264196f60c 100644 --- a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -7,12 +7,12 @@ .col-lg-9 = render Pajamas::CardComponent.new(header_options: { class: 'gl-display-flex gl-align-items-center' }, body_options: { class: 'gl-p-0' }, card_options: { class: 'gl-mb-5 custom-monitored-metrics js-panel-custom-monitored-metrics', data: { active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } }) do |c| - - c.header do + - c.with_header do %strong = s_('PrometheusService|Custom metrics') = gl_badge_tag 0, nil, class: 'gl-ml-2 js-custom-monitored-count' = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden' - - c.body do + - c.with_body do .flash-container.hidden .flash-warning .flash-text diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml index 7cd4eeee5f8..cb78faa383a 100644 --- a/app/views/shared/integrations/prometheus/_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_metrics.html.haml @@ -9,11 +9,11 @@ .col-lg-9 = render Pajamas::CardComponent.new(body_options: { class: 'gl-p-0' }, card_options: { class: 'gl-mb-5 js-panel-monitored-metrics', data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/index') }}) do |c| - - c.header do + - c.with_header do %strong = s_('PrometheusService|Common metrics') = gl_badge_tag 0, nil, class: 'js-monitored-count' - - c.body do + - c.with_body do .loading-metrics.js-loading-metrics %p.m-3 = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner') @@ -24,12 +24,12 @@ %ul.list-unstyled.metrics-list.hidden.js-metrics-list = render Pajamas::CardComponent.new(body_options: { class: 'hidden gl-p-0' }, card_options: { class: 'hidden js-panel-missing-env-vars' }) do |c| - - c.header do + - c.with_header do = sprite_icon('chevron-lg-right', css_class: 'panel-toggle js-panel-toggle-right') = sprite_icon('chevron-lg-down', css_class: 'panel-toggle js-panel-toggle-down hidden') = s_('PrometheusService|Missing environment variable') = gl_badge_tag 0, nil, class: 'js-env-var-count' - - c.body do + - c.with_body do .flash-container .flash-notice .flash-text diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index 76678c48a86..b8f98c28574 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -13,7 +13,7 @@ - if @can_bulk_update .check-all-holder.gl-display-none.gl-sm-display-block.hidden.gl-float-left.gl-mr-3.gl-line-height-36 = render Pajamas::CheckboxTagComponent.new(name: 'check-all-issues', value: nil) do |c| - = c.label do + - c.with_label do %span.gl-sr-only = _('Select all') .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row diff --git a/app/views/shared/issuable/form/_branch_chooser.html.haml b/app/views/shared/issuable/form/_branch_chooser.html.haml index 634e927f891..01f1dbdb3cf 100644 --- a/app/views/shared/issuable/form/_branch_chooser.html.haml +++ b/app/views/shared/issuable/form/_branch_chooser.html.haml @@ -42,7 +42,7 @@ - if source_level < target_level = render Pajamas::AlertComponent.new(variant: :warning, dismissible: false, alert_options: { class: 'gl-mb-4' }) do |c| - = c.body do + - c.with_body do = visibilityMismatchString %br = _('Review the target project before submitting to avoid exposing %{source} changes.') % { source: source_visibility } diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index 8e9793cdba5..051a1a75f2b 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -12,7 +12,7 @@ .form-check.gl-pl-0 = hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil = render Pajamas::CheckboxTagComponent.new(name: 'merge_request[force_remove_source_branch]', checked: issuable.force_remove_source_branch?, value: '1', checkbox_options: { class: 'js-form-update' }) do |c| - = c.label do + - c.with_label do = _("Delete source branch when merge request is accepted.") - if !project.squash_never? @@ -20,14 +20,14 @@ - if project.squash_always? = hidden_field_tag 'merge_request[squash]', '1', id: nil = render Pajamas::CheckboxTagComponent.new(name: 'merge_request[squash]', checked: project.squash_enabled_by_default?, value: '1', checkbox_options: { class: 'js-form-update', disabled: true }) do |c| - = c.label do + - c.with_label do = _("Squash commits when merge request is accepted.") = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' - = c.help_text do + - c.with_help_text do = _('Required in this project.') - else = hidden_field_tag 'merge_request[squash]', '0', id: nil = render Pajamas::CheckboxTagComponent.new(name: 'merge_request[squash]', checked: issuable_squash_option?(issuable, project), value: '1', checkbox_options: { class: 'js-form-update' }) do |c| - = c.label do + - c.with_label do = _("Squash commits when merge request is accepted.") = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml index be836f4b8a9..36000f3cc67 100644 --- a/app/views/shared/issuable/form/_title.html.haml +++ b/app/views/shared/issuable/form/_title.html.haml @@ -8,7 +8,7 @@ - if issuable.respond_to?(:draft?) .gl-pt-3 = render Pajamas::CheckboxTagComponent.new(name: 'mark_as_draft', checkbox_options: { class: 'js-toggle-draft' }) do |c| - = c.label do + - c.with_label do = s_('MergeRequests|Mark as draft') - = c.help_text do + - c.with_help_text do = s_('MergeRequests|Drafts cannot be merged until marked ready.') diff --git a/app/views/shared/members/_requests.html.haml b/app/views/shared/members/_requests.html.haml index 31625c22a94..45e34a63f91 100644 --- a/app/views/shared/members/_requests.html.haml +++ b/app/views/shared/members/_requests.html.haml @@ -6,12 +6,12 @@ - return if requesters.empty? = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5', data: { testid: 'access-requests' } }, body_options: { class: 'gl-p-0' }) do |c| - - c.header do + - c.with_header do = _('Users requesting access to') %strong= membership_source.name = gl_badge_tag requesters.size = render 'shared/members/manage_access_button', path: membership_source.is_a?(Project) ? project_project_members_path(@project, tab: 'access_requests') : group_group_members_path(@group, tab: 'access_requests') - - c.body do + - c.with_body do %ul.content-list.members-list = render partial: 'shared/members/member', collection: requesters, as: :member, diff --git a/app/views/shared/milestones/_issuables.html.haml b/app/views/shared/milestones/_issuables.html.haml index 2502f7fca62..d56e24a070a 100644 --- a/app/views/shared/milestones/_issuables.html.haml +++ b/app/views/shared/milestones/_issuables.html.haml @@ -2,7 +2,7 @@ - primary = local_assigns.fetch(:primary, false) = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }, body_options: { class: 'gl-py-0' }, header_options: { class: milestone_header_class(primary, issuables) }) do |c| - - c.header do + - c.with_header do .gl-flex-grow-2 = title .gl-ml-3.gl-flex-shrink-0.gl-font-weight-bold.gl-white-space-nowrap{ class: milestone_counter_class(primary) } @@ -11,7 +11,7 @@ = sprite_icon('issues', css_class: 'gl-vertical-align-text-bottom') = number_with_delimiter(issuables.length) = render_if_exists "shared/milestones/issuables_weight", issuables: issuables - = c.body do + - c.with_body do - class_prefix = dom_class(issuables).pluralize %ul{ class: "content-list milestone-#{class_prefix}-list", id: "#{class_prefix}-list-#{id}" } = render partial: 'shared/milestones/issuable', diff --git a/app/views/shared/milestones/_milestone_complete_alert.html.haml b/app/views/shared/milestones/_milestone_complete_alert.html.haml index bde8a0b91b0..dc923465c2f 100644 --- a/app/views/shared/milestones/_milestone_complete_alert.html.haml +++ b/app/views/shared/milestones/_milestone_complete_alert.html.haml @@ -4,5 +4,5 @@ = render Pajamas::AlertComponent.new(variant: :success, alert_options: { data: { testid: 'all-issues-closed-alert' }}, dismissible: false) do |c| - = c.body do + - c.with_body do = yield diff --git a/app/views/shared/promotions/_promote_servicedesk.html.haml b/app/views/shared/promotions/_promote_servicedesk.html.haml index 57ac1370f8d..24071ed0da4 100644 --- a/app/views/shared/promotions/_promote_servicedesk.html.haml +++ b/app/views/shared/promotions/_promote_servicedesk.html.haml @@ -2,7 +2,7 @@ close_options: {'aria-label' => s_('Promotions|Dismiss Service Desk promotion'), class: 'js-close-callout'}, svg_path: 'illustrations/service_desk_callout.svg', button_text: s_('Promotions|Configure Service Desk'), button_link: help_page_path('user/project/service_desk.html', anchor: 'configuring-service-desk')) do |c| - - c.title do + - c.with_title do = _('Improve customer support with Service Desk') %p = _('Service Desk allows people to create issues in your GitLab instance without their own user account. It provides a unique email address for end users to create issues in a project. Replies can be sent either through the GitLab interface or by email. End users only see threads through email.') diff --git a/app/views/shared/runners/_runner_type_alert.html.haml b/app/views/shared/runners/_runner_type_alert.html.haml index 63ecdaf4149..26c3501e3d9 100644 --- a/app/views/shared/runners/_runner_type_alert.html.haml +++ b/app/views/shared/runners/_runner_type_alert.html.haml @@ -4,13 +4,13 @@ = render Pajamas::AlertComponent.new(alert_options: alert_options, title: s_('Runners|This runner is available to all projects and subgroups in a group.'), dismissible: false) do |c| - = c.body do + - c.with_body do = s_('Runners|Use Group runners when you want all projects in a group to have access to a set of runners.') = link_to _('Learn more.'), help_page_path('ci/runners/runners_scope', anchor: 'group-runners'), target: '_blank', rel: 'noopener noreferrer' - else = render Pajamas::AlertComponent.new(alert_options: alert_options, title: s_('Runners|This runner is associated with specific projects.'), dismissible: false) do |c| - = c.body do + - c.with_body do = s_('Runners|You can set up a project runner to be used by multiple projects but you cannot make this a shared or group runner.') = link_to _('Learn more.'), help_page_path('ci/runners/runners_scope', anchor: 'project-runners'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/shared/topics/_topic.html.haml b/app/views/shared/topics/_topic.html.haml index 9b9630733fd..be3672dc6d6 100644 --- a/app/views/shared/topics/_topic.html.haml +++ b/app/views/shared/topics/_topic.html.haml @@ -4,7 +4,7 @@ .col-lg-3.col-md-4.col-sm-12 = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }, body_options: { class: 'gl-display-flex gl-align-items-center' }) do |c| - = c.body do + - c.with_body do = link_to detail_page_link do = render Pajamas::AvatarComponent.new(topic, size: 48, alt: '', class: 'gl-mr-3') = link_to detail_page_link do diff --git a/app/views/shared/users/_user.html.haml b/app/views/shared/users/_user.html.haml index 51eb24f6d4a..e3c1ca4d9cf 100644 --- a/app/views/shared/users/_user.html.haml +++ b/app/views/shared/users/_user.html.haml @@ -2,7 +2,7 @@ .col-lg-3.col-md-4.col-sm-12 = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }) do |c| - = c.body do + - c.with_body do = render Pajamas::AvatarComponent.new(user, size: 48, alt: "", class: 'gl-float-left gl-mr-3') .user-info diff --git a/app/views/shared/web_hooks/_hook_errors.html.haml b/app/views/shared/web_hooks/_hook_errors.html.haml index 098cc19c435..0e5f6d844cd 100644 --- a/app/views/shared/web_hooks/_hook_errors.html.haml +++ b/app/views/shared/web_hooks/_hook_errors.html.haml @@ -8,12 +8,12 @@ root_namespace: hook.parent.root_namespace.path } = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook rate limit has been reached'), variant: :danger) do |c| - = c.body do + - c.with_body do = s_("Webhooks|Webhooks for %{root_namespace} are now disabled because they've been triggered more than %{limit} times per minute. They'll be automatically re-enabled in the next minute.").html_safe % placeholders - elsif hook.permanently_disabled? = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook failed to connect'), variant: :danger) do |c| - = c.body do + - c.with_body do = s_('Webhooks|The webhook failed to connect, and is disabled. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % { strong_start: strong_start, strong_end: strong_end } - elsif hook.temporarily_disabled? - help_path = help_page_path('user/project/integrations/webhooks', anchor: 'webhook-fails-or-multiple-webhook-requests-are-triggered') @@ -24,5 +24,5 @@ help_link_end: link_end } = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook fails to connect'), variant: :warning) do |c| - = c.body do + - c.with_body do = s_('Webhooks|The webhook %{help_link_start}failed to connect%{help_link_end}, and will retry in %{retry_time}. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % placeholders diff --git a/app/views/shared/web_hooks/_index.html.haml b/app/views/shared/web_hooks/_index.html.haml index 868633143cd..8a81e697a59 100644 --- a/app/views/shared/web_hooks/_index.html.haml +++ b/app/views/shared/web_hooks/_index.html.haml @@ -1,9 +1,9 @@ %hr = render Pajamas::CardComponent.new(card_options: { id: 'webhooks-index' }, body_options: { class: 'gl-py-0'}) do |c| - - c.header do + - c.with_header do = hook_class.underscore.humanize.titleize.pluralize (#{hooks.size}) - - c.body do + - c.with_body do - if hooks.any? %ul.content-list - hooks.each do |hook| diff --git a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml index f8e2dc3d8dd..cbbb2f51fd5 100644 --- a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml +++ b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml @@ -5,9 +5,9 @@ title: s_('Webhooks|Webhook disabled'), alert_options: { class: 'gl-my-4 js-web-hook-disabled-callout', data: { feature_id: Users::CalloutsHelper::WEB_HOOK_DISABLED, dismiss_endpoint: project_callouts_path, project_id: @project.id, defer_links: 'true'} }) do |c| - = c.body do + - c.with_body do = s_('Webhooks|A webhook in this project was automatically disabled after being retried multiple times.') = succeed '.' do = link_to _('Learn more'), help_page_path('user/project/integrations/webhooks', anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer' - = c.actions do + - c.with_actions do = link_to s_('Webhooks|Go to webhooks'), project_hooks_path(@project, anchor: 'webhooks-index'), class: 'btn gl-alert-action btn-confirm gl-button' diff --git a/app/views/shared/wikis/empty.html.haml b/app/views/shared/wikis/empty.html.haml index d30a37aaa3e..e83cad0d42f 100644 --- a/app/views/shared/wikis/empty.html.haml +++ b/app/views/shared/wikis/empty.html.haml @@ -6,7 +6,7 @@ = render Pajamas::AlertComponent.new(alert_options: { id: 'error_explanation', class: 'gl-mb-3'}, dismissible: false, variant: :danger) do |c| - = c.body do + - c.with_body do %ul.gl-pl-4 = @error diff --git a/doc/user/profile/account/delete_account.md b/doc/user/profile/account/delete_account.md index a2c82fdeadf..0b6aed01309 100644 --- a/doc/user/profile/account/delete_account.md +++ b/doc/user/profile/account/delete_account.md @@ -17,6 +17,11 @@ Deleting a user deletes all projects in that user namespace. ## Delete your own account +> Delay between a user deleting their own account and deletion of the user record introduced in GitLab 16.0 [with a flag](../../../administration/feature_flags.md) named `delay_delete_own_user`. Enabled by default on GitLab.com. + +FLAG: +On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `delay_delete_own_user`. On GitLab.com, this feature is available. + As a user, to delete your own account: 1. On the top bar, in the upper-right corner, select your avatar. @@ -24,6 +29,9 @@ As a user, to delete your own account: 1. On the left sidebar, select **Account**. 1. Select **Delete account**. +NOTE: +On GitLab.com, there is a seven day delay between a user deleting their own account and deletion of the user record. During this time, that user is [blocked](../../admin_area/moderate_users.md#block-a-user) and a new account with the same email address or username cannot be created. + ## Delete users and user contributions **(FREE SELF)** As an administrator, to delete a user account: diff --git a/qa/Gemfile b/qa/Gemfile index bf9def83a01..5a1493a033f 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -40,7 +40,7 @@ gem 'chemlab', '~> 0.10' gem 'chemlab-library-www-gitlab-com', '~> 0.1', '>= 0.1.1' # dependencies for jenkins client -gem 'nokogiri', '~> 1.14', '>= 1.14.4' +gem 'nokogiri', '~> 1.15' gem 'deprecation_toolkit', '~> 2.0.3', require: false diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index bbc06686b10..46ca11233fa 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -185,13 +185,13 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2023.0218.1) mini_mime (1.1.0) - mini_portile2 (2.8.1) + mini_portile2 (2.8.2) minitest (5.18.0) multi_json (1.15.0) multi_xml (0.6.0) netrc (0.11.0) - nokogiri (1.14.4) - mini_portile2 (~> 2.8.0) + nokogiri (1.15.0) + mini_portile2 (~> 2.8.2) racc (~> 1.4) octokit (6.1.1) faraday (>= 1, < 3) @@ -331,7 +331,7 @@ DEPENDENCIES gitlab_quality-test_tooling (~> 0.4.0) influxdb-client (~> 2.9) knapsack (~> 4.0) - nokogiri (~> 1.14, >= 1.14.4) + nokogiri (~> 1.15) octokit (~> 6.1.1) parallel (~> 1.23) parallel_tests (~> 4.2, >= 4.2.1) diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb index 934aa182b12..7e0337035e3 100644 --- a/qa/qa/page/main/menu.rb +++ b/qa/qa/page/main/menu.rb @@ -17,11 +17,11 @@ module QA # Define alternative navbar (super sidebar) which does not yet implement all the same elements view 'app/assets/javascripts/super_sidebar/components/super_sidebar.vue' do element :navbar, required: true # TODO: rename to sidebar once it's default implementation - element :user_menu, required: !Runtime::Env.phone_layout? - element :user_avatar_content, required: !Runtime::Env.phone_layout? end view 'app/assets/javascripts/super_sidebar/components/user_menu.vue' do + element :user_menu, required: !Runtime::Env.phone_layout? + element :user_avatar_content, required: !Runtime::Env.phone_layout? element :sign_out_link element :edit_profile_link end @@ -32,6 +32,7 @@ module QA view 'app/assets/javascripts/super_sidebar/components/user_bar.vue' do element :global_search_button + element :stop_impersonation_link end view 'app/assets/javascripts/super_sidebar/components/global_search/components/global_search.vue' do @@ -252,19 +253,14 @@ module QA end def has_admin_area_link?(wait: Capybara.default_max_wait_time) + return super if Runtime::Env.super_sidebar_enabled? + within_top_menu do click_element(:navbar_dropdown, title: 'Menu') has_element?(:admin_area_link, wait: wait) end end - def has_no_admin_area_link?(wait: Capybara.default_max_wait_time) - within_top_menu do - click_element(:navbar_dropdown, title: 'Menu') - has_no_element?(:admin_area_link, wait: wait) - end - end - def click_stop_impersonation_link click_element(:stop_impersonation_link) end diff --git a/qa/qa/page/project/sub_menus/super_sidebar/code.rb b/qa/qa/page/project/sub_menus/super_sidebar/code.rb index 44d46725b47..fae7210e3c8 100644 --- a/qa/qa/page/project/sub_menus/super_sidebar/code.rb +++ b/qa/qa/page/project/sub_menus/super_sidebar/code.rb @@ -36,6 +36,10 @@ module QA open_code_submenu('Compare revisions') end + def go_to_merge_requests + open_code_submenu('Merge requests') + end + private def open_code_submenu(sub_menu) diff --git a/qa/qa/page/project/sub_menus/super_sidebar/main.rb b/qa/qa/page/project/sub_menus/super_sidebar/main.rb index 63641248b15..bf2619737ab 100644 --- a/qa/qa/page/project/sub_menus/super_sidebar/main.rb +++ b/qa/qa/page/project/sub_menus/super_sidebar/main.rb @@ -8,14 +8,6 @@ module QA module Main extend QA::Page::PageConcern - def self.included(base) - super - - base.class_eval do - include QA::Page::SubMenus::SuperSidebar::Main - end - end - def click_project click_element(:nav_item_link, submenu_item: 'Project overview') end diff --git a/qa/qa/page/project/sub_menus/super_sidebar/plan.rb b/qa/qa/page/project/sub_menus/super_sidebar/plan.rb index fe45bb6bb65..fe77789f371 100644 --- a/qa/qa/page/project/sub_menus/super_sidebar/plan.rb +++ b/qa/qa/page/project/sub_menus/super_sidebar/plan.rb @@ -25,6 +25,10 @@ module QA def go_to_open_jira open_plan_submenu("Open Jira") end + + def go_to_issues + open_plan_submenu("Issues") + end end end end diff --git a/qa/qa/page/sub_menus/super_sidebar/context_switcher.rb b/qa/qa/page/sub_menus/super_sidebar/context_switcher.rb index 1fd35e57dc2..e5f2e702e60 100644 --- a/qa/qa/page/sub_menus/super_sidebar/context_switcher.rb +++ b/qa/qa/page/sub_menus/super_sidebar/context_switcher.rb @@ -30,13 +30,22 @@ module QA go_to_context("Admin Area") end + def has_admin_area_link?(wait: Capybara.default_max_wait_time) + open_context_switcher + + has_element?(:nav_item_link, submenu_item: "Admin Area", wait: wait) + end + private def go_to_context(sub_menu) - click_element(:context_switcher) unless has_element?(:context_navigation, wait: 0) - + open_context_switcher click_element(:nav_item_link, submenu_item: sub_menu) end + + def open_context_switcher + click_element(:context_switcher) unless has_element?(:context_navigation, wait: 0) + end end end end diff --git a/qa/qa/page/sub_menus/super_sidebar/manage.rb b/qa/qa/page/sub_menus/super_sidebar/manage.rb index 535b29e607f..369171299b2 100644 --- a/qa/qa/page/sub_menus/super_sidebar/manage.rb +++ b/qa/qa/page/sub_menus/super_sidebar/manage.rb @@ -19,10 +19,6 @@ module QA open_manage_submenu('Labels') end - def go_to_milestones - open_manage_submenu('Milestones') - end - private def open_manage_submenu(sub_menu) diff --git a/qa/qa/page/sub_menus/super_sidebar/plan.rb b/qa/qa/page/sub_menus/super_sidebar/plan.rb index e4b9fcf099c..839ba89cedb 100644 --- a/qa/qa/page/sub_menus/super_sidebar/plan.rb +++ b/qa/qa/page/sub_menus/super_sidebar/plan.rb @@ -19,6 +19,10 @@ module QA open_plan_submenu("Wiki") end + def go_to_milestones + open_plan_submenu('Milestones') + end + private def open_plan_submenu(sub_menu) diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index cde36ba80c4..cc16d2dfc76 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -569,7 +569,7 @@ module QA end def super_sidebar_enabled? - enabled?(ENV['QA_SUPER_SIDEBAR_ENABLED'], default: false) + enabled?(ENV['QA_SUPER_SIDEBAR_ENABLED'], default: true) end def require_slack_env! diff --git a/spec/helpers/registrations_helper_spec.rb b/spec/helpers/registrations_helper_spec.rb index b2f9a794cb3..a5ad80abd11 100644 --- a/spec/helpers/registrations_helper_spec.rb +++ b/spec/helpers/registrations_helper_spec.rb @@ -2,10 +2,18 @@ require 'spec_helper' -RSpec.describe RegistrationsHelper do +RSpec.describe RegistrationsHelper, feature_category: :user_management do describe '#signup_username_data_attributes' do it 'has expected attributes' do expect(helper.signup_username_data_attributes.keys).to include(:min_length, :min_length_message, :max_length, :max_length_message, :qa_selector) end end + + describe '#register_omniauth_params' do + it 'adds intent to register' do + allow(helper).to receive(:glm_tracking_params).and_return({}) + + expect(helper.register_omniauth_params({})).to eq({ intent: :register }) + end + end end diff --git a/spec/support/stub_dot_com_check.rb b/spec/support/stub_dot_com_check.rb index 6934b33d111..db2904d3ac5 100644 --- a/spec/support/stub_dot_com_check.rb +++ b/spec/support/stub_dot_com_check.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.configure do |config| - %i[saas saas_registration].each do |metadata| + %i[saas saas_registration saas_sso_registration].each do |metadata| config.before(:context, metadata) do # Ensure Gitlab.com? returns true during context. # This is needed for let_it_be which is shared across examples,