Skip to content

Move some shared code to `members` directory [RUN AS-IF-FOSS]

What does this MR do?

In &4233 (closed) we converted the group members view from HAML to Vue to improve the UX. Now I am working on giving the same treatment to the project members view. I am finding some code that was originally put in the groups/members directory but I am realizing this code can be used for the project members view. This MR moves that code from groups/members directory to the members directory.

Summary of changes

  • Move app/assets/javascripts/groups/members/components/app.vue to app/assets/javascripts/members/components/app.vue
  • Move a few shared utilities from app/assets/javascripts/groups/members/utils.js to app/assets/javascripts/members/utils.js
  • Move a few shared constants from app/assets/javascripts/groups/members/constants.js to app/assets/javascripts/members/constants.js
  • Move a few shared EE utilities from ee/app/assets/javascripts/groups/members/utils.js to ee/app/assets/javascripts/members/utils.js
  • Rename data-group-id to data-source-id in !51520 (diffs)
    • For group members this value is group.id. For project members this value will be project.id. source is a naming convention that is used on the backend so seems like the best name here.
  • Rename linked_groups_data_json and linked_groups_list_data_attributes helper methods to group_group_links_data_json and group_group_links_list_data_attributes.
    • To better match the naming convention used by the backend in the group_group_link model. Also to avoid name clashing when we add the project member helpers. The project member helper names will be project_group_links_data_json and project_group_links_list_data_attributes

Screenshots (strongly suggested)

No visual changes. Screenshots below for context:

Before After
Screen_Shot_2021-01-11_at_11.29.08_AM Screen_Shot_2021-01-11_at_10.58.27_AM
Screen_Shot_2021-01-11_at_11.29.21_AM Screen_Shot_2021-01-11_at_10.59.05_AM
Screen_Shot_2021-01-11_at_11.29.34_AM Screen_Shot_2021-01-11_at_10.59.45_AM
Screen_Shot_2021-01-11_at_11.29.46_AM Screen_Shot_2021-01-11_at_11.00.34_AM

Local testing

  1. Create a group
  2. Navigate to Group -> Members

How to add a group

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

How to add an invited member

  1. Navigate to Group -> 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 a project

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

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

Related to #281815 (closed)

Edited by Peter Hegman

Merge request reports

Loading