Skip to content

Organizations - Make delete utils non-project specific

Zack Cuddy requested to merge zcuddy-make-utils-non-project-specific into master

What does this MR do and why?

Broken off from !148701 (merged)
Work towards: #442810 (closed)

This change generalizes the deletion utils methods for Organizations to be non-project specific. The logic is the same between Groups and Projects so we want to share these methods in both scopes. This can be seen implemented in !148701 (merged)

Screenshots or screen recordings

Screen_Recording_2024-04-04_at_9.33.48_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 projects
    • The first one should be a personal project on your user (ie. root)
    • The second one should be a project tied to a group (ie. Flight)
  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 Projects in the dropdown

No delay deletion

  1. Click the ... for the personal project you made
  2. Ensure no help text appears below the input box in the modal
  3. Fill out input and click delete
  4. Ensure alert appears that says project is in the process of being deleted
  5. Ensure project is no longer in the list

Delayed deletion

  1. Click the ... for the project you made tied to a group
  2. Ensure help text appears below the input box in the modal, stating when the project will be deleted and a learn more link
  3. Fill out input and click delete
  4. Ensure alert appears that says the project will be deleted on x date.
  5. Ensure project is still in the list with a pending deletion tag
  6. Click the ... again for the project you made tied to a group
  7. Ensure no help text appears below the input box in the modal
  8. Fill out input and click delete
  9. Ensure alert appears that says project is in the process of being deleted
  10. Ensure project is no longer in the list

Merge request reports