@esfaenza/dashboard-feature 15.2.11 → 15.2.13
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/README.md +24 -24
- package/esm2020/lib/components/dashboard/dashboard.component.mjs +3 -3
- package/esm2020/lib/components/widgets/BaseWidgetComponent.mjs +7 -4
- package/esm2020/lib/components/widgets/chart/jace-dsh-chart.component.mjs +2 -2
- package/esm2020/lib/components/widgets/counter/jace-dsh-counter.component.mjs +4 -4
- package/esm2020/lib/components/widgets/list/jace-dsh-list.component.mjs +2 -2
- package/esm2020/lib/components/widgets/multiprog/jace-dsh-multiprog.component.mjs +2 -2
- package/esm2020/lib/dashboard-feature.module.mjs +3 -3
- package/esm2020/lib/services/DashboardWidgetFactory.mjs +2 -2
- package/esm2020/lib/services/IDashboardFeatureDataService.mjs +1 -1
- package/esm2020/lib/services/dashboard-feature.service.mjs +21 -1
- package/esm2020/lib/tokens.mjs +8 -0
- package/esm2020/public-api.mjs +2 -2
- package/fesm2015/esfaenza-dashboard-feature.mjs +31 -9
- package/fesm2015/esfaenza-dashboard-feature.mjs.map +1 -1
- package/fesm2020/esfaenza-dashboard-feature.mjs +31 -9
- package/fesm2020/esfaenza-dashboard-feature.mjs.map +1 -1
- package/lib/components/widgets/BaseWidgetComponent.d.ts +6 -3
- package/lib/services/DashboardWidgetFactory.d.ts +1 -1
- package/lib/services/IDashboardFeatureDataService.d.ts +20 -0
- package/lib/services/dashboard-feature.service.d.ts +20 -0
- package/lib/{public-injection-tokens.d.ts → tokens.d.ts} +2 -0
- package/package.json +6 -12
- package/public-api.d.ts +1 -1
- package/esm2020/lib/private-injection-tokens.mjs +0 -3
- package/esm2020/lib/public-injection-tokens.mjs +0 -7
- package/lib/private-injection-tokens.d.ts +0 -3
|
@@ -28,8 +28,7 @@ import { AppSearch } from '@esfaenza/es-table';
|
|
|
28
28
|
* Token di registrazione della DashboardFeatureService.
|
|
29
29
|
* Permette di fare l'override dell'implementazione di default a scopo di test delle widget
|
|
30
30
|
*/
|
|
31
|
-
const DSH_DATA_SERVICE = new InjectionToken('DSH_DATA_SERVICE');
|
|
32
|
-
|
|
31
|
+
const DSH_DATA_SERVICE = new InjectionToken('DSH_DATA_SERVICE');
|
|
33
32
|
const DSH_OPTIONS = new InjectionToken('DSH_MODULE_OPTIONS');
|
|
34
33
|
|
|
35
34
|
class JaceChartWidgetComponent {
|
|
@@ -116,7 +115,7 @@ class JaceCounterWidgetComponent {
|
|
|
116
115
|
this.dataReady = false;
|
|
117
116
|
this.lastdate = "";
|
|
118
117
|
}
|
|
119
|
-
//TODO per online update: importare cdr: ChangeDectectorRef
|
|
118
|
+
//TODO per online update: importare cdr: ChangeDectectorRef
|
|
120
119
|
setWidgetModel(dshBackendId, widgetModel) {
|
|
121
120
|
this.model = widgetModel;
|
|
122
121
|
if (this.model.backendid === undefined || this.model.backendid == "default_backend")
|
|
@@ -153,7 +152,7 @@ class JaceCounterWidgetComponent {
|
|
|
153
152
|
if (this.model) {
|
|
154
153
|
this.model.setData(data);
|
|
155
154
|
this.dataReady = true;
|
|
156
|
-
//TODO per online update: this.cdr.markForCheck();
|
|
155
|
+
//TODO per online update: this.cdr.markForCheck();
|
|
157
156
|
}
|
|
158
157
|
});
|
|
159
158
|
}
|
|
@@ -521,7 +520,7 @@ class DashboardWidgetFactory {
|
|
|
521
520
|
}
|
|
522
521
|
}
|
|
523
522
|
/**
|
|
524
|
-
* Versione
|
|
523
|
+
* Versione ng13+ della creazione dei componenti dinamici delle widget
|
|
525
524
|
* @param type
|
|
526
525
|
* @param vcr
|
|
527
526
|
* @returns
|
|
@@ -617,7 +616,7 @@ class DashboardComponent {
|
|
|
617
616
|
ngOnChanges(changes) {
|
|
618
617
|
//occhio: arriva prima di ngAfterViewInit
|
|
619
618
|
if (changes.Configuration) {
|
|
620
|
-
//appena ho configuration
|
|
619
|
+
//appena ho configuration
|
|
621
620
|
console.log(changes.Configuration);
|
|
622
621
|
// la prima volta l'ho già fatta alla creazione del componente
|
|
623
622
|
if (!changes.Configuration.firstChange) {
|
|
@@ -727,6 +726,14 @@ class DashboardFeatureAPIDataService {
|
|
|
727
726
|
constructor(http) {
|
|
728
727
|
this.http = http;
|
|
729
728
|
}
|
|
729
|
+
/**
|
|
730
|
+
* Recupera la dashboard specificata dal backend specificato per l'account specificato.
|
|
731
|
+
* Usata dal component DashboardComponent
|
|
732
|
+
* @param backendid id del backend che pubblica questa dashboard
|
|
733
|
+
* @param idaccount idaccount dell'utente che sta visitando questa dashboard
|
|
734
|
+
* @param dashboardName identificativo della dashboard da recuperare
|
|
735
|
+
* @returns JaceDashboardLayoutDetail layout della dashboard
|
|
736
|
+
*/
|
|
730
737
|
GetUserDashboard(backendid, idaccount, dashboardName) {
|
|
731
738
|
let params = new HttpParams();
|
|
732
739
|
params = params.append("backendid", backendid.toString());
|
|
@@ -734,9 +741,21 @@ class DashboardFeatureAPIDataService {
|
|
|
734
741
|
params = params.append("name", dashboardName);
|
|
735
742
|
return this.http.get(Repository["GET_Dashboard_GetLayout"], params);
|
|
736
743
|
}
|
|
744
|
+
/**
|
|
745
|
+
*Salva le impostazioni della dashboard (es. preferenze specifiche dell'utente)
|
|
746
|
+
* @param dto dati di salvataggio
|
|
747
|
+
* @returns CallResult
|
|
748
|
+
*/
|
|
737
749
|
SaveUserDashboard(dto) {
|
|
738
750
|
return this.http.post(Repository["POST_Dashboard_SaveLayout"], dto);
|
|
739
751
|
}
|
|
752
|
+
/**
|
|
753
|
+
* Recupera i dati di una specifica Widget. Chiamato dal metodo refreshData() di BaseWidgetComponent.
|
|
754
|
+
* @param backendid id del backend che pubblica i dati di questa Widget
|
|
755
|
+
* @param name nome univoco di questa Widget
|
|
756
|
+
* @param options dizionario di configurazioni impostate sulla specifica Widget (aka configurazioni particolari)
|
|
757
|
+
* @returns Un oggetto any con i dati della Widget (Nota: ogni Widget è responsabile di interpretare i propri dati)
|
|
758
|
+
*/
|
|
740
759
|
GetWidgetData(backendid, name, options) {
|
|
741
760
|
let params = new HttpParams();
|
|
742
761
|
params = params.append("backendid", backendid.toString());
|
|
@@ -917,6 +936,9 @@ class BaseWidgetComponent {
|
|
|
917
936
|
this.refreshData();
|
|
918
937
|
}
|
|
919
938
|
ngOnInit() { }
|
|
939
|
+
/**
|
|
940
|
+
* Ascolta i cambiamenti sull'input DashboardDate e, se è cambiata, lancia refreshData()
|
|
941
|
+
*/
|
|
920
942
|
ngOnChanges(changes) {
|
|
921
943
|
//console.log(changes['DashboardDate'].currentValue);
|
|
922
944
|
if (changes['DashboardDate'].previousValue)
|
|
@@ -931,8 +953,8 @@ class BaseWidgetComponent {
|
|
|
931
953
|
}
|
|
932
954
|
}
|
|
933
955
|
/**
|
|
934
|
-
* Prepara i parametri e lancia la chiamata GetWidgetData della DashboardFeatureService.
|
|
935
|
-
* Imposta il model con i dati restituiti (setData)
|
|
956
|
+
* Prepara i parametri e lancia la chiamata GetWidgetData della service DashboardFeatureService.
|
|
957
|
+
* Imposta il model con i dati restituiti (setData) ed imposta il campo dataReady del component a true
|
|
936
958
|
*/
|
|
937
959
|
refreshData() {
|
|
938
960
|
if (!this.model)
|
|
@@ -998,5 +1020,5 @@ var JaceWidgetTypes;
|
|
|
998
1020
|
* Generated bundle index. Do not edit.
|
|
999
1021
|
*/
|
|
1000
1022
|
|
|
1001
|
-
export { BaseJaceWidgetModel, BaseWidgetComponent, DSH_DATA_SERVICE, DashboardComponent, DashboardFeatureAPIDataService, DashboardFeatureModule, DashboardWidgetFactory, DefaultDashboardModuleOptions, JaceChartWidgetComponent, JaceCounterWidgetComponent, JaceDashboardConfig, JaceDashboardLayoutAppSearch, JaceDashboardLayoutDetail, JaceListWidgetComponent, JaceMultiprogWidgetComponent, JaceWidgetInstanceDetail, JaceWidgetTypes, SaveJaceDashboardLayoutDTO };
|
|
1023
|
+
export { BaseJaceWidgetModel, BaseWidgetComponent, DSH_DATA_SERVICE, DSH_OPTIONS, DashboardComponent, DashboardFeatureAPIDataService, DashboardFeatureModule, DashboardWidgetFactory, DefaultDashboardModuleOptions, JaceChartWidgetComponent, JaceCounterWidgetComponent, JaceDashboardConfig, JaceDashboardLayoutAppSearch, JaceDashboardLayoutDetail, JaceListWidgetComponent, JaceMultiprogWidgetComponent, JaceWidgetInstanceDetail, JaceWidgetTypes, SaveJaceDashboardLayoutDTO };
|
|
1002
1024
|
//# sourceMappingURL=esfaenza-dashboard-feature.mjs.map
|