Skip to content

Add the Catalog ReadMe tab

What does this MR do and why?

We add a new readme tab. For now it is the only tab, but that will soon change with the addition of the components tab and eventually steps as well.

Because we will now have tabs, this mean that the details component becomes the wrapper where we have tabs and conditionally render content based on the selected tab. So ci_resource_details contains the tab and is basically the actual details section while _readme is for the readme content and later we will add a new tab which will render the metadata.

We also now defer the readmeHtml fetching to the readme component. This is because we only want to fetch it when the user goes to that tab, not as a default fetch. This way, when we add the new tab (and it will be the default), the readme tab will only be fetched if the user access it.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2023-09-27_at_9.40.30_AM Screenshot_2023-09-27_at_9.23.16_AM

How to set up and validate locally

  1. Make sure you have an premium license for your GDK
  2. Login as an admin user
  3. Create a few projects that you will be able to convert to Ci resources. Create them under the admin namespace for ease of testing.
  4. 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 /$namespace/$project/-/ci/catalog/resources/. Any project under the same namespace will do (in this case, anything under the admin namespace)
  2. Click on a resource
  3. Notice the new layout!

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

Edited by Frédéric Caplette

Merge request reports