Skip to content

Add "Imported" badge to Snippet header

What does this MR do and why?

Add "Imported" badge to Snippet header. This is not shown at the moment as the backend is not providing any data.

Changelog: changed

Here is the list of visual indicator MRs for "Imported" badge:

MR Status
Issues: !149876 (merged) Merged
Merge requests: !150095 (merged) Merged
Epics: !150266 (merged) Merged
User profile activity: !150485 (merged) Merged
Designs: !150625 (merged) 🚧 In review
Snippets: !150828 (merged) 👈 You are here

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

Snippet
Snippet_with_imported_badge

How to set up and validate locally

  1. Go to Project > Code > Snippets and create a snippet if there isn't already one. Go to the snippet details page. For example, http://127.0.0.1:3000/gitlab-org/gitlab-test/-/snippets/21.
  2. Apply this diff to show the imported badge:
diff --git a/app/assets/javascripts/snippets/components/snippet_header.vue b/app/assets/javascripts/snippets/components/snippet_header.vue
index 3ee0a582df76..f63754fe721e 100644
--- a/app/assets/javascripts/snippets/components/snippet_header.vue
+++ b/app/assets/javascripts/snippets/components/snippet_header.vue
@@ -361,7 +361,7 @@ export default {
         </div>
 
         <imported-badge
-          v-if="snippet.imported"
+          v-if="snippet.imported || true"
           :importable-type="$options.TYPE_SNIPPET"
           class="gl-mr-2"
         />

Related to #457868 (closed)

Edited by Justin Ho Tuan Duong

Merge request reports

Loading