[feature] Implement scope warning for exports (#1504)

This commit is contained in:
Addison Beck 2022-02-28 11:37:02 -05:00 committed by GitHub
parent d0c0e80b6c
commit b8a23cf014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 1 deletions

View File

@ -44,10 +44,10 @@ export class ExportComponent extends BaseExportComponent {
}
async ngOnInit() {
await super.ngOnInit();
this.route.parent.parent.params.subscribe(async (params) => {
this.organizationId = params.organizationId;
});
await super.ngOnInit();
}
async checkExportDisabled() {

View File

@ -58,6 +58,7 @@ import { ToastrModule } from "ngx-toastr";
import { AvatarComponent } from "jslib-angular/components/avatar.component";
import { CalloutComponent } from "jslib-angular/components/callout.component";
import { ExportScopeCalloutComponent } from "jslib-angular/components/export-scope-callout.component";
import { IconComponent } from "jslib-angular/components/icon.component";
import { VerifyMasterPasswordComponent } from "jslib-angular/components/verify-master-password.component";
import { A11yTitleDirective } from "jslib-angular/directives/a11y-title.directive";
@ -338,6 +339,7 @@ registerLocaleData(localeZhTw, "zh-TW");
EmergencyAccessViewComponent,
EmergencyAddEditComponent,
ExportComponent,
ExportScopeCalloutComponent,
ExposedPasswordsReportComponent,
FallbackSrcDirective,
FamiliesForEnterpriseSetupComponent,

View File

@ -12,6 +12,10 @@
<app-callout type="error" title="{{ 'vaultExportDisabled' | i18n }}" *ngIf="disabledByPolicy">
{{ "personalVaultExportPolicyInEffect" | i18n }}
</app-callout>
<app-export-scope-callout
[organizationId]="organizationId"
*ngIf="!disabledByPolicy"
></app-export-scope-callout>
<div class="row">
<div class="form-group col-6">

View File

@ -4742,5 +4742,29 @@
},
"sessionTimeout": {
"message": "Your session has timed out. Please go back and try logging in again."
},
"exportingPersonalVaultTitle": {
"message": "Exporting Personal Vault"
},
"exportingOrganizationVaultTitle": {
"message": "Exporting Organization Vault"
},
"exportingPersonalVaultDescription": {
"message": "Only the personal vault items associated with $EMAIL$ will be exported. Organization vault items will not be included.",
"placeholders": {
"email": {
"content": "$1",
"example": "name@example.com"
}
}
},
"exportingOrganizationVaultDescription": {
"message": "Only the organization vault associated with $ORGANIZATION$ will be exported. Personal vault items and items from other organizations will not be included.",
"placeholders": {
"organization": {
"content": "$1",
"example": "My Org Name"
}
}
}
}