Skip to content

Adding 'Copy to clipboard' buttons into the Command line instructions after creating a blank new project

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

Fix #469486 (closed), created after a discussion with @stingrayza

Assisted by @oksanakohuch-ext (thanks a lot again !) to adopt the right way to make 'Copy to clipboard' appearing into each command panel displayed after creating a blank project without any README.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Done

Remark : I could not keep the 'js-clone' CSS class which existed previously (line 47, 62 and 74 into /app/views/projects/empty.html.haml) because it was not rendered correctly after using the helper methods into /app/helpers/projects_helper.rb but this class was not doing anything, if it really needs to be kept, just please tell me how to deal with it in projects_helper.rb.

Screenshots or screen recordings

image

Before After
No copy to clipboard button Copy to clipboard button on the right of each command panel

How to set up and validate locally

  1. Use GDK and login to Gitlab
  2. Create a new blank project (http://localhost:3000/projects/new#blank_project)
  3. Uncheck 'Initialize repository with a README' checkbox
  4. Click on the 'Create project' button
  5. Check for each panel command that the 'Copy to clipboard' button appears when hovering on the right
  6. Check that clicking the button copy the command
Edited by 🤖 GitLab Bot 🤖

Merge request reports