mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-02 03:41:09 +01:00
Add warning when importing to organization (#825)
This commit is contained in:
parent
168f9a5525
commit
9d1b2b9f60
@ -9,6 +9,8 @@ import { Angulartics2 } from 'angulartics2';
|
|||||||
|
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { ImportService } from 'jslib/abstractions/import.service';
|
import { ImportService } from 'jslib/abstractions/import.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
import { ImportComponent as BaseImportComponent } from '../../tools/import.component';
|
import { ImportComponent as BaseImportComponent } from '../../tools/import.component';
|
||||||
|
|
||||||
@ -17,17 +19,33 @@ import { ImportComponent as BaseImportComponent } from '../../tools/import.compo
|
|||||||
templateUrl: '../../tools/import.component.html',
|
templateUrl: '../../tools/import.component.html',
|
||||||
})
|
})
|
||||||
export class ImportComponent extends BaseImportComponent {
|
export class ImportComponent extends BaseImportComponent {
|
||||||
|
organizationName: string;
|
||||||
|
|
||||||
constructor(i18nService: I18nService, analytics: Angulartics2,
|
constructor(i18nService: I18nService, analytics: Angulartics2,
|
||||||
toasterService: ToasterService, importService: ImportService,
|
toasterService: ToasterService, importService: ImportService,
|
||||||
router: Router, private route: ActivatedRoute) {
|
router: Router, private route: ActivatedRoute,
|
||||||
|
private platformUtilsService: PlatformUtilsService,
|
||||||
|
private userService: UserService) {
|
||||||
super(i18nService, analytics, toasterService, importService, router);
|
super(i18nService, analytics, toasterService, importService, router);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
this.organizationId = params.organizationId;
|
this.organizationId = params.organizationId;
|
||||||
this.successNavigate = ['organizations', this.organizationId, 'vault'];
|
this.successNavigate = ['organizations', this.organizationId, 'vault'];
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
});
|
});
|
||||||
|
const organization = await this.userService.getOrganization(this.organizationId);
|
||||||
|
this.organizationName = organization.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
async submit() {
|
||||||
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('importWarning', this.organizationName),
|
||||||
|
this.i18nService.t('warning'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||||
|
if (!confirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1003,6 +1003,15 @@
|
|||||||
"importSuccess": {
|
"importSuccess": {
|
||||||
"message": "Data has been successfully imported into your vault."
|
"message": "Data has been successfully imported into your vault."
|
||||||
},
|
},
|
||||||
|
"importWarning": {
|
||||||
|
"message": "You are importing data to $ORGANIZATION$. Your data may be shared with members of this organization. Do you want to proceed?",
|
||||||
|
"placeholders": {
|
||||||
|
"organization": {
|
||||||
|
"content": "$1",
|
||||||
|
"example": "My Org Name"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"importFormatError": {
|
"importFormatError": {
|
||||||
"message": "Data is not formatted correctly. Please check your import file and try again."
|
"message": "Data is not formatted correctly. Please check your import file and try again."
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user