Skip to content

Refreshing page after inviting members on Project/Group Members Page

Ross Byrne requested to merge 323226-refresh-users-on-invite into master

What does this MR do and why?

What

When on the Project or Group members page, you can invite users through a set of dialogs. Currently, after members are invited a toast is displayed with a success message. The list of members becomes stale and the end user must manually refresh the page to get an updated list.

The page now refreshes when a member is invited to a Project or Group, to refresh the data displayed on the page.

As a consequence, I have replaced the toast with an alert, anywhere the page refreshes, based on the Pajamas spec which states:

If there's a page refresh, or a message needs to be communicated after a user visits a new page, consider using an alert

Why

This is the first iteration to solve this issue, which requires the user to refresh the page manually to see changes.

This feature is implemented based on the following discussion.

I am aware that this implementation is not the best solution to solve the problem but it is the first iteration. This solution and the identified next interations are outlined in https://gitlab.com/gitlab-org/gitlab/-/issues/323226#note_1196354625.

Possible future iterations

Based on the discussion https://gitlab.com/gitlab-org/gitlab/-/issues/323226#note_1196354625 I have created issues #385272 and #385279 to capture future iterations to improve on the work done in this MR.

Screenshots or screen recordings

I made some GIFs to demonstrate the before and after behavior.

Before After
inviting-member-before inviting-members-after

How to set up and validate locally

For Projects

  1. From the landing page, use the menu in the top left to navigate to a Project.
  2. When in a Project, in left side menu, hover over Project information and select 'Members'.
  3. On the top right of the page, you should see a number of buttons for inviting members:
    • Import from a project
    • Invite a group
    • Invite members
  4. All options should trigger a dialog to appear.
  5. Submitting the dialog will refresh the page.

For Groups

  1. From the landing page, use the menu in the top left to navigate to a Group.
  2. When in a Group, in left side menu, hover over Group information and select 'Members'.
  3. On the top right of the page, you should see a number of buttons for inviting members:
    • Invite a group
    • Invite members
  4. All options should trigger a dialog to appear.
  5. Submitting the dialog will refresh the page.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #323226

Edited by Ross Byrne

Merge request reports