1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

navigate fix on import success

This commit is contained in:
Kyle Spearrin 2018-07-05 23:44:58 -04:00
parent 6f75e0bba0
commit 311baaa3d1
3 changed files with 5 additions and 2 deletions

View File

@ -122,7 +122,7 @@ const routes: Routes = [
canActivate: [OrganizationTypeGuardService], canActivate: [OrganizationTypeGuardService],
data: { allowedTypes: [OrganizationUserType.Owner, OrganizationUserType.Admin] }, data: { allowedTypes: [OrganizationUserType.Owner, OrganizationUserType.Admin] },
children: [ children: [
{ path: '', pathMatch: 'full', redirectTo: 'export' }, { path: '', pathMatch: 'full', redirectTo: 'import' },
{ path: 'import', component: OrgImportComponent, data: { titleId: 'importData' } }, { path: 'import', component: OrgImportComponent, data: { titleId: 'importData' } },
{ path: 'export', component: OrgExportComponent, data: { titleId: 'exportVault' } }, { path: 'export', component: OrgExportComponent, data: { titleId: 'exportVault' } },
], ],

View File

@ -42,6 +42,7 @@ export class ImportComponent extends BaseImportComponent {
ngOnInit() { 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'];
super.ngOnInit(); super.ngOnInit();
}); });
} }

View File

@ -38,6 +38,8 @@ export class ImportComponent implements OnInit {
fileContents: string; fileContents: string;
formPromise: Promise<any>; formPromise: Promise<any>;
protected successNavigate: any[] = ['vault'];
constructor(protected i18nService: I18nService, protected analytics: Angulartics2, constructor(protected i18nService: I18nService, protected analytics: Angulartics2,
protected toasterService: ToasterService, protected cipherService: CipherService, protected toasterService: ToasterService, protected cipherService: CipherService,
protected folderService: FolderService, protected apiService: ApiService, protected folderService: FolderService, protected apiService: ApiService,
@ -117,7 +119,7 @@ export class ImportComponent implements OnInit {
properties: { label: this.format }, properties: { label: this.format },
}); });
this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess')); this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess'));
this.router.navigate(['vault']); this.router.navigate(this.successNavigate);
} catch { } } catch { }
} else { } else {
this.error(this.i18nService.t('importFormatError')); this.error(this.i18nService.t('importFormatError'));