Skip to content

Migrate bs-callout to alert components in lets_encrypt_callout

Taras Tadai requested to merge 441415-migrate-lets-encrypt-callout-to-alert into master

What does this MR do and why?

Migrate deprecated bs-callout to Pajamas::AlertComponent in app/views/projects/pages_domains/_lets_encrypt_callout.html.haml

It's a part of Pajamas adoption project

Changed according to migration guide available in next epic: &5213

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
lets_encrypt_old lets_encrypt_new

How to set up and validate locally

  1. Enable pages in config/gitlab.yml:
development:
  pages:
    enabled: true
    access_control: false
    host: 127.0.0.1.nip.io
    port: 3010
    https: false # Set to true if you serve the pages with HTTPS
    external_https: ["1.1.1.1:80", "[2001::1]:80"] # If defined, enables custom domain support in GitLab Pages
  1. Open some project
  2. Goto Deploy -> Pages
  3. Setup pages(if required).
  4. Add new domain.
  5. Open created domain and verify warning messages. Mock related if/elsif/else conditions to see warnings:

app/views/projects/pages_domains/_lets_encrypt_callout.html.haml

- auto_ssl_available_and_enabled = true # mock it with true to not assign "d-none" class
- if true # mock
  - if true # mock
    - if true # mock
      .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
        .row
          .col-sm-10.offset-sm-2
            = render Pajamas::AlertComponent.new(dismissible: false, variant: :warning) do |c|
              - c.with_body do
                = _("Something went wrong while obtaining the Let's Encrypt certificate.")
              - c.with_actions do
                = link_button_to s_('GitLabPagesDomains|Retry'), retry_auto_ssl_project_pages_domain_path(@project, domain_presenter), method: :post, size: :small
    - if true # mock
      .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
        .row
          .col-sm-10.offset-sm-2
            = render Pajamas::AlertComponent.new(dismissible: false, show_icon: false) do |c|
              - c.with_body do
                = _("GitLab is obtaining a Let's Encrypt SSL certificate for this domain. This process can take some time. Please try again later.")
- if true # mock
  .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
    .row
      .col-sm-10.offset-sm-2
        = render Pajamas::AlertComponent.new(dismissible: false, variant: :warning, show_icon: false) do |c|
          - c.with_body do
            = _("A Let's Encrypt SSL certificate can not be obtained until your domain is verified.")

Related to #441415 (closed)

Edited by Taras Tadai

Merge request reports