Skip to content

Projects List - Abstract EE component

What does this MR do and why?

Follow up from !145338 (merged)
Important: This change is behind a feature flag ui_for_organizations

This change abstracts the some EE specific code around the Project List Item badges into an ee_else_ce scenario. The logic in particular being abstracted is the Pending deletion badge as this is an EE only feature

Screenshots or screen recordings

Before After (No change)
Screenshot_2024-02-27_at_3.08.43_PM Screenshot_2024-02-27_at_3.08.43_PM

How to set up and validate locally

Setup Organizations

  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 (be sure to do this under an existing group)
  2. Mark one project for deletion
    a. Navigate to project
    b. Settings -> General in side bar
    c. Expand Advanced tab
    d. Click delete project button and follow instructions
    e. Project should be marked for deletion (noted by banner on project overview)
  3. Mark other project as archived
    a. Navigate to project
    b. Settings -> General in side bar
    c. Expand Advanced tab
    d. Click archive project
    e. Project should be marked as archived/read-only (noted by banner on project overview)
  4. Navigate to the GDK home page ex: 127.0.0.1:3000/
  5. Click Organizations in the sidebar
  6. Click the Default Organization
  7. Click the Manage > Groups and projects in the sidebar
  8. Switch list to Projects in the dropdown
  9. Ensure badges appear correctly for the projects you just acted on
  10. You can repeat with a CE configured GDK to ensure the pending deletion badge does not appear
    • You can also "spoof" the CE component by changing the ee_else_ce/ import in project_list_item.vue to use the ~/ import instead.

Merge request reports