Skip to content

Add CTA to private catalog in pipeline editor

What does this MR do and why?

We are adding a CTA to browse the private catalog inside the pipeline editor header. This should only be visible to user who have access to the catalog ,meanign that we are using the policy can_view_namespace_catalog. Using that helper from ee/app/helpers/ee/ci/catalog/resources_helper.rb will already contain all the permissions check, including licenses and FF. Clicking on the button should take you to the ci catalog index page.

I also noticed while I was updating this component that action buttons in the header were overflowing on smaller screens. I fixed it for now by making them render in a column rather than a row.

Design: #393209[MVC_-_Editor.png]

Screenshots or screen recordings

Desktop

Before After
Screenshot_2023-05-19_at_1.59.27_PM Screenshot_2023-05-19_at_1.40.21_PM

Mobile

Before After
Screenshot_2023-05-19_at_2.00.02_PM Screenshot_2023-05-19_at_1.40.42_PM

Video

Screen_Recording_2023-05-19_at_1.41.14_PM

How to set up and validate locally

  1. Make sure you have an ultimate license for your GDK
  2. Enable the feature flag: ci_namespace_catalog_experimental
  3. Login as a user
  4. Create a few projects that you will be able to convert to Ci resources (ideally 20+).
  5. Once you have done so, get the ID of the first new project you wanted to convert. Then in Rails console, run:
projects = Project.where("id > ?", your_first_project_id)
projects.each do |project|
  project.update!(description: 'description')  
  ::Ci::Catalog::Resource.new(project_id: project.id).save   
end  
  1. Navigate to CI -> Pipeline editor
  2. Notice the new button to take you to the catalog
  3. Click on it
  4. Notice you are taken to the catalog index page
  5. Turn off the FF
  6. Go back to CI -> Pipeline editor
  7. Notice that you do not see the button anymore

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 #393209 (closed)

Edited by Frédéric Caplette

Merge request reports