Skip to content

Add ability to toggle off a catalog resource

What does this MR do and why?

Add feature that users can "unmark project as a catalog resource". This leverage a new mutation input type to mark and unmark a resource instead of just marking.

So now that this is a two-way door action, we remove the modal warning when marking and instead show a warning when unmarking since it removes a resource from the CI/CD Catalog. The resource is still usable, but not visible anymore.

Screenshots or screen recordings

Video

Screen_Recording_2023-11-17_at_2.55.20_PM

How to set up and validate locally

  1. Enable the FF global_ci_catalog
  2. Create a new project
  3. Add a Readme file
  4. Go to the project settings and add a project description
  5. Then in General project settings under Visibility, find the Set this project as a Catalog resource toggle
  6. click on it
  7. Notice the success message
  8. Navigate to Explore -> CI/CD Catalog
  9. There should still be nothing visible, because the resource is not published
  10. Open the rails console with rails c
  11. Run Ci::Catalog::Resource.last.update(state: "published")
  12. Refresh the page
  13. Notice that your project is now visible!
  14. Go back to the settings, under visibility
  15. Click the toggle to unlist this project as a Catalog resource
  16. Notice the confirmation modal
  17. Cancel
  18. Navigate to Explore -> CI/CD Catalog
  19. Notice the resource is still listed
  20. Go back to the settings
  21. Click "Unlist this project as a Catalog resource"
  22. In the confirmation modal, click ok
  23. Navigate to Explore -> CI/CD Catalog
  24. Notice the resource is no longer listed

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

Edited by Alex Pennells

Merge request reports