Add Global Catalog search and sort
What does this MR do and why?
We add a search bar and the sort options, for now only created_at in asc and desc, to the Global catalog page. this is behind the disabled FF global_ci_catalog
Screenshots or screen recordings
header | header |
---|---|
Searching:
Screen_Recording_2023-10-25_at_1.02.53_PM
Sorting
Screen_Recording_2023-10-25_at_1.30.40_PM
How to set up and validate locally
- Enable the FF
global_ci_catalog
- Create a few projects that you will be able to convert to Ci resources. Create them under the admin namespace for ease of testing.
- 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 -1)
projects.each do |project|
project.update!(description: 'description')
::Ci::Catalog::Resource.new(project_id: project.id).save
end
- Navigate to
Explore -> CI/CD Catalog
- Notice that you see Catalog resources
- Scroll to the bottom
- Click on page 2
- Notice that it loads
- Click on a single item
- Notice that it loads the details page
- Enter a search term that does not exists
- Notice the empty page
- Clear the search term
- Notice that it reloads
- Enter a search term with less than 3 chars
- Notice a different empty screen
- Enter a valid search term
- Notice that it shows the right resources
- Change the sort direction
- Notice that it changes the order of resources shown.
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.
Edited by Frédéric Caplette