mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
setup org module and link org listing
This commit is contained in:
parent
1e7c2c2362
commit
6d731e2939
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit 3454d93fef76f84c7351990089f7b155b88580f8
|
||||
Subproject commit af43232567fa63911725929d549f2b01927fa243
|
@ -14,6 +14,8 @@ import { LoginComponent } from './accounts/login.component';
|
||||
import { RegisterComponent } from './accounts/register.component';
|
||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||
|
||||
import { VaultComponent as OrganizationVaultComponent } from './organizations/vault.component';
|
||||
|
||||
import { AccountComponent } from './settings/account.component';
|
||||
import { CreateOrganizationComponent } from './settings/create-organization.component';
|
||||
import { DomainRulesComponent } from './settings/domain-rules.component';
|
||||
@ -84,10 +86,11 @@ const routes: Routes = [
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'organization/:organizationId',
|
||||
path: 'organizations/:organizationId',
|
||||
component: OrganizationLayoutComponent,
|
||||
children: [
|
||||
{ path: 'vault', component: VaultComponent, canActivate: [AuthGuardService] },
|
||||
{ path: '', pathMatch: 'full', redirectTo: 'vault' },
|
||||
{ path: 'vault', component: OrganizationVaultComponent, canActivate: [AuthGuardService] },
|
||||
],
|
||||
},
|
||||
{ path: '**', redirectTo: '' },
|
||||
|
@ -11,6 +11,7 @@ import { FormsModule } from '@angular/forms';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
import { OrganizationsModule } from './organizations/organizations.module';
|
||||
import { ServicesModule } from './services/services.module';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
@ -99,6 +100,7 @@ import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';
|
||||
BrowserAnimationsModule,
|
||||
FormsModule,
|
||||
AppRoutingModule,
|
||||
OrganizationsModule,
|
||||
ServicesModule,
|
||||
Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], {
|
||||
pageTracking: {
|
||||
|
12
src/app/organizations/organizations.module.ts
Normal file
12
src/app/organizations/organizations.module.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { VaultComponent } from './vault.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
VaultComponent,
|
||||
],
|
||||
entryComponents: [],
|
||||
providers: [],
|
||||
})
|
||||
export class OrganizationsModule { }
|
1
src/app/organizations/vault.component.html
Normal file
1
src/app/organizations/vault.component.html
Normal file
@ -0,0 +1 @@
|
||||
Org vault!!
|
11
src/app/organizations/vault.component.ts
Normal file
11
src/app/organizations/vault.component.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import {
|
||||
Component
|
||||
} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-org-vault',
|
||||
templateUrl: 'vault.component.html',
|
||||
})
|
||||
export class VaultComponent {
|
||||
|
||||
}
|
@ -4,13 +4,14 @@
|
||||
<ng-container *ngIf="loaded">
|
||||
<ul class="fa-ul card-ul carets" *ngIf="organizations && organizations.length">
|
||||
<li *ngFor="let o of organizations">
|
||||
<a href="#" class="text-body" appStopClick appBlurClick (click)="selectOrganization(o)">
|
||||
<i class="fa-li fa fa-caret-right"></i> {{o.name}}</a>
|
||||
<a [routerLink]="['/organizations', o.id]" class="text-body">
|
||||
<i class="fa-li fa fa-caret-right"></i> {{o.name}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p *ngIf="!organizations || !organizations.length">{{'noOrganizationsList' | i18n}}</p>
|
||||
</ng-container>
|
||||
<a href="#" appStopClick routerLink="/settings/create-organization" class="btn btn-block btn-outline-primary">
|
||||
<a routerLink="/settings/create-organization" class="btn btn-block btn-outline-primary">
|
||||
<i class="fa fa-plus fa-fw"></i>
|
||||
{{'newOrganization' | i18n}}
|
||||
</a>
|
||||
|
@ -13,19 +13,13 @@ import { Organization } from 'jslib/models/domain/organization';
|
||||
templateUrl: 'organizations.component.html',
|
||||
})
|
||||
export class OrganizationsComponent {
|
||||
@Output() onOrganizationClicked = new EventEmitter<Organization>();
|
||||
organizations: Organization[];
|
||||
loaded: boolean = false;
|
||||
|
||||
constructor(private userService: UserService) {
|
||||
}
|
||||
constructor(private userService: UserService) { }
|
||||
|
||||
async load() {
|
||||
this.organizations = await this.userService.getAllOrganizations();
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
selectOrganization(o: Organization) {
|
||||
this.onOrganizationClicked.emit(o);
|
||||
}
|
||||
}
|
||||
|
@ -59,8 +59,7 @@
|
||||
Organizations
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<app-vault-organizations (onOrganizationClicked)="selectOrganization($event)">
|
||||
</app-vault-organizations>
|
||||
<app-vault-organizations></app-vault-organizations>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,7 +14,6 @@ import {
|
||||
import { CipherType } from 'jslib/enums/cipherType';
|
||||
|
||||
import { CipherView } from 'jslib/models/view/cipherView';
|
||||
import { FolderView } from 'jslib/models/view/folderView';
|
||||
|
||||
import { ModalComponent } from '../modal.component';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user