Skip to content

Warn about impacted escalation policies when members are deleted/leave

Sarah Yasonik requested to merge sy-modal-for-user-rule-removal into master

What does this MR do?

Related issue: #335546 (closed)

This MR updates the warning modals a user will see when trying to leave a group/project or delete a user. Escalation policies route alerts to either on-call schedules or directly to users. On-call schedules are already listed in the modal, so this MR adds a list of escalation policies which route alerts directly to users.

Changes

Backend:

  • Adds support for escalation policies to the relevant internal APIs backend
  • Limits listed on-call schedules to only the ones in which the user is an active participant
  • De-dupes on-call schedules for a user in the group/project member list

Frontend:

  • Renames OncallSchedulesList to UserDeletionObstaclesList & all corresponding props/files frontend
  • Adds escalation policies to UserDeletionObstaclesList

Screenshots or Screencasts

User removing self [leave modal] Owner removing user [remove member modal] Admin deleting [delete user modal] Admin deleting with contributions [delete user modal]
Screen_Shot_2021-09-01_at_5.15.03_PM Screen_Shot_2021-09-01_at_5.12.05_PM Screen_Shot_2021-09-01_at_5.13.37_PM Screen_Shot_2021-09-01_at_5.13.20_PM

Out of scope (will be other MRs)

  • Deleting the escalation rules corresponding to the user
  • Sending an email to project/group owners informing them of the change

How to setup and validate locally

  1. Removing yourself from a group/project
    • Navigate to Project information/Group information > Members > find self > click leave button
  2. Remove a user from a group/project (as owner/maintainer)
    • Navigate to Project information/Group information > Members > find user > click remove button
  3. Deleting user from instance (as admin)
    • Navigate to Menu > Admin > Overview > Users > find user > click settings button > Delete user/Delete user and contributions

Streamlined testing flow:

  • Create a new account & logout (skip if you have a non-admin user already)
  • Sign in as instance administrator
  • Create a project
  • Add new user as a developer on the project
  • Setup on-call schedules & escalation policies which direct alerts to developer
  • Navigate to members list to see removal modal
  • Navigate to instance user list to see deletion modal
  • Logout & Login as developer
  • Navigate to members list to see removal modal

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Sarah Yasonik

Merge request reports