@schneideress/dashboardframework 0.0.232 → 0.0.234

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.
@@ -291,6 +291,8 @@ const RAEvent = {
291
291
  LaunchCustomWidgetFlyout: "LaunchCustomWidgetFlyout",
292
292
  /**update applied filter badge for inaplicable filters */
293
293
  UpdateAppledFiterForInapplicableFilter: "UpdateAppledFiterForInapplicableFilter",
294
+ /**show inapplicable filter message in global filter flyout */
295
+ ShowInapplicableFilterMessage: "ShowInapplicableFilterMessage",
294
296
  };
295
297
  /** @enum {string} */
296
298
  const RAEventKey = {
@@ -601,6 +603,7 @@ class RADashboardArea {
601
603
  this.gridheight = 300;
602
604
  this.gridcellHeight = 0;
603
605
  this.userWidgets = [];
606
+ this.PAMWidgets = [];
604
607
  this.isWidgetLoaded = false;
605
608
  this.domResized = false;
606
609
  this.showEmptyDashboard = false;
@@ -615,22 +618,14 @@ class RADashboardArea {
615
618
  ngOnInit() {
616
619
  this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
617
620
  this.initiateGridsterConfig();
621
+ this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
618
622
  this.responsiveService.resized.subscribe((/**
619
623
  * @param {?} isDesktop
620
624
  * @return {?}
621
625
  */
622
626
  (isDesktop) => {
623
- if (isDesktop) {
624
- setTimeout((/**
625
- * @return {?}
626
- */
627
- () => {
628
- this.gridcellHeight = this.options.api.getCurrentRowHeight();
629
- this.domResized = !this.domResized;
630
- this.setAreaHeight();
631
- }), 100);
632
- }
633
- else {
627
+ if (this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
628
+ this.lastViewType = (isDesktop ? 'desktop' : 'mobile');
634
629
  this.widgetList = [];
635
630
  setTimeout((/**
636
631
  * @return {?}
@@ -653,6 +648,16 @@ class RADashboardArea {
653
648
  this.domResized = !this.domResized;
654
649
  }));
655
650
  }
651
+ else {
652
+ setTimeout((/**
653
+ * @return {?}
654
+ */
655
+ () => {
656
+ this.gridcellHeight = this.options.api.getCurrentRowHeight();
657
+ this.domResized = !this.domResized;
658
+ this.setAreaHeight();
659
+ }), 100);
660
+ }
656
661
  }));
657
662
  }
658
663
  /**
@@ -894,6 +899,21 @@ class RADashboardArea {
894
899
  */
895
900
  widgets => {
896
901
  this.userWidgets = widgets;
902
+ this.PAMWidgets = [];
903
+ widgets.forEach((/**
904
+ * @param {?} element
905
+ * @return {?}
906
+ */
907
+ element => {
908
+ /** @type {?} */
909
+ var settings = undefined;
910
+ if (element.widgetSettings) {
911
+ settings = JSON.parse(element.widgetSettings);
912
+ if (settings && settings.isPAMWidget)
913
+ this.PAMWidgets.push(element.widgetInstanceId);
914
+ }
915
+ }));
916
+ this.checkPAMWidgets();
897
917
  if (widgets && widgets.length > 0) {
898
918
  this.widgetList = this.mapObjectListToGridsterItemList(widgets);
899
919
  this.setAreaHeight();
@@ -987,6 +1007,13 @@ class RADashboardArea {
987
1007
  if (widget.length > 0) {
988
1008
  this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
989
1009
  }
1010
+ if (this.PAMWidgets.length > 0) {
1011
+ /** @type {?} */
1012
+ var indx = this.PAMWidgets.indexOf(widgetInstanceId);
1013
+ if (indx > -1)
1014
+ this.PAMWidgets.splice(indx, 1);
1015
+ this.checkPAMWidgets();
1016
+ }
990
1017
  this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
991
1018
  this.setAreaHeight();
992
1019
  if (!isalertDisabled) {
@@ -1075,6 +1102,10 @@ class RADashboardArea {
1075
1102
  }));
1076
1103
  }
1077
1104
  }
1105
+ if (widget.settings && widget.settings.isPAMWidget) {
1106
+ this.PAMWidgets.push(widget.widgetInstanceId);
1107
+ this.checkPAMWidgets();
1108
+ }
1078
1109
  this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
1079
1110
  }));
1080
1111
  }
@@ -1121,6 +1152,10 @@ class RADashboardArea {
1121
1152
  let gridsterItem = this.responsiveService.getGridsterItem(data);
1122
1153
  this.widgetList.push(gridsterItem);
1123
1154
  this.setAreaHeight();
1155
+ if (data.settings && data.settings.isPAMWidget) {
1156
+ this.PAMWidgets.push(data.widgetInstanceId);
1157
+ this.checkPAMWidgets();
1158
+ }
1124
1159
  }
1125
1160
  /**
1126
1161
  * @param {?} widgetList
@@ -1182,6 +1217,17 @@ class RADashboardArea {
1182
1217
  updateAppliedFilters(data) {
1183
1218
  this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
1184
1219
  }
1220
+ /**
1221
+ * @return {?}
1222
+ */
1223
+ checkPAMWidgets() {
1224
+ if (this.PAMWidgets.length > 0) {
1225
+ this.raDashboardEventBus.publish(RAEvent.ShowInapplicableFilterMessage, true);
1226
+ }
1227
+ else {
1228
+ this.raDashboardEventBus.publish(RAEvent.ShowInapplicableFilterMessage, false);
1229
+ }
1230
+ }
1185
1231
  }
1186
1232
  RADashboardArea.decorators = [
1187
1233
  { type: Component, args: [{
@@ -1222,6 +1268,8 @@ if (false) {
1222
1268
  RADashboardArea.prototype.gridcellHeight;
1223
1269
  /** @type {?} */
1224
1270
  RADashboardArea.prototype.userWidgets;
1271
+ /** @type {?} */
1272
+ RADashboardArea.prototype.PAMWidgets;
1225
1273
  /**
1226
1274
  * @type {?}
1227
1275
  * @private
@@ -1259,6 +1307,8 @@ if (false) {
1259
1307
  /** @type {?} */
1260
1308
  RADashboardArea.prototype.isWidgetMgmnt;
1261
1309
  /** @type {?} */
1310
+ RADashboardArea.prototype.lastViewType;
1311
+ /** @type {?} */
1262
1312
  RADashboardArea.prototype.userDashboardId;
1263
1313
  /** @type {?} */
1264
1314
  RADashboardArea.prototype.areaKey;
@@ -7268,13 +7318,12 @@ class RaBaseDashboardFilter {
7268
7318
  (async) => {
7269
7319
  return this.getFilterConfig();
7270
7320
  });
7271
- this.setAllFilterConfig = (/**
7272
- * @param {?} globalFilter
7273
- * @param {?} appConfig
7321
+ this.setInapplicableFilterMsg = (/**
7322
+ * @param {?} status
7274
7323
  * @return {?}
7275
7324
  */
7276
- (globalFilter, appConfig) => {
7277
- this.setFilterConfig(globalFilter, appConfig);
7325
+ (status) => {
7326
+ this.showHideInapplicableMsg(status);
7278
7327
  });
7279
7328
  this.isValidEntry = (/**
7280
7329
  * @return {?}
@@ -7288,6 +7337,14 @@ class RaBaseDashboardFilter {
7288
7337
  () => {
7289
7338
  this.clearData();
7290
7339
  });
7340
+ this.setAllFilterConfig = (/**
7341
+ * @param {?} globalFilter
7342
+ * @param {?} appConfig
7343
+ * @return {?}
7344
+ */
7345
+ (globalFilter, appConfig) => {
7346
+ this.setFilterConfig(globalFilter, appConfig);
7347
+ });
7291
7348
  }
7292
7349
  /**
7293
7350
  * @return {?}
@@ -7300,9 +7357,10 @@ class RaBaseDashboardFilter {
7300
7357
  }
7301
7358
  RaBaseDashboardFilter.propDecorators = {
7302
7359
  getAllFilterConfig: [{ type: Input }],
7303
- setAllFilterConfig: [{ type: Input }],
7360
+ setInapplicableFilterMsg: [{ type: Input }],
7304
7361
  isValidEntry: [{ type: Input }],
7305
- clearAllData: [{ type: Input }]
7362
+ clearAllData: [{ type: Input }],
7363
+ setAllFilterConfig: [{ type: Input }]
7306
7364
  };
7307
7365
  if (false) {
7308
7366
  /**
@@ -7311,11 +7369,13 @@ if (false) {
7311
7369
  */
7312
7370
  RaBaseDashboardFilter.prototype.getAllFilterConfig;
7313
7371
  /** @type {?} */
7314
- RaBaseDashboardFilter.prototype.setAllFilterConfig;
7372
+ RaBaseDashboardFilter.prototype.setInapplicableFilterMsg;
7315
7373
  /** @type {?} */
7316
7374
  RaBaseDashboardFilter.prototype.isValidEntry;
7317
7375
  /** @type {?} */
7318
7376
  RaBaseDashboardFilter.prototype.clearAllData;
7377
+ /** @type {?} */
7378
+ RaBaseDashboardFilter.prototype.setAllFilterConfig;
7319
7379
  /**
7320
7380
  * @abstract
7321
7381
  * @return {?}
@@ -7338,6 +7398,12 @@ if (false) {
7338
7398
  * @return {?}
7339
7399
  */
7340
7400
  RaBaseDashboardFilter.prototype.isValid = function () { };
7401
+ /**
7402
+ * @abstract
7403
+ * @param {?} status
7404
+ * @return {?}
7405
+ */
7406
+ RaBaseDashboardFilter.prototype.showHideInapplicableMsg = function (status) { };
7341
7407
  }
7342
7408
 
7343
7409
  /**