mirror of
https://github.com/bitwarden/web
synced 2025-12-14 15:23:14 +00:00
organizations component in vault
This commit is contained in:
@@ -38,6 +38,7 @@ import { AttachmentsComponent } from './vault/attachments.component';
|
|||||||
import { CiphersComponent } from './vault/ciphers.component';
|
import { CiphersComponent } from './vault/ciphers.component';
|
||||||
import { FolderAddEditComponent } from './vault/folder-add-edit.component';
|
import { FolderAddEditComponent } from './vault/folder-add-edit.component';
|
||||||
import { GroupingsComponent } from './vault/groupings.component';
|
import { GroupingsComponent } from './vault/groupings.component';
|
||||||
|
import { OrganizationsComponent } from './vault/organizations.component';
|
||||||
import { VaultComponent } from './vault/vault.component';
|
import { VaultComponent } from './vault/vault.component';
|
||||||
|
|
||||||
import { IconComponent } from 'jslib/angular/components/icon.component';
|
import { IconComponent } from 'jslib/angular/components/icon.component';
|
||||||
@@ -94,6 +95,7 @@ import { Folder } from 'jslib/models/domain';
|
|||||||
LoginComponent,
|
LoginComponent,
|
||||||
ModalComponent,
|
ModalComponent,
|
||||||
NavbarComponent,
|
NavbarComponent,
|
||||||
|
OrganizationsComponent,
|
||||||
OrganizationLayoutComponent,
|
OrganizationLayoutComponent,
|
||||||
RegisterComponent,
|
RegisterComponent,
|
||||||
SearchCiphersPipe,
|
SearchCiphersPipe,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<input type="search" placeholder="{{searchPlaceholder || ('searchVault' | i18n)}}" id="search" class="form-control" [(ngModel)]="searchText"
|
<input type="search" placeholder="{{searchPlaceholder || ('searchVault' | i18n)}}" id="search" class="form-control" [(ngModel)]="searchText"
|
||||||
(input)="searchTextChanged()" appAutofocus>
|
(input)="searchTextChanged()" appAutofocus>
|
||||||
<ul class="fa-ul">
|
<ul class="fa-ul card-ul">
|
||||||
<li [ngClass]="{active: selectedAll}">
|
<li [ngClass]="{active: selectedAll}">
|
||||||
<a href="#" appStopClick appBlurClick (click)="selectAll()">
|
<a href="#" appStopClick appBlurClick (click)="selectAll()">
|
||||||
<i class="fa-li fa fa-fw fa-th"></i>{{'allItems' | i18n}}
|
<i class="fa-li fa fa-fw fa-th"></i>{{'allItems' | i18n}}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>{{'types' | i18n}}</h3>
|
<h3>{{'types' | i18n}}</h3>
|
||||||
<ul class="fa-ul">
|
<ul class="fa-ul card-ul">
|
||||||
<li [ngClass]="{active: selectedType === cipherType.Login}">
|
<li [ngClass]="{active: selectedType === cipherType.Login}">
|
||||||
<a href="#" appStopClick appBlurClick (click)="selectType(cipherType.Login)">
|
<a href="#" appStopClick appBlurClick (click)="selectType(cipherType.Login)">
|
||||||
<i class="fa-li fa fa-fw fa-globe"></i>{{'typeLogin' | i18n}}
|
<i class="fa-li fa fa-fw fa-globe"></i>{{'typeLogin' | i18n}}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<i class="fa fa-plus fa-fw"></i>
|
<i class="fa fa-plus fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
<ul class="fa-ul carets">
|
<ul class="fa-ul card-ul carets">
|
||||||
<li *ngFor="let f of folders" class="d-flex" [ngClass]="{active: selectedFolder && f.id === selectedFolderId}">
|
<li *ngFor="let f of folders" class="d-flex" [ngClass]="{active: selectedFolder && f.id === selectedFolderId}">
|
||||||
<a href="#" appStopClick appBlurClick (click)="selectFolder(f)">
|
<a href="#" appStopClick appBlurClick (click)="selectFolder(f)">
|
||||||
<i class="fa-li fa fa-caret-right"></i> {{f.name}}</a>
|
<i class="fa-li fa fa-caret-right"></i> {{f.name}}</a>
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div *ngIf="collections && collections.length">
|
<div *ngIf="collections && collections.length">
|
||||||
<h3>{{'collections' | i18n}}</h3>
|
<h3>{{'collections' | i18n}}</h3>
|
||||||
<ul class="fa-ul carets">
|
<ul class="fa-ul card-ul carets">
|
||||||
<li *ngFor="let c of collections" [ngClass]="{active: c.id === selectedCollectionId}">
|
<li *ngFor="let c of collections" [ngClass]="{active: c.id === selectedCollectionId}">
|
||||||
<a href="#" appStopClick appBlurClick (click)="selectCollection(c)">
|
<a href="#" appStopClick appBlurClick (click)="selectCollection(c)">
|
||||||
<i class="fa-li fa fa-caret-right"></i> {{c.name}}</a>
|
<i class="fa-li fa fa-caret-right"></i> {{c.name}}</a>
|
||||||
|
|||||||
10
src/app/vault/organizations.component.html
Normal file
10
src/app/vault/organizations.component.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<ul class="fa-ul card-ul carets">
|
||||||
|
<li *ngFor="let o of organizations">
|
||||||
|
<a href="#" appStopClick appBlurClick (click)="selectOrganization(o)">
|
||||||
|
<i class="fa-li fa fa-caret-right"></i> {{o.name}}</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<button (click)="newOrganization()" class="btn btn-block btn-outline-primary">
|
||||||
|
<i class="fa fa-plus fa-fw"></i>
|
||||||
|
{{'newOrganization' | i18n}}
|
||||||
|
</button>
|
||||||
31
src/app/vault/organizations.component.ts
Normal file
31
src/app/vault/organizations.component.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-vault-organizations',
|
||||||
|
templateUrl: 'organizations.component.html',
|
||||||
|
})
|
||||||
|
export class OrganizationsComponent {
|
||||||
|
@Output() onOrganizationClicked = new EventEmitter<any>();
|
||||||
|
organizations: any;
|
||||||
|
|
||||||
|
constructor(private userService: UserService, private analytics: Angulartics2,
|
||||||
|
private toasterService: ToasterService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
this.organizations = await this.userService.getAllOrganizations();
|
||||||
|
}
|
||||||
|
|
||||||
|
selectOrganization(o: any) {
|
||||||
|
this.onOrganizationClicked.emit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,7 +58,8 @@
|
|||||||
Organizations
|
Organizations
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
Your organizations.
|
<app-vault-organizations (onOrganizationClicked)="selectOrganization($event)">
|
||||||
|
</app-vault-organizations>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { AttachmentsComponent } from './attachments.component';
|
|||||||
import { CiphersComponent } from './ciphers.component';
|
import { CiphersComponent } from './ciphers.component';
|
||||||
import { FolderAddEditComponent } from './folder-add-edit.component';
|
import { FolderAddEditComponent } from './folder-add-edit.component';
|
||||||
import { GroupingsComponent } from './groupings.component';
|
import { GroupingsComponent } from './groupings.component';
|
||||||
|
import { OrganizationsComponent } from './organizations.component';
|
||||||
|
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
import { SyncService } from 'jslib/abstractions/sync.service';
|
import { SyncService } from 'jslib/abstractions/sync.service';
|
||||||
@@ -34,6 +35,7 @@ import { SyncService } from 'jslib/abstractions/sync.service';
|
|||||||
export class VaultComponent implements OnInit {
|
export class VaultComponent implements OnInit {
|
||||||
@ViewChild(GroupingsComponent) groupingsComponent: GroupingsComponent;
|
@ViewChild(GroupingsComponent) groupingsComponent: GroupingsComponent;
|
||||||
@ViewChild(CiphersComponent) ciphersComponent: CiphersComponent;
|
@ViewChild(CiphersComponent) ciphersComponent: CiphersComponent;
|
||||||
|
@ViewChild(OrganizationsComponent) organizationsComponent: OrganizationsComponent;
|
||||||
@ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;
|
@ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;
|
||||||
@ViewChild('folderAddEdit', { read: ViewContainerRef }) folderAddEditModalRef: ViewContainerRef;
|
@ViewChild('folderAddEdit', { read: ViewContainerRef }) folderAddEditModalRef: ViewContainerRef;
|
||||||
@ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditRef: ViewContainerRef;
|
@ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditRef: ViewContainerRef;
|
||||||
@@ -53,7 +55,10 @@ export class VaultComponent implements OnInit {
|
|||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.queryParams.subscribe(async (params) => {
|
this.route.queryParams.subscribe(async (params) => {
|
||||||
await this.syncService.fullSync(true);
|
await this.syncService.fullSync(true);
|
||||||
await this.groupingsComponent.load();
|
await Promise.all([
|
||||||
|
this.groupingsComponent.load(),
|
||||||
|
this.organizationsComponent.load(),
|
||||||
|
]);
|
||||||
|
|
||||||
if (params == null) {
|
if (params == null) {
|
||||||
this.groupingsComponent.selectedAll = true;
|
this.groupingsComponent.selectedAll = true;
|
||||||
|
|||||||
@@ -548,6 +548,9 @@
|
|||||||
"noItemsInList": {
|
"noItemsInList": {
|
||||||
"message": "There are no items to list."
|
"message": "There are no items to list."
|
||||||
},
|
},
|
||||||
|
"newOrganization": {
|
||||||
|
"message": "New Organization"
|
||||||
|
},
|
||||||
"versionNumber": {
|
"versionNumber": {
|
||||||
"message": "Version $VERSION_NUMBER$",
|
"message": "Version $VERSION_NUMBER$",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
|
|||||||
@@ -121,6 +121,22 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card ul.fa-ul.card-ul {
|
||||||
|
margin-left: 1.9em;
|
||||||
|
|
||||||
|
.fa-li {
|
||||||
|
top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.carets {
|
||||||
|
margin-left: 1.1em;
|
||||||
|
|
||||||
|
.fa-li {
|
||||||
|
left: -24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.modal-body {
|
.modal-body {
|
||||||
h3 {
|
h3 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -238,22 +254,6 @@ app-vault-groupings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.fa-ul {
|
|
||||||
margin-left: 1.9em;
|
|
||||||
|
|
||||||
.fa-li {
|
|
||||||
top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.carets {
|
|
||||||
margin-left: 1.1em;
|
|
||||||
|
|
||||||
.fa-li {
|
|
||||||
left: -24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.show-active {
|
.show-active {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user