mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-18 02:41:15 +02:00
exporting organization data
This commit is contained in:
parent
9d4e0849d6
commit
ba3b2fbed1
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit 47ab71e73098d1b83a1bdcbae3cd3e2b1d9ccacc
|
Subproject commit 87e273252be42dab90d9a33857fe7755f378338b
|
@ -14,7 +14,10 @@ import { LoginComponent } from './accounts/login.component';
|
|||||||
import { RegisterComponent } from './accounts/register.component';
|
import { RegisterComponent } from './accounts/register.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
|
|
||||||
import { VaultComponent as OrganizationVaultComponent } from './organizations/vault/vault.component';
|
import { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';
|
||||||
|
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
||||||
|
|
||||||
|
import { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';
|
||||||
|
|
||||||
import { AccountComponent } from './settings/account.component';
|
import { AccountComponent } from './settings/account.component';
|
||||||
import { CreateOrganizationComponent } from './settings/create-organization.component';
|
import { CreateOrganizationComponent } from './settings/create-organization.component';
|
||||||
@ -92,7 +95,16 @@ const routes: Routes = [
|
|||||||
component: OrganizationLayoutComponent,
|
component: OrganizationLayoutComponent,
|
||||||
children: [
|
children: [
|
||||||
{ path: '', pathMatch: 'full', redirectTo: 'vault' },
|
{ path: '', pathMatch: 'full', redirectTo: 'vault' },
|
||||||
{ path: 'vault', component: OrganizationVaultComponent, canActivate: [AuthGuardService] },
|
{ path: 'vault', component: OrgVaultComponent, canActivate: [AuthGuardService] },
|
||||||
|
{
|
||||||
|
path: 'tools',
|
||||||
|
component: OrgToolsComponent,
|
||||||
|
children: [
|
||||||
|
{ path: '', pathMatch: 'full', redirectTo: 'export' },
|
||||||
|
// { path: 'import', component: ImportComponent, canActivate: [AuthGuardService] },
|
||||||
|
{ path: 'export', component: OrgExportComponent, canActivate: [AuthGuardService] },
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ path: '**', redirectTo: '' },
|
{ path: '**', redirectTo: '' },
|
||||||
|
@ -32,6 +32,9 @@ import { RegisterComponent } from './accounts/register.component';
|
|||||||
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
|
|
||||||
|
import { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';
|
||||||
|
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
||||||
|
|
||||||
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
||||||
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
||||||
import { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';
|
import { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';
|
||||||
@ -159,7 +162,9 @@ import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';
|
|||||||
OrgAttachmentsComponent,
|
OrgAttachmentsComponent,
|
||||||
OrgCiphersComponent,
|
OrgCiphersComponent,
|
||||||
OrgCollectionsComponent,
|
OrgCollectionsComponent,
|
||||||
|
OrgExportComponent,
|
||||||
OrgGroupingsComponent,
|
OrgGroupingsComponent,
|
||||||
|
OrgToolsComponent,
|
||||||
OrganizationsComponent,
|
OrganizationsComponent,
|
||||||
OrganizationLayoutComponent,
|
OrganizationLayoutComponent,
|
||||||
OrgVaultComponent,
|
OrgVaultComponent,
|
||||||
|
43
src/app/organizations/tools/export.component.ts
Normal file
43
src/app/organizations/tools/export.component.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
|
import { ExportService } from 'jslib/abstractions/export.service';
|
||||||
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
|
import { ExportComponent as BaseExportComponent } from '../../tools/export.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-org-export',
|
||||||
|
templateUrl: '../../tools/export.component.html',
|
||||||
|
})
|
||||||
|
export class ExportComponent extends BaseExportComponent {
|
||||||
|
organizationId: string;
|
||||||
|
|
||||||
|
constructor(analytics: Angulartics2, toasterService: ToasterService,
|
||||||
|
cryptoService: CryptoService, userService: UserService,
|
||||||
|
i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||||
|
exportService: ExportService, private route: ActivatedRoute, ) {
|
||||||
|
super(analytics, toasterService, cryptoService, userService, i18nService, platformUtilsService,
|
||||||
|
exportService);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.route.parent.parent.params.subscribe(async (params) => {
|
||||||
|
this.organizationId = params.organizationId;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getExportData() {
|
||||||
|
return this.exportService.getOrganizationExport(this.organizationId, 'csv');
|
||||||
|
}
|
||||||
|
|
||||||
|
getFileName() {
|
||||||
|
return super.getFileName('org');
|
||||||
|
}
|
||||||
|
}
|
20
src/app/organizations/tools/tools.component.html
Normal file
20
src/app/organizations/tools/tools.component.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<div class="container page-content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">{{'tools' | i18n}}</div>
|
||||||
|
<div class="list-group list-group-flush">
|
||||||
|
<a routerLink="import" class="list-group-item" routerLinkActive="active">
|
||||||
|
{{'import' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a routerLink="export" class="list-group-item" routerLinkActive="active">
|
||||||
|
{{'exportVault' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-9">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
9
src/app/organizations/tools/tools.component.ts
Normal file
9
src/app/organizations/tools/tools.component.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-org-tools',
|
||||||
|
templateUrl: 'tools.component.html',
|
||||||
|
})
|
||||||
|
export class ToolsComponent { }
|
@ -102,7 +102,7 @@ const totpService = new TotpService(storageService, cryptoFunctionService);
|
|||||||
const containerService = new ContainerService(cryptoService, platformUtilsService);
|
const containerService = new ContainerService(cryptoService, platformUtilsService);
|
||||||
const authService = new AuthService(cryptoService, apiService,
|
const authService = new AuthService(cryptoService, apiService,
|
||||||
userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService);
|
userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService);
|
||||||
const exportService = new ExportService(folderService, cipherService);
|
const exportService = new ExportService(folderService, cipherService, apiService);
|
||||||
const auditService = new AuditService(cryptoFunctionService);
|
const auditService = new AuditService(cryptoFunctionService);
|
||||||
|
|
||||||
const analytics = new Analytics(window, () => platformUtilsService.isDev(),
|
const analytics = new Analytics(window, () => platformUtilsService.isDev(),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<form (ngSubmit)="submit()" ngNativeValidate>
|
<form #form (ngSubmit)="submit()" ngNativeValidate [appApiAction]="formPromise">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>{{'exportVault' | i18n}}</h1>
|
<h1>{{'exportVault' | i18n}}</h1>
|
||||||
</div>
|
</div>
|
||||||
@ -10,7 +10,8 @@
|
|||||||
<input id="masterPassword" type="password" name="MasterPassword" class="form-control" [(ngModel)]="masterPassword" required>
|
<input id="masterPassword" type="password" name="MasterPassword" class="form-control" [(ngModel)]="masterPassword" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button appBlurClick type="submit" class="btn btn-primary">
|
<button appBlurClick type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||||
{{'exportVault' | i18n}}
|
<i class="fa fa-spinner fa-spin"></i>
|
||||||
|
<span>{{'exportVault' | i18n}}</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user