@schneideress/dashboardframework 0.0.269 → 0.0.271
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 +54 -197
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +2 -2
- 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 +20 -100
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +31 -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 +20 -107
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +31 -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 +54 -190
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +54 -197
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +2 -20
- 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,7 +396,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
417
396
|
this.domResized = false;
|
|
418
397
|
this.showEmptyDashboard = false;
|
|
419
398
|
this.isWidgetMgmnt = false;
|
|
420
|
-
this.initialWidgetCount = 10;
|
|
421
399
|
this.widgetHeight = 2;
|
|
422
400
|
this.widgetWidth = 4;
|
|
423
401
|
this.hideDashboardBanner = new EventEmitter();
|
|
@@ -425,7 +403,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
425
403
|
ngOnInit() {
|
|
426
404
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
427
405
|
this.initiateGridsterConfig();
|
|
428
|
-
this.setEmptyDashboardConfig();
|
|
429
406
|
this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
|
|
430
407
|
this.responsiveService.resized.subscribe((isDesktop) => {
|
|
431
408
|
if (this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
|
|
@@ -454,11 +431,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
454
431
|
}, 100);
|
|
455
432
|
}
|
|
456
433
|
});
|
|
457
|
-
setTimeout(() => {
|
|
458
|
-
this.bulkActionClick = this.raDashboardEventBus.subscribe(RAEvent.BulkActionClick).subscribe((data) => {
|
|
459
|
-
this.bulkActionData = JSON.parse(JSON.stringify(data)); // To create a new reference;
|
|
460
|
-
});
|
|
461
|
-
});
|
|
462
434
|
}
|
|
463
435
|
ngOnChanges(changes) {
|
|
464
436
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
@@ -466,40 +438,27 @@ let RADashboardArea = class RADashboardArea {
|
|
|
466
438
|
this.isWidgetLoaded = true;
|
|
467
439
|
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
468
440
|
}
|
|
469
|
-
this.initiateGridsterConfig();
|
|
470
441
|
if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
|
|
471
442
|
this.inititateEventBusSubscritions();
|
|
472
443
|
}
|
|
473
444
|
}
|
|
474
|
-
setEmptyDashboardConfig() {
|
|
475
|
-
if (this.dashboardInfo && this.dashboardInfo.templateConfig.emptyDashboardHeader) {
|
|
476
|
-
this.emptyDashboardTitle = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.titleKey);
|
|
477
|
-
this.emptyDashboardMsg1 = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey1);
|
|
478
|
-
this.emptyDashboardMsg2 = (this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) ? this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) : '';
|
|
479
|
-
this.emptyDashboardButtonText = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonTextKey);
|
|
480
|
-
this.emptyDashboardButtonIcon = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon : '';
|
|
481
|
-
this.emptyDashboardButtonAction = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction : '';
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
445
|
/**To set GridsterConfig */
|
|
485
446
|
initiateGridsterConfig() {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
this.options.
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
this.
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
498
|
-
}
|
|
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);
|
|
499
458
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
459
|
+
}
|
|
460
|
+
this.setAreaHeight();
|
|
461
|
+
};
|
|
503
462
|
}
|
|
504
463
|
/** To initiate eventbus subsctiptions */
|
|
505
464
|
inititateEventBusSubscritions() {
|
|
@@ -518,11 +477,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
518
477
|
this.addWidget(e);
|
|
519
478
|
});
|
|
520
479
|
});
|
|
521
|
-
this.curatedFilterChange = this.raDashboardEventBus.subscribe(RAEvent.CuratedFilterChange).subscribe((e) => {
|
|
522
|
-
this.ngZone.run(() => {
|
|
523
|
-
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
480
|
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((e) => {
|
|
527
481
|
this.ngZone.run(() => {
|
|
528
482
|
this.rearrangeWidgets();
|
|
@@ -571,10 +525,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
571
525
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
572
526
|
if (this.rearrangeWidgetClick)
|
|
573
527
|
this.rearrangeWidgetClick.unsubscribe();
|
|
574
|
-
if (this.curatedFilterChange)
|
|
575
|
-
this.curatedFilterChange.unsubscribe();
|
|
576
|
-
if (this.bulkActionClick)
|
|
577
|
-
this.bulkActionClick.unsubscribe();
|
|
578
528
|
}
|
|
579
529
|
/**To update position/dimention of all widgets in the area */
|
|
580
530
|
updateWidgets() {
|
|
@@ -610,8 +560,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
610
560
|
}
|
|
611
561
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
612
562
|
loadWidgets(userDashboarId, areaKey) {
|
|
613
|
-
if (this.templateConfig && this.templateConfig.initialWidgetCount)
|
|
614
|
-
this.initialWidgetCount = this.templateConfig.initialWidgetCount;
|
|
615
563
|
let widgetInfo = {
|
|
616
564
|
dashboardId: userDashboarId.toString(),
|
|
617
565
|
dashboardAreaKey: areaKey
|
|
@@ -619,6 +567,7 @@ let RADashboardArea = class RADashboardArea {
|
|
|
619
567
|
this.widgetList = [];
|
|
620
568
|
this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe(widgets => {
|
|
621
569
|
this.userWidgets = widgets;
|
|
570
|
+
this.dashboardService.clientId = widgets[0].clientId;
|
|
622
571
|
this.PAMWidgets = [];
|
|
623
572
|
widgets.forEach(element => {
|
|
624
573
|
var settings = undefined;
|
|
@@ -640,45 +589,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
640
589
|
}
|
|
641
590
|
});
|
|
642
591
|
}
|
|
643
|
-
widgetLoaded(widget) {
|
|
644
|
-
let lst = this.widgetList.filter((item) => {
|
|
645
|
-
return item.widgetLoaded == true;
|
|
646
|
-
});
|
|
647
|
-
widget.widgetLoaded = true;
|
|
648
|
-
if (lst.length == 0) {
|
|
649
|
-
this.startLoadWidgetData(this.widgetList);
|
|
650
|
-
}
|
|
651
|
-
if (widget.dataTriggered) {
|
|
652
|
-
this.loadWidgetData(widget);
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
startLoadWidgetData(lst) {
|
|
656
|
-
if (lst) {
|
|
657
|
-
if (lst.length < this.initialWidgetCount) {
|
|
658
|
-
for (let i = 0; i < lst.length; i++)
|
|
659
|
-
this.loadWidgetData(lst[i]);
|
|
660
|
-
}
|
|
661
|
-
else
|
|
662
|
-
for (let i = 0; i < this.initialWidgetCount; i++)
|
|
663
|
-
this.loadWidgetData(lst[i]);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
loadWidgetData(widget) {
|
|
667
|
-
widget.dataTriggered = true;
|
|
668
|
-
if (widget.widgetLoaded) {
|
|
669
|
-
widget.canLoadData = true;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
dataLoaded() {
|
|
673
|
-
for (let i = 0; i < this.widgetList.length; i++) {
|
|
674
|
-
if (!this.widgetList[i].dataTriggered) {
|
|
675
|
-
setTimeout(() => {
|
|
676
|
-
this.loadWidgetData(this.widgetList[i]);
|
|
677
|
-
});
|
|
678
|
-
break;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
592
|
/** To set Area(Gridster) height dynamically as widgets are added/removed */
|
|
683
593
|
setAreaHeight() {
|
|
684
594
|
setTimeout(() => {
|
|
@@ -869,11 +779,8 @@ let RADashboardArea = class RADashboardArea {
|
|
|
869
779
|
});
|
|
870
780
|
return widgetListArray;
|
|
871
781
|
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
875
|
-
else if (this.emptyDashboardButtonAction == "filter")
|
|
876
|
-
this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
|
|
782
|
+
addNewWidget() {
|
|
783
|
+
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
877
784
|
}
|
|
878
785
|
updateAppliedFilters(data) {
|
|
879
786
|
this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
|
|
@@ -924,14 +831,6 @@ __decorate([
|
|
|
924
831
|
Input('app-config'),
|
|
925
832
|
__metadata("design:type", Object)
|
|
926
833
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
927
|
-
__decorate([
|
|
928
|
-
Input('dashboard-info'),
|
|
929
|
-
__metadata("design:type", Object)
|
|
930
|
-
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
931
|
-
__decorate([
|
|
932
|
-
Input(),
|
|
933
|
-
__metadata("design:type", Object)
|
|
934
|
-
], RADashboardArea.prototype, "templateConfig", void 0);
|
|
935
834
|
__decorate([
|
|
936
835
|
Output(),
|
|
937
836
|
__metadata("design:type", Object)
|
|
@@ -943,8 +842,8 @@ __decorate([
|
|
|
943
842
|
RADashboardArea = __decorate([
|
|
944
843
|
Component({
|
|
945
844
|
selector: 'ra-dashboard-area',
|
|
946
|
-
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
|
|
947
|
-
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}}"]
|
|
948
847
|
}),
|
|
949
848
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
950
849
|
NgZone,
|
|
@@ -1042,11 +941,8 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1042
941
|
this.showExcell = true;
|
|
1043
942
|
this.hideTitle = false;
|
|
1044
943
|
this.inapplicableFilters = [];
|
|
1045
|
-
this.canLoadData = false;
|
|
1046
944
|
this.widgetDeleted = new EventEmitter();
|
|
1047
945
|
this.updateAppliedFilters = new EventEmitter();
|
|
1048
|
-
this.dataLoaded = new EventEmitter();
|
|
1049
|
-
this.widgetLoaded = new EventEmitter();
|
|
1050
946
|
this.isWidgetStateApplicable = false;
|
|
1051
947
|
this.widgetEmptyState = '';
|
|
1052
948
|
this.lockVisible = false;
|
|
@@ -1067,7 +963,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1067
963
|
this.invokeWidgetResizedEvent();
|
|
1068
964
|
}
|
|
1069
965
|
ngOnInit() {
|
|
1070
|
-
this.WidgetDisplayName = this.
|
|
966
|
+
this.WidgetDisplayName = this.getwidgetTitleTranslation(this.data.widgetInfo.widgetTitle);
|
|
1071
967
|
this.lockIconTitle = this.translateService.translate('Common.lockedfields');
|
|
1072
968
|
this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
|
|
1073
969
|
this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
|
|
@@ -1083,32 +979,19 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1083
979
|
});
|
|
1084
980
|
});
|
|
1085
981
|
}
|
|
1086
|
-
if (this.widgetElement) {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
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);
|
|
1091
987
|
}
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
let filterObj = this.getParsedConfig(this.globalFilter);
|
|
1095
|
-
if (filterObj.WidgetInstanceId) {
|
|
1096
|
-
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1097
|
-
this.refreshWidget(this.data.widgetInfo);
|
|
1098
|
-
}
|
|
1099
|
-
else {
|
|
1100
|
-
//this.refreshWidget(this.data.widgetInfo);
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1105
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1106
|
-
this.invokeWidgetResizedEvent();
|
|
988
|
+
else {
|
|
989
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1107
990
|
}
|
|
1108
991
|
}
|
|
1109
|
-
if (changes.
|
|
1110
|
-
|
|
1111
|
-
|
|
992
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
993
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
994
|
+
this.invokeWidgetResizedEvent();
|
|
1112
995
|
}
|
|
1113
996
|
}
|
|
1114
997
|
invokeWidgetResizedEvent() {
|
|
@@ -1287,10 +1170,6 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1287
1170
|
this.showPanel = true;
|
|
1288
1171
|
else
|
|
1289
1172
|
this.showPanel = false;
|
|
1290
|
-
if (!this.data.dataLoaded) {
|
|
1291
|
-
this.data.dataLoaded = true;
|
|
1292
|
-
this.dataLoaded.emit();
|
|
1293
|
-
}
|
|
1294
1173
|
break;
|
|
1295
1174
|
case 'onConfigEditClicked':
|
|
1296
1175
|
this.editWidget();
|
|
@@ -1363,9 +1242,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1363
1242
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1364
1243
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1365
1244
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1366
|
-
|
|
1367
|
-
// this.widgetElement.loadContent(widgetConfigFilter);
|
|
1368
|
-
this.widgetLoaded.emit();
|
|
1245
|
+
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1369
1246
|
yield this.setLock(widgetConfigFilter.config);
|
|
1370
1247
|
yield this.setDownloadIcon();
|
|
1371
1248
|
}));
|
|
@@ -1599,12 +1476,9 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1599
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;">';
|
|
1600
1477
|
let settings = '';
|
|
1601
1478
|
if (this.isWidgetMgmnt) {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1606
|
-
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
|
|
1607
|
-
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);
|
|
1608
1482
|
}
|
|
1609
1483
|
let customPageParams = false;
|
|
1610
1484
|
if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
|
|
@@ -1613,14 +1487,14 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1613
1487
|
customPageParams = true;
|
|
1614
1488
|
}
|
|
1615
1489
|
}
|
|
1616
|
-
if (
|
|
1490
|
+
if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1617
1491
|
settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
|
|
1618
1492
|
settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
|
|
1619
1493
|
settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
|
|
1620
1494
|
settings += this.translateService.translate('Common.visitpage');
|
|
1621
1495
|
settings += '</span></a>';
|
|
1622
1496
|
}
|
|
1623
|
-
if (
|
|
1497
|
+
if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1624
1498
|
html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
|
|
1625
1499
|
html += this.translateService.translate('Common.settings') + '</div>';
|
|
1626
1500
|
html += settings;
|
|
@@ -1652,7 +1526,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1652
1526
|
if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
|
|
1653
1527
|
html += this.getHr();
|
|
1654
1528
|
}
|
|
1655
|
-
if (this.isWidgetMgmnt
|
|
1529
|
+
if (this.isWidgetMgmnt) {
|
|
1656
1530
|
html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
|
|
1657
1531
|
html += this.deleteText;
|
|
1658
1532
|
html += '</span></a>';
|
|
@@ -1731,6 +1605,18 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1731
1605
|
if (this.currentComponent)
|
|
1732
1606
|
this.popupInstance.removeMe(this.currentComponent);
|
|
1733
1607
|
}
|
|
1608
|
+
getwidgetTitleTranslation(item) {
|
|
1609
|
+
let rKey = 'DBW_' + this.translateService.makeCode(item);
|
|
1610
|
+
let translatedString = '';
|
|
1611
|
+
const translationModule = this.dashboardService.clientId + '_DBW';
|
|
1612
|
+
translatedString = this.translateService.translate(translationModule + '.' + rKey);
|
|
1613
|
+
if (translatedString.toLowerCase() === rKey.toLowerCase()) {
|
|
1614
|
+
return item;
|
|
1615
|
+
}
|
|
1616
|
+
else {
|
|
1617
|
+
return translatedString;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1734
1620
|
};
|
|
1735
1621
|
RAWidgetContainer.ctorParameters = () => [
|
|
1736
1622
|
{ type: RaDashboardService },
|
|
@@ -1774,10 +1660,6 @@ __decorate([
|
|
|
1774
1660
|
Input('global-filter'),
|
|
1775
1661
|
__metadata("design:type", Object)
|
|
1776
1662
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
1777
|
-
__decorate([
|
|
1778
|
-
Input('dashboard-info'),
|
|
1779
|
-
__metadata("design:type", Object)
|
|
1780
|
-
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1781
1663
|
__decorate([
|
|
1782
1664
|
Input('data'),
|
|
1783
1665
|
__metadata("design:type", Object)
|
|
@@ -1802,14 +1684,6 @@ __decorate([
|
|
|
1802
1684
|
Input('grid-cell-height'),
|
|
1803
1685
|
__metadata("design:type", Number)
|
|
1804
1686
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1805
|
-
__decorate([
|
|
1806
|
-
Input('bulk-action-data'),
|
|
1807
|
-
__metadata("design:type", Object)
|
|
1808
|
-
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1809
|
-
__decorate([
|
|
1810
|
-
Input(),
|
|
1811
|
-
__metadata("design:type", Boolean)
|
|
1812
|
-
], RAWidgetContainer.prototype, "canLoadData", void 0);
|
|
1813
1687
|
__decorate([
|
|
1814
1688
|
Output(),
|
|
1815
1689
|
__metadata("design:type", Object)
|
|
@@ -1818,14 +1692,6 @@ __decorate([
|
|
|
1818
1692
|
Output(),
|
|
1819
1693
|
__metadata("design:type", Object)
|
|
1820
1694
|
], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
|
|
1821
|
-
__decorate([
|
|
1822
|
-
Output(),
|
|
1823
|
-
__metadata("design:type", Object)
|
|
1824
|
-
], RAWidgetContainer.prototype, "dataLoaded", void 0);
|
|
1825
|
-
__decorate([
|
|
1826
|
-
Output(),
|
|
1827
|
-
__metadata("design:type", Object)
|
|
1828
|
-
], RAWidgetContainer.prototype, "widgetLoaded", void 0);
|
|
1829
1695
|
__decorate([
|
|
1830
1696
|
Input('dom-resized'),
|
|
1831
1697
|
__metadata("design:type", Boolean),
|
|
@@ -4781,13 +4647,11 @@ DashboardFrameworkModule = __decorate([
|
|
|
4781
4647
|
class RaBaseDashboardTemplate {
|
|
4782
4648
|
constructor(ngZone) {
|
|
4783
4649
|
this.ngZone = ngZone;
|
|
4784
|
-
this.initialize = (eventBus, userDashboardId, appConfig
|
|
4650
|
+
this.initialize = (eventBus, userDashboardId, appConfig) => {
|
|
4785
4651
|
this.ngZone.run(() => {
|
|
4786
4652
|
this.userDashboardId = userDashboardId;
|
|
4787
4653
|
this.appConfig = appConfig;
|
|
4788
4654
|
this.raDashboardEventBus = eventBus;
|
|
4789
|
-
this.dashboardInfo = dashboardInfo;
|
|
4790
|
-
this.templateConfig = templateConfig;
|
|
4791
4655
|
});
|
|
4792
4656
|
this.init();
|
|
4793
4657
|
};
|