From 7dfb70eb8e2020735c4918495cb55ad6d2de1863 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 25 Sep 2018 09:12:24 -0400 Subject: [PATCH] purge org vault --- jslib | 2 +- .../settings/account.component.html | 2 ++ .../settings/account.component.ts | 17 +++++++++++++++++ src/app/services/event.service.ts | 3 +++ src/app/settings/purge-vault.component.html | 2 +- src/app/settings/purge-vault.component.ts | 19 +++++++++++++++---- src/locales/en/messages.json | 6 ++++++ 7 files changed, 45 insertions(+), 6 deletions(-) diff --git a/jslib b/jslib index d81273c44f..d1847690f2 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit d81273c44f97ff709f21623c36b5a4661fea6627 +Subproject commit d1847690f260cf06ace8ed98b7308edabc3b62c0 diff --git a/src/app/organizations/settings/account.component.html b/src/app/organizations/settings/account.component.html index 5c060995f5..504cd60e86 100644 --- a/src/app/organizations/settings/account.component.html +++ b/src/app/organizations/settings/account.component.html @@ -43,6 +43,8 @@

{{'dangerZoneDesc' | i18n}}

+
+ diff --git a/src/app/organizations/settings/account.component.ts b/src/app/organizations/settings/account.component.ts index 5c500998bb..d7b613d467 100644 --- a/src/app/organizations/settings/account.component.ts +++ b/src/app/organizations/settings/account.component.ts @@ -17,6 +17,7 @@ import { OrganizationUpdateRequest } from 'jslib/models/request/organizationUpda import { OrganizationResponse } from 'jslib/models/response/organizationResponse'; import { ModalComponent } from '../../modal.component'; +import { PurgeVaultComponent } from '../../settings/purge-vault.component'; import { DeleteOrganizationComponent } from './delete-organization.component'; @Component({ @@ -25,6 +26,7 @@ import { DeleteOrganizationComponent } from './delete-organization.component'; }) export class AccountComponent { @ViewChild('deleteOrganizationTemplate', { read: ViewContainerRef }) deleteModalRef: ViewContainerRef; + @ViewChild('purgeOrganizationTemplate', { read: ViewContainerRef }) purgeModalRef: ViewContainerRef; loading = true; org: OrganizationResponse; @@ -78,4 +80,19 @@ export class AccountComponent { this.modal = null; }); } + + purgeVault() { + if (this.modal != null) { + this.modal.close(); + } + + const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent); + this.modal = this.purgeModalRef.createComponent(factory).instance; + const childComponent = this.modal.show(PurgeVaultComponent, this.purgeModalRef); + childComponent.organizationId = this.organizationId; + + this.modal.onClosed.subscribe(async () => { + this.modal = null; + }); + } } diff --git a/src/app/services/event.service.ts b/src/app/services/event.service.ts index a3c5e3fe2c..3e29f0fb6c 100644 --- a/src/app/services/event.service.ts +++ b/src/app/services/event.service.ts @@ -124,6 +124,9 @@ export class EventService { case EventType.Organization_Updated: msg = this.i18nService.t('editedOrgSettings'); break; + case EventType.Organization_PurgedVault: + msg = this.i18nService.t('purgedOrganizationVault'); + break; default: break; } diff --git a/src/app/settings/purge-vault.component.html b/src/app/settings/purge-vault.component.html index 62f9111929..f11300f405 100644 --- a/src/app/settings/purge-vault.component.html +++ b/src/app/settings/purge-vault.component.html @@ -8,7 +8,7 @@