@schneideress/dashboardframework 0.0.274 → 0.0.275
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.
- package/bundles/schneideress-dashboardframework.umd.js +123 -435
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +15 -1
- package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
- package/esm2015/gridster/lib/gridsterItem.component.js +1 -1
- package/esm2015/gridster/lib/gridsterRenderer.service.js +1 -1
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +62 -167
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +36 -66
- package/esm2015/lib/ra.base.dashboard.template.js +2 -4
- package/esm2015/lib/ra.dashboard.responsive.service.js +2 -12
- package/esm2015/lib/ra.dashboard.service.js +2 -7
- package/esm2015/lib/ra.event.enum.js +1 -7
- package/esm2015/lib/ra.gridster.config.js +3 -3
- package/esm5/gridster/lib/gridsterItem.component.js +1 -1
- package/esm5/gridster/lib/gridsterRenderer.service.js +1 -1
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +62 -169
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +36 -66
- package/esm5/lib/ra.base.dashboard.template.js +2 -4
- package/esm5/lib/ra.dashboard.responsive.service.js +2 -12
- package/esm5/lib/ra.dashboard.service.js +2 -7
- package/esm5/lib/ra.event.enum.js +1 -7
- package/esm5/lib/ra.gridster.config.js +3 -3
- package/fesm2015/schneideress-dashboardframework.js +101 -259
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +102 -262
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +2 -24
- package/lib/ra-widget-container/ra.widget.container.component.d.ts +2 -6
- package/lib/ra.base.dashboard.template.d.ts +2 -4
- package/lib/ra.dashboard.responsive.service.d.ts +1 -1
- package/lib/ra.dashboard.service.d.ts +1 -0
- package/lib/ra.event.enum.d.ts +1 -7
- package/package.json +1 -1
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -16,6 +16,7 @@ let RaDashboardService = class RaDashboardService extends BaseService {
|
|
|
16
16
|
constructor(injector) {
|
|
17
17
|
super(injector, '');
|
|
18
18
|
this.loadedScripts = [];
|
|
19
|
+
this.clientId = undefined;
|
|
19
20
|
}
|
|
20
21
|
/*
|
|
21
22
|
* To load external scripts in the dom
|
|
@@ -67,12 +68,6 @@ let RaDashboardService = class RaDashboardService extends BaseService {
|
|
|
67
68
|
/**To Update widgetInfo in database */
|
|
68
69
|
updateWidget(widgetInfo, appConfig) {
|
|
69
70
|
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;
|
|
76
71
|
return this.post('widget/UpdateUserWidget', widgetInfo);
|
|
77
72
|
}
|
|
78
73
|
/** To Move or change position if current widget container*/
|
|
@@ -186,12 +181,6 @@ var RAEvent;
|
|
|
186
181
|
RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
|
|
187
182
|
/**show inapplicable filter message in global filter flyout */
|
|
188
183
|
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";
|
|
195
184
|
})(RAEvent || (RAEvent = {}));
|
|
196
185
|
var RAEventKey;
|
|
197
186
|
(function (RAEventKey) {
|
|
@@ -205,9 +194,9 @@ const GridsterConfigDefaultSettings = {
|
|
|
205
194
|
margin: 10,
|
|
206
195
|
outerMargin: true,
|
|
207
196
|
outerMarginTop: 10,
|
|
208
|
-
outerMarginRight:
|
|
197
|
+
outerMarginRight: 10,
|
|
209
198
|
outerMarginBottom: 30,
|
|
210
|
-
outerMarginLeft:
|
|
199
|
+
outerMarginLeft: 10,
|
|
211
200
|
useTransformPositioning: true,
|
|
212
201
|
mobileBreakpoint: 640,
|
|
213
202
|
minCols: 10,
|
|
@@ -312,7 +301,7 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
|
|
|
312
301
|
check = true;
|
|
313
302
|
return check;
|
|
314
303
|
}
|
|
315
|
-
getGridsterConfig(isWidgetMgmnt
|
|
304
|
+
getGridsterConfig(isWidgetMgmnt) {
|
|
316
305
|
let config = GridsterConfigDefaultSettings;
|
|
317
306
|
config.minCols = this.currentResInfo.maxCols;
|
|
318
307
|
config.maxCols = this.currentResInfo.maxCols;
|
|
@@ -334,13 +323,6 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
|
|
|
334
323
|
config.swap = true;
|
|
335
324
|
config.draggable.enabled = true;
|
|
336
325
|
}
|
|
337
|
-
if (!resize) {
|
|
338
|
-
config.resizable.enabled = false;
|
|
339
|
-
config.swap = false;
|
|
340
|
-
}
|
|
341
|
-
if (!canMove) {
|
|
342
|
-
config.draggable.enabled = false;
|
|
343
|
-
}
|
|
344
326
|
return config;
|
|
345
327
|
}
|
|
346
328
|
/**To map IwidgetInfo object to gridsterItem */
|
|
@@ -348,9 +330,6 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
|
|
|
348
330
|
if (widget.widgetSettings) {
|
|
349
331
|
widget.settings = JSON.parse(widget.widgetSettings);
|
|
350
332
|
}
|
|
351
|
-
if (widget.templateSettings) {
|
|
352
|
-
widget.templateWidgetSettings = JSON.parse(widget.templateSettings);
|
|
353
|
-
}
|
|
354
333
|
let gridsterItem = {
|
|
355
334
|
cols: this.getWidth(widget.width),
|
|
356
335
|
rows: this.getHeight(widget.height),
|
|
@@ -417,20 +396,13 @@ let RADashboardArea = class RADashboardArea {
|
|
|
417
396
|
this.domResized = false;
|
|
418
397
|
this.showEmptyDashboard = false;
|
|
419
398
|
this.isWidgetMgmnt = false;
|
|
420
|
-
this.initialWidgetCount = 10;
|
|
421
|
-
this.currentLoadedIndex = 0;
|
|
422
|
-
this.loading = false;
|
|
423
399
|
this.widgetHeight = 2;
|
|
424
400
|
this.widgetWidth = 4;
|
|
425
401
|
this.hideDashboardBanner = new EventEmitter();
|
|
426
402
|
}
|
|
427
403
|
ngOnInit() {
|
|
428
|
-
window.addEventListener('scroll', () => {
|
|
429
|
-
this.loadNext();
|
|
430
|
-
});
|
|
431
404
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
432
405
|
this.initiateGridsterConfig();
|
|
433
|
-
this.setEmptyDashboardConfig();
|
|
434
406
|
this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
|
|
435
407
|
this.responsiveService.resized.subscribe((isDesktop) => {
|
|
436
408
|
if (this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
|
|
@@ -459,11 +431,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
459
431
|
}, 100);
|
|
460
432
|
}
|
|
461
433
|
});
|
|
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
|
-
});
|
|
467
434
|
}
|
|
468
435
|
ngOnChanges(changes) {
|
|
469
436
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
@@ -471,43 +438,27 @@ let RADashboardArea = class RADashboardArea {
|
|
|
471
438
|
this.isWidgetLoaded = true;
|
|
472
439
|
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
473
440
|
}
|
|
474
|
-
this.initiateGridsterConfig();
|
|
475
441
|
if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
|
|
476
442
|
this.inititateEventBusSubscritions();
|
|
477
443
|
}
|
|
478
444
|
}
|
|
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
|
-
}
|
|
489
445
|
/**To set GridsterConfig */
|
|
490
446
|
initiateGridsterConfig() {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
this.options.
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
this.
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
503
|
-
}
|
|
447
|
+
/**To override default configuration values to the gridster control */
|
|
448
|
+
this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt);
|
|
449
|
+
this.options.initCallback = (gridster) => {
|
|
450
|
+
if (this.options.api) {
|
|
451
|
+
this.gridcellHeight = this.options.api.getCurrentRowHeight();
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
this.options.itemChangeCallback = (item) => {
|
|
455
|
+
if (this.responsiveService.IsDesktopView) {
|
|
456
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
457
|
+
this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
504
458
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
widgetLoaded(widget) {
|
|
510
|
-
widget.canLoadData = true;
|
|
459
|
+
}
|
|
460
|
+
this.setAreaHeight();
|
|
461
|
+
};
|
|
511
462
|
}
|
|
512
463
|
/** To initiate eventbus subsctiptions */
|
|
513
464
|
inititateEventBusSubscritions() {
|
|
@@ -526,11 +477,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
526
477
|
this.addWidget(e);
|
|
527
478
|
});
|
|
528
479
|
});
|
|
529
|
-
this.curatedFilterChange = this.raDashboardEventBus.subscribe(RAEvent.CuratedFilterChange).subscribe((e) => {
|
|
530
|
-
this.ngZone.run(() => {
|
|
531
|
-
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
532
|
-
});
|
|
533
|
-
});
|
|
534
480
|
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((e) => {
|
|
535
481
|
this.ngZone.run(() => {
|
|
536
482
|
this.rearrangeWidgets();
|
|
@@ -579,10 +525,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
579
525
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
580
526
|
if (this.rearrangeWidgetClick)
|
|
581
527
|
this.rearrangeWidgetClick.unsubscribe();
|
|
582
|
-
if (this.curatedFilterChange)
|
|
583
|
-
this.curatedFilterChange.unsubscribe();
|
|
584
|
-
if (this.bulkActionClick)
|
|
585
|
-
this.bulkActionClick.unsubscribe();
|
|
586
528
|
}
|
|
587
529
|
/**To update position/dimention of all widgets in the area */
|
|
588
530
|
updateWidgets() {
|
|
@@ -618,13 +560,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
618
560
|
}
|
|
619
561
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
620
562
|
loadWidgets(userDashboarId, areaKey) {
|
|
621
|
-
if (this.templateConfig && this.templateConfig.initialWidgetCount)
|
|
622
|
-
this.initialWidgetCount = this.templateConfig.initialWidgetCount;
|
|
623
|
-
window.scrollTo(0, 0);
|
|
624
|
-
if (location.href.indexOf('/kiosk/') > -1)
|
|
625
|
-
this.initialWidgetCount = 1000;
|
|
626
|
-
this.currentLoadedIndex = 0;
|
|
627
|
-
this.loading = false;
|
|
628
563
|
let widgetInfo = {
|
|
629
564
|
dashboardId: userDashboarId.toString(),
|
|
630
565
|
dashboardAreaKey: areaKey
|
|
@@ -643,8 +578,9 @@ let RADashboardArea = class RADashboardArea {
|
|
|
643
578
|
});
|
|
644
579
|
this.checkPAMWidgets();
|
|
645
580
|
if (widgets && widgets.length > 0) {
|
|
646
|
-
this.
|
|
647
|
-
this.
|
|
581
|
+
this.dashboardService.clientId = widgets[0].clientId;
|
|
582
|
+
this.widgetList = this.mapObjectListToGridsterItemList(widgets);
|
|
583
|
+
this.setAreaHeight();
|
|
648
584
|
this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
|
|
649
585
|
}
|
|
650
586
|
else {
|
|
@@ -653,43 +589,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
653
589
|
}
|
|
654
590
|
});
|
|
655
591
|
}
|
|
656
|
-
loadWidgetsDelta() {
|
|
657
|
-
if (!this.loading) {
|
|
658
|
-
this.loading = true;
|
|
659
|
-
let widgets = this.mapObjectListToGridsterItemList(this.userWidgets.slice(this.currentLoadedIndex, (this.currentLoadedIndex + this.initialWidgetCount)));
|
|
660
|
-
this.currentLoadedIndex += this.initialWidgetCount;
|
|
661
|
-
this.widgetList.push(...widgets);
|
|
662
|
-
this.setAreaHeight();
|
|
663
|
-
setTimeout(() => {
|
|
664
|
-
this.loading = false;
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
dataLoaded(widgetElement) {
|
|
669
|
-
this.loadNext();
|
|
670
|
-
}
|
|
671
|
-
loadNext() {
|
|
672
|
-
if (this.divBottom) {
|
|
673
|
-
if (this.elementInViewport(this.divBottom.nativeElement)) {
|
|
674
|
-
this.loadWidgetsDelta();
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
elementInViewport(el) {
|
|
679
|
-
var top = el.offsetTop;
|
|
680
|
-
var left = el.offsetLeft;
|
|
681
|
-
var width = el.offsetWidth;
|
|
682
|
-
var height = el.offsetHeight;
|
|
683
|
-
while (el.offsetParent) {
|
|
684
|
-
el = el.offsetParent;
|
|
685
|
-
top += el.offsetTop;
|
|
686
|
-
left += el.offsetLeft;
|
|
687
|
-
}
|
|
688
|
-
return (top >= window.scrollY &&
|
|
689
|
-
left >= window.scrollX &&
|
|
690
|
-
(top + height) <= (window.scrollY + window.innerHeight) &&
|
|
691
|
-
(left + width) <= (window.scrollX + window.innerWidth));
|
|
692
|
-
}
|
|
693
592
|
/** To set Area(Gridster) height dynamically as widgets are added/removed */
|
|
694
593
|
setAreaHeight() {
|
|
695
594
|
setTimeout(() => {
|
|
@@ -731,22 +630,22 @@ let RADashboardArea = class RADashboardArea {
|
|
|
731
630
|
}
|
|
732
631
|
/** To remove a widget instance from dashboard and to save info in database */
|
|
733
632
|
deleteWidget(widgetInstanceId, isalertDisabled = false) {
|
|
734
|
-
let widget = this.userWidgets.filter((item) => {
|
|
735
|
-
return item.widgetInstanceId === widgetInstanceId;
|
|
736
|
-
});
|
|
737
|
-
if (widget.length > 0) {
|
|
738
|
-
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
739
|
-
}
|
|
740
|
-
if (this.PAMWidgets.length > 0) {
|
|
741
|
-
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
742
|
-
if (indx > -1)
|
|
743
|
-
this.PAMWidgets.splice(indx, 1);
|
|
744
|
-
this.checkPAMWidgets();
|
|
745
|
-
}
|
|
746
633
|
let gridsterItem = this.widgetList.filter((item) => {
|
|
747
634
|
return item.widgetInfo.widgetInstanceId === widgetInstanceId;
|
|
748
635
|
});
|
|
749
636
|
if (gridsterItem.length > 0) {
|
|
637
|
+
let widget = this.userWidgets.filter((item) => {
|
|
638
|
+
return item.widgetInstanceId === widgetInstanceId;
|
|
639
|
+
});
|
|
640
|
+
if (widget.length > 0) {
|
|
641
|
+
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
642
|
+
}
|
|
643
|
+
if (this.PAMWidgets.length > 0) {
|
|
644
|
+
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
645
|
+
if (indx > -1)
|
|
646
|
+
this.PAMWidgets.splice(indx, 1);
|
|
647
|
+
this.checkPAMWidgets();
|
|
648
|
+
}
|
|
750
649
|
this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
|
|
751
650
|
this.setAreaHeight();
|
|
752
651
|
if (!isalertDisabled) {
|
|
@@ -760,15 +659,11 @@ let RADashboardArea = class RADashboardArea {
|
|
|
760
659
|
}
|
|
761
660
|
/**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
|
|
762
661
|
rearrangeWidgets() {
|
|
763
|
-
this.currentLoadedIndex = 0;
|
|
764
|
-
this.loading = false;
|
|
765
662
|
for (let i = 0; i < this.userWidgets.length; i++) {
|
|
766
663
|
this.userWidgets[i].position_x = 0;
|
|
767
664
|
this.userWidgets[i].position_y = 0;
|
|
768
665
|
}
|
|
769
|
-
this.widgetList =
|
|
770
|
-
this.loadWidgetsDelta();
|
|
771
|
-
this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
|
|
666
|
+
this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
|
|
772
667
|
if (this.widgetList.length > 0)
|
|
773
668
|
this.updateWidgetPosition(this.widgetList[0].widgetInfo.widgetInstanceId);
|
|
774
669
|
setTimeout(() => {
|
|
@@ -800,33 +695,30 @@ let RADashboardArea = class RADashboardArea {
|
|
|
800
695
|
this.ngxService.start();
|
|
801
696
|
this.dashboardService.addWidget(data, this.appConfig).subscribe(widget => {
|
|
802
697
|
this.userWidgets.push(widget);
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
this.
|
|
808
|
-
if (
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
widget.rowHeight = curRowHeight;
|
|
812
|
-
this.gridcellHeight = curRowHeight;
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
var widgetInstanceId = 0;
|
|
816
|
-
if (widget && widget.widgetInstanceId) {
|
|
817
|
-
widgetInstanceId = widget.widgetInstanceId;
|
|
818
|
-
/**To save added widget position in db */
|
|
819
|
-
if (this.responsiveService.IsDesktopView) {
|
|
820
|
-
setTimeout(() => {
|
|
821
|
-
this.updateWidgetPosition(widgetInstanceId);
|
|
822
|
-
});
|
|
823
|
-
}
|
|
698
|
+
let gridsterItem = this.responsiveService.getGridsterItem(widget);
|
|
699
|
+
this.widgetList.push(gridsterItem);
|
|
700
|
+
this.setAreaHeight();
|
|
701
|
+
if (this.options.api) {
|
|
702
|
+
let curRowHeight = Number(this.options.api.getCurrentRowHeight());
|
|
703
|
+
if (curRowHeight > 0) {
|
|
704
|
+
widget.rowHeight = curRowHeight;
|
|
705
|
+
this.gridcellHeight = curRowHeight;
|
|
824
706
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
707
|
+
}
|
|
708
|
+
var widgetInstanceId = 0;
|
|
709
|
+
if (widget && widget.widgetInstanceId) {
|
|
710
|
+
widgetInstanceId = widget.widgetInstanceId;
|
|
711
|
+
/**To save added widget position in db */
|
|
712
|
+
if (this.responsiveService.IsDesktopView) {
|
|
713
|
+
setTimeout(() => {
|
|
714
|
+
this.updateWidgetPosition(widgetInstanceId);
|
|
715
|
+
});
|
|
828
716
|
}
|
|
829
717
|
}
|
|
718
|
+
if (widget.settings && widget.settings.isPAMWidget) {
|
|
719
|
+
this.PAMWidgets.push(widget.widgetInstanceId);
|
|
720
|
+
this.checkPAMWidgets();
|
|
721
|
+
}
|
|
830
722
|
this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
|
|
831
723
|
});
|
|
832
724
|
}
|
|
@@ -855,15 +747,12 @@ let RADashboardArea = class RADashboardArea {
|
|
|
855
747
|
});
|
|
856
748
|
}
|
|
857
749
|
this.userWidgets.push(data);
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
this.
|
|
863
|
-
|
|
864
|
-
this.PAMWidgets.push(data.widgetInstanceId);
|
|
865
|
-
this.checkPAMWidgets();
|
|
866
|
-
}
|
|
750
|
+
let gridsterItem = this.responsiveService.getGridsterItem(data);
|
|
751
|
+
this.widgetList.push(gridsterItem);
|
|
752
|
+
this.setAreaHeight();
|
|
753
|
+
if (data.settings && data.settings.isPAMWidget) {
|
|
754
|
+
this.PAMWidgets.push(data.widgetInstanceId);
|
|
755
|
+
this.checkPAMWidgets();
|
|
867
756
|
}
|
|
868
757
|
}
|
|
869
758
|
mapObjectListToGridsterItemList(widgetList) {
|
|
@@ -890,11 +779,8 @@ let RADashboardArea = class RADashboardArea {
|
|
|
890
779
|
});
|
|
891
780
|
return widgetListArray;
|
|
892
781
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
896
|
-
else if (this.emptyDashboardButtonAction == "filter")
|
|
897
|
-
this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
|
|
782
|
+
addNewWidget() {
|
|
783
|
+
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
898
784
|
}
|
|
899
785
|
updateAppliedFilters(data) {
|
|
900
786
|
this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
|
|
@@ -945,14 +831,6 @@ __decorate([
|
|
|
945
831
|
Input('app-config'),
|
|
946
832
|
__metadata("design:type", Object)
|
|
947
833
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
948
|
-
__decorate([
|
|
949
|
-
Input('dashboard-info'),
|
|
950
|
-
__metadata("design:type", Object)
|
|
951
|
-
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
952
|
-
__decorate([
|
|
953
|
-
Input(),
|
|
954
|
-
__metadata("design:type", Object)
|
|
955
|
-
], RADashboardArea.prototype, "templateConfig", void 0);
|
|
956
834
|
__decorate([
|
|
957
835
|
Output(),
|
|
958
836
|
__metadata("design:type", Object)
|
|
@@ -961,15 +839,11 @@ __decorate([
|
|
|
961
839
|
ViewChild('gridWrapper', { static: false }),
|
|
962
840
|
__metadata("design:type", ElementRef)
|
|
963
841
|
], RADashboardArea.prototype, "gridWrapper", void 0);
|
|
964
|
-
__decorate([
|
|
965
|
-
ViewChild('divBottom', { static: false }),
|
|
966
|
-
__metadata("design:type", ElementRef)
|
|
967
|
-
], RADashboardArea.prototype, "divBottom", void 0);
|
|
968
842
|
RADashboardArea = __decorate([
|
|
969
843
|
Component({
|
|
970
844
|
selector: 'ra-dashboard-area',
|
|
971
|
-
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"
|
|
972
|
-
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#
|
|
845
|
+
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>",
|
|
846
|
+
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}}"]
|
|
973
847
|
}),
|
|
974
848
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
975
849
|
NgZone,
|
|
@@ -1067,11 +941,8 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1067
941
|
this.showExcell = true;
|
|
1068
942
|
this.hideTitle = false;
|
|
1069
943
|
this.inapplicableFilters = [];
|
|
1070
|
-
this.canLoadData = false;
|
|
1071
944
|
this.widgetDeleted = new EventEmitter();
|
|
1072
945
|
this.updateAppliedFilters = new EventEmitter();
|
|
1073
|
-
this.dataLoaded = new EventEmitter();
|
|
1074
|
-
this.widgetLoaded = new EventEmitter();
|
|
1075
946
|
this.isWidgetStateApplicable = false;
|
|
1076
947
|
this.widgetEmptyState = '';
|
|
1077
948
|
this.lockVisible = false;
|
|
@@ -1092,7 +963,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1092
963
|
this.invokeWidgetResizedEvent();
|
|
1093
964
|
}
|
|
1094
965
|
ngOnInit() {
|
|
1095
|
-
this.WidgetDisplayName = this.
|
|
966
|
+
this.WidgetDisplayName = this.getwidgetTitleTranslation(this.data.widgetInfo.widgetTitle);
|
|
1096
967
|
this.lockIconTitle = this.translateService.translate('Common.lockedfields');
|
|
1097
968
|
this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
|
|
1098
969
|
this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
|
|
@@ -1108,32 +979,19 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1108
979
|
});
|
|
1109
980
|
});
|
|
1110
981
|
}
|
|
1111
|
-
if (this.widgetElement) {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
982
|
+
if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
|
|
983
|
+
let filterObj = this.getParsedConfig(this.globalFilter);
|
|
984
|
+
if (filterObj.WidgetInstanceId) {
|
|
985
|
+
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
986
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1116
987
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
let filterObj = this.getParsedConfig(this.globalFilter);
|
|
1120
|
-
if (filterObj.WidgetInstanceId) {
|
|
1121
|
-
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1122
|
-
this.refreshWidget(this.data.widgetInfo);
|
|
1123
|
-
}
|
|
1124
|
-
else {
|
|
1125
|
-
//this.refreshWidget(this.data.widgetInfo);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1130
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1131
|
-
this.invokeWidgetResizedEvent();
|
|
988
|
+
else {
|
|
989
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1132
990
|
}
|
|
1133
991
|
}
|
|
1134
|
-
if (changes.
|
|
1135
|
-
|
|
1136
|
-
|
|
992
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
993
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
994
|
+
this.invokeWidgetResizedEvent();
|
|
1137
995
|
}
|
|
1138
996
|
}
|
|
1139
997
|
invokeWidgetResizedEvent() {
|
|
@@ -1312,10 +1170,6 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1312
1170
|
this.showPanel = true;
|
|
1313
1171
|
else
|
|
1314
1172
|
this.showPanel = false;
|
|
1315
|
-
if (!this.data.dataLoaded) {
|
|
1316
|
-
this.data.dataLoaded = true;
|
|
1317
|
-
this.dataLoaded.emit(this.widgetElement);
|
|
1318
|
-
}
|
|
1319
1173
|
break;
|
|
1320
1174
|
case 'onConfigEditClicked':
|
|
1321
1175
|
this.editWidget();
|
|
@@ -1388,9 +1242,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1388
1242
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1389
1243
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1390
1244
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1391
|
-
|
|
1392
|
-
//this.widgetElement.loadContent(widgetConfigFilter);
|
|
1393
|
-
this.widgetLoaded.emit();
|
|
1245
|
+
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1394
1246
|
yield this.setLock(widgetConfigFilter.config);
|
|
1395
1247
|
yield this.setDownloadIcon();
|
|
1396
1248
|
}));
|
|
@@ -1457,8 +1309,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1457
1309
|
globalFilter: this.globalFilter,
|
|
1458
1310
|
appConfig: this.appConfig,
|
|
1459
1311
|
widgetInfo: widgetInfo,
|
|
1460
|
-
configChanges: this.getConfigChanges(configChanged)
|
|
1461
|
-
dashboardInfo: this.dashboardInfo
|
|
1312
|
+
configChanges: this.getConfigChanges(configChanged)
|
|
1462
1313
|
};
|
|
1463
1314
|
if (widgetContainerContext.isWidgetLoaded) {
|
|
1464
1315
|
if (this.widgetElement && typeof (this.widgetElement.setConfigFilter) == 'function') {
|
|
@@ -1625,12 +1476,9 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1625
1476
|
let html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
|
|
1626
1477
|
let settings = '';
|
|
1627
1478
|
if (this.isWidgetMgmnt) {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1632
|
-
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
|
|
1633
|
-
settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
|
|
1479
|
+
settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
|
|
1480
|
+
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1481
|
+
settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
|
|
1634
1482
|
}
|
|
1635
1483
|
let customPageParams = false;
|
|
1636
1484
|
if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
|
|
@@ -1639,14 +1487,14 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1639
1487
|
customPageParams = true;
|
|
1640
1488
|
}
|
|
1641
1489
|
}
|
|
1642
|
-
if (
|
|
1490
|
+
if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1643
1491
|
settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
|
|
1644
1492
|
settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
|
|
1645
1493
|
settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
|
|
1646
1494
|
settings += this.translateService.translate('Common.visitpage');
|
|
1647
1495
|
settings += '</span></a>';
|
|
1648
1496
|
}
|
|
1649
|
-
if (
|
|
1497
|
+
if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1650
1498
|
html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
|
|
1651
1499
|
html += this.translateService.translate('Common.settings') + '</div>';
|
|
1652
1500
|
html += settings;
|
|
@@ -1678,7 +1526,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1678
1526
|
if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
|
|
1679
1527
|
html += this.getHr();
|
|
1680
1528
|
}
|
|
1681
|
-
if (this.isWidgetMgmnt
|
|
1529
|
+
if (this.isWidgetMgmnt) {
|
|
1682
1530
|
html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
|
|
1683
1531
|
html += this.deleteText;
|
|
1684
1532
|
html += '</span></a>';
|
|
@@ -1757,6 +1605,22 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1757
1605
|
if (this.currentComponent)
|
|
1758
1606
|
this.popupInstance.removeMe(this.currentComponent);
|
|
1759
1607
|
}
|
|
1608
|
+
getwidgetTitleTranslation(item) {
|
|
1609
|
+
let rKey = 'DBW_' + this.translateService.makeCode(item);
|
|
1610
|
+
let translatedString = '';
|
|
1611
|
+
if (this.dashboardService.clientId) {
|
|
1612
|
+
const translationModule = this.dashboardService.clientId + '_DBW';
|
|
1613
|
+
translatedString = this.translateService.translate(translationModule + '.' + rKey);
|
|
1614
|
+
if (translatedString.toLowerCase() === rKey.toLowerCase()) {
|
|
1615
|
+
return item;
|
|
1616
|
+
}
|
|
1617
|
+
else {
|
|
1618
|
+
return translatedString;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
else
|
|
1622
|
+
return item;
|
|
1623
|
+
}
|
|
1760
1624
|
};
|
|
1761
1625
|
RAWidgetContainer.ctorParameters = () => [
|
|
1762
1626
|
{ type: RaDashboardService },
|
|
@@ -1800,10 +1664,6 @@ __decorate([
|
|
|
1800
1664
|
Input('global-filter'),
|
|
1801
1665
|
__metadata("design:type", Object)
|
|
1802
1666
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
1803
|
-
__decorate([
|
|
1804
|
-
Input('dashboard-info'),
|
|
1805
|
-
__metadata("design:type", Object)
|
|
1806
|
-
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1807
1667
|
__decorate([
|
|
1808
1668
|
Input('data'),
|
|
1809
1669
|
__metadata("design:type", Object)
|
|
@@ -1828,14 +1688,6 @@ __decorate([
|
|
|
1828
1688
|
Input('grid-cell-height'),
|
|
1829
1689
|
__metadata("design:type", Number)
|
|
1830
1690
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1831
|
-
__decorate([
|
|
1832
|
-
Input('bulk-action-data'),
|
|
1833
|
-
__metadata("design:type", Object)
|
|
1834
|
-
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1835
|
-
__decorate([
|
|
1836
|
-
Input(),
|
|
1837
|
-
__metadata("design:type", Boolean)
|
|
1838
|
-
], RAWidgetContainer.prototype, "canLoadData", void 0);
|
|
1839
1691
|
__decorate([
|
|
1840
1692
|
Output(),
|
|
1841
1693
|
__metadata("design:type", Object)
|
|
@@ -1844,14 +1696,6 @@ __decorate([
|
|
|
1844
1696
|
Output(),
|
|
1845
1697
|
__metadata("design:type", Object)
|
|
1846
1698
|
], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
|
|
1847
|
-
__decorate([
|
|
1848
|
-
Output(),
|
|
1849
|
-
__metadata("design:type", Object)
|
|
1850
|
-
], RAWidgetContainer.prototype, "dataLoaded", void 0);
|
|
1851
|
-
__decorate([
|
|
1852
|
-
Output(),
|
|
1853
|
-
__metadata("design:type", Object)
|
|
1854
|
-
], RAWidgetContainer.prototype, "widgetLoaded", void 0);
|
|
1855
1699
|
__decorate([
|
|
1856
1700
|
Input('dom-resized'),
|
|
1857
1701
|
__metadata("design:type", Boolean),
|
|
@@ -4807,13 +4651,11 @@ DashboardFrameworkModule = __decorate([
|
|
|
4807
4651
|
class RaBaseDashboardTemplate {
|
|
4808
4652
|
constructor(ngZone) {
|
|
4809
4653
|
this.ngZone = ngZone;
|
|
4810
|
-
this.initialize = (eventBus, userDashboardId, appConfig
|
|
4654
|
+
this.initialize = (eventBus, userDashboardId, appConfig) => {
|
|
4811
4655
|
this.ngZone.run(() => {
|
|
4812
4656
|
this.userDashboardId = userDashboardId;
|
|
4813
4657
|
this.appConfig = appConfig;
|
|
4814
4658
|
this.raDashboardEventBus = eventBus;
|
|
4815
|
-
this.dashboardInfo = dashboardInfo;
|
|
4816
|
-
this.templateConfig = templateConfig;
|
|
4817
4659
|
});
|
|
4818
4660
|
this.init();
|
|
4819
4661
|
};
|