Skip to content

Conditionally display workspaces dropdown group

What does this MR do and why?

Displays workspaces dropdown group above the "Edit Web IDE" actions dropdown when workspaces are supported on a project. Otherwise, the workspaces dropdown group appears below the actions.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Description Before After
Project supports workspaces supports_workspaces_before.png supports_workspaces_after.png
Project doesn't support workspaces does_not_support_workspaces_before.png does_not_support_workspaces_after.png

How to set up and validate locally

My recommendation is using the e2e spec to test this change. We can rely on live_debug and CHROME_HEADLESS=0 so you can avoid setting up remote development in your local environment.

  1. Apply the following patch

    diff --git a/ee/spec/features/remote_development/workspaces_dropdown_group_spec.rb b/ee/spec/features/remote_development/workspaces_dropdown_group_spec.rb
    index 8c76427b768c..edf25b236824 100644
    --- a/ee/spec/features/remote_development/workspaces_dropdown_group_spec.rb
    +++ b/ee/spec/features/remote_development/workspaces_dropdown_group_spec.rb
    @@ -82,6 +82,8 @@
           it 'allows navigating to the new workspace page' do
             click_link 'New workspace'
     
    +        live_debug
    +
             expect(page).to have_current_path("#{new_remote_development_workspace_path}?project=#{project.full_path}")
             expect(page).to have_css('button', text: project.name_with_namespace)
           end
    
  2. Run the test using this command: CHROME_HEADLESS=0 bundle exec rspec ee/spec/features/remote_development/workspaces_dropdown_group_spec.rb

  3. Click "Edit" in the repository view

  4. You should see the Workspaces popover displaying one workspace.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #417668 (closed)

Edited by Enrique Alcántara

Merge request reports