@dative-gpi/foundation-core-domain 1.0.37 → 1.0.39
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.
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { CreateDashboardVariableValueDTO } from "../dashboardVariableValues";
|
|
2
|
-
|
|
3
1
|
export interface CreateDashboardShallowVariableDTO {
|
|
4
2
|
hiddenCode: string;
|
|
5
|
-
|
|
6
|
-
useOnlyAllowedValues: boolean;
|
|
7
|
-
allowedValues: CreateDashboardVariableValueDTO[];
|
|
3
|
+
value: string;
|
|
8
4
|
}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import type { DashboardVariableValueDTO } from "../dashboardVariableValues";
|
|
2
|
-
import { DashboardVariableValue } from "../dashboardVariableValues";
|
|
3
|
-
|
|
4
1
|
export class DashboardShallowVariableInfos {
|
|
5
2
|
hiddenCode: string;
|
|
6
|
-
|
|
7
|
-
useOnlyAllowedValues: boolean;
|
|
8
|
-
allowedValues: DashboardVariableValue[];
|
|
3
|
+
value: string;
|
|
9
4
|
|
|
10
5
|
constructor(params: DashboardShallowVariableInfosDTO) {
|
|
11
6
|
this.hiddenCode = params.hiddenCode;
|
|
12
|
-
this.
|
|
13
|
-
this.useOnlyAllowedValues = params.useOnlyAllowedValues;
|
|
14
|
-
this.allowedValues = params.allowedValues.map(dto => new DashboardVariableValue(dto));
|
|
7
|
+
this.value = params.value;
|
|
15
8
|
}
|
|
16
9
|
}
|
|
17
10
|
|
|
18
11
|
export interface DashboardShallowVariableInfosDTO {
|
|
19
12
|
hiddenCode: string;
|
|
20
|
-
|
|
21
|
-
useOnlyAllowedValues: boolean;
|
|
22
|
-
allowedValues: DashboardVariableValueDTO[];
|
|
13
|
+
value: string;
|
|
23
14
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { translate } from "@dative-gpi/foundation-shared-services/tools";
|
|
2
|
+
|
|
1
3
|
import type { CreateDashboardShallowEntityPresetDTO, DashboardShallowEntityPresetInfosDTO } from "../dashboardShallowEntityPresets";
|
|
2
4
|
import { DashboardShallowEntityPresetInfos } from "../dashboardShallowEntityPresets";
|
|
3
5
|
import type { CreateDashboardShallowDatePresetDTO, DashboardShallowDatePresetInfosDTO } from "../dashboardShallowDatePresets";
|
|
@@ -19,43 +21,86 @@ import { WidgetInfos } from "../widgets/widgetInfos";
|
|
|
19
21
|
import type { PathCrumbDTO } from "../shared/pathCrumb";
|
|
20
22
|
import { PathCrumb } from "../shared/pathCrumb";
|
|
21
23
|
|
|
24
|
+
|
|
22
25
|
export class DashboardShallowDetails extends DashboardShallowInfos {
|
|
23
26
|
labelDefault: string;
|
|
27
|
+
translations: DashboardTranslation[];
|
|
24
28
|
path: PathCrumb[];
|
|
29
|
+
widgets: WidgetInfos[];
|
|
30
|
+
|
|
31
|
+
// @ts-expect-error ts(2611)
|
|
32
|
+
get label() {
|
|
33
|
+
return translate(this.translations, t => t.label, this.labelDefault);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
defaultEntityPresetCode: string | null;
|
|
37
|
+
defaultDatePresetCode: string | null;
|
|
38
|
+
defaultVariableCode: string | null;
|
|
39
|
+
defaultDatePresets: DashboardDatePresetInfos[];
|
|
40
|
+
defaultEntityPresets: DashboardEntityPresetInfos[];
|
|
41
|
+
defaultVariables: DashboardVariableInfos[];
|
|
42
|
+
|
|
25
43
|
overrideEntityPresetCode: string | null;
|
|
26
44
|
overrideDatePresetCode: string | null;
|
|
27
45
|
overrideVariableCode: string | null;
|
|
28
46
|
overrideDatePresets: DashboardShallowDatePresetInfos[];
|
|
29
47
|
overrideEntityPresets: DashboardShallowEntityPresetInfos[];
|
|
30
48
|
overrideVariables: DashboardShallowVariableInfos[];
|
|
31
|
-
|
|
32
|
-
entityPresetCode
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
|
|
50
|
+
get entityPresetCode() {
|
|
51
|
+
return this.overrideEntityPresetCode ?? this.defaultEntityPresetCode;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get datePresetCode() {
|
|
55
|
+
return this.overrideDatePresetCode ?? this.defaultDatePresetCode;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get variableCode() {
|
|
59
|
+
return this.overrideVariableCode ?? this.defaultVariableCode;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get datePresets() : DashboardDatePresetInfos[] {
|
|
63
|
+
return this.defaultDatePresets.map(d => {
|
|
64
|
+
const override = this.overrideDatePresets.find(od => od.hiddenCode === d.hiddenCode);
|
|
65
|
+
return override ? new DashboardDatePresetInfos({ ...d, ...override }) : d;
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get entityPresets() {
|
|
70
|
+
return this.defaultEntityPresets.map(d => {
|
|
71
|
+
const override = this.overrideEntityPresets.find(od => od.hiddenCode === d.hiddenCode);
|
|
72
|
+
return override ? new DashboardEntityPresetInfos({ ...d, ...override }) : d;
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get variables() {
|
|
77
|
+
return this.defaultVariables.map(d => {
|
|
78
|
+
const override = this.overrideVariables.find(od => od.hiddenCode === d.hiddenCode);
|
|
79
|
+
return override ? new DashboardVariableInfos({ ...d, ...override }) : d;
|
|
80
|
+
})
|
|
81
|
+
}
|
|
39
82
|
|
|
40
83
|
constructor(params: DashboardShallowDetailsDTO) {
|
|
41
84
|
super(params);
|
|
42
|
-
|
|
85
|
+
|
|
43
86
|
this.labelDefault = params.labelDefault;
|
|
44
87
|
this.path = params.path.map(dto => new PathCrumb(dto)).sort((a, b) => b.index - a.index);
|
|
88
|
+
this.translations = params.translations.map(t => new DashboardTranslation(t));
|
|
89
|
+
this.widgets = params.widgets.map(dto => new WidgetInfos(dto));
|
|
90
|
+
|
|
45
91
|
this.overrideEntityPresetCode = params.overrideEntityPresetCode;
|
|
46
92
|
this.overrideDatePresetCode = params.overrideDatePresetCode;
|
|
47
93
|
this.overrideVariableCode = params.overrideVariableCode;
|
|
48
94
|
this.overrideDatePresets = params.overrideDatePresets.map(dto => new DashboardShallowDatePresetInfos(dto));
|
|
49
95
|
this.overrideEntityPresets = params.overrideEntityPresets.map(dto => new DashboardShallowEntityPresetInfos(dto));
|
|
50
96
|
this.overrideVariables = params.overrideVariables.map(dto => new DashboardShallowVariableInfos(dto));
|
|
51
|
-
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
this.widgets = params.widgets.map(dto => new WidgetInfos(dto));
|
|
97
|
+
|
|
98
|
+
this.defaultEntityPresetCode = params.defaultEntityPresetCode;
|
|
99
|
+
this.defaultDatePresetCode = params.defaultDatePresetCode;
|
|
100
|
+
this.defaultVariableCode = params.defaultVariableCode;
|
|
101
|
+
this.defaultDatePresets = params.defaultDatePresets.map(dto => new DashboardDatePresetInfos(dto));
|
|
102
|
+
this.defaultEntityPresets = params.defaultEntityPresets.map(dto => new DashboardEntityPresetInfos(dto));
|
|
103
|
+
this.defaultVariables = params.defaultVariables.map(dto => new DashboardVariableInfos(dto));
|
|
59
104
|
}
|
|
60
105
|
}
|
|
61
106
|
|
|
@@ -71,12 +116,12 @@ export interface DashboardShallowDetailsDTO extends DashboardShallowInfosDTO {
|
|
|
71
116
|
translations: DashboardTranslationDTO[];
|
|
72
117
|
dashboardId: string;
|
|
73
118
|
scope: number;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
119
|
+
defaultEntityPresetCode: string | null;
|
|
120
|
+
defaultDatePresetCode: string | null;
|
|
121
|
+
defaultVariableCode: string | null;
|
|
122
|
+
defaultDatePresets: DashboardDatePresetInfosDTO[];
|
|
123
|
+
defaultEntityPresets: DashboardEntityPresetInfosDTO[];
|
|
124
|
+
defaultVariables: DashboardVariableInfosDTO[];
|
|
80
125
|
widgets: WidgetInfosDTO[];
|
|
81
126
|
}
|
|
82
127
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-domain",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.39",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.39",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.39"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "247b9b16217be308d34982b2a44971c138317f06"
|
|
17
17
|
}
|