Skip to content

Protected packages + containers: Badge "protected" as reusable component

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

  • Extracting the protected badge into a reusable component.
  • These changes are based on a comment from @seggenbreger, see !158600 (comment 2032445258)

To identify which existing vue components (or pages) could benefit from the new resuable component "ProtectedBadge", we looked for occurrences of the string literal "protected". We found the following cases:

Note: In order to determine the other potential When looking for other occurrences of the protected https://gitlab.com/gitlab-community/gitlab/-/blob/d1e092fb6967cc82d5e8734790598fc723b3b27d/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_table.vue#L190

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

Luckily (or by intention) there are no frontend changes because we just replaced an existing component. However, feel free to check if this is the case.

File Before After
https://gitlab.com/gitlab-org/gitlab/-/blob/533ed762d66e602e8f2ef32755bfcaca8be2bbbb/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/details_header.vue grafik
https://gitlab.com/gitlab-org/gitlab/-/blob/533ed762d66e602e8f2ef32755bfcaca8be2bbbb/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/image_list_row.vue grafik
https://gitlab.com/gitlab-org/gitlab/-/blob/533ed762d66e602e8f2ef32755bfcaca8be2bbbb/app/assets/javascripts/packages_and_registries/package_registry/components/details/package_title.vue grafik
https://gitlab.com/gitlab-org/gitlab/-/blob/533ed762d66e602e8f2ef32755bfcaca8be2bbbb/app/assets/javascripts/packages_and_registries/package_registry/components/list/package_list_row.vue grafik
https://gitlab.com/gitlab-org/gitlab/-/blob/533ed762d66e602e8f2ef32755bfcaca8be2bbbb/app/assets/javascripts/projects/settings/repository/branch_rules/components/branch_rule.vue grafik

How to set up and validate locally

Related to #467718 (closed)

Edited by Gerardo Navarro

Merge request reports

Loading