Commit 9c5e70716c5016e79aa898fa0a98b293495069d6

Authored by Artem Babak
1 parent cf1e4bf5

Edges widget cleanup

... ... @@ -23,7 +23,6 @@
23 23 <div fxFlex class="tb-entities-nav-tree-panel">
24 24 <tb-nav-tree
25 25 [loadNodes]="loadNodes"
26   - enableSearch="true"
27 26 ></tb-nav-tree>
28 27 </div>
29 28 </div>
... ...
... ... @@ -14,7 +14,7 @@
14 14 /// limitations under the License.
15 15 ///
16 16
17   -import { ChangeDetectorRef, Component, ElementRef, Input, OnInit, ViewChild, ViewContainerRef } from '@angular/core';
  17 +import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
18 18 import { PageComponent } from '@shared/components/page.component';
19 19 import { Store } from '@ngrx/store';
20 20 import { AppState } from '@core/core.state';
... ... @@ -22,12 +22,8 @@ import { WidgetContext } from '@home/models/widget-component.models';
22 22 import { WidgetConfig } from '@shared/models/widget.models';
23 23 import { IWidgetSubscription } from '@core/api/widget-api.models';
24 24 import { UtilsService } from '@core/services/utils.service';
25   -import cssjs from '@core/css/css';
26   -import { constructTableCssString } from '@home/components/widget/lib/table-widget.models';
27   -import { Overlay } from '@angular/cdk/overlay';
28 25 import { LoadNodesCallback } from '@shared/components/nav-tree.component';
29 26 import { EntityType } from '@shared/models/entity-type.models';
30   -import { hashCode } from '@core/utils';
31 27 import {
32 28 EdgeGroupNodeData,
33 29 edgeGroupsNodeText,
... ... @@ -57,8 +53,6 @@ export class EdgesOverviewWidgetComponent extends PageComponent implements OnIni
57 53 @Input()
58 54 ctx: WidgetContext;
59 55
60   - @ViewChild('searchInput') searchInputField: ElementRef;
61   -
62 56 public toastTargetId = 'edges-overview-' + this.utils.guid();
63 57 public customerTitle: string = null;
64 58
... ... @@ -72,12 +66,9 @@ export class EdgesOverviewWidgetComponent extends PageComponent implements OnIni
72 66 private edgeGroupsNodesMap: {[edgeNodeId: string]: {[groupType: string]: string}} = {};
73 67
74 68 constructor(protected store: Store<AppState>,
75   - private elementRef: ElementRef,
76 69 private edgeService: EdgeService,
77 70 private entityService: EntityService,
78 71 private translateService: TranslateService,
79   - private overlay: Overlay,
80   - private viewContainerRef: ViewContainerRef,
81 72 private utils: UtilsService,
82 73 private cd: ChangeDetectorRef) {
83 74 super(store);
... ... @@ -92,20 +83,9 @@ export class EdgesOverviewWidgetComponent extends PageComponent implements OnIni
92 83 this.getCustomerTitle(selectedEdge.id.id);
93 84 this.ctx.widgetTitle = selectedEdge.name;
94 85 }
95   - this.initializeConfig();
96 86 this.ctx.updateWidgetParams();
97 87 }
98 88
99   - private initializeConfig() {
100   - const cssString = constructTableCssString(this.widgetConfig);
101   - const cssParser = new cssjs();
102   - cssParser.testMode = false;
103   - const namespace = 'edges-overview-' + hashCode(cssString);
104   - cssParser.cssPreviewNamespace = namespace;
105   - cssParser.createStyleElement(namespace, cssString);
106   - $(this.elementRef.nativeElement).addClass(namespace);
107   - }
108   -
109 89 public loadNodes: LoadNodesCallback = (node, cb) => {
110 90 var selectedEdge: BaseData<EntityId> = null;
111 91 if (this.datasources.length > 0 && this.datasources[0].entity && this.datasources[0].entity.id.entityType === EntityType.EDGE) {
... ...