From 2c24d9dfdaf230746bd028daddd4d255ee22338f Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 22 Jun 2018 12:46:42 +0900 Subject: [PATCH] test --- .../discovery-infra-tree.component.html | 31 +++++---------- .../discovery-infra-tree.component.ts | 6 +-- .../component/discovery.component.html | 5 +-- .../component/discovery.component.ts | 2 - .../component/search-filter.component.html | 7 +--- .../component/search-filter.component.ts | 39 ++++++------------- 6 files changed, 27 insertions(+), 63 deletions(-) diff --git a/@overflow/discovery/component/discovery-infra-tree.component.html b/@overflow/discovery/component/discovery-infra-tree.component.html index 95c748e..111657d 100644 --- a/@overflow/discovery/component/discovery-infra-tree.component.html +++ b/@overflow/discovery/component/discovery-infra-tree.component.html @@ -19,21 +19,14 @@
- {{node.data.date | date: 'yy/MM/dd'}} + {{node.data.date | date: 'yy/MM/dd'}}
-
- New!! -
- - - New!! - + New!!
@@ -41,21 +34,15 @@
- {{node.data.date | date: 'yy/MM/dd'}} + {{node.data.date | date: 'yy/MM/dd'}}
-
- New!! -
- - - New!! - + New!!
diff --git a/@overflow/discovery/component/discovery-infra-tree.component.ts b/@overflow/discovery/component/discovery-infra-tree.component.ts index 89dafc0..2ee6e36 100644 --- a/@overflow/discovery/component/discovery-infra-tree.component.ts +++ b/@overflow/discovery/component/discovery-infra-tree.component.ts @@ -338,12 +338,12 @@ export class DiscoveryInfraTreeComponent implements OnChanges { }); } - checkHighlight(label: string, type: number) { + checkHighlight(name: string, type: number) { let highlight = true; - if (this.filterWord && (label.toUpperCase().indexOf(this.filterWord.toUpperCase()) < 0)) { + if (this.filterWord && (name.toUpperCase().indexOf(this.filterWord.toUpperCase()) < 0)) { highlight = false; } - if (type === 1 && this.filterServices[label] === false) { + if (type === 1 && this.filterServices[name] === false) { highlight = false; } return highlight; diff --git a/@overflow/discovery/component/discovery.component.html b/@overflow/discovery/component/discovery.component.html index 07b8d34..429807a 100644 --- a/@overflow/discovery/component/discovery.component.html +++ b/@overflow/discovery/component/discovery.component.html @@ -15,14 +15,13 @@ - +
- - +
diff --git a/@overflow/discovery/component/discovery.component.ts b/@overflow/discovery/component/discovery.component.ts index bd79fba..55055c9 100644 --- a/@overflow/discovery/component/discovery.component.ts +++ b/@overflow/discovery/component/discovery.component.ts @@ -37,7 +37,6 @@ export class DiscoveryComponent implements OnInit, OnDestroy { filterServices: Service[]; @ViewChild('infraTree') infraTree: DiscoveryInfraTreeComponent; - @ViewChild('filter') filter: SearchFilterComponent; constructor( private discoveryService: DiscoveryService, @@ -104,7 +103,6 @@ export class DiscoveryComponent implements OnInit, OnDestroy { case 'DiscoveryService.discoveredService': { const service = discoveryNotify.params as Service; this.infraTree.addService(service); - this.filter.addService(service); break; } default: { diff --git a/@overflow/discovery/component/search-filter.component.html b/@overflow/discovery/component/search-filter.component.html index 668274c..c74291e 100644 --- a/@overflow/discovery/component/search-filter.component.html +++ b/@overflow/discovery/component/search-filter.component.html @@ -1,15 +1,12 @@
-
+ -
-
+ --> \ No newline at end of file diff --git a/@overflow/discovery/component/search-filter.component.ts b/@overflow/discovery/component/search-filter.component.ts index 926f6db..c801d86 100644 --- a/@overflow/discovery/component/search-filter.component.ts +++ b/@overflow/discovery/component/search-filter.component.ts @@ -16,10 +16,8 @@ export class SearchFilterComponent implements OnInit { services: Service[] = []; filterWord: string; - filterServices = new Map(); @Output() search = new EventEmitter(); - @Output() serviceSelect = new EventEmitter>(); constructor( ) { @@ -36,33 +34,18 @@ export class SearchFilterComponent implements OnInit { } addService(service: Service) { - if (service.key.indexOf('Not Supported Service') >= 0) { - const tempName = service.key.split('Perhaps ')[1].split('[')[0]; - service.key = '*' + tempName; - } - let exist = false; - this.services.forEach(value => { - if (value.key === service.key) { - exist = true; - return; - } - }); - if (!exist) { - this.services.push(service); - this.filterServices[service.key] = true; - } - this.serviceSelect.emit(this.filterServices); - } - - onServiceFilter(e, service: Service) { - // if (e.checked) { - // this.filterServices.push(service); - // } else { - // const index = this.filterServices.indexOf(service); - // this.filterServices.splice(index, 1); + // let exist = false; + // this.services.forEach(value => { + // if (value.key === service.key) { + // exist = true; + // return; + // } + // }); + // if (!exist) { + // this.services.push(service); + // this.filterServices[service.key] = true; // } - - this.serviceSelect.emit(this.filterServices); + // this.serviceSelect.emit(this.filterServices); } }