1
0
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:
Kyle Spearrin 2018-07-03 12:34:20 -04:00
parent 1e7c2c2362
commit 6d731e2939
10 changed files with 38 additions and 16 deletions

2
jslib

@ -1 +1 @@
Subproject commit 3454d93fef76f84c7351990089f7b155b88580f8 Subproject commit af43232567fa63911725929d549f2b01927fa243

View File

@ -14,6 +14,8 @@ 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.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';
import { DomainRulesComponent } from './settings/domain-rules.component'; import { DomainRulesComponent } from './settings/domain-rules.component';
@ -84,10 +86,11 @@ const routes: Routes = [
], ],
}, },
{ {
path: 'organization/:organizationId', path: 'organizations/:organizationId',
component: OrganizationLayoutComponent, component: OrganizationLayoutComponent,
children: [ children: [
{ path: 'vault', component: VaultComponent, canActivate: [AuthGuardService] }, { path: '', pathMatch: 'full', redirectTo: 'vault' },
{ path: 'vault', component: OrganizationVaultComponent, canActivate: [AuthGuardService] },
], ],
}, },
{ path: '**', redirectTo: '' }, { path: '**', redirectTo: '' },

View File

@ -11,6 +11,7 @@ import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { OrganizationsModule } from './organizations/organizations.module';
import { ServicesModule } from './services/services.module'; import { ServicesModule } from './services/services.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
@ -99,6 +100,7 @@ import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';
BrowserAnimationsModule, BrowserAnimationsModule,
FormsModule, FormsModule,
AppRoutingModule, AppRoutingModule,
OrganizationsModule,
ServicesModule, ServicesModule,
Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], { Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], {
pageTracking: { pageTracking: {

View File

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { VaultComponent } from './vault.component';
@NgModule({
declarations: [
VaultComponent,
],
entryComponents: [],
providers: [],
})
export class OrganizationsModule { }

View File

@ -0,0 +1 @@
Org vault!!

View File

@ -0,0 +1,11 @@
import {
Component
} from '@angular/core';
@Component({
selector: 'app-org-vault',
templateUrl: 'vault.component.html',
})
export class VaultComponent {
}

View File

@ -4,13 +4,14 @@
<ng-container *ngIf="loaded"> <ng-container *ngIf="loaded">
<ul class="fa-ul card-ul carets" *ngIf="organizations && organizations.length"> <ul class="fa-ul card-ul carets" *ngIf="organizations && organizations.length">
<li *ngFor="let o of organizations"> <li *ngFor="let o of organizations">
<a href="#" class="text-body" appStopClick appBlurClick (click)="selectOrganization(o)"> <a [routerLink]="['/organizations', o.id]" class="text-body">
<i class="fa-li fa fa-caret-right"></i> {{o.name}}</a> <i class="fa-li fa fa-caret-right"></i> {{o.name}}
</a>
</li> </li>
</ul> </ul>
<p *ngIf="!organizations || !organizations.length">{{'noOrganizationsList' | i18n}}</p> <p *ngIf="!organizations || !organizations.length">{{'noOrganizationsList' | i18n}}</p>
</ng-container> </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> <i class="fa fa-plus fa-fw"></i>
{{'newOrganization' | i18n}} {{'newOrganization' | i18n}}
</a> </a>

View File

@ -13,19 +13,13 @@ import { Organization } from 'jslib/models/domain/organization';
templateUrl: 'organizations.component.html', templateUrl: 'organizations.component.html',
}) })
export class OrganizationsComponent { export class OrganizationsComponent {
@Output() onOrganizationClicked = new EventEmitter<Organization>();
organizations: Organization[]; organizations: Organization[];
loaded: boolean = false; loaded: boolean = false;
constructor(private userService: UserService) { constructor(private userService: UserService) { }
}
async load() { async load() {
this.organizations = await this.userService.getAllOrganizations(); this.organizations = await this.userService.getAllOrganizations();
this.loaded = true; this.loaded = true;
} }
selectOrganization(o: Organization) {
this.onOrganizationClicked.emit(o);
}
} }

View File

@ -59,8 +59,7 @@
Organizations Organizations
</div> </div>
<div class="card-body"> <div class="card-body">
<app-vault-organizations (onOrganizationClicked)="selectOrganization($event)"> <app-vault-organizations></app-vault-organizations>
</app-vault-organizations>
</div> </div>
</div> </div>
</div> </div>

View File

@ -14,7 +14,6 @@ import {
import { CipherType } from 'jslib/enums/cipherType'; import { CipherType } from 'jslib/enums/cipherType';
import { CipherView } from 'jslib/models/view/cipherView'; import { CipherView } from 'jslib/models/view/cipherView';
import { FolderView } from 'jslib/models/view/folderView';
import { ModalComponent } from '../modal.component'; import { ModalComponent } from '../modal.component';