Add option to open catalog resource details in separate tab
What does this MR do and why?
Since we are using VueRouter on a GlButton
element in the Catalog list, the option to open in a new tab is not present, but simply using a link will break the SPA pattern. This MR introduces a workaround where we use a link with the href attribute to get all the link default features, like opening the link in a new tab, but will not do so if the user is not holding down one of the accepted modifier key. This should offer a pretty nice experience with little downside and support both usecases, although I am opened to simpler/more elegant alternatives!
This is still behind a FF, so there are no changelogs.
Screenshots or screen recordings
Before | After |
---|---|
Screen_Recording_2023-11-15_at_3.26.59_PM | Screen_Recording_2023-11-15_at_2.44.37_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
- Click on a resource
- Notice that you stay in context (AKA, no reload)
- Right click on the title to open the contextual web browser menu
- Click on "Open in a new window"
- Notice that it open a new window
- Use CMD + click on macos
- Notice that it opens a new window
- Use CTRL + click on Windows (if applicable)
- Notice that it opens a new window
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 #431408 (closed)