@schneideress/dashboardframework 0.0.270 → 0.0.272

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.
Files changed (33) hide show
  1. package/bundles/schneideress-dashboardframework.umd.js +415 -115
  2. package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
  3. package/bundles/schneideress-dashboardframework.umd.min.js +1 -15
  4. package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
  5. package/esm2015/gridster/lib/gridsterItem.component.js +1 -1
  6. package/esm2015/gridster/lib/gridsterRenderer.service.js +1 -1
  7. package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +159 -61
  8. package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +55 -30
  9. package/esm2015/lib/ra.base.dashboard.template.js +4 -2
  10. package/esm2015/lib/ra.dashboard.responsive.service.js +12 -2
  11. package/esm2015/lib/ra.dashboard.service.js +7 -1
  12. package/esm2015/lib/ra.event.enum.js +7 -1
  13. package/esm2015/lib/ra.gridster.config.js +3 -3
  14. package/esm5/gridster/lib/gridsterItem.component.js +1 -1
  15. package/esm5/gridster/lib/gridsterRenderer.service.js +1 -1
  16. package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +160 -61
  17. package/esm5/lib/ra-widget-container/ra.widget.container.component.js +55 -30
  18. package/esm5/lib/ra.base.dashboard.template.js +4 -2
  19. package/esm5/lib/ra.dashboard.responsive.service.js +12 -2
  20. package/esm5/lib/ra.dashboard.service.js +7 -1
  21. package/esm5/lib/ra.event.enum.js +7 -1
  22. package/esm5/lib/ra.gridster.config.js +3 -3
  23. package/fesm2015/schneideress-dashboardframework.js +240 -93
  24. package/fesm2015/schneideress-dashboardframework.js.map +1 -1
  25. package/fesm5/schneideress-dashboardframework.js +242 -94
  26. package/fesm5/schneideress-dashboardframework.js.map +1 -1
  27. package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +23 -2
  28. package/lib/ra-widget-container/ra.widget.container.component.d.ts +5 -2
  29. package/lib/ra.base.dashboard.template.d.ts +4 -2
  30. package/lib/ra.dashboard.responsive.service.d.ts +1 -1
  31. package/lib/ra.event.enum.d.ts +7 -1
  32. package/package.json +1 -1
  33. package/schneideress-dashboardframework.metadata.json +1 -1
@@ -67,6 +67,12 @@ let RaDashboardService = class RaDashboardService extends BaseService {
67
67
  /**To Update widgetInfo in database */
68
68
  updateWidget(widgetInfo, appConfig) {
69
69
  this.baseUrl = appConfig.apiBaseUrl;
70
+ let info = {};
71
+ info.widgetConfigInfo = widgetInfo.widgetConfigInfo;
72
+ info.widgetInstanceId = widgetInfo.widgetInstanceId;
73
+ info.widgetTitle = widgetInfo.widgetTitle;
74
+ info.widgetType = widgetInfo.widgetType;
75
+ info.widgetId = widgetInfo.widgetId;
70
76
  return this.post('widget/UpdateUserWidget', widgetInfo);
71
77
  }
72
78
  /** To Move or change position if current widget container*/
@@ -180,6 +186,12 @@ var RAEvent;
180
186
  RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
181
187
  /**show inapplicable filter message in global filter flyout */
182
188
  RAEvent["ShowInapplicableFilterMessage"] = "ShowInapplicableFilterMessage";
189
+ /** Bulk Action Clicked */
190
+ RAEvent["BulkActionClick"] = "BulkActionClick";
191
+ /** Global Filter Clicked */
192
+ /** When user change the curated filter(eg:data streams), system will create/delete widgets */
193
+ RAEvent["CuratedFilterChange"] = "CuratedFilterChange";
194
+ RAEvent["GlobalFilterClick"] = "GlobalFilterClick";
183
195
  })(RAEvent || (RAEvent = {}));
184
196
  var RAEventKey;
185
197
  (function (RAEventKey) {
@@ -193,9 +205,9 @@ const GridsterConfigDefaultSettings = {
193
205
  margin: 10,
194
206
  outerMargin: true,
195
207
  outerMarginTop: 10,
196
- outerMarginRight: 10,
208
+ outerMarginRight: 0,
197
209
  outerMarginBottom: 30,
198
- outerMarginLeft: 10,
210
+ outerMarginLeft: 0,
199
211
  useTransformPositioning: true,
200
212
  mobileBreakpoint: 640,
201
213
  minCols: 10,
@@ -300,7 +312,7 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
300
312
  check = true;
301
313
  return check;
302
314
  }
303
- getGridsterConfig(isWidgetMgmnt) {
315
+ getGridsterConfig(isWidgetMgmnt, resize, canMove) {
304
316
  let config = GridsterConfigDefaultSettings;
305
317
  config.minCols = this.currentResInfo.maxCols;
306
318
  config.maxCols = this.currentResInfo.maxCols;
@@ -322,6 +334,13 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
322
334
  config.swap = true;
323
335
  config.draggable.enabled = true;
324
336
  }
337
+ if (!resize) {
338
+ config.resizable.enabled = false;
339
+ config.swap = false;
340
+ }
341
+ if (!canMove) {
342
+ config.draggable.enabled = false;
343
+ }
325
344
  return config;
326
345
  }
327
346
  /**To map IwidgetInfo object to gridsterItem */
@@ -329,6 +348,9 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
329
348
  if (widget.widgetSettings) {
330
349
  widget.settings = JSON.parse(widget.widgetSettings);
331
350
  }
351
+ if (widget.templateSettings) {
352
+ widget.templateWidgetSettings = JSON.parse(widget.templateSettings);
353
+ }
332
354
  let gridsterItem = {
333
355
  cols: this.getWidth(widget.width),
334
356
  rows: this.getHeight(widget.height),
@@ -395,13 +417,20 @@ let RADashboardArea = class RADashboardArea {
395
417
  this.domResized = false;
396
418
  this.showEmptyDashboard = false;
397
419
  this.isWidgetMgmnt = false;
420
+ this.initialWidgetCount = 10;
421
+ this.currentLoadedIndex = 0;
422
+ this.loading = false;
398
423
  this.widgetHeight = 2;
399
424
  this.widgetWidth = 4;
400
425
  this.hideDashboardBanner = new EventEmitter();
401
426
  }
402
427
  ngOnInit() {
428
+ window.addEventListener('scroll', () => {
429
+ this.loadNext();
430
+ });
403
431
  this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
404
432
  this.initiateGridsterConfig();
433
+ this.setEmptyDashboardConfig();
405
434
  this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
406
435
  this.responsiveService.resized.subscribe((isDesktop) => {
407
436
  if (this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
@@ -430,6 +459,11 @@ let RADashboardArea = class RADashboardArea {
430
459
  }, 100);
431
460
  }
432
461
  });
462
+ setTimeout(() => {
463
+ this.bulkActionClick = this.raDashboardEventBus.subscribe(RAEvent.BulkActionClick).subscribe((data) => {
464
+ this.bulkActionData = JSON.parse(JSON.stringify(data)); // To create a new reference;
465
+ });
466
+ });
433
467
  }
434
468
  ngOnChanges(changes) {
435
469
  this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
@@ -437,27 +471,40 @@ let RADashboardArea = class RADashboardArea {
437
471
  this.isWidgetLoaded = true;
438
472
  this.loadWidgets(this.userDashboardId, this.areaKey);
439
473
  }
474
+ this.initiateGridsterConfig();
440
475
  if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
441
476
  this.inititateEventBusSubscritions();
442
477
  }
443
478
  }
479
+ setEmptyDashboardConfig() {
480
+ if (this.dashboardInfo && this.dashboardInfo.templateConfig.emptyDashboardHeader) {
481
+ this.emptyDashboardTitle = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.titleKey);
482
+ this.emptyDashboardMsg1 = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey1);
483
+ this.emptyDashboardMsg2 = (this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) ? this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) : '';
484
+ this.emptyDashboardButtonText = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonTextKey);
485
+ this.emptyDashboardButtonIcon = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon : '';
486
+ this.emptyDashboardButtonAction = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction : '';
487
+ }
488
+ }
444
489
  /**To set GridsterConfig */
445
490
  initiateGridsterConfig() {
446
- /**To override default configuration values to the gridster control */
447
- this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt);
448
- this.options.initCallback = (gridster) => {
449
- if (this.options.api) {
450
- this.gridcellHeight = this.options.api.getCurrentRowHeight();
451
- }
452
- };
453
- this.options.itemChangeCallback = (item) => {
454
- if (this.responsiveService.IsDesktopView) {
455
- if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
456
- this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
491
+ if (this.dashboardInfo) {
492
+ /**To override default configuration values to the gridster control */
493
+ this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt, this.dashboardInfo.templateConfig.widget.canResize, this.dashboardInfo.templateConfig.widget.canMove);
494
+ this.options.initCallback = (gridster) => {
495
+ if (this.options.api) {
496
+ this.gridcellHeight = this.options.api.getCurrentRowHeight();
457
497
  }
458
- }
459
- this.setAreaHeight();
460
- };
498
+ };
499
+ this.options.itemChangeCallback = (item) => {
500
+ if (this.responsiveService.IsDesktopView) {
501
+ if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
502
+ this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
503
+ }
504
+ }
505
+ this.setAreaHeight();
506
+ };
507
+ }
461
508
  }
462
509
  /** To initiate eventbus subsctiptions */
463
510
  inititateEventBusSubscritions() {
@@ -476,6 +523,11 @@ let RADashboardArea = class RADashboardArea {
476
523
  this.addWidget(e);
477
524
  });
478
525
  });
526
+ this.curatedFilterChange = this.raDashboardEventBus.subscribe(RAEvent.CuratedFilterChange).subscribe((e) => {
527
+ this.ngZone.run(() => {
528
+ this.loadWidgets(this.userDashboardId, this.areaKey);
529
+ });
530
+ });
479
531
  this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((e) => {
480
532
  this.ngZone.run(() => {
481
533
  this.rearrangeWidgets();
@@ -524,6 +576,10 @@ let RADashboardArea = class RADashboardArea {
524
576
  this.widgetLibraryDoneClick.unsubscribe();
525
577
  if (this.rearrangeWidgetClick)
526
578
  this.rearrangeWidgetClick.unsubscribe();
579
+ if (this.curatedFilterChange)
580
+ this.curatedFilterChange.unsubscribe();
581
+ if (this.bulkActionClick)
582
+ this.bulkActionClick.unsubscribe();
527
583
  }
528
584
  /**To update position/dimention of all widgets in the area */
529
585
  updateWidgets() {
@@ -559,6 +615,12 @@ let RADashboardArea = class RADashboardArea {
559
615
  }
560
616
  /** To retrieve widgets based on userDashboardid and area name */
561
617
  loadWidgets(userDashboarId, areaKey) {
618
+ if (this.templateConfig && this.templateConfig.initialWidgetCount)
619
+ this.initialWidgetCount = this.templateConfig.initialWidgetCount;
620
+ if (location.href.indexOf('loadAllWidgets') > -1)
621
+ this.initialWidgetCount = 1000;
622
+ this.currentLoadedIndex = 0;
623
+ this.loading = false;
562
624
  let widgetInfo = {
563
625
  dashboardId: userDashboarId.toString(),
564
626
  dashboardAreaKey: areaKey
@@ -577,8 +639,8 @@ let RADashboardArea = class RADashboardArea {
577
639
  });
578
640
  this.checkPAMWidgets();
579
641
  if (widgets && widgets.length > 0) {
580
- this.widgetList = this.mapObjectListToGridsterItemList(widgets);
581
- this.setAreaHeight();
642
+ this.widgetList = [];
643
+ this.loadWidgetsDelta();
582
644
  this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
583
645
  }
584
646
  else {
@@ -587,6 +649,41 @@ let RADashboardArea = class RADashboardArea {
587
649
  }
588
650
  });
589
651
  }
652
+ loadWidgetsDelta() {
653
+ if (!this.loading) {
654
+ this.loading = true;
655
+ let widgets = this.mapObjectListToGridsterItemList(this.userWidgets.slice(this.currentLoadedIndex, (this.currentLoadedIndex + this.initialWidgetCount)));
656
+ this.currentLoadedIndex += this.initialWidgetCount;
657
+ this.widgetList.push(...widgets);
658
+ this.setAreaHeight();
659
+ this.loading = false;
660
+ }
661
+ }
662
+ dataLoaded(widgetElement) {
663
+ this.loadNext();
664
+ }
665
+ loadNext() {
666
+ if (this.divBottom) {
667
+ if (this.elementInViewport(this.divBottom.nativeElement)) {
668
+ this.loadWidgetsDelta();
669
+ }
670
+ }
671
+ }
672
+ elementInViewport(el) {
673
+ var top = el.offsetTop;
674
+ var left = el.offsetLeft;
675
+ var width = el.offsetWidth;
676
+ var height = el.offsetHeight;
677
+ while (el.offsetParent) {
678
+ el = el.offsetParent;
679
+ top += el.offsetTop;
680
+ left += el.offsetLeft;
681
+ }
682
+ return (top >= window.scrollY &&
683
+ left >= window.scrollX &&
684
+ (top + height) <= (window.scrollY + window.innerHeight) &&
685
+ (left + width) <= (window.scrollX + window.innerWidth));
686
+ }
590
687
  /** To set Area(Gridster) height dynamically as widgets are added/removed */
591
688
  setAreaHeight() {
592
689
  setTimeout(() => {
@@ -628,22 +725,22 @@ let RADashboardArea = class RADashboardArea {
628
725
  }
629
726
  /** To remove a widget instance from dashboard and to save info in database */
630
727
  deleteWidget(widgetInstanceId, isalertDisabled = false) {
728
+ let widget = this.userWidgets.filter((item) => {
729
+ return item.widgetInstanceId === widgetInstanceId;
730
+ });
731
+ if (widget.length > 0) {
732
+ this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
733
+ }
734
+ if (this.PAMWidgets.length > 0) {
735
+ var indx = this.PAMWidgets.indexOf(widgetInstanceId);
736
+ if (indx > -1)
737
+ this.PAMWidgets.splice(indx, 1);
738
+ this.checkPAMWidgets();
739
+ }
631
740
  let gridsterItem = this.widgetList.filter((item) => {
632
741
  return item.widgetInfo.widgetInstanceId === widgetInstanceId;
633
742
  });
634
743
  if (gridsterItem.length > 0) {
635
- let widget = this.userWidgets.filter((item) => {
636
- return item.widgetInstanceId === widgetInstanceId;
637
- });
638
- if (widget.length > 0) {
639
- this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
640
- }
641
- if (this.PAMWidgets.length > 0) {
642
- var indx = this.PAMWidgets.indexOf(widgetInstanceId);
643
- if (indx > -1)
644
- this.PAMWidgets.splice(indx, 1);
645
- this.checkPAMWidgets();
646
- }
647
744
  this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
648
745
  this.setAreaHeight();
649
746
  if (!isalertDisabled) {
@@ -657,11 +754,15 @@ let RADashboardArea = class RADashboardArea {
657
754
  }
658
755
  /**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
659
756
  rearrangeWidgets() {
757
+ this.currentLoadedIndex = 0;
758
+ this.loading = false;
660
759
  for (let i = 0; i < this.userWidgets.length; i++) {
661
760
  this.userWidgets[i].position_x = 0;
662
761
  this.userWidgets[i].position_y = 0;
663
762
  }
664
- this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
763
+ this.widgetList = [];
764
+ this.loadWidgetsDelta();
765
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
665
766
  if (this.widgetList.length > 0)
666
767
  this.updateWidgetPosition(this.widgetList[0].widgetInfo.widgetInstanceId);
667
768
  setTimeout(() => {
@@ -693,29 +794,31 @@ let RADashboardArea = class RADashboardArea {
693
794
  this.ngxService.start();
694
795
  this.dashboardService.addWidget(data, this.appConfig).subscribe(widget => {
695
796
  this.userWidgets.push(widget);
696
- let gridsterItem = this.responsiveService.getGridsterItem(widget);
697
- this.widgetList.push(gridsterItem);
698
- this.setAreaHeight();
699
- if (this.options.api) {
700
- let curRowHeight = Number(this.options.api.getCurrentRowHeight());
701
- if (curRowHeight > 0) {
702
- widget.rowHeight = curRowHeight;
703
- this.gridcellHeight = curRowHeight;
797
+ if (this.currentLoadedIndex >= this.userWidgets.length) {
798
+ let gridsterItem = this.responsiveService.getGridsterItem(widget);
799
+ this.widgetList.push(gridsterItem);
800
+ this.setAreaHeight();
801
+ if (this.options.api) {
802
+ let curRowHeight = Number(this.options.api.getCurrentRowHeight());
803
+ if (curRowHeight > 0) {
804
+ widget.rowHeight = curRowHeight;
805
+ this.gridcellHeight = curRowHeight;
806
+ }
704
807
  }
705
- }
706
- var widgetInstanceId = 0;
707
- if (widget && widget.widgetInstanceId) {
708
- widgetInstanceId = widget.widgetInstanceId;
709
- /**To save added widget position in db */
710
- if (this.responsiveService.IsDesktopView) {
711
- setTimeout(() => {
712
- this.updateWidgetPosition(widgetInstanceId);
713
- });
808
+ var widgetInstanceId = 0;
809
+ if (widget && widget.widgetInstanceId) {
810
+ widgetInstanceId = widget.widgetInstanceId;
811
+ /**To save added widget position in db */
812
+ if (this.responsiveService.IsDesktopView) {
813
+ setTimeout(() => {
814
+ this.updateWidgetPosition(widgetInstanceId);
815
+ });
816
+ }
817
+ }
818
+ if (widget.settings && widget.settings.isPAMWidget) {
819
+ this.PAMWidgets.push(widget.widgetInstanceId);
820
+ this.checkPAMWidgets();
714
821
  }
715
- }
716
- if (widget.settings && widget.settings.isPAMWidget) {
717
- this.PAMWidgets.push(widget.widgetInstanceId);
718
- this.checkPAMWidgets();
719
822
  }
720
823
  this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
721
824
  });
@@ -745,12 +848,14 @@ let RADashboardArea = class RADashboardArea {
745
848
  });
746
849
  }
747
850
  this.userWidgets.push(data);
748
- let gridsterItem = this.responsiveService.getGridsterItem(data);
749
- this.widgetList.push(gridsterItem);
750
- this.setAreaHeight();
751
- if (data.settings && data.settings.isPAMWidget) {
752
- this.PAMWidgets.push(data.widgetInstanceId);
753
- this.checkPAMWidgets();
851
+ if (this.currentLoadedIndex >= this.userWidgets.length) {
852
+ let gridsterItem = this.responsiveService.getGridsterItem(data);
853
+ this.widgetList.push(gridsterItem);
854
+ this.setAreaHeight();
855
+ if (data.settings && data.settings.isPAMWidget) {
856
+ this.PAMWidgets.push(data.widgetInstanceId);
857
+ this.checkPAMWidgets();
858
+ }
754
859
  }
755
860
  }
756
861
  mapObjectListToGridsterItemList(widgetList) {
@@ -777,8 +882,11 @@ let RADashboardArea = class RADashboardArea {
777
882
  });
778
883
  return widgetListArray;
779
884
  }
780
- addNewWidget() {
781
- this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
885
+ buttonClick() {
886
+ if (this.emptyDashboardButtonAction == "widgets")
887
+ this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
888
+ else if (this.emptyDashboardButtonAction == "filter")
889
+ this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
782
890
  }
783
891
  updateAppliedFilters(data) {
784
892
  this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
@@ -829,6 +937,14 @@ __decorate([
829
937
  Input('app-config'),
830
938
  __metadata("design:type", Object)
831
939
  ], RADashboardArea.prototype, "appConfig", void 0);
940
+ __decorate([
941
+ Input('dashboard-info'),
942
+ __metadata("design:type", Object)
943
+ ], RADashboardArea.prototype, "dashboardInfo", void 0);
944
+ __decorate([
945
+ Input(),
946
+ __metadata("design:type", Object)
947
+ ], RADashboardArea.prototype, "templateConfig", void 0);
832
948
  __decorate([
833
949
  Output(),
834
950
  __metadata("design:type", Object)
@@ -837,11 +953,15 @@ __decorate([
837
953
  ViewChild('gridWrapper', { static: false }),
838
954
  __metadata("design:type", ElementRef)
839
955
  ], RADashboardArea.prototype, "gridWrapper", void 0);
956
+ __decorate([
957
+ ViewChild('divBottom', { static: false }),
958
+ __metadata("design:type", ElementRef)
959
+ ], RADashboardArea.prototype, "divBottom", void 0);
840
960
  RADashboardArea = __decorate([
841
961
  Component({
842
962
  selector: 'ra-dashboard-area',
843
- template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>",
844
- styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#ededed;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:0 1px 10px rgba(0,0,0,.05)}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:40px 20px 20px;background-color:#ededed;display:flex;justify-content:center;align-content:center}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:72%}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;align-items:center;padding:10px 30px;min-width:-webkit-max-content;min-width:max-content;min-width:-moz-max-content}.empty-content{color:#333;border-left:1px solid #a9afb1;width:100%;display:flex;align-items:center;padding:15px 30px 10px 40px}.empty-msg{padding:0 0 5px;font-size:16px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:10px;background-color:#ededed;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:6px 10px 8px}.empty-content{color:#333;display:flex;padding:5px 10px 10px;margin-top:44px;margin-left:-185px;border-left:none}.empty-msg{padding:12px 10px 10px 5px;font-size:14px;border-top:1px solid #a9afb1}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
963
+ template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"\r\n [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container (dataLoaded)=\"dataLoaded($event)\"\r\n [bulk-action-data]=\"bulkActionData\" [dashboard-info]=\"dashboardInfo\" [app-config]=\"appConfig\"\r\n [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\"\r\n [widget-width]=\"item.cols\" [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\"\r\n [dom-resized]=\"domResized\" (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"empty-prefix\">\r\n <!-- <i class=\"fal fa-edit edit-icon\"></i> -->\r\n <span>{{emptyDashboardTitle}}</span>\r\n </div>\r\n <hr class=\"horizontalLine-solid\" />\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{emptyDashboardMsg1}} <br />\r\n {{emptyDashboardMsg2}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm dashboard-button light\" (click)=\"buttonClick()\">\r\n <i class=\"{{emptyDashboardButtonIcon}}\"></i>{{emptyDashboardButtonText}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>\r\n<div #divBottom></div>",
964
+ styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#fff;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:none}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)!important}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:15px 0;background-color:#fff;display:flex}.empty-wrapper{background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:18px;padding:15px}.empty-content{color:#626469;width:100%;padding:15px}.empty-msg{padding:0 0 15px;font-size:16px}.horizontalLine-solid{border-top:1px solid #cbcbcb;margin:0 15px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:15px 0;background-color:#fff;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:15px}.empty-content{color:#333;display:flex;padding:15px}.empty-msg{padding:0 0 15px;font-size:14px}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
845
965
  }),
846
966
  __metadata("design:paramtypes", [RaDashboardService,
847
967
  NgZone,
@@ -941,6 +1061,8 @@ let RAWidgetContainer = class RAWidgetContainer {
941
1061
  this.inapplicableFilters = [];
942
1062
  this.widgetDeleted = new EventEmitter();
943
1063
  this.updateAppliedFilters = new EventEmitter();
1064
+ this.dataLoaded = new EventEmitter();
1065
+ this.widgetLoaded = new EventEmitter();
944
1066
  this.isWidgetStateApplicable = false;
945
1067
  this.widgetEmptyState = '';
946
1068
  this.lockVisible = false;
@@ -961,7 +1083,7 @@ let RAWidgetContainer = class RAWidgetContainer {
961
1083
  this.invokeWidgetResizedEvent();
962
1084
  }
963
1085
  ngOnInit() {
964
- this.WidgetDisplayName = this.getwidgetTitleTranslation(this.data.widgetInfo.widgetTitle);
1086
+ this.WidgetDisplayName = this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true);
965
1087
  this.lockIconTitle = this.translateService.translate('Common.lockedfields');
966
1088
  this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
967
1089
  this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
@@ -977,19 +1099,28 @@ let RAWidgetContainer = class RAWidgetContainer {
977
1099
  });
978
1100
  });
979
1101
  }
980
- if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
981
- let filterObj = this.getParsedConfig(this.globalFilter);
982
- if (filterObj.WidgetInstanceId) {
983
- if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
984
- this.refreshWidget(this.data.widgetInfo);
1102
+ if (this.widgetElement) {
1103
+ if (changes.bulkActionData && changes.bulkActionData.currentValue != changes.bulkActionData.previousValue) {
1104
+ if (typeof this.widgetElement.bulkActionClicked === "function") {
1105
+ this.widgetElement.bulkActionClicked(this.bulkActionData);
1106
+ }
985
1107
  }
986
- else {
987
- this.refreshWidget(this.data.widgetInfo);
1108
+ if (changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
1109
+ if (!this.dashboardInfo.curatedFilters) {
1110
+ let filterObj = this.getParsedConfig(this.globalFilter);
1111
+ if (filterObj.WidgetInstanceId) {
1112
+ if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
1113
+ this.refreshWidget(this.data.widgetInfo);
1114
+ }
1115
+ else {
1116
+ //this.refreshWidget(this.data.widgetInfo);
1117
+ }
1118
+ }
1119
+ }
1120
+ if (changes.width && changes.width.currentValue != changes.width.previousValue ||
1121
+ (changes.height && changes.height.currentValue != changes.height.previousValue)) {
1122
+ this.invokeWidgetResizedEvent();
988
1123
  }
989
- }
990
- if (changes.width && changes.width.currentValue != changes.width.previousValue ||
991
- (changes.height && changes.height.currentValue != changes.height.previousValue)) {
992
- this.invokeWidgetResizedEvent();
993
1124
  }
994
1125
  }
995
1126
  invokeWidgetResizedEvent() {
@@ -1168,6 +1299,10 @@ let RAWidgetContainer = class RAWidgetContainer {
1168
1299
  this.showPanel = true;
1169
1300
  else
1170
1301
  this.showPanel = false;
1302
+ if (!this.data.dataLoaded) {
1303
+ this.data.dataLoaded = true;
1304
+ this.dataLoaded.emit(this.widgetElement);
1305
+ }
1171
1306
  break;
1172
1307
  case 'onConfigEditClicked':
1173
1308
  this.editWidget();
@@ -1240,7 +1375,9 @@ let RAWidgetContainer = class RAWidgetContainer {
1240
1375
  widgetConfigFilter.configChanges = this.getConfigChanges(false);
1241
1376
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1242
1377
  widgetConfigFilter.globalFilter = this.globalFilter;
1378
+ widgetConfigFilter.dashboardInfo = me.dashboardInfo;
1243
1379
  this.widgetElement.loadContent(widgetConfigFilter);
1380
+ this.widgetLoaded.emit();
1244
1381
  yield this.setLock(widgetConfigFilter.config);
1245
1382
  yield this.setDownloadIcon();
1246
1383
  }));
@@ -1474,9 +1611,12 @@ let RAWidgetContainer = class RAWidgetContainer {
1474
1611
  let html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
1475
1612
  let settings = '';
1476
1613
  if (this.isWidgetMgmnt) {
1477
- settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
1478
- settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
1479
- settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
1614
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideEdit)
1615
+ settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
1616
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideCopy)
1617
+ settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
1618
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
1619
+ settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
1480
1620
  }
1481
1621
  let customPageParams = false;
1482
1622
  if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
@@ -1485,14 +1625,14 @@ let RAWidgetContainer = class RAWidgetContainer {
1485
1625
  customPageParams = true;
1486
1626
  }
1487
1627
  }
1488
- if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
1628
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
1489
1629
  settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
1490
1630
  settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
1491
1631
  settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
1492
1632
  settings += this.translateService.translate('Common.visitpage');
1493
1633
  settings += '</span></a>';
1494
1634
  }
1495
- if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
1635
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
1496
1636
  html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
1497
1637
  html += this.translateService.translate('Common.settings') + '</div>';
1498
1638
  html += settings;
@@ -1524,7 +1664,7 @@ let RAWidgetContainer = class RAWidgetContainer {
1524
1664
  if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
1525
1665
  html += this.getHr();
1526
1666
  }
1527
- if (this.isWidgetMgmnt) {
1667
+ if (this.isWidgetMgmnt && !this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideDelete) {
1528
1668
  html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
1529
1669
  html += this.deleteText;
1530
1670
  html += '</span></a>';
@@ -1603,17 +1743,6 @@ let RAWidgetContainer = class RAWidgetContainer {
1603
1743
  if (this.currentComponent)
1604
1744
  this.popupInstance.removeMe(this.currentComponent);
1605
1745
  }
1606
- getwidgetTitleTranslation(item) {
1607
- let rKey = 'DBW_' + this.translateService.makeCode(item);
1608
- let translatedString = '';
1609
- translatedString = this.translateService.translate('Common.' + rKey);
1610
- if (translatedString.toLowerCase() === rKey.toLowerCase()) {
1611
- return item;
1612
- }
1613
- else {
1614
- return translatedString;
1615
- }
1616
- }
1617
1746
  };
1618
1747
  RAWidgetContainer.ctorParameters = () => [
1619
1748
  { type: RaDashboardService },
@@ -1657,6 +1786,10 @@ __decorate([
1657
1786
  Input('global-filter'),
1658
1787
  __metadata("design:type", Object)
1659
1788
  ], RAWidgetContainer.prototype, "globalFilter", void 0);
1789
+ __decorate([
1790
+ Input('dashboard-info'),
1791
+ __metadata("design:type", Object)
1792
+ ], RAWidgetContainer.prototype, "dashboardInfo", void 0);
1660
1793
  __decorate([
1661
1794
  Input('data'),
1662
1795
  __metadata("design:type", Object)
@@ -1681,6 +1814,10 @@ __decorate([
1681
1814
  Input('grid-cell-height'),
1682
1815
  __metadata("design:type", Number)
1683
1816
  ], RAWidgetContainer.prototype, "gridCellHeight", void 0);
1817
+ __decorate([
1818
+ Input('bulk-action-data'),
1819
+ __metadata("design:type", Object)
1820
+ ], RAWidgetContainer.prototype, "bulkActionData", void 0);
1684
1821
  __decorate([
1685
1822
  Output(),
1686
1823
  __metadata("design:type", Object)
@@ -1689,6 +1826,14 @@ __decorate([
1689
1826
  Output(),
1690
1827
  __metadata("design:type", Object)
1691
1828
  ], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
1829
+ __decorate([
1830
+ Output(),
1831
+ __metadata("design:type", Object)
1832
+ ], RAWidgetContainer.prototype, "dataLoaded", void 0);
1833
+ __decorate([
1834
+ Output(),
1835
+ __metadata("design:type", Object)
1836
+ ], RAWidgetContainer.prototype, "widgetLoaded", void 0);
1692
1837
  __decorate([
1693
1838
  Input('dom-resized'),
1694
1839
  __metadata("design:type", Boolean),
@@ -4644,11 +4789,13 @@ DashboardFrameworkModule = __decorate([
4644
4789
  class RaBaseDashboardTemplate {
4645
4790
  constructor(ngZone) {
4646
4791
  this.ngZone = ngZone;
4647
- this.initialize = (eventBus, userDashboardId, appConfig) => {
4792
+ this.initialize = (eventBus, userDashboardId, appConfig, dashboardInfo, templateConfig) => {
4648
4793
  this.ngZone.run(() => {
4649
4794
  this.userDashboardId = userDashboardId;
4650
4795
  this.appConfig = appConfig;
4651
4796
  this.raDashboardEventBus = eventBus;
4797
+ this.dashboardInfo = dashboardInfo;
4798
+ this.templateConfig = templateConfig;
4652
4799
  });
4653
4800
  this.init();
4654
4801
  };