@schneideress/dashboardframework 20.0.5 → 20.0.6

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.
@@ -164,8 +164,6 @@ var RAEvent;
164
164
  RAEvent["SnapShotClick"] = "SnapShotClick";
165
165
  /** Event on emission report snapshot selected from list*/
166
166
  RAEvent["SnapShotSelected"] = "SnapShotSelected";
167
- /** Event to update widget count */
168
- RAEvent["UpdateWidgetCount"] = "UpdateWidgetCount";
169
167
  })(RAEvent || (RAEvent = {}));
170
168
  var RAEventKey;
171
169
  (function (RAEventKey) {
@@ -4785,7 +4783,6 @@ class RADashboardArea {
4785
4783
  this.hasGird = false;
4786
4784
  this.initialWidgetCount = 10;
4787
4785
  this.currentLoadingCount = 0;
4788
- this.isSiteDetailDashboard = false;
4789
4786
  this.downloadDatastreamLimit = 200;
4790
4787
  this.reportDatastreamLimit = 50;
4791
4788
  this.widgetHeight = 2;
@@ -4845,7 +4842,7 @@ class RADashboardArea {
4845
4842
  });
4846
4843
  setTimeout(() => {
4847
4844
  this.calculateLayout = this.raDashboardEventBus.subscribe(RAEvent.LayoutChange).subscribe(() => {
4848
- this.options.api.optionsChanged();
4845
+ this.options.api?.optionsChanged();
4849
4846
  });
4850
4847
  });
4851
4848
  }
@@ -5080,7 +5077,6 @@ class RADashboardArea {
5080
5077
  isIndicatorDashboard: this.isIndicatorDashboard
5081
5078
  };
5082
5079
  let _the = this;
5083
- this.isSiteDetailDashboard = this.dashboardInfo?.templateName === 'Site Detail';
5084
5080
  this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe(widgets => {
5085
5081
  _the.widgetList = [];
5086
5082
  this.userWidgets = widgets;
@@ -5092,8 +5088,6 @@ class RADashboardArea {
5092
5088
  if (settings && settings.isPAMWidget)
5093
5089
  this.PAMWidgets.push(element.widgetInstanceId);
5094
5090
  }
5095
- if (this.isSiteDetailDashboard)
5096
- element.templateSettings = JSON.stringify(this.dashboardInfo?.templateConfig?.widget);
5097
5091
  });
5098
5092
  this.checkPAMWidgets();
5099
5093
  if (this.dashboardInfo?.isReport && widgets && widgets.length > this.reportDatastreamLimit) {
@@ -5109,15 +5103,8 @@ class RADashboardArea {
5109
5103
  else {
5110
5104
  this.showDownloadOnlyState = false;
5111
5105
  this.showEmptyDashboard = true;
5112
- if (this.isSiteDetailDashboard) {
5113
- this.showDownloadOnlyState = false;
5114
- this.showEmptyDashboard = false;
5115
- }
5116
- else {
5117
- this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, this.showEmptyDashboard);
5118
- }
5106
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, this.showEmptyDashboard);
5119
5107
  }
5120
- this.raDashboardEventBus.publish(RAEvent.UpdateWidgetCount, this.userWidgets.length);
5121
5108
  });
5122
5109
  }
5123
5110
  /** To set Area(Gridster) height dynamically as widgets are added/removed */
@@ -5133,12 +5120,7 @@ class RADashboardArea {
5133
5120
  if (this.options.api) {
5134
5121
  curRowHeight = this.options.api.getCurrentRowHeight();
5135
5122
  }
5136
- if (this.isSiteDetailDashboard) {
5137
- this.showEmptyDashboard = false;
5138
- }
5139
- else {
5140
- this.showEmptyDashboard = this.userWidgets.length === 0;
5141
- }
5123
+ this.showEmptyDashboard = this.userWidgets.length > 0 ? false : true;
5142
5124
  this.widgetList.forEach((t) => {
5143
5125
  let currentHeight = t.y + t.rows;
5144
5126
  if (currentHeight > areaScrollHeight) {
@@ -5194,13 +5176,9 @@ class RADashboardArea {
5194
5176
  }
5195
5177
  }
5196
5178
  this.showEmptyDashboard = this.userWidgets.length > 0 ? false : true;
5197
- if (this.showEmptyDashboard == true && !this.isSiteDetailDashboard) {
5179
+ if (this.showEmptyDashboard == true) {
5198
5180
  this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, this.showEmptyDashboard);
5199
5181
  }
5200
- if (this.isSiteDetailDashboard) {
5201
- this.raDashboardEventBus.publish(RAEvent.UpdateWidgetCount, -1);
5202
- this.raDashboardEventBus.publish(RAEvent.RearrangeClicked, true);
5203
- }
5204
5182
  }
5205
5183
  /**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
5206
5184
  rearrangeWidgets() {
@@ -5241,8 +5219,6 @@ class RADashboardArea {
5241
5219
  data.dashboardId = this.userDashboardId;
5242
5220
  this.ngxService.start();
5243
5221
  this.dashboardService.addWidget(data, this.appConfig).subscribe(widget => {
5244
- if (this.isSiteDetailDashboard)
5245
- widget.templateSettings = JSON.stringify(this.dashboardInfo?.templateConfig?.widget);
5246
5222
  this.userWidgets.push(widget);
5247
5223
  let gridsterItem = this.responsiveService.getGridsterItem(widget);
5248
5224
  this.widgetList.push(gridsterItem);