Skip to content

Make badges in the header Pajamas compliant

What does this MR do and why?

This migrates badges in layouts/header/_default.html.haml to the shared gl_badge util. This affects the following badges:

  • Canary badge
  • Issue count
  • MR total count
  • Assigned MRs count
  • Review requests count
  • Todos count

Screenshots or screen recordings

Before After
Screen_Shot_2022-02-01_at_10.20.21_AM Screen_Shot_2022-02-01_at_10.13.27_AM

How to set up and validate locally

  1. To get the Next badge to show up, override the Canary condition like so:

    diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
    index 246a31f86c9..d24f8365cc1 100644
    --- a/app/views/layouts/header/_default.html.haml
    +++ b/app/views/layouts/header/_default.html.haml
    @@ -14,7 +14,7 @@
                 - if logo_text.present?
                   %span.logo-text.d-none.d-lg-block.gl-ml-3
                     = logo_text
    -          - if Gitlab.com_and_canary?
    +          - if true
                 = link_to Gitlab::Saas.canary_toggle_com_url, class: 'canary-badge bg-transparent', data: { qa_selector: 'canary_badge_link' }, target: :_blank, rel: 'noopener noreferrer' do
                   %span.gl-badge.gl-bg-green-500.gl-text-white.gl-rounded-pill.gl-font-weight-bold.gl-py-1
                     = _('Next')

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #344388 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading