From 97e195cd7b45613d59b2a13f9e9e32958e469f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:06:33 +0100 Subject: [PATCH] [PM-11404] Account Management: Prevent a verified user from purging their vault (#11411) * Update AccountService to include a method for setting the managedByOrganizationId * Update AccountComponent to conditionally show the purgeVault button based on a feature flag and if the user is managed by an organization * Add missing method to FakeAccountService * Remove the setAccountManagedByOrganizationId method from the AccountService abstract class. * Refactor AccountComponent to use OrganizationService to check for managing organization * Rename managesActiveUser to userIsManagedByOrganization * Refactor userIsManagedByOrganization property to be non-nullable in organization data and response models * Refactor organization.data.spec.ts to include non-nullable userIsManagedByOrganization property --- .../settings/account/account.component.html | 8 ++++++- .../settings/account/account.component.ts | 22 ++++++++++++++++++- .../models/data/organization.data.spec.ts | 1 + .../models/data/organization.data.ts | 2 ++ .../models/domain/organization.ts | 7 ++++++ .../response/profile-organization.response.ts | 2 ++ .../src/models/response/profile.response.ts | 2 -- 7 files changed, 40 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/auth/settings/account/account.component.html b/apps/web/src/app/auth/settings/account/account.component.html index c176469371..71508f7ae9 100644 --- a/apps/web/src/app/auth/settings/account/account.component.html +++ b/apps/web/src/app/auth/settings/account/account.component.html @@ -12,7 +12,13 @@ -