@schneideress/dashboardframework 0.0.270 → 0.0.272
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/schneideress-dashboardframework.umd.js +415 -115
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +1 -15
- 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 +159 -61
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +55 -30
- package/esm2015/lib/ra.base.dashboard.template.js +4 -2
- package/esm2015/lib/ra.dashboard.responsive.service.js +12 -2
- package/esm2015/lib/ra.dashboard.service.js +7 -1
- package/esm2015/lib/ra.event.enum.js +7 -1
- 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 +160 -61
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +55 -30
- package/esm5/lib/ra.base.dashboard.template.js +4 -2
- package/esm5/lib/ra.dashboard.responsive.service.js +12 -2
- package/esm5/lib/ra.dashboard.service.js +7 -1
- package/esm5/lib/ra.event.enum.js +7 -1
- package/esm5/lib/ra.gridster.config.js +3 -3
- package/fesm2015/schneideress-dashboardframework.js +240 -93
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +242 -94
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +23 -2
- package/lib/ra-widget-container/ra.widget.container.component.d.ts +5 -2
- package/lib/ra.base.dashboard.template.d.ts +4 -2
- package/lib/ra.dashboard.responsive.service.d.ts +1 -1
- package/lib/ra.event.enum.d.ts +7 -1
- package/package.json +1 -1
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __extends, __decorate, __metadata, __awaiter, __generator, __assign, __param } from 'tslib';
|
|
1
|
+
import { __extends, __decorate, __metadata, __spread, __awaiter, __generator, __assign, __param } from 'tslib';
|
|
2
2
|
import { Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable, EventEmitter, NgZone, Input, Output, ViewChild, ElementRef, Component, Renderer2, ChangeDetectorRef, ViewEncapsulation, Host, NgModule } from '@angular/core';
|
|
3
3
|
import { of, Subject } from 'rxjs';
|
|
4
4
|
import { BaseService, RATranslateService, RAPermissionService, DomService, RACommonModule } from '@schneideress/ra-common';
|
|
@@ -69,6 +69,12 @@ var RaDashboardService = /** @class */ (function (_super) {
|
|
|
69
69
|
/**To Update widgetInfo in database */
|
|
70
70
|
RaDashboardService.prototype.updateWidget = function (widgetInfo, appConfig) {
|
|
71
71
|
this.baseUrl = appConfig.apiBaseUrl;
|
|
72
|
+
var info = {};
|
|
73
|
+
info.widgetConfigInfo = widgetInfo.widgetConfigInfo;
|
|
74
|
+
info.widgetInstanceId = widgetInfo.widgetInstanceId;
|
|
75
|
+
info.widgetTitle = widgetInfo.widgetTitle;
|
|
76
|
+
info.widgetType = widgetInfo.widgetType;
|
|
77
|
+
info.widgetId = widgetInfo.widgetId;
|
|
72
78
|
return this.post('widget/UpdateUserWidget', widgetInfo);
|
|
73
79
|
};
|
|
74
80
|
/** To Move or change position if current widget container*/
|
|
@@ -184,6 +190,12 @@ var RAEvent;
|
|
|
184
190
|
RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
|
|
185
191
|
/**show inapplicable filter message in global filter flyout */
|
|
186
192
|
RAEvent["ShowInapplicableFilterMessage"] = "ShowInapplicableFilterMessage";
|
|
193
|
+
/** Bulk Action Clicked */
|
|
194
|
+
RAEvent["BulkActionClick"] = "BulkActionClick";
|
|
195
|
+
/** Global Filter Clicked */
|
|
196
|
+
/** When user change the curated filter(eg:data streams), system will create/delete widgets */
|
|
197
|
+
RAEvent["CuratedFilterChange"] = "CuratedFilterChange";
|
|
198
|
+
RAEvent["GlobalFilterClick"] = "GlobalFilterClick";
|
|
187
199
|
})(RAEvent || (RAEvent = {}));
|
|
188
200
|
var RAEventKey;
|
|
189
201
|
(function (RAEventKey) {
|
|
@@ -197,9 +209,9 @@ var GridsterConfigDefaultSettings = {
|
|
|
197
209
|
margin: 10,
|
|
198
210
|
outerMargin: true,
|
|
199
211
|
outerMarginTop: 10,
|
|
200
|
-
outerMarginRight:
|
|
212
|
+
outerMarginRight: 0,
|
|
201
213
|
outerMarginBottom: 30,
|
|
202
|
-
outerMarginLeft:
|
|
214
|
+
outerMarginLeft: 0,
|
|
203
215
|
useTransformPositioning: true,
|
|
204
216
|
mobileBreakpoint: 640,
|
|
205
217
|
minCols: 10,
|
|
@@ -314,7 +326,7 @@ var RADashboardResponsiveService = /** @class */ (function () {
|
|
|
314
326
|
enumerable: true,
|
|
315
327
|
configurable: true
|
|
316
328
|
});
|
|
317
|
-
RADashboardResponsiveService.prototype.getGridsterConfig = function (isWidgetMgmnt) {
|
|
329
|
+
RADashboardResponsiveService.prototype.getGridsterConfig = function (isWidgetMgmnt, resize, canMove) {
|
|
318
330
|
var config = GridsterConfigDefaultSettings;
|
|
319
331
|
config.minCols = this.currentResInfo.maxCols;
|
|
320
332
|
config.maxCols = this.currentResInfo.maxCols;
|
|
@@ -336,6 +348,13 @@ var RADashboardResponsiveService = /** @class */ (function () {
|
|
|
336
348
|
config.swap = true;
|
|
337
349
|
config.draggable.enabled = true;
|
|
338
350
|
}
|
|
351
|
+
if (!resize) {
|
|
352
|
+
config.resizable.enabled = false;
|
|
353
|
+
config.swap = false;
|
|
354
|
+
}
|
|
355
|
+
if (!canMove) {
|
|
356
|
+
config.draggable.enabled = false;
|
|
357
|
+
}
|
|
339
358
|
return config;
|
|
340
359
|
};
|
|
341
360
|
/**To map IwidgetInfo object to gridsterItem */
|
|
@@ -343,6 +362,9 @@ var RADashboardResponsiveService = /** @class */ (function () {
|
|
|
343
362
|
if (widget.widgetSettings) {
|
|
344
363
|
widget.settings = JSON.parse(widget.widgetSettings);
|
|
345
364
|
}
|
|
365
|
+
if (widget.templateSettings) {
|
|
366
|
+
widget.templateWidgetSettings = JSON.parse(widget.templateSettings);
|
|
367
|
+
}
|
|
346
368
|
var gridsterItem = {
|
|
347
369
|
cols: this.getWidth(widget.width),
|
|
348
370
|
rows: this.getHeight(widget.height),
|
|
@@ -410,14 +432,21 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
410
432
|
this.domResized = false;
|
|
411
433
|
this.showEmptyDashboard = false;
|
|
412
434
|
this.isWidgetMgmnt = false;
|
|
435
|
+
this.initialWidgetCount = 10;
|
|
436
|
+
this.currentLoadedIndex = 0;
|
|
437
|
+
this.loading = false;
|
|
413
438
|
this.widgetHeight = 2;
|
|
414
439
|
this.widgetWidth = 4;
|
|
415
440
|
this.hideDashboardBanner = new EventEmitter();
|
|
416
441
|
}
|
|
417
442
|
RADashboardArea.prototype.ngOnInit = function () {
|
|
418
443
|
var _this = this;
|
|
444
|
+
window.addEventListener('scroll', function () {
|
|
445
|
+
_this.loadNext();
|
|
446
|
+
});
|
|
419
447
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
420
448
|
this.initiateGridsterConfig();
|
|
449
|
+
this.setEmptyDashboardConfig();
|
|
421
450
|
this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
|
|
422
451
|
this.responsiveService.resized.subscribe(function (isDesktop) {
|
|
423
452
|
if (_this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
|
|
@@ -446,6 +475,11 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
446
475
|
}, 100);
|
|
447
476
|
}
|
|
448
477
|
});
|
|
478
|
+
setTimeout(function () {
|
|
479
|
+
_this.bulkActionClick = _this.raDashboardEventBus.subscribe(RAEvent.BulkActionClick).subscribe(function (data) {
|
|
480
|
+
_this.bulkActionData = JSON.parse(JSON.stringify(data)); // To create a new reference;
|
|
481
|
+
});
|
|
482
|
+
});
|
|
449
483
|
};
|
|
450
484
|
RADashboardArea.prototype.ngOnChanges = function (changes) {
|
|
451
485
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
@@ -453,28 +487,41 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
453
487
|
this.isWidgetLoaded = true;
|
|
454
488
|
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
455
489
|
}
|
|
490
|
+
this.initiateGridsterConfig();
|
|
456
491
|
if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
|
|
457
492
|
this.inititateEventBusSubscritions();
|
|
458
493
|
}
|
|
459
494
|
};
|
|
495
|
+
RADashboardArea.prototype.setEmptyDashboardConfig = function () {
|
|
496
|
+
if (this.dashboardInfo && this.dashboardInfo.templateConfig.emptyDashboardHeader) {
|
|
497
|
+
this.emptyDashboardTitle = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.titleKey);
|
|
498
|
+
this.emptyDashboardMsg1 = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey1);
|
|
499
|
+
this.emptyDashboardMsg2 = (this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) ? this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) : '';
|
|
500
|
+
this.emptyDashboardButtonText = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonTextKey);
|
|
501
|
+
this.emptyDashboardButtonIcon = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon : '';
|
|
502
|
+
this.emptyDashboardButtonAction = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction : '';
|
|
503
|
+
}
|
|
504
|
+
};
|
|
460
505
|
/**To set GridsterConfig */
|
|
461
506
|
RADashboardArea.prototype.initiateGridsterConfig = function () {
|
|
462
507
|
var _this = this;
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
};
|
|
470
|
-
this.options.itemChangeCallback = function (item) {
|
|
471
|
-
if (_this.responsiveService.IsDesktopView) {
|
|
472
|
-
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
473
|
-
_this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
508
|
+
if (this.dashboardInfo) {
|
|
509
|
+
/**To override default configuration values to the gridster control */
|
|
510
|
+
this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt, this.dashboardInfo.templateConfig.widget.canResize, this.dashboardInfo.templateConfig.widget.canMove);
|
|
511
|
+
this.options.initCallback = function (gridster) {
|
|
512
|
+
if (_this.options.api) {
|
|
513
|
+
_this.gridcellHeight = _this.options.api.getCurrentRowHeight();
|
|
474
514
|
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
515
|
+
};
|
|
516
|
+
this.options.itemChangeCallback = function (item) {
|
|
517
|
+
if (_this.responsiveService.IsDesktopView) {
|
|
518
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
519
|
+
_this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
_this.setAreaHeight();
|
|
523
|
+
};
|
|
524
|
+
}
|
|
478
525
|
};
|
|
479
526
|
/** To initiate eventbus subsctiptions */
|
|
480
527
|
RADashboardArea.prototype.inititateEventBusSubscritions = function () {
|
|
@@ -494,6 +541,11 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
494
541
|
_this.addWidget(e);
|
|
495
542
|
});
|
|
496
543
|
});
|
|
544
|
+
this.curatedFilterChange = this.raDashboardEventBus.subscribe(RAEvent.CuratedFilterChange).subscribe(function (e) {
|
|
545
|
+
_this.ngZone.run(function () {
|
|
546
|
+
_this.loadWidgets(_this.userDashboardId, _this.areaKey);
|
|
547
|
+
});
|
|
548
|
+
});
|
|
497
549
|
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe(function (e) {
|
|
498
550
|
_this.ngZone.run(function () {
|
|
499
551
|
_this.rearrangeWidgets();
|
|
@@ -542,6 +594,10 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
542
594
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
543
595
|
if (this.rearrangeWidgetClick)
|
|
544
596
|
this.rearrangeWidgetClick.unsubscribe();
|
|
597
|
+
if (this.curatedFilterChange)
|
|
598
|
+
this.curatedFilterChange.unsubscribe();
|
|
599
|
+
if (this.bulkActionClick)
|
|
600
|
+
this.bulkActionClick.unsubscribe();
|
|
545
601
|
};
|
|
546
602
|
/**To update position/dimention of all widgets in the area */
|
|
547
603
|
RADashboardArea.prototype.updateWidgets = function () {
|
|
@@ -578,6 +634,12 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
578
634
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
579
635
|
RADashboardArea.prototype.loadWidgets = function (userDashboarId, areaKey) {
|
|
580
636
|
var _this = this;
|
|
637
|
+
if (this.templateConfig && this.templateConfig.initialWidgetCount)
|
|
638
|
+
this.initialWidgetCount = this.templateConfig.initialWidgetCount;
|
|
639
|
+
if (location.href.indexOf('loadAllWidgets') > -1)
|
|
640
|
+
this.initialWidgetCount = 1000;
|
|
641
|
+
this.currentLoadedIndex = 0;
|
|
642
|
+
this.loading = false;
|
|
581
643
|
var widgetInfo = {
|
|
582
644
|
dashboardId: userDashboarId.toString(),
|
|
583
645
|
dashboardAreaKey: areaKey
|
|
@@ -596,8 +658,8 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
596
658
|
});
|
|
597
659
|
_this.checkPAMWidgets();
|
|
598
660
|
if (widgets && widgets.length > 0) {
|
|
599
|
-
_this.widgetList =
|
|
600
|
-
_this.
|
|
661
|
+
_this.widgetList = [];
|
|
662
|
+
_this.loadWidgetsDelta();
|
|
601
663
|
_this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
|
|
602
664
|
}
|
|
603
665
|
else {
|
|
@@ -606,6 +668,42 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
606
668
|
}
|
|
607
669
|
});
|
|
608
670
|
};
|
|
671
|
+
RADashboardArea.prototype.loadWidgetsDelta = function () {
|
|
672
|
+
var _a;
|
|
673
|
+
if (!this.loading) {
|
|
674
|
+
this.loading = true;
|
|
675
|
+
var widgets = this.mapObjectListToGridsterItemList(this.userWidgets.slice(this.currentLoadedIndex, (this.currentLoadedIndex + this.initialWidgetCount)));
|
|
676
|
+
this.currentLoadedIndex += this.initialWidgetCount;
|
|
677
|
+
(_a = this.widgetList).push.apply(_a, __spread(widgets));
|
|
678
|
+
this.setAreaHeight();
|
|
679
|
+
this.loading = false;
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
RADashboardArea.prototype.dataLoaded = function (widgetElement) {
|
|
683
|
+
this.loadNext();
|
|
684
|
+
};
|
|
685
|
+
RADashboardArea.prototype.loadNext = function () {
|
|
686
|
+
if (this.divBottom) {
|
|
687
|
+
if (this.elementInViewport(this.divBottom.nativeElement)) {
|
|
688
|
+
this.loadWidgetsDelta();
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
RADashboardArea.prototype.elementInViewport = function (el) {
|
|
693
|
+
var top = el.offsetTop;
|
|
694
|
+
var left = el.offsetLeft;
|
|
695
|
+
var width = el.offsetWidth;
|
|
696
|
+
var height = el.offsetHeight;
|
|
697
|
+
while (el.offsetParent) {
|
|
698
|
+
el = el.offsetParent;
|
|
699
|
+
top += el.offsetTop;
|
|
700
|
+
left += el.offsetLeft;
|
|
701
|
+
}
|
|
702
|
+
return (top >= window.scrollY &&
|
|
703
|
+
left >= window.scrollX &&
|
|
704
|
+
(top + height) <= (window.scrollY + window.innerHeight) &&
|
|
705
|
+
(left + width) <= (window.scrollX + window.innerWidth));
|
|
706
|
+
};
|
|
609
707
|
/** To set Area(Gridster) height dynamically as widgets are added/removed */
|
|
610
708
|
RADashboardArea.prototype.setAreaHeight = function () {
|
|
611
709
|
var _this = this;
|
|
@@ -649,22 +747,22 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
649
747
|
/** To remove a widget instance from dashboard and to save info in database */
|
|
650
748
|
RADashboardArea.prototype.deleteWidget = function (widgetInstanceId, isalertDisabled) {
|
|
651
749
|
if (isalertDisabled === void 0) { isalertDisabled = false; }
|
|
750
|
+
var widget = this.userWidgets.filter(function (item) {
|
|
751
|
+
return item.widgetInstanceId === widgetInstanceId;
|
|
752
|
+
});
|
|
753
|
+
if (widget.length > 0) {
|
|
754
|
+
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
755
|
+
}
|
|
756
|
+
if (this.PAMWidgets.length > 0) {
|
|
757
|
+
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
758
|
+
if (indx > -1)
|
|
759
|
+
this.PAMWidgets.splice(indx, 1);
|
|
760
|
+
this.checkPAMWidgets();
|
|
761
|
+
}
|
|
652
762
|
var gridsterItem = this.widgetList.filter(function (item) {
|
|
653
763
|
return item.widgetInfo.widgetInstanceId === widgetInstanceId;
|
|
654
764
|
});
|
|
655
765
|
if (gridsterItem.length > 0) {
|
|
656
|
-
var widget = this.userWidgets.filter(function (item) {
|
|
657
|
-
return item.widgetInstanceId === widgetInstanceId;
|
|
658
|
-
});
|
|
659
|
-
if (widget.length > 0) {
|
|
660
|
-
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
661
|
-
}
|
|
662
|
-
if (this.PAMWidgets.length > 0) {
|
|
663
|
-
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
664
|
-
if (indx > -1)
|
|
665
|
-
this.PAMWidgets.splice(indx, 1);
|
|
666
|
-
this.checkPAMWidgets();
|
|
667
|
-
}
|
|
668
766
|
this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
|
|
669
767
|
this.setAreaHeight();
|
|
670
768
|
if (!isalertDisabled) {
|
|
@@ -679,11 +777,15 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
679
777
|
/**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
|
|
680
778
|
RADashboardArea.prototype.rearrangeWidgets = function () {
|
|
681
779
|
var _this = this;
|
|
780
|
+
this.currentLoadedIndex = 0;
|
|
781
|
+
this.loading = false;
|
|
682
782
|
for (var i = 0; i < this.userWidgets.length; i++) {
|
|
683
783
|
this.userWidgets[i].position_x = 0;
|
|
684
784
|
this.userWidgets[i].position_y = 0;
|
|
685
785
|
}
|
|
686
|
-
this.widgetList =
|
|
786
|
+
this.widgetList = [];
|
|
787
|
+
this.loadWidgetsDelta();
|
|
788
|
+
this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
|
|
687
789
|
if (this.widgetList.length > 0)
|
|
688
790
|
this.updateWidgetPosition(this.widgetList[0].widgetInfo.widgetInstanceId);
|
|
689
791
|
setTimeout(function () {
|
|
@@ -716,29 +818,31 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
716
818
|
this.ngxService.start();
|
|
717
819
|
this.dashboardService.addWidget(data, this.appConfig).subscribe(function (widget) {
|
|
718
820
|
_this.userWidgets.push(widget);
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
821
|
+
if (_this.currentLoadedIndex >= _this.userWidgets.length) {
|
|
822
|
+
var gridsterItem = _this.responsiveService.getGridsterItem(widget);
|
|
823
|
+
_this.widgetList.push(gridsterItem);
|
|
824
|
+
_this.setAreaHeight();
|
|
825
|
+
if (_this.options.api) {
|
|
826
|
+
var curRowHeight = Number(_this.options.api.getCurrentRowHeight());
|
|
827
|
+
if (curRowHeight > 0) {
|
|
828
|
+
widget.rowHeight = curRowHeight;
|
|
829
|
+
_this.gridcellHeight = curRowHeight;
|
|
830
|
+
}
|
|
727
831
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}
|
|
832
|
+
var widgetInstanceId = 0;
|
|
833
|
+
if (widget && widget.widgetInstanceId) {
|
|
834
|
+
widgetInstanceId = widget.widgetInstanceId;
|
|
835
|
+
/**To save added widget position in db */
|
|
836
|
+
if (_this.responsiveService.IsDesktopView) {
|
|
837
|
+
setTimeout(function () {
|
|
838
|
+
_this.updateWidgetPosition(widgetInstanceId);
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
if (widget.settings && widget.settings.isPAMWidget) {
|
|
843
|
+
_this.PAMWidgets.push(widget.widgetInstanceId);
|
|
844
|
+
_this.checkPAMWidgets();
|
|
737
845
|
}
|
|
738
|
-
}
|
|
739
|
-
if (widget.settings && widget.settings.isPAMWidget) {
|
|
740
|
-
_this.PAMWidgets.push(widget.widgetInstanceId);
|
|
741
|
-
_this.checkPAMWidgets();
|
|
742
846
|
}
|
|
743
847
|
_this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
|
|
744
848
|
});
|
|
@@ -768,12 +872,14 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
768
872
|
});
|
|
769
873
|
}
|
|
770
874
|
this.userWidgets.push(data);
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
875
|
+
if (this.currentLoadedIndex >= this.userWidgets.length) {
|
|
876
|
+
var gridsterItem = this.responsiveService.getGridsterItem(data);
|
|
877
|
+
this.widgetList.push(gridsterItem);
|
|
878
|
+
this.setAreaHeight();
|
|
879
|
+
if (data.settings && data.settings.isPAMWidget) {
|
|
880
|
+
this.PAMWidgets.push(data.widgetInstanceId);
|
|
881
|
+
this.checkPAMWidgets();
|
|
882
|
+
}
|
|
777
883
|
}
|
|
778
884
|
};
|
|
779
885
|
RADashboardArea.prototype.mapObjectListToGridsterItemList = function (widgetList) {
|
|
@@ -802,8 +908,11 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
802
908
|
});
|
|
803
909
|
return widgetListArray;
|
|
804
910
|
};
|
|
805
|
-
RADashboardArea.prototype.
|
|
806
|
-
this.
|
|
911
|
+
RADashboardArea.prototype.buttonClick = function () {
|
|
912
|
+
if (this.emptyDashboardButtonAction == "widgets")
|
|
913
|
+
this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
|
|
914
|
+
else if (this.emptyDashboardButtonAction == "filter")
|
|
915
|
+
this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
|
|
807
916
|
};
|
|
808
917
|
RADashboardArea.prototype.updateAppliedFilters = function (data) {
|
|
809
918
|
this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
|
|
@@ -853,6 +962,14 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
853
962
|
Input('app-config'),
|
|
854
963
|
__metadata("design:type", Object)
|
|
855
964
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
965
|
+
__decorate([
|
|
966
|
+
Input('dashboard-info'),
|
|
967
|
+
__metadata("design:type", Object)
|
|
968
|
+
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
969
|
+
__decorate([
|
|
970
|
+
Input(),
|
|
971
|
+
__metadata("design:type", Object)
|
|
972
|
+
], RADashboardArea.prototype, "templateConfig", void 0);
|
|
856
973
|
__decorate([
|
|
857
974
|
Output(),
|
|
858
975
|
__metadata("design:type", Object)
|
|
@@ -861,11 +978,15 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
861
978
|
ViewChild('gridWrapper', { static: false }),
|
|
862
979
|
__metadata("design:type", ElementRef)
|
|
863
980
|
], RADashboardArea.prototype, "gridWrapper", void 0);
|
|
981
|
+
__decorate([
|
|
982
|
+
ViewChild('divBottom', { static: false }),
|
|
983
|
+
__metadata("design:type", ElementRef)
|
|
984
|
+
], RADashboardArea.prototype, "divBottom", void 0);
|
|
864
985
|
RADashboardArea = __decorate([
|
|
865
986
|
Component({
|
|
866
987
|
selector: 'ra-dashboard-area',
|
|
867
|
-
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"
|
|
868
|
-
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#
|
|
988
|
+
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"\r\n [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container (dataLoaded)=\"dataLoaded($event)\"\r\n [bulk-action-data]=\"bulkActionData\" [dashboard-info]=\"dashboardInfo\" [app-config]=\"appConfig\"\r\n [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\"\r\n [widget-width]=\"item.cols\" [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\"\r\n [dom-resized]=\"domResized\" (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"empty-prefix\">\r\n <!-- <i class=\"fal fa-edit edit-icon\"></i> -->\r\n <span>{{emptyDashboardTitle}}</span>\r\n </div>\r\n <hr class=\"horizontalLine-solid\" />\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{emptyDashboardMsg1}} <br />\r\n {{emptyDashboardMsg2}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm dashboard-button light\" (click)=\"buttonClick()\">\r\n <i class=\"{{emptyDashboardButtonIcon}}\"></i>{{emptyDashboardButtonText}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>\r\n<div #divBottom></div>",
|
|
989
|
+
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#fff;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:none}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)!important}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:15px 0;background-color:#fff;display:flex}.empty-wrapper{background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:18px;padding:15px}.empty-content{color:#626469;width:100%;padding:15px}.empty-msg{padding:0 0 15px;font-size:16px}.horizontalLine-solid{border-top:1px solid #cbcbcb;margin:0 15px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:15px 0;background-color:#fff;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:15px}.empty-content{color:#333;display:flex;padding:15px}.empty-msg{padding:0 0 15px;font-size:14px}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
|
|
869
990
|
}),
|
|
870
991
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
871
992
|
NgZone,
|
|
@@ -970,6 +1091,8 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
970
1091
|
this.inapplicableFilters = [];
|
|
971
1092
|
this.widgetDeleted = new EventEmitter();
|
|
972
1093
|
this.updateAppliedFilters = new EventEmitter();
|
|
1094
|
+
this.dataLoaded = new EventEmitter();
|
|
1095
|
+
this.widgetLoaded = new EventEmitter();
|
|
973
1096
|
this.isWidgetStateApplicable = false;
|
|
974
1097
|
this.widgetEmptyState = '';
|
|
975
1098
|
this.lockVisible = false;
|
|
@@ -994,7 +1117,7 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
994
1117
|
configurable: true
|
|
995
1118
|
});
|
|
996
1119
|
RAWidgetContainer.prototype.ngOnInit = function () {
|
|
997
|
-
this.WidgetDisplayName = this.
|
|
1120
|
+
this.WidgetDisplayName = this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true);
|
|
998
1121
|
this.lockIconTitle = this.translateService.translate('Common.lockedfields');
|
|
999
1122
|
this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
|
|
1000
1123
|
this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
|
|
@@ -1015,19 +1138,28 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1015
1138
|
});
|
|
1016
1139
|
});
|
|
1017
1140
|
}
|
|
1018
|
-
if (this.widgetElement
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1141
|
+
if (this.widgetElement) {
|
|
1142
|
+
if (changes.bulkActionData && changes.bulkActionData.currentValue != changes.bulkActionData.previousValue) {
|
|
1143
|
+
if (typeof this.widgetElement.bulkActionClicked === "function") {
|
|
1144
|
+
this.widgetElement.bulkActionClicked(this.bulkActionData);
|
|
1145
|
+
}
|
|
1023
1146
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1147
|
+
if (changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
|
|
1148
|
+
if (!this.dashboardInfo.curatedFilters) {
|
|
1149
|
+
var filterObj = this.getParsedConfig(this.globalFilter);
|
|
1150
|
+
if (filterObj.WidgetInstanceId) {
|
|
1151
|
+
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1152
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1153
|
+
}
|
|
1154
|
+
else {
|
|
1155
|
+
//this.refreshWidget(this.data.widgetInfo);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1160
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1161
|
+
this.invokeWidgetResizedEvent();
|
|
1026
1162
|
}
|
|
1027
|
-
}
|
|
1028
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1029
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1030
|
-
this.invokeWidgetResizedEvent();
|
|
1031
1163
|
}
|
|
1032
1164
|
};
|
|
1033
1165
|
RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
|
|
@@ -1219,6 +1351,10 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1219
1351
|
_this.showPanel = true;
|
|
1220
1352
|
else
|
|
1221
1353
|
_this.showPanel = false;
|
|
1354
|
+
if (!_this.data.dataLoaded) {
|
|
1355
|
+
_this.data.dataLoaded = true;
|
|
1356
|
+
_this.dataLoaded.emit(_this.widgetElement);
|
|
1357
|
+
}
|
|
1222
1358
|
break;
|
|
1223
1359
|
case 'onConfigEditClicked':
|
|
1224
1360
|
_this.editWidget();
|
|
@@ -1291,7 +1427,9 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1291
1427
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1292
1428
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1293
1429
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1430
|
+
widgetConfigFilter.dashboardInfo = me.dashboardInfo;
|
|
1294
1431
|
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1432
|
+
this.widgetLoaded.emit();
|
|
1295
1433
|
return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
|
|
1296
1434
|
case 1:
|
|
1297
1435
|
_a.sent();
|
|
@@ -1561,9 +1699,12 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1561
1699
|
var html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
|
|
1562
1700
|
var settings = '';
|
|
1563
1701
|
if (this.isWidgetMgmnt) {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1702
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideEdit)
|
|
1703
|
+
settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
|
|
1704
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideCopy)
|
|
1705
|
+
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
1706
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
|
|
1707
|
+
settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
|
|
1567
1708
|
}
|
|
1568
1709
|
var customPageParams = false;
|
|
1569
1710
|
if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
|
|
@@ -1572,14 +1713,14 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1572
1713
|
customPageParams = true;
|
|
1573
1714
|
}
|
|
1574
1715
|
}
|
|
1575
|
-
if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1716
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1576
1717
|
settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
|
|
1577
1718
|
settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
|
|
1578
1719
|
settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
|
|
1579
1720
|
settings += this.translateService.translate('Common.visitpage');
|
|
1580
1721
|
settings += '</span></a>';
|
|
1581
1722
|
}
|
|
1582
|
-
if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1723
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1583
1724
|
html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
|
|
1584
1725
|
html += this.translateService.translate('Common.settings') + '</div>';
|
|
1585
1726
|
html += settings;
|
|
@@ -1611,7 +1752,7 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1611
1752
|
if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
|
|
1612
1753
|
html += this.getHr();
|
|
1613
1754
|
}
|
|
1614
|
-
if (this.isWidgetMgmnt) {
|
|
1755
|
+
if (this.isWidgetMgmnt && !this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideDelete) {
|
|
1615
1756
|
html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
|
|
1616
1757
|
html += this.deleteText;
|
|
1617
1758
|
html += '</span></a>';
|
|
@@ -1692,17 +1833,6 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1692
1833
|
if (this.currentComponent)
|
|
1693
1834
|
this.popupInstance.removeMe(this.currentComponent);
|
|
1694
1835
|
};
|
|
1695
|
-
RAWidgetContainer.prototype.getwidgetTitleTranslation = function (item) {
|
|
1696
|
-
var rKey = 'DBW_' + this.translateService.makeCode(item);
|
|
1697
|
-
var translatedString = '';
|
|
1698
|
-
translatedString = this.translateService.translate('Common.' + rKey);
|
|
1699
|
-
if (translatedString.toLowerCase() === rKey.toLowerCase()) {
|
|
1700
|
-
return item;
|
|
1701
|
-
}
|
|
1702
|
-
else {
|
|
1703
|
-
return translatedString;
|
|
1704
|
-
}
|
|
1705
|
-
};
|
|
1706
1836
|
RAWidgetContainer.ctorParameters = function () { return [
|
|
1707
1837
|
{ type: RaDashboardService },
|
|
1708
1838
|
{ type: NgxUiLoaderService },
|
|
@@ -1745,6 +1875,10 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1745
1875
|
Input('global-filter'),
|
|
1746
1876
|
__metadata("design:type", Object)
|
|
1747
1877
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
1878
|
+
__decorate([
|
|
1879
|
+
Input('dashboard-info'),
|
|
1880
|
+
__metadata("design:type", Object)
|
|
1881
|
+
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1748
1882
|
__decorate([
|
|
1749
1883
|
Input('data'),
|
|
1750
1884
|
__metadata("design:type", Object)
|
|
@@ -1769,6 +1903,10 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1769
1903
|
Input('grid-cell-height'),
|
|
1770
1904
|
__metadata("design:type", Number)
|
|
1771
1905
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1906
|
+
__decorate([
|
|
1907
|
+
Input('bulk-action-data'),
|
|
1908
|
+
__metadata("design:type", Object)
|
|
1909
|
+
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1772
1910
|
__decorate([
|
|
1773
1911
|
Output(),
|
|
1774
1912
|
__metadata("design:type", Object)
|
|
@@ -1777,6 +1915,14 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1777
1915
|
Output(),
|
|
1778
1916
|
__metadata("design:type", Object)
|
|
1779
1917
|
], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
|
|
1918
|
+
__decorate([
|
|
1919
|
+
Output(),
|
|
1920
|
+
__metadata("design:type", Object)
|
|
1921
|
+
], RAWidgetContainer.prototype, "dataLoaded", void 0);
|
|
1922
|
+
__decorate([
|
|
1923
|
+
Output(),
|
|
1924
|
+
__metadata("design:type", Object)
|
|
1925
|
+
], RAWidgetContainer.prototype, "widgetLoaded", void 0);
|
|
1780
1926
|
__decorate([
|
|
1781
1927
|
Input('dom-resized'),
|
|
1782
1928
|
__metadata("design:type", Boolean),
|
|
@@ -4775,11 +4921,13 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
|
|
|
4775
4921
|
function RaBaseDashboardTemplate(ngZone) {
|
|
4776
4922
|
var _this = this;
|
|
4777
4923
|
this.ngZone = ngZone;
|
|
4778
|
-
this.initialize = function (eventBus, userDashboardId, appConfig) {
|
|
4924
|
+
this.initialize = function (eventBus, userDashboardId, appConfig, dashboardInfo, templateConfig) {
|
|
4779
4925
|
_this.ngZone.run(function () {
|
|
4780
4926
|
_this.userDashboardId = userDashboardId;
|
|
4781
4927
|
_this.appConfig = appConfig;
|
|
4782
4928
|
_this.raDashboardEventBus = eventBus;
|
|
4929
|
+
_this.dashboardInfo = dashboardInfo;
|
|
4930
|
+
_this.templateConfig = templateConfig;
|
|
4783
4931
|
});
|
|
4784
4932
|
_this.init();
|
|
4785
4933
|
};
|