From dd47eed7c7cafdd4dbda06292c03fc91424c78ae Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 8 Sep 2021 07:19:49 +1000 Subject: [PATCH] Disable personal imports if Personal Ownership policy applies (#1176) * Disable imports if personal ownership policy set * Add missing await --- src/app/organizations/tools/import.component.ts | 8 +++++--- src/app/tools/import.component.html | 14 ++++++++++---- src/app/tools/import.component.ts | 16 ++++++++++++++-- src/locales/en/messages.json | 3 +++ 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/app/organizations/tools/import.component.ts b/src/app/organizations/tools/import.component.ts index e0f0f4d4e0..04c5e8597b 100644 --- a/src/app/organizations/tools/import.component.ts +++ b/src/app/organizations/tools/import.component.ts @@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; import { ImportService } from 'jslib-common/abstractions/import.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; +import { PolicyService } from 'jslib-common/abstractions/policy.service'; import { UserService } from 'jslib-common/abstractions/user.service'; import { ImportComponent as BaseImportComponent } from '../../tools/import.component'; @@ -22,16 +23,17 @@ export class ImportComponent extends BaseImportComponent { constructor(i18nService: I18nService, toasterService: ToasterService, importService: ImportService, router: Router, private route: ActivatedRoute, - platformUtilsService: PlatformUtilsService, + platformUtilsService: PlatformUtilsService, policyService: PolicyService, private userService: UserService) { - super(i18nService, toasterService, importService, router, platformUtilsService); + super(i18nService, toasterService, importService, router, platformUtilsService, policyService); } async ngOnInit() { this.route.parent.parent.params.subscribe(async params => { this.organizationId = params.organizationId; this.successNavigate = ['organizations', this.organizationId, 'vault']; - super.ngOnInit(); + await super.ngOnInit(); + this.importBlockedByPolicy = false; }); const organization = await this.userService.getOrganization(this.organizationId); this.organizationName = organization.name; diff --git a/src/app/tools/import.component.html b/src/app/tools/import.component.html index 578695f36a..c52d4b1d3b 100644 --- a/src/app/tools/import.component.html +++ b/src/app/tools/import.component.html @@ -1,12 +1,16 @@