Add a copy button inside Catalog Resource components tab
requested to merge 426755-frontend-add-a-copy-to-clipboard-button-in-the-code-snippet-in-the-component-tab into master
What does this MR do and why?
Add a copy-to-clipboard button in the code snippet in the component tab
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
Screen recording of the copy in action (Note that the BG hover size for the button has changed after this video was taken!)
Screen_Recording_2023-10-20_at_3.48.20_PM
How to set up and validate locally
- Make sure you have an premium license for your GDK
- Login as an admin user
- 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)
projects.each do |project|
project.update!(description: 'description')
::Ci::Catalog::Resource.new(project_id: project.id).save
end
- Open your rails console and execute:
Feature.enable(:ci_catalog_components_tab)
- Navigate to
/$namespace/$project/-/ci/catalog/resources/
. Any project under the same namespace will do (in this case, anything under the admin namespace) - Click on a resource
- Make sure to go to the components tab (depending on other MRs, it may or may not be loaded as the default)
- Notice in the code block the new copy-to-clipboard button
- Click on it
- Navigate to
Build -> Pipeline Editor
- Paste it in the code editor
- Notice that it works!
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 #426755 (closed)
Edited by Frédéric Caplette