@schneideress/dashboardframework 0.0.273 → 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 +122 -430
- 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 -164
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +35 -64
- 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 -166
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +35 -64
- 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 +100 -254
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +101 -257
- 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,12 +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
|
-
if (location.href.indexOf('/kiosk/') > -1)
|
|
624
|
-
this.initialWidgetCount = 1000;
|
|
625
|
-
this.currentLoadedIndex = 0;
|
|
626
|
-
this.loading = false;
|
|
627
563
|
let widgetInfo = {
|
|
628
564
|
dashboardId: userDashboarId.toString(),
|
|
629
565
|
dashboardAreaKey: areaKey
|
|
@@ -642,8 +578,9 @@ let RADashboardArea = class RADashboardArea {
|
|
|
642
578
|
});
|
|
643
579
|
this.checkPAMWidgets();
|
|
644
580
|
if (widgets && widgets.length > 0) {
|
|
645
|
-
this.
|
|
646
|
-
this.
|
|
581
|
+
this.dashboardService.clientId = widgets[0].clientId;
|
|
582
|
+
this.widgetList = this.mapObjectListToGridsterItemList(widgets);
|
|
583
|
+
this.setAreaHeight();
|
|
647
584
|
this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
|
|
648
585
|
}
|
|
649
586
|
else {
|
|
@@ -652,43 +589,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
652
589
|
}
|
|
653
590
|
});
|
|
654
591
|
}
|
|
655
|
-
loadWidgetsDelta() {
|
|
656
|
-
if (!this.loading) {
|
|
657
|
-
this.loading = true;
|
|
658
|
-
let widgets = this.mapObjectListToGridsterItemList(this.userWidgets.slice(this.currentLoadedIndex, (this.currentLoadedIndex + this.initialWidgetCount)));
|
|
659
|
-
this.currentLoadedIndex += this.initialWidgetCount;
|
|
660
|
-
this.widgetList.push(...widgets);
|
|
661
|
-
this.setAreaHeight();
|
|
662
|
-
setTimeout(() => {
|
|
663
|
-
this.loading = false;
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
dataLoaded(widgetElement) {
|
|
668
|
-
this.loadNext();
|
|
669
|
-
}
|
|
670
|
-
loadNext() {
|
|
671
|
-
if (this.divBottom) {
|
|
672
|
-
if (this.elementInViewport(this.divBottom.nativeElement)) {
|
|
673
|
-
this.loadWidgetsDelta();
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
elementInViewport(el) {
|
|
678
|
-
var top = el.offsetTop;
|
|
679
|
-
var left = el.offsetLeft;
|
|
680
|
-
var width = el.offsetWidth;
|
|
681
|
-
var height = el.offsetHeight;
|
|
682
|
-
while (el.offsetParent) {
|
|
683
|
-
el = el.offsetParent;
|
|
684
|
-
top += el.offsetTop;
|
|
685
|
-
left += el.offsetLeft;
|
|
686
|
-
}
|
|
687
|
-
return (top >= window.scrollY &&
|
|
688
|
-
left >= window.scrollX &&
|
|
689
|
-
(top + height) <= (window.scrollY + window.innerHeight) &&
|
|
690
|
-
(left + width) <= (window.scrollX + window.innerWidth));
|
|
691
|
-
}
|
|
692
592
|
/** To set Area(Gridster) height dynamically as widgets are added/removed */
|
|
693
593
|
setAreaHeight() {
|
|
694
594
|
setTimeout(() => {
|
|
@@ -730,22 +630,22 @@ let RADashboardArea = class RADashboardArea {
|
|
|
730
630
|
}
|
|
731
631
|
/** To remove a widget instance from dashboard and to save info in database */
|
|
732
632
|
deleteWidget(widgetInstanceId, isalertDisabled = false) {
|
|
733
|
-
let widget = this.userWidgets.filter((item) => {
|
|
734
|
-
return item.widgetInstanceId === widgetInstanceId;
|
|
735
|
-
});
|
|
736
|
-
if (widget.length > 0) {
|
|
737
|
-
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
738
|
-
}
|
|
739
|
-
if (this.PAMWidgets.length > 0) {
|
|
740
|
-
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
741
|
-
if (indx > -1)
|
|
742
|
-
this.PAMWidgets.splice(indx, 1);
|
|
743
|
-
this.checkPAMWidgets();
|
|
744
|
-
}
|
|
745
633
|
let gridsterItem = this.widgetList.filter((item) => {
|
|
746
634
|
return item.widgetInfo.widgetInstanceId === widgetInstanceId;
|
|
747
635
|
});
|
|
748
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
|
+
}
|
|
749
649
|
this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
|
|
750
650
|
this.setAreaHeight();
|
|
751
651
|
if (!isalertDisabled) {
|
|
@@ -759,15 +659,11 @@ let RADashboardArea = class RADashboardArea {
|
|
|
759
659
|
}
|
|
760
660
|
/**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
|
|
761
661
|
rearrangeWidgets() {
|
|
762
|
-
this.currentLoadedIndex = 0;
|
|
763
|
-
this.loading = false;
|
|
764
662
|
for (let i = 0; i < this.userWidgets.length; i++) {
|
|
765
663
|
this.userWidgets[i].position_x = 0;
|
|
766
664
|
this.userWidgets[i].position_y = 0;
|
|
767
665
|
}
|
|
768
|
-
this.widgetList =
|
|
769
|
-
this.loadWidgetsDelta();
|
|
770
|
-
this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
|
|
666
|
+
this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
|
|
771
667
|
if (this.widgetList.length > 0)
|
|
772
668
|
this.updateWidgetPosition(this.widgetList[0].widgetInfo.widgetInstanceId);
|
|
773
669
|
setTimeout(() => {
|
|
@@ -799,32 +695,30 @@ let RADashboardArea = class RADashboardArea {
|
|
|
799
695
|
this.ngxService.start();
|
|
800
696
|
this.dashboardService.addWidget(data, this.appConfig).subscribe(widget => {
|
|
801
697
|
this.userWidgets.push(widget);
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
this.gridcellHeight = curRowHeight;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
var widgetInstanceId = 0;
|
|
814
|
-
if (widget && widget.widgetInstanceId) {
|
|
815
|
-
widgetInstanceId = widget.widgetInstanceId;
|
|
816
|
-
/**To save added widget position in db */
|
|
817
|
-
if (this.responsiveService.IsDesktopView) {
|
|
818
|
-
setTimeout(() => {
|
|
819
|
-
this.updateWidgetPosition(widgetInstanceId);
|
|
820
|
-
});
|
|
821
|
-
}
|
|
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;
|
|
822
706
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
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
|
+
});
|
|
826
716
|
}
|
|
827
717
|
}
|
|
718
|
+
if (widget.settings && widget.settings.isPAMWidget) {
|
|
719
|
+
this.PAMWidgets.push(widget.widgetInstanceId);
|
|
720
|
+
this.checkPAMWidgets();
|
|
721
|
+
}
|
|
828
722
|
this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
|
|
829
723
|
});
|
|
830
724
|
}
|
|
@@ -853,14 +747,12 @@ let RADashboardArea = class RADashboardArea {
|
|
|
853
747
|
});
|
|
854
748
|
}
|
|
855
749
|
this.userWidgets.push(data);
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
this.checkPAMWidgets();
|
|
863
|
-
}
|
|
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();
|
|
864
756
|
}
|
|
865
757
|
}
|
|
866
758
|
mapObjectListToGridsterItemList(widgetList) {
|
|
@@ -887,11 +779,8 @@ let RADashboardArea = class RADashboardArea {
|
|
|
887
779
|
});
|
|
888
780
|
return widgetListArray;
|
|
889
781
|
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
893
|
-
else if (this.emptyDashboardButtonAction == "filter")
|
|
894
|
-
this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
|
|
782
|
+
addNewWidget() {
|
|
783
|
+
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
895
784
|
}
|
|
896
785
|
updateAppliedFilters(data) {
|
|
897
786
|
this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
|
|
@@ -942,14 +831,6 @@ __decorate([
|
|
|
942
831
|
Input('app-config'),
|
|
943
832
|
__metadata("design:type", Object)
|
|
944
833
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
945
|
-
__decorate([
|
|
946
|
-
Input('dashboard-info'),
|
|
947
|
-
__metadata("design:type", Object)
|
|
948
|
-
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
949
|
-
__decorate([
|
|
950
|
-
Input(),
|
|
951
|
-
__metadata("design:type", Object)
|
|
952
|
-
], RADashboardArea.prototype, "templateConfig", void 0);
|
|
953
834
|
__decorate([
|
|
954
835
|
Output(),
|
|
955
836
|
__metadata("design:type", Object)
|
|
@@ -958,15 +839,11 @@ __decorate([
|
|
|
958
839
|
ViewChild('gridWrapper', { static: false }),
|
|
959
840
|
__metadata("design:type", ElementRef)
|
|
960
841
|
], RADashboardArea.prototype, "gridWrapper", void 0);
|
|
961
|
-
__decorate([
|
|
962
|
-
ViewChild('divBottom', { static: false }),
|
|
963
|
-
__metadata("design:type", ElementRef)
|
|
964
|
-
], RADashboardArea.prototype, "divBottom", void 0);
|
|
965
842
|
RADashboardArea = __decorate([
|
|
966
843
|
Component({
|
|
967
844
|
selector: 'ra-dashboard-area',
|
|
968
|
-
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"
|
|
969
|
-
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}}"]
|
|
970
847
|
}),
|
|
971
848
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
972
849
|
NgZone,
|
|
@@ -1064,11 +941,8 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1064
941
|
this.showExcell = true;
|
|
1065
942
|
this.hideTitle = false;
|
|
1066
943
|
this.inapplicableFilters = [];
|
|
1067
|
-
this.canLoadData = false;
|
|
1068
944
|
this.widgetDeleted = new EventEmitter();
|
|
1069
945
|
this.updateAppliedFilters = new EventEmitter();
|
|
1070
|
-
this.dataLoaded = new EventEmitter();
|
|
1071
|
-
this.widgetLoaded = new EventEmitter();
|
|
1072
946
|
this.isWidgetStateApplicable = false;
|
|
1073
947
|
this.widgetEmptyState = '';
|
|
1074
948
|
this.lockVisible = false;
|
|
@@ -1089,7 +963,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1089
963
|
this.invokeWidgetResizedEvent();
|
|
1090
964
|
}
|
|
1091
965
|
ngOnInit() {
|
|
1092
|
-
this.WidgetDisplayName = this.
|
|
966
|
+
this.WidgetDisplayName = this.getwidgetTitleTranslation(this.data.widgetInfo.widgetTitle);
|
|
1093
967
|
this.lockIconTitle = this.translateService.translate('Common.lockedfields');
|
|
1094
968
|
this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
|
|
1095
969
|
this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
|
|
@@ -1105,32 +979,19 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1105
979
|
});
|
|
1106
980
|
});
|
|
1107
981
|
}
|
|
1108
|
-
if (this.widgetElement) {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
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);
|
|
1113
987
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
let filterObj = this.getParsedConfig(this.globalFilter);
|
|
1117
|
-
if (filterObj.WidgetInstanceId) {
|
|
1118
|
-
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1119
|
-
this.refreshWidget(this.data.widgetInfo);
|
|
1120
|
-
}
|
|
1121
|
-
else {
|
|
1122
|
-
//this.refreshWidget(this.data.widgetInfo);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1127
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1128
|
-
this.invokeWidgetResizedEvent();
|
|
988
|
+
else {
|
|
989
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1129
990
|
}
|
|
1130
991
|
}
|
|
1131
|
-
if (changes.
|
|
1132
|
-
|
|
1133
|
-
|
|
992
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
993
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
994
|
+
this.invokeWidgetResizedEvent();
|
|
1134
995
|
}
|
|
1135
996
|
}
|
|
1136
997
|
invokeWidgetResizedEvent() {
|
|
@@ -1309,10 +1170,6 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1309
1170
|
this.showPanel = true;
|
|
1310
1171
|
else
|
|
1311
1172
|
this.showPanel = false;
|
|
1312
|
-
if (!this.data.dataLoaded) {
|
|
1313
|
-
this.data.dataLoaded = true;
|
|
1314
|
-
this.dataLoaded.emit(this.widgetElement);
|
|
1315
|
-
}
|
|
1316
1173
|
break;
|
|
1317
1174
|
case 'onConfigEditClicked':
|
|
1318
1175
|
this.editWidget();
|
|
@@ -1385,9 +1242,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1385
1242
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1386
1243
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1387
1244
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1388
|
-
|
|
1389
|
-
//this.widgetElement.loadContent(widgetConfigFilter);
|
|
1390
|
-
this.widgetLoaded.emit();
|
|
1245
|
+
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1391
1246
|
yield this.setLock(widgetConfigFilter.config);
|
|
1392
1247
|
yield this.setDownloadIcon();
|
|
1393
1248
|
}));
|
|
@@ -1621,12 +1476,9 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1621
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;">';
|
|
1622
1477
|
let settings = '';
|
|
1623
1478
|
if (this.isWidgetMgmnt) {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1628
|
-
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
|
|
1629
|
-
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);
|
|
1630
1482
|
}
|
|
1631
1483
|
let customPageParams = false;
|
|
1632
1484
|
if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
|
|
@@ -1635,14 +1487,14 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1635
1487
|
customPageParams = true;
|
|
1636
1488
|
}
|
|
1637
1489
|
}
|
|
1638
|
-
if (
|
|
1490
|
+
if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1639
1491
|
settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
|
|
1640
1492
|
settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
|
|
1641
1493
|
settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
|
|
1642
1494
|
settings += this.translateService.translate('Common.visitpage');
|
|
1643
1495
|
settings += '</span></a>';
|
|
1644
1496
|
}
|
|
1645
|
-
if (
|
|
1497
|
+
if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1646
1498
|
html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
|
|
1647
1499
|
html += this.translateService.translate('Common.settings') + '</div>';
|
|
1648
1500
|
html += settings;
|
|
@@ -1674,7 +1526,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1674
1526
|
if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
|
|
1675
1527
|
html += this.getHr();
|
|
1676
1528
|
}
|
|
1677
|
-
if (this.isWidgetMgmnt
|
|
1529
|
+
if (this.isWidgetMgmnt) {
|
|
1678
1530
|
html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
|
|
1679
1531
|
html += this.deleteText;
|
|
1680
1532
|
html += '</span></a>';
|
|
@@ -1753,6 +1605,22 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1753
1605
|
if (this.currentComponent)
|
|
1754
1606
|
this.popupInstance.removeMe(this.currentComponent);
|
|
1755
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
|
+
}
|
|
1756
1624
|
};
|
|
1757
1625
|
RAWidgetContainer.ctorParameters = () => [
|
|
1758
1626
|
{ type: RaDashboardService },
|
|
@@ -1796,10 +1664,6 @@ __decorate([
|
|
|
1796
1664
|
Input('global-filter'),
|
|
1797
1665
|
__metadata("design:type", Object)
|
|
1798
1666
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
1799
|
-
__decorate([
|
|
1800
|
-
Input('dashboard-info'),
|
|
1801
|
-
__metadata("design:type", Object)
|
|
1802
|
-
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1803
1667
|
__decorate([
|
|
1804
1668
|
Input('data'),
|
|
1805
1669
|
__metadata("design:type", Object)
|
|
@@ -1824,14 +1688,6 @@ __decorate([
|
|
|
1824
1688
|
Input('grid-cell-height'),
|
|
1825
1689
|
__metadata("design:type", Number)
|
|
1826
1690
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1827
|
-
__decorate([
|
|
1828
|
-
Input('bulk-action-data'),
|
|
1829
|
-
__metadata("design:type", Object)
|
|
1830
|
-
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1831
|
-
__decorate([
|
|
1832
|
-
Input(),
|
|
1833
|
-
__metadata("design:type", Boolean)
|
|
1834
|
-
], RAWidgetContainer.prototype, "canLoadData", void 0);
|
|
1835
1691
|
__decorate([
|
|
1836
1692
|
Output(),
|
|
1837
1693
|
__metadata("design:type", Object)
|
|
@@ -1840,14 +1696,6 @@ __decorate([
|
|
|
1840
1696
|
Output(),
|
|
1841
1697
|
__metadata("design:type", Object)
|
|
1842
1698
|
], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
|
|
1843
|
-
__decorate([
|
|
1844
|
-
Output(),
|
|
1845
|
-
__metadata("design:type", Object)
|
|
1846
|
-
], RAWidgetContainer.prototype, "dataLoaded", void 0);
|
|
1847
|
-
__decorate([
|
|
1848
|
-
Output(),
|
|
1849
|
-
__metadata("design:type", Object)
|
|
1850
|
-
], RAWidgetContainer.prototype, "widgetLoaded", void 0);
|
|
1851
1699
|
__decorate([
|
|
1852
1700
|
Input('dom-resized'),
|
|
1853
1701
|
__metadata("design:type", Boolean),
|
|
@@ -4803,13 +4651,11 @@ DashboardFrameworkModule = __decorate([
|
|
|
4803
4651
|
class RaBaseDashboardTemplate {
|
|
4804
4652
|
constructor(ngZone) {
|
|
4805
4653
|
this.ngZone = ngZone;
|
|
4806
|
-
this.initialize = (eventBus, userDashboardId, appConfig
|
|
4654
|
+
this.initialize = (eventBus, userDashboardId, appConfig) => {
|
|
4807
4655
|
this.ngZone.run(() => {
|
|
4808
4656
|
this.userDashboardId = userDashboardId;
|
|
4809
4657
|
this.appConfig = appConfig;
|
|
4810
4658
|
this.raDashboardEventBus = eventBus;
|
|
4811
|
-
this.dashboardInfo = dashboardInfo;
|
|
4812
|
-
this.templateConfig = templateConfig;
|
|
4813
4659
|
});
|
|
4814
4660
|
this.init();
|
|
4815
4661
|
};
|