Skip to content

Fix registry-list deselecting items after select all

What does this MR do and why?

From comment, fixes these issues:

  • Once all the packages are selected it's impossible to deselect a couple. As soon as I deselect one, they all get deselected:

    deselecting

    Expected to deselect a few that perhaps I didn't want to delete.

  • the lines between seem to double and that's why the divider looks thicker (compared to non-selected).

Screenshot_2023-02-03_at_13.33.17

Screenshots or screen recordings

the lines between seem to double and that's why the divider looks thicker (compared to non-selected).

Container registry Screenshot_2023-02-06_at_6.08.49_pm

Package registry Screenshot_2023-02-06_at_6.21.51_pm

deselect images and add indeterminate state

Container registry Screenshot_2023-02-06_at_6.09.02_pm

Package registry Screenshot_2023-02-06_at_6.22.03_pm

How to set up and validate locally

  1. Publish few packages with same name & different versions, as mentioned in https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/wikis/Packages-Tips-&-Tricks#how-to-create-a-list-of-packages-artificially
    1. rails c - Open the rails console

    2. p = Project.find(1) - Find one of your GDK projects. Project id can be found on the project home page

    3. FactoryBot.create_list(:npm_package, 10, project: p, name: p.name) - Creates 10 npm packages

    4. Add this line if above fails during the creation of files

       def fixture_file_upload(*args, **kwargs)
         Rack::Test::UploadedFile.new(*args, **kwargs)
       end
  2. View projects package list page.
  3. Add fix to add highlighting when selected
    1. Replace line with <list-item data-testid="package-row" :selected="selected" v-bind="$attrs">
  4. Make sure above issues (double margin & deselecting after select all unselects all items) are fixed.
  5. Since this is a shared component, this can be tested on the container registry image tags page as well. Steps: 4. Setup & enable Container Registry https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/registry.md
    1. Add a few images with tags by following https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/wikis/Packages-Tips-&-Tricks#how-to-add-images-with-tags-quickly-to-the-registry
    2. Visit the tags page where bulk deletion pattern exists & behaviour works the same way.

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 #374295 (closed)

Edited by Rahul Chanila

Merge request reports