From 45cb346be1f0af1f7046312f2665e581298ebf47 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Apr 2019 09:56:15 -0400 Subject: [PATCH] Revert "no need to just search name on edge any longer" This reverts commit 20fb4d3a391ef8e9457cab98a50de6f5e5a883cf. --- src/angular/pipes/search-ciphers.pipe.ts | 8 ++++++++ src/services/search.service.ts | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/angular/pipes/search-ciphers.pipe.ts b/src/angular/pipes/search-ciphers.pipe.ts index 2b0e442a90..e81371c4e8 100644 --- a/src/angular/pipes/search-ciphers.pipe.ts +++ b/src/angular/pipes/search-ciphers.pipe.ts @@ -5,12 +5,20 @@ import { import { CipherView } from '../../models/view/cipherView'; +import { PlatformUtilsService } from '../../abstractions/platformUtils.service'; + +import { DeviceType } from '../../enums'; + @Pipe({ name: 'searchCiphers', }) export class SearchCiphersPipe implements PipeTransform { private onlySearchName = false; + constructor(platformUtilsService: PlatformUtilsService) { + this.onlySearchName = platformUtilsService.getDevice() === DeviceType.EdgeExtension; + } + transform(ciphers: CipherView[], searchText: string): CipherView[] { if (ciphers == null || ciphers.length === 0) { return []; diff --git a/src/services/search.service.ts b/src/services/search.service.ts index 7cc1b91e60..550a6ab933 100644 --- a/src/services/search.service.ts +++ b/src/services/search.service.ts @@ -3,9 +3,11 @@ import * as lunr from 'lunr'; import { CipherView } from '../models/view/cipherView'; import { CipherService } from '../abstractions/cipher.service'; +import { PlatformUtilsService } from '../abstractions/platformUtils.service'; import { SearchService as SearchServiceAbstraction } from '../abstractions/search.service'; import { CipherType } from '../enums/cipherType'; +import { DeviceType } from '../enums/deviceType'; import { FieldType } from '../enums/fieldType'; import { UriMatchType } from '../enums/uriMatchType'; @@ -14,7 +16,10 @@ export class SearchService implements SearchServiceAbstraction { private index: lunr.Index = null; private onlySearchName = false; - constructor(private cipherService: CipherService) { } + constructor(private cipherService: CipherService, platformUtilsService: PlatformUtilsService) { + this.onlySearchName = platformUtilsService == null || + platformUtilsService.getDevice() === DeviceType.EdgeExtension; + } clearIndex(): void { this.index = null;