Browse Source

Edge widget message warning

pull/3811/head
deaflynx 6 years ago
parent
commit
746d17185c
  1. 3
      ui-ngx/src/app/modules/home/components/widget/lib/edges-overview-widget.component.html
  2. 3
      ui-ngx/src/app/modules/home/components/widget/lib/edges-overview-widget.component.ts
  3. 2
      ui-ngx/src/assets/locale/locale.constant-en_US.json

3
ui-ngx/src/app/modules/home/components/widget/lib/edges-overview-widget.component.html

@ -20,6 +20,9 @@
<div *ngIf="customerTitle" fxLayout="row"> <div *ngIf="customerTitle" fxLayout="row">
<span class="mat-subheader">{{ customerTitle }}</span> <span class="mat-subheader">{{ customerTitle }}</span>
</div> </div>
<div *ngIf="!isDatasourceEdgeType" fxLayout="row">
<span class="mat-subheader" translate>edge.widget-datasource-error</span>
</div>
<div fxFlex class="tb-entities-nav-tree-panel"> <div fxFlex class="tb-entities-nav-tree-panel">
<tb-nav-tree <tb-nav-tree
[loadNodes]="loadNodes" [loadNodes]="loadNodes"

3
ui-ngx/src/app/modules/home/components/widget/lib/edges-overview-widget.component.ts

@ -54,6 +54,7 @@ export class EdgesOverviewWidgetComponent extends PageComponent implements OnIni
public toastTargetId = 'edges-overview-' + this.utils.guid(); public toastTargetId = 'edges-overview-' + this.utils.guid();
public customerTitle: string = null; public customerTitle: string = null;
public isDatasourceEdgeType: boolean = true;
private widgetConfig: WidgetConfig; private widgetConfig: WidgetConfig;
private subscription: IWidgetSubscription; private subscription: IWidgetSubscription;
@ -91,7 +92,7 @@ export class EdgesOverviewWidgetComponent extends PageComponent implements OnIni
} else if (datasource.type === DatasourceType.function) { } else if (datasource.type === DatasourceType.function) {
cb(this.loadNodesForEdge(datasource.entityId, datasource.entity)); cb(this.loadNodesForEdge(datasource.entityId, datasource.entity));
} else { } else {
this.ctx.showErrorToast(this.translateService.instant('edge.widget-datasource-error')); this.isDatasourceEdgeType = false;
cb([]); cb([]);
} }
} }

2
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -1288,7 +1288,7 @@
"sync-process-started-successfully": "Sync process started successfully!", "sync-process-started-successfully": "Sync process started successfully!",
"missing-related-rule-chains-title": "Edge has missing related rule chain(s)", "missing-related-rule-chains-title": "Edge has missing related rule chain(s)",
"missing-related-rule-chains-text": "Assigned to edge rule chain(s) use rule nodes that forward message(s) to rule chain(s) that are not assigned to this edge. <br><br> List of missing rule chain(s): <br> {{missingRuleChains}}", "missing-related-rule-chains-text": "Assigned to edge rule chain(s) use rule nodes that forward message(s) to rule chain(s) that are not assigned to this edge. <br><br> List of missing rule chain(s): <br> {{missingRuleChains}}",
"widget-datasource-error": "This widget supports only EDGE entity" "widget-datasource-error": "This widget supports only EDGE entity datasource"
}, },
"edge-event": { "edge-event": {
"type-dashboard": "Dashboard", "type-dashboard": "Dashboard",

Loading…
Cancel
Save