Browse Source

Edges overview widget template cleanup

pull/3957/head
Artem Babak 6 years ago
parent
commit
743d2440aa
  1. 2
      ui/src/app/widget/lib/edges-overview-widget.js
  2. 29
      ui/src/app/widget/lib/edges-overview-widget.tpl.html

2
ui/src/app/widget/lib/edges-overview-widget.js

@ -295,7 +295,7 @@ function EdgesOverviewWidgetController($element, $scope, $q, $timeout, $translat
function loadNodes(node, cb) {
var datasource = vm.datasources[0];
if (node.id === '#' && datasource) {
if (datasource.type === types.datasourceType.entity && datasource.entity.id.entityType === types.entityType.edge) {
if (datasource.type === types.datasourceType.entity && datasource.entity && datasource.entity.id.entityType === types.entityType.edge) {
var selectedEdge = datasource.entity;
getCustomerTitle(selectedEdge.id.id);
vm.ctx.widgetTitle = selectedEdge.name;

29
ui/src/app/widget/lib/edges-overview-widget.tpl.html

@ -17,36 +17,11 @@
-->
<div class="tb-absolute-fill tb-edges-overview" layout="column">
<div ng-show="vm.showData" flex class="tb-absolute-fill" layout="column">
<span class="mat-subheader" ng-if="vm.customerTitle" fxLayout="row">{{ vm.customerTitle }}</span>
<span class="mat-subheader" ng-if="!vm.edgeIsDatasource" fxLayout="row" translate>edge.widget-datasource-error</span>
<md-toolbar class="md-table-toolbar md-default" ng-show="vm.query.search != null">
<div class="md-toolbar-tools">
<md-button class="md-icon-button" aria-label="{{ 'action.search' | translate }}">
<md-icon aria-label="{{ 'action.search' | translate }}" class="material-icons">search</md-icon>
<md-tooltip md-direction="{{vm.ctx.dashboard.isWidgetExpanded ? 'bottom' : 'top'}}">
{{'entity.search' | translate}}
</md-tooltip>
</md-button>
<md-input-container flex>
<label>&nbsp;</label>
<input ng-model="vm.query.search" class="searchInput" placeholder="{{'entity.search' | translate}}"/>
</md-input-container>
<md-button class="md-icon-button" aria-label="Close" ng-click="vm.exitFilterMode()">
<md-icon aria-label="Close" class="material-icons">close</md-icon>
<md-tooltip md-direction="{{vm.ctx.dashboard.isWidgetExpanded ? 'bottom' : 'top'}}">
{{ 'action.close' | translate }}
</md-tooltip>
</md-button>
</div>
</md-toolbar>
<span class="mat-subheader" ng-if="vm.customerTitle">{{ vm.customerTitle }}</span>
<span class="mat-subheader" ng-if="!vm.edgeIsDatasource" translate>edge.widget-datasource-error</span>
<div flex class="tb-entities-nav-tree-panel">
<tb-nav-tree
load-nodes="vm.loadNodes"
on-node-selected="vm.onNodeSelected(node, event)"
on-nodes-inserted="vm.onNodesInserted(nodes, parent)"
edit-callbacks="vm.nodeEditCallbacks"
enable-search="true"
search-callback="vm.searchCallback(searchText, node)"
></tb-nav-tree>
</div>
</div>

Loading…
Cancel
Save