Skip to content

Refactor how data is passed to group/project members Vue apps [RUN ALL RSPEC]

📖 What does this MR do?

Related to #324681 (closed) and part of &5616

Currently the group/project member pages are composed of 4 separate Vue applications that use Bootstrap tabs. We would like to move these into one Vue app so we can use GlTabs and move towards deprecating Bootstrap tabs. Currently the data is passed to the Vue applications via multiple data-* attributes. Each data-* attribute is parsed separately before being passed to the Vue application. This makes it difficult to merge these 4 separate Vue applications into one because we run into name clashing between data-* attributes. This MR changes how the data is passed to the Vue application by using one data attribute with a JSON string. This has the added benefit of not having to use parseBoolean or parseInt.

When we move to one Vue application we will be able to set the data-members-data attribute to something like this as a JSON string:

{
  user: {
    members: [],
    pagination: {},
    member_path: '/groups/foo-bar/-/group_members/:id',
  },
  group: {
    members: [],
    pagination: {},
    member_path: '/groups/foo-bar/-/group_links/:id',
  },
  invite: {
    members: [],
    pagination: {},
    member_path: '/groups/foo-bar/-/group_members/:id',
  },
  access_request: {
    members: [],
    pagination: {},
    member_path: '/groups/foo-bar/-/group_members/:id',
  }
}

💻 Local testing

  1. Create a group or project and navigate to Group or Project -> Members

How to add a group to the Groups tab

  1. Navigate to Group or Project -> Members
  2. Click the Invite group tab

How to add an invited member to the Invited tab

  1. Navigate to Group or Project -> Members
  2. In the GitLab member or Email address enter an email that a user does not already own
  3. Click Invite "example@test.com" by email

How to request access to the Access requests tab

  1. Log in (or impersonate) a user that doesn't already have access to the group or project
  2. Navigate to the group or project overview
  3. Click Request access located below the project name

📷 Screenshots

No visual/functionality changes. All backstage

Screenshots for context:

Group members

Screen_Shot_2021-05-05_at_2.40.04_PM

Project members

Screen_Shot_2021-05-05_at_2.41.16_PM

🚦 Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman

Merge request reports

Loading