@esfaenza/admin-module 11.2.33 → 11.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1584,14 +1584,16 @@
1584
1584
  this.metricsToShow = [];
1585
1585
  this.searchView = t;
1586
1586
  this.searchView.items.forEach(function (m) {
1587
- if (!_this.Instances.find(function (t) { return t.id == m.name; }))
1588
- _this.Instances.push(new KeyValue(m.name, m.name));
1587
+ if (!_this.Instances.find(function (t) { return t.id == m.instance; }) && m.instance)
1588
+ _this.Instances.push(new KeyValue(m.instance, m.instance));
1589
1589
  });
1590
1590
  this.instanceRequired = this.Instances.length > 1;
1591
1591
  if (this.Instances.length == 1) {
1592
1592
  this.selectedInstance = this.Instances[0].id;
1593
1593
  this.instanceSelected();
1594
1594
  }
1595
+ else
1596
+ this.instanceSelected(true);
1595
1597
  this.localStorage.setItem("HotSearchMetrics", this.searchView).subscribe();
1596
1598
  }
1597
1599
  else {
@@ -1614,11 +1616,12 @@
1614
1616
  });
1615
1617
  }); });
1616
1618
  };
1617
- AdmMetricsComponent.prototype.instanceSelected = function () {
1619
+ AdmMetricsComponent.prototype.instanceSelected = function (allowNull) {
1618
1620
  var _this = this;
1619
- if (!this.selectedInstance)
1621
+ if (allowNull === void 0) { allowNull = false; }
1622
+ if (!this.selectedInstance && !allowNull)
1620
1623
  return;
1621
- this.metricsToShow = this.searchView.items.filter(function (t) { return t.instance == _this.selectedInstance; });
1624
+ this.metricsToShow = this.searchView.items.filter(function (t) { return !_this.selectedInstance || (t.instance == _this.selectedInstance); });
1622
1625
  };
1623
1626
  AdmMetricsComponent.prototype.linkChartToMetric = function (metric, metricChart, chartComp) {
1624
1627
  var _this = this;