Add attributes for visual indicators on imported items
What does this MR do and why?
This MR is an integration MR between backend and frontend. It passes data via data attributes / helpers / GraphQL from backend to frontend so the "Imported" badge / text is rendered properly.
This is done for Issues, MRs, Epics, Designs, Snippets, Notes (comments / system notes), User profile activity.
Changelog: changed
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
Screenshots can be found in each MR listed here: #443492 (comment 1889447118).
Page | Screenshot |
---|---|
Issue | |
Epic | |
MR | |
Design | |
Snippet | |
User profile |
How to set up and validate locally
Apply this diff to show the "Imported" badge / text:
diff --git a/app/models/concerns/import/has_import_source.rb b/app/models/concerns/import/has_import_source.rb
index f617c7accc38..e8a3fad67b93 100644
--- a/app/models/concerns/import/has_import_source.rb
+++ b/app/models/concerns/import/has_import_source.rb
@@ -23,6 +23,7 @@ module HasImportSource
end
def imported?
+ return true
!imported_from_none?
end
end
Page | Example URL |
---|---|
Issue | http://127.0.0.1:3000/gitlab-org/gitlab-test/-/issues/49/ |
Epic | http://127.0.0.1:3000/groups/flightjs/copy/gitlab-instance-2/-/epics/5 |
MR | http://127.0.0.1:3000/gitlab-org/gitlab-test/-/merge_requests/6 |
Design | http://127.0.0.1:3000/gitlab-org/gitlab-test/-/issues/49/designs/Screenshot_2024-05-08_at_21.42.46.png |
Snippet | http://127.0.0.1:3000/gitlab-org/gitlab-test/-/snippets/21 |
User profile | http://127.0.0.1:3000/root |
Related to #443492 (closed)