Skip to content

Organizations - Abstract group deletion component

What does this MR do and why?

Part of #442810 (closed)
Important: This change was broken off from !148701 (merged) due to size and review-ability
UX was approved for this flow on !148701 (merged)
Important: This change is behind a feature flag ui_for_organizations

This change breaks off the functional portion of !148701 (merged) and creates a CE and EE entry point for the shared Group List deletion modal. This shared component is currently only used in Organizations.

This change enables user to fire permanent deletion requests from the UI and sets up the actual UX flow approved and implemented in !148701 (merged).

Important: There is a known bug when permanently deleting Sub Groups from this list: #455871

The group deletion flows are as follows:

Note: Anything related to the modal footer or directing users to the group settings is part of !148701 (merged)

CE Environments

a. In CE environments, delayed deletion is not possible. Thus there is no help text in the modal footer, groups are deleted immediately, and the toasts simply states the group is in the process of being deleted.

EE Environments

a. If delayed group deletion is disabled, it behaves the same as CE environment above.
b. If delayed group deletion is enabled, attempting to delete will show help text in the modal footer of when the group will be deleted, the group will then be marked as pending deletion, and the toast will re-affirm when the group will be fully deleted.
c. If delayed group deletion is enabled and the group is already scheduled to be deleted:

  • If it is a Top Level Group, deletion will be disabled and user is directed to the Settings page to finish deletion
  • If it is a Sub level group, deletion will follow the CE path of fully deleting the group

Screenshots or screen recordings

Demo

Screen_Recording_2024-04-19_at_9.42.26_AM

How to set up and validate locally

Setup Organizations

important: You only need to do this in your GDK if you haven't yet!

  1. Access rails c
  2. Enable Feature Flag Feature.enable(:ui_for_organizations)
  3. Create the default organization and add root to it
you = User.find_by_username('root')
default_organization = Organizations::Organization.default_organization
Organizations::OrganizationUser.create!(organization_id: default_organization.id, user_id: you.id)

Testing

  1. Create two test groups
    • The first group should be a top level group
    • The second group should be a subgroup to your top level group
  2. Navigate to the GDK home page ex: 127.0.0.1:3000/
  3. Click Organizations in the sidebar
  4. Click the Default Organization
  5. Click the Manage -> Groups and projects in the sidebar
  6. Switch list to Groups in the dropdown

Top Level Group Deletion

  1. Click the ... for the top level group you made
  2. Fill out input and click delete
  3. Ensure toast appears that says the group will be deleted on x date.
  4. Ensure group is still in the list with a pending deletion tag
  5. Click the ... again for the top level group you made
  6. Fill out input and click delete
  7. Ensure there is an error and no toast appears

Subgroup Deletion

  1. Click the ... for the subgroup you made
  2. Fill out input and click delete
  3. Ensure toast appears that says the group will be deleted on x date.
  4. Ensure group is still in the list with a pending deletion tag
  5. Click the ... again for the top level group you made
  6. Fill out input and click delete
  7. Ensure toast appears that says the group is being deleted
  8. Important: There is a known bug here and there will be an Error alert at the top of the page: #455871
  9. Refresh page
  10. Ensure subgroup is now gone from list

Related to #442810 (closed)

Merge request reports