@schneideress/dashboardframework 0.0.268 → 0.0.270
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 +51 -192
- 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 +19 -101
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +30 -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 +1 -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 +19 -102
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +30 -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 +1 -7
- package/esm5/lib/ra.event.enum.js +1 -7
- package/esm5/lib/ra.gridster.config.js +3 -3
- package/fesm2015/schneideress-dashboardframework.js +51 -191
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +51 -192
- 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.event.enum.d.ts +1 -7
- package/package.json +1 -1
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -67,12 +67,6 @@ let RaDashboardService = class RaDashboardService extends BaseService {
|
|
|
67
67
|
/**To Update widgetInfo in database */
|
|
68
68
|
updateWidget(widgetInfo, appConfig) {
|
|
69
69
|
this.baseUrl = appConfig.apiBaseUrl;
|
|
70
|
-
let info = {};
|
|
71
|
-
info.widgetConfigInfo = widgetInfo.widgetConfigInfo;
|
|
72
|
-
info.widgetInstanceId = widgetInfo.widgetInstanceId;
|
|
73
|
-
info.widgetTitle = widgetInfo.widgetTitle;
|
|
74
|
-
info.widgetType = widgetInfo.widgetType;
|
|
75
|
-
info.widgetId = widgetInfo.widgetId;
|
|
76
70
|
return this.post('widget/UpdateUserWidget', widgetInfo);
|
|
77
71
|
}
|
|
78
72
|
/** To Move or change position if current widget container*/
|
|
@@ -186,12 +180,6 @@ var RAEvent;
|
|
|
186
180
|
RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
|
|
187
181
|
/**show inapplicable filter message in global filter flyout */
|
|
188
182
|
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
183
|
})(RAEvent || (RAEvent = {}));
|
|
196
184
|
var RAEventKey;
|
|
197
185
|
(function (RAEventKey) {
|
|
@@ -205,9 +193,9 @@ const GridsterConfigDefaultSettings = {
|
|
|
205
193
|
margin: 10,
|
|
206
194
|
outerMargin: true,
|
|
207
195
|
outerMarginTop: 10,
|
|
208
|
-
outerMarginRight:
|
|
196
|
+
outerMarginRight: 10,
|
|
209
197
|
outerMarginBottom: 30,
|
|
210
|
-
outerMarginLeft:
|
|
198
|
+
outerMarginLeft: 10,
|
|
211
199
|
useTransformPositioning: true,
|
|
212
200
|
mobileBreakpoint: 640,
|
|
213
201
|
minCols: 10,
|
|
@@ -312,7 +300,7 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
|
|
|
312
300
|
check = true;
|
|
313
301
|
return check;
|
|
314
302
|
}
|
|
315
|
-
getGridsterConfig(isWidgetMgmnt
|
|
303
|
+
getGridsterConfig(isWidgetMgmnt) {
|
|
316
304
|
let config = GridsterConfigDefaultSettings;
|
|
317
305
|
config.minCols = this.currentResInfo.maxCols;
|
|
318
306
|
config.maxCols = this.currentResInfo.maxCols;
|
|
@@ -334,13 +322,6 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
|
|
|
334
322
|
config.swap = true;
|
|
335
323
|
config.draggable.enabled = true;
|
|
336
324
|
}
|
|
337
|
-
if (!resize) {
|
|
338
|
-
config.resizable.enabled = false;
|
|
339
|
-
config.swap = false;
|
|
340
|
-
}
|
|
341
|
-
if (!canMove) {
|
|
342
|
-
config.draggable.enabled = false;
|
|
343
|
-
}
|
|
344
325
|
return config;
|
|
345
326
|
}
|
|
346
327
|
/**To map IwidgetInfo object to gridsterItem */
|
|
@@ -348,9 +329,6 @@ let RADashboardResponsiveService = class RADashboardResponsiveService {
|
|
|
348
329
|
if (widget.widgetSettings) {
|
|
349
330
|
widget.settings = JSON.parse(widget.widgetSettings);
|
|
350
331
|
}
|
|
351
|
-
if (widget.templateSettings) {
|
|
352
|
-
widget.templateWidgetSettings = JSON.parse(widget.templateSettings);
|
|
353
|
-
}
|
|
354
332
|
let gridsterItem = {
|
|
355
333
|
cols: this.getWidth(widget.width),
|
|
356
334
|
rows: this.getHeight(widget.height),
|
|
@@ -417,7 +395,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
417
395
|
this.domResized = false;
|
|
418
396
|
this.showEmptyDashboard = false;
|
|
419
397
|
this.isWidgetMgmnt = false;
|
|
420
|
-
this.initialWidgetCount = 10;
|
|
421
398
|
this.widgetHeight = 2;
|
|
422
399
|
this.widgetWidth = 4;
|
|
423
400
|
this.hideDashboardBanner = new EventEmitter();
|
|
@@ -425,7 +402,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
425
402
|
ngOnInit() {
|
|
426
403
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
427
404
|
this.initiateGridsterConfig();
|
|
428
|
-
this.setEmptyDashboardConfig();
|
|
429
405
|
this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
|
|
430
406
|
this.responsiveService.resized.subscribe((isDesktop) => {
|
|
431
407
|
if (this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
|
|
@@ -454,11 +430,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
454
430
|
}, 100);
|
|
455
431
|
}
|
|
456
432
|
});
|
|
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
433
|
}
|
|
463
434
|
ngOnChanges(changes) {
|
|
464
435
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
@@ -466,40 +437,27 @@ let RADashboardArea = class RADashboardArea {
|
|
|
466
437
|
this.isWidgetLoaded = true;
|
|
467
438
|
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
468
439
|
}
|
|
469
|
-
this.initiateGridsterConfig();
|
|
470
440
|
if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
|
|
471
441
|
this.inititateEventBusSubscritions();
|
|
472
442
|
}
|
|
473
443
|
}
|
|
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
444
|
/**To set GridsterConfig */
|
|
485
445
|
initiateGridsterConfig() {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
this.options.
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
this.
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
498
|
-
}
|
|
446
|
+
/**To override default configuration values to the gridster control */
|
|
447
|
+
this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt);
|
|
448
|
+
this.options.initCallback = (gridster) => {
|
|
449
|
+
if (this.options.api) {
|
|
450
|
+
this.gridcellHeight = this.options.api.getCurrentRowHeight();
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
this.options.itemChangeCallback = (item) => {
|
|
454
|
+
if (this.responsiveService.IsDesktopView) {
|
|
455
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
456
|
+
this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
499
457
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
458
|
+
}
|
|
459
|
+
this.setAreaHeight();
|
|
460
|
+
};
|
|
503
461
|
}
|
|
504
462
|
/** To initiate eventbus subsctiptions */
|
|
505
463
|
inititateEventBusSubscritions() {
|
|
@@ -518,11 +476,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
518
476
|
this.addWidget(e);
|
|
519
477
|
});
|
|
520
478
|
});
|
|
521
|
-
this.curatedFilterChange = this.raDashboardEventBus.subscribe(RAEvent.CuratedFilterChange).subscribe((e) => {
|
|
522
|
-
this.ngZone.run(() => {
|
|
523
|
-
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
479
|
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((e) => {
|
|
527
480
|
this.ngZone.run(() => {
|
|
528
481
|
this.rearrangeWidgets();
|
|
@@ -571,10 +524,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
571
524
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
572
525
|
if (this.rearrangeWidgetClick)
|
|
573
526
|
this.rearrangeWidgetClick.unsubscribe();
|
|
574
|
-
if (this.curatedFilterChange)
|
|
575
|
-
this.curatedFilterChange.unsubscribe();
|
|
576
|
-
if (this.bulkActionClick)
|
|
577
|
-
this.bulkActionClick.unsubscribe();
|
|
578
527
|
}
|
|
579
528
|
/**To update position/dimention of all widgets in the area */
|
|
580
529
|
updateWidgets() {
|
|
@@ -610,8 +559,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
610
559
|
}
|
|
611
560
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
612
561
|
loadWidgets(userDashboarId, areaKey) {
|
|
613
|
-
if (this.templateConfig && this.templateConfig.initialWidgetCount)
|
|
614
|
-
this.initialWidgetCount = this.templateConfig.initialWidgetCount;
|
|
615
562
|
let widgetInfo = {
|
|
616
563
|
dashboardId: userDashboarId.toString(),
|
|
617
564
|
dashboardAreaKey: areaKey
|
|
@@ -640,46 +587,6 @@ let RADashboardArea = class RADashboardArea {
|
|
|
640
587
|
}
|
|
641
588
|
});
|
|
642
589
|
}
|
|
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
|
-
}
|
|
652
|
-
startLoadWidgetData(lst) {
|
|
653
|
-
if (lst) {
|
|
654
|
-
if (lst.length < this.initialWidgetCount) {
|
|
655
|
-
for (let i = 0; i < lst.length; i++)
|
|
656
|
-
this.loadWidgetData(lst[i]);
|
|
657
|
-
}
|
|
658
|
-
else
|
|
659
|
-
for (let i = 0; i < this.initialWidgetCount; i++)
|
|
660
|
-
this.loadWidgetData(lst[i]);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
loadWidgetData(widget) {
|
|
664
|
-
widget.dataTriggered = true;
|
|
665
|
-
if (widget.widgetLoaded) {
|
|
666
|
-
setTimeout(() => {
|
|
667
|
-
widget.canLoadData = true;
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
else
|
|
671
|
-
setTimeout(() => {
|
|
672
|
-
this.loadWidgetData(widget);
|
|
673
|
-
}, 1000);
|
|
674
|
-
}
|
|
675
|
-
dataLoaded() {
|
|
676
|
-
for (let i = 0; i < this.widgetList.length; i++) {
|
|
677
|
-
if (!this.widgetList[i].dataTriggered) {
|
|
678
|
-
this.loadWidgetData(this.widgetList[i]);
|
|
679
|
-
break;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
590
|
/** To set Area(Gridster) height dynamically as widgets are added/removed */
|
|
684
591
|
setAreaHeight() {
|
|
685
592
|
setTimeout(() => {
|
|
@@ -870,11 +777,8 @@ let RADashboardArea = class RADashboardArea {
|
|
|
870
777
|
});
|
|
871
778
|
return widgetListArray;
|
|
872
779
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
876
|
-
else if (this.emptyDashboardButtonAction == "filter")
|
|
877
|
-
this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
|
|
780
|
+
addNewWidget() {
|
|
781
|
+
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
878
782
|
}
|
|
879
783
|
updateAppliedFilters(data) {
|
|
880
784
|
this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
|
|
@@ -925,14 +829,6 @@ __decorate([
|
|
|
925
829
|
Input('app-config'),
|
|
926
830
|
__metadata("design:type", Object)
|
|
927
831
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
928
|
-
__decorate([
|
|
929
|
-
Input('dashboard-info'),
|
|
930
|
-
__metadata("design:type", Object)
|
|
931
|
-
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
932
|
-
__decorate([
|
|
933
|
-
Input(),
|
|
934
|
-
__metadata("design:type", Object)
|
|
935
|
-
], RADashboardArea.prototype, "templateConfig", void 0);
|
|
936
832
|
__decorate([
|
|
937
833
|
Output(),
|
|
938
834
|
__metadata("design:type", Object)
|
|
@@ -944,8 +840,8 @@ __decorate([
|
|
|
944
840
|
RADashboardArea = __decorate([
|
|
945
841
|
Component({
|
|
946
842
|
selector: 'ra-dashboard-area',
|
|
947
|
-
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
|
|
948
|
-
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#
|
|
843
|
+
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>",
|
|
844
|
+
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#ededed;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:0 1px 10px rgba(0,0,0,.05)}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:40px 20px 20px;background-color:#ededed;display:flex;justify-content:center;align-content:center}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:72%}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;align-items:center;padding:10px 30px;min-width:-webkit-max-content;min-width:max-content;min-width:-moz-max-content}.empty-content{color:#333;border-left:1px solid #a9afb1;width:100%;display:flex;align-items:center;padding:15px 30px 10px 40px}.empty-msg{padding:0 0 5px;font-size:16px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:10px;background-color:#ededed;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:6px 10px 8px}.empty-content{color:#333;display:flex;padding:5px 10px 10px;margin-top:44px;margin-left:-185px;border-left:none}.empty-msg{padding:12px 10px 10px 5px;font-size:14px;border-top:1px solid #a9afb1}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
|
|
949
845
|
}),
|
|
950
846
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
951
847
|
NgZone,
|
|
@@ -1043,11 +939,8 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1043
939
|
this.showExcell = true;
|
|
1044
940
|
this.hideTitle = false;
|
|
1045
941
|
this.inapplicableFilters = [];
|
|
1046
|
-
this.canLoadData = false;
|
|
1047
942
|
this.widgetDeleted = new EventEmitter();
|
|
1048
943
|
this.updateAppliedFilters = new EventEmitter();
|
|
1049
|
-
this.dataLoaded = new EventEmitter();
|
|
1050
|
-
this.widgetLoaded = new EventEmitter();
|
|
1051
944
|
this.isWidgetStateApplicable = false;
|
|
1052
945
|
this.widgetEmptyState = '';
|
|
1053
946
|
this.lockVisible = false;
|
|
@@ -1068,7 +961,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1068
961
|
this.invokeWidgetResizedEvent();
|
|
1069
962
|
}
|
|
1070
963
|
ngOnInit() {
|
|
1071
|
-
this.WidgetDisplayName = this.
|
|
964
|
+
this.WidgetDisplayName = this.getwidgetTitleTranslation(this.data.widgetInfo.widgetTitle);
|
|
1072
965
|
this.lockIconTitle = this.translateService.translate('Common.lockedfields');
|
|
1073
966
|
this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
|
|
1074
967
|
this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
|
|
@@ -1084,32 +977,19 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1084
977
|
});
|
|
1085
978
|
});
|
|
1086
979
|
}
|
|
1087
|
-
if (this.widgetElement) {
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
980
|
+
if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
|
|
981
|
+
let filterObj = this.getParsedConfig(this.globalFilter);
|
|
982
|
+
if (filterObj.WidgetInstanceId) {
|
|
983
|
+
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
984
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1092
985
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
let filterObj = this.getParsedConfig(this.globalFilter);
|
|
1096
|
-
if (filterObj.WidgetInstanceId) {
|
|
1097
|
-
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1098
|
-
this.refreshWidget(this.data.widgetInfo);
|
|
1099
|
-
}
|
|
1100
|
-
else {
|
|
1101
|
-
//this.refreshWidget(this.data.widgetInfo);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1106
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1107
|
-
this.invokeWidgetResizedEvent();
|
|
986
|
+
else {
|
|
987
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1108
988
|
}
|
|
1109
989
|
}
|
|
1110
|
-
if (changes.
|
|
1111
|
-
|
|
1112
|
-
|
|
990
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
991
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
992
|
+
this.invokeWidgetResizedEvent();
|
|
1113
993
|
}
|
|
1114
994
|
}
|
|
1115
995
|
invokeWidgetResizedEvent() {
|
|
@@ -1288,10 +1168,6 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1288
1168
|
this.showPanel = true;
|
|
1289
1169
|
else
|
|
1290
1170
|
this.showPanel = false;
|
|
1291
|
-
if (!this.data.dataLoaded) {
|
|
1292
|
-
this.data.dataLoaded = true;
|
|
1293
|
-
this.dataLoaded.emit();
|
|
1294
|
-
}
|
|
1295
1171
|
break;
|
|
1296
1172
|
case 'onConfigEditClicked':
|
|
1297
1173
|
this.editWidget();
|
|
@@ -1364,9 +1240,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1364
1240
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1365
1241
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1366
1242
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1367
|
-
|
|
1368
|
-
// this.widgetElement.loadContent(widgetConfigFilter);
|
|
1369
|
-
this.widgetLoaded.emit();
|
|
1243
|
+
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1370
1244
|
yield this.setLock(widgetConfigFilter.config);
|
|
1371
1245
|
yield this.setDownloadIcon();
|
|
1372
1246
|
}));
|
|
@@ -1600,12 +1474,9 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1600
1474
|
let html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
|
|
1601
1475
|
let settings = '';
|
|
1602
1476
|
if (this.isWidgetMgmnt) {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1607
|
-
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
|
|
1608
|
-
settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
|
|
1477
|
+
settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
|
|
1478
|
+
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1479
|
+
settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
|
|
1609
1480
|
}
|
|
1610
1481
|
let customPageParams = false;
|
|
1611
1482
|
if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
|
|
@@ -1614,14 +1485,14 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1614
1485
|
customPageParams = true;
|
|
1615
1486
|
}
|
|
1616
1487
|
}
|
|
1617
|
-
if (
|
|
1488
|
+
if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1618
1489
|
settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
|
|
1619
1490
|
settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
|
|
1620
1491
|
settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
|
|
1621
1492
|
settings += this.translateService.translate('Common.visitpage');
|
|
1622
1493
|
settings += '</span></a>';
|
|
1623
1494
|
}
|
|
1624
|
-
if (
|
|
1495
|
+
if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1625
1496
|
html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
|
|
1626
1497
|
html += this.translateService.translate('Common.settings') + '</div>';
|
|
1627
1498
|
html += settings;
|
|
@@ -1653,7 +1524,7 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1653
1524
|
if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
|
|
1654
1525
|
html += this.getHr();
|
|
1655
1526
|
}
|
|
1656
|
-
if (this.isWidgetMgmnt
|
|
1527
|
+
if (this.isWidgetMgmnt) {
|
|
1657
1528
|
html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
|
|
1658
1529
|
html += this.deleteText;
|
|
1659
1530
|
html += '</span></a>';
|
|
@@ -1732,6 +1603,17 @@ let RAWidgetContainer = class RAWidgetContainer {
|
|
|
1732
1603
|
if (this.currentComponent)
|
|
1733
1604
|
this.popupInstance.removeMe(this.currentComponent);
|
|
1734
1605
|
}
|
|
1606
|
+
getwidgetTitleTranslation(item) {
|
|
1607
|
+
let rKey = 'DBW_' + this.translateService.makeCode(item);
|
|
1608
|
+
let translatedString = '';
|
|
1609
|
+
translatedString = this.translateService.translate('Common.' + rKey);
|
|
1610
|
+
if (translatedString.toLowerCase() === rKey.toLowerCase()) {
|
|
1611
|
+
return item;
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
return translatedString;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1735
1617
|
};
|
|
1736
1618
|
RAWidgetContainer.ctorParameters = () => [
|
|
1737
1619
|
{ type: RaDashboardService },
|
|
@@ -1775,10 +1657,6 @@ __decorate([
|
|
|
1775
1657
|
Input('global-filter'),
|
|
1776
1658
|
__metadata("design:type", Object)
|
|
1777
1659
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
1778
|
-
__decorate([
|
|
1779
|
-
Input('dashboard-info'),
|
|
1780
|
-
__metadata("design:type", Object)
|
|
1781
|
-
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1782
1660
|
__decorate([
|
|
1783
1661
|
Input('data'),
|
|
1784
1662
|
__metadata("design:type", Object)
|
|
@@ -1803,14 +1681,6 @@ __decorate([
|
|
|
1803
1681
|
Input('grid-cell-height'),
|
|
1804
1682
|
__metadata("design:type", Number)
|
|
1805
1683
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1806
|
-
__decorate([
|
|
1807
|
-
Input('bulk-action-data'),
|
|
1808
|
-
__metadata("design:type", Object)
|
|
1809
|
-
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1810
|
-
__decorate([
|
|
1811
|
-
Input(),
|
|
1812
|
-
__metadata("design:type", Boolean)
|
|
1813
|
-
], RAWidgetContainer.prototype, "canLoadData", void 0);
|
|
1814
1684
|
__decorate([
|
|
1815
1685
|
Output(),
|
|
1816
1686
|
__metadata("design:type", Object)
|
|
@@ -1819,14 +1689,6 @@ __decorate([
|
|
|
1819
1689
|
Output(),
|
|
1820
1690
|
__metadata("design:type", Object)
|
|
1821
1691
|
], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
|
|
1822
|
-
__decorate([
|
|
1823
|
-
Output(),
|
|
1824
|
-
__metadata("design:type", Object)
|
|
1825
|
-
], RAWidgetContainer.prototype, "dataLoaded", void 0);
|
|
1826
|
-
__decorate([
|
|
1827
|
-
Output(),
|
|
1828
|
-
__metadata("design:type", Object)
|
|
1829
|
-
], RAWidgetContainer.prototype, "widgetLoaded", void 0);
|
|
1830
1692
|
__decorate([
|
|
1831
1693
|
Input('dom-resized'),
|
|
1832
1694
|
__metadata("design:type", Boolean),
|
|
@@ -4782,13 +4644,11 @@ DashboardFrameworkModule = __decorate([
|
|
|
4782
4644
|
class RaBaseDashboardTemplate {
|
|
4783
4645
|
constructor(ngZone) {
|
|
4784
4646
|
this.ngZone = ngZone;
|
|
4785
|
-
this.initialize = (eventBus, userDashboardId, appConfig
|
|
4647
|
+
this.initialize = (eventBus, userDashboardId, appConfig) => {
|
|
4786
4648
|
this.ngZone.run(() => {
|
|
4787
4649
|
this.userDashboardId = userDashboardId;
|
|
4788
4650
|
this.appConfig = appConfig;
|
|
4789
4651
|
this.raDashboardEventBus = eventBus;
|
|
4790
|
-
this.dashboardInfo = dashboardInfo;
|
|
4791
|
-
this.templateConfig = templateConfig;
|
|
4792
4652
|
});
|
|
4793
4653
|
this.init();
|
|
4794
4654
|
};
|