1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 11:43:46 +00:00

implement search service

This commit is contained in:
Kyle Spearrin
2018-08-13 16:27:17 -04:00
parent e7c6fbf423
commit e3ca470a6a
10 changed files with 51 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
<ng-container *ngIf="(ciphers | searchCiphers: searchText) as searchedCiphers">
<table class="table table-hover table-list table-ciphers" *ngIf="searchedCiphers.length > 0">
<ng-container *ngIf="ciphers">
<table class="table table-hover table-list table-ciphers" *ngIf="ciphers.length > 0">
<tbody>
<tr *ngFor="let c of searchedCiphers">
<tr *ngFor="let c of ciphers">
<td (click)="checkCipher(c)" class="table-list-checkbox" *ngIf="!organization">
<input type="checkbox" [(ngModel)]="c.checked">
</td>
@@ -52,7 +52,7 @@
</tr>
</tbody>
</table>
<div class="no-items" *ngIf="searchedCiphers.length === 0">
<div class="no-items" *ngIf="ciphers.length === 0">
<i class="fa fa-spinner fa-spin text-muted" *ngIf="!loaded" title="{{'loading' | i18n}}"></i>
<ng-container *ngIf="loaded">
<p>{{'noItemsInList' | i18n}}</p>

View File

@@ -12,6 +12,7 @@ import { Angulartics2 } from 'angulartics2';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SearchService } from 'jslib/abstractions/search.service';
import { CiphersComponent as BaseCiphersComponent } from 'jslib/angular/components/ciphers.component';
@@ -38,10 +39,10 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
private searchPipe: SearchCiphersPipe;
constructor(cipherService: CipherService, protected analytics: Angulartics2,
constructor(searchService: SearchService, protected analytics: Angulartics2,
protected toasterService: ToasterService, protected i18nService: I18nService,
protected platformUtilsService: PlatformUtilsService) {
super(cipherService);
protected platformUtilsService: PlatformUtilsService, protected cipherService: CipherService) {
super(searchService);
this.searchPipe = new SearchCiphersPipe(platformUtilsService);
}

View File

@@ -167,6 +167,7 @@ export class VaultComponent implements OnInit {
filterSearchText(searchText: string) {
this.ciphersComponent.searchText = searchText;
this.ciphersComponent.search(200);
}
async editCipherAttachments(cipher: CipherView) {