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
- Enable the FF
global_ci_catalog
- Create a new project
- Add a Readme file
- Go to the project settings and add a project description
- Then in General project settings under Visibility, find the
Set this project as a Catalog resource
toggle - click on it
- Notice the success message
- Navigate to Explore -> CI/CD Catalog
- There should still be nothing visible, because the resource is not published
- Open the rails console with
rails c
- Run
Ci::Catalog::Resource.last.update(state: "published")
- Refresh the page
- Notice that your project is now visible!
- Go back to the settings, under visibility
- Click the toggle to unlist this project as a Catalog resource
- Notice the confirmation modal
- Cancel
- Navigate to Explore -> CI/CD Catalog
- Notice the resource is still listed
- Go back to the settings
- Click "Unlist this project as a Catalog resource"
- In the confirmation modal, click ok
- Navigate to Explore -> CI/CD Catalog
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #430109 (closed)
Edited by Alex Pennells