@dative-gpi/foundation-core-domain 1.0.66 → 1.0.67-map-carousel
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/models/actions/actionInfos.ts +3 -0
- package/models/alerts/alertDetails.ts +0 -7
- package/models/alerts/alertInfos.ts +26 -8
- package/models/alerts/alertState.ts +9 -6
- package/models/chartCategories/chartCategoryDetails.ts +2 -0
- package/models/chartCategories/chartCategoryInfos.ts +3 -0
- package/models/chartOrganisationTypes/chartOrganisationTypeDetails.ts +17 -4
- package/models/chartOrganisationTypes/chartOrganisationTypeInfos.ts +10 -1
- package/models/chartOrganisations/chartOrganisationDetails.ts +20 -7
- package/models/chartOrganisations/chartOrganisationInfos.ts +10 -1
- package/models/charts/chartAllowedStep.ts +31 -0
- package/models/charts/chartAllowedStepTranslation.ts +19 -0
- package/models/charts/chartDetails.ts +12 -1
- package/models/charts/chartInfos.ts +6 -0
- package/models/charts/chartPreset.ts +4 -0
- package/models/charts/chartTimeRange.ts +3 -1
- package/models/charts/chartTimeStep.ts +0 -4
- package/models/charts/index.ts +2 -0
- package/models/connectivityAlerts/connectivityAlertInfos.ts +6 -0
- package/models/connectivityScenarios/connectivityScenarioDetails.ts +2 -2
- package/models/customProperties/customPropertyInfos.ts +0 -3
- package/models/dashboardDatePresets/dashboardDatePresetDetails.ts +1 -0
- package/models/dashboardDatePresets/dashboardDatePresetInfos.ts +3 -0
- package/models/dashboardEntityPresets/dashboardEntityPresetDetails.ts +1 -0
- package/models/dashboardEntityPresets/dashboardEntityPresetInfos.ts +3 -0
- package/models/dashboardShallowWidgets/dashboardShallowWidgetDetails.ts +4 -0
- package/models/dashboardShallowWidgets/dashboardShallowWidgetInfos.ts +30 -0
- package/models/dashboardShallowWidgets/index.ts +2 -0
- package/models/dashboardShallows/dashboardShallowDetails.ts +37 -61
- package/models/dashboardShallows/dashboardShallowInfos.ts +1 -0
- package/models/dashboardVariables/dashboardVariableDetails.ts +1 -0
- package/models/dashboardVariables/dashboardVariableInfos.ts +3 -0
- package/models/dashboards/dashboardSettings.ts +22 -0
- package/models/dashboards/index.ts +1 -0
- package/models/deviceDataDefinitions/deviceDataDefinitionInfos.ts +39 -0
- package/models/deviceDataDefinitions/index.ts +1 -0
- package/models/deviceExplorerElements/deviceExplorerElementDetails.ts +11 -0
- package/models/deviceExplorerElements/deviceExplorerElementInfos.ts +149 -0
- package/models/deviceExplorerElements/index.ts +2 -0
- package/models/deviceOrganisations/deviceOrganisationAlert.ts +3 -0
- package/models/deviceOrganisations/deviceOrganisationDetails.ts +2 -3
- package/models/deviceOrganisations/deviceOrganisationInfos.ts +26 -12
- package/models/folders/folderInfos.ts +6 -0
- package/models/groups/groupInfos.ts +1 -2
- package/models/index.ts +5 -1
- package/models/locations/locationInfos.ts +3 -0
- package/models/playlists/index.ts +3 -0
- package/models/playlists/playlistDashboard.ts +31 -0
- package/models/playlists/playlistDetails.ts +32 -0
- package/models/playlists/playlistInfos.ts +39 -0
- package/models/roleOrganisations/roleOrganisationDetails.ts +12 -0
- package/models/roles/index.ts +1 -0
- package/models/roles/roleTranslation.ts +17 -0
- package/models/scenarioDeviceOrganisations/scenarioDeviceOrganisationDetails.ts +18 -9
- package/models/scenarioDeviceOrganisations/scenarioDeviceOrganisationInfos.ts +14 -11
- package/models/scenarioOrganisationTypes/scenarioOrganisationTypeDetails.ts +12 -3
- package/models/scenarioOrganisationTypes/scenarioOrganisationTypeInfos.ts +18 -7
- package/models/scenarioOrganisations/scenarioOrganisationDetails.ts +16 -5
- package/models/scenarioOrganisations/scenarioOrganisationInfos.ts +18 -7
- package/models/scenarios/scenarioChart.ts +1 -1
- package/models/scenarios/scenarioParameterOverride.ts +4 -4
- package/models/serviceAccountOrganisations/serviceAccountOrganisationDetails.ts +0 -7
- package/models/serviceAccountOrganisations/serviceAccountOrganisationInfos.ts +6 -0
- package/models/shared/timeRange.ts +5 -1
- package/models/userOrganisationTables/userOrganisationTableInfos.ts +2 -2
- package/models/userOrganisations/userOrganisationDetails.ts +2 -1
- package/models/userOrganisations/userOrganisationInfos.ts +3 -0
- package/models/widgetTemplates/widgetTemplateInfos.ts +10 -0
- package/models/widgets/index.ts +2 -1
- package/models/widgets/widgetDetails.ts +3 -0
- package/models/widgets/widgetInfos.ts +7 -0
- package/models/widgets/widgetInterface.ts +15 -0
- package/package.json +4 -4
- package/models/extensionApplications/extensionApplicationDetails.ts +0 -18
- package/models/extensionApplications/extensionApplicationInfos.ts +0 -18
- package/models/extensionApplications/index.ts +0 -2
|
@@ -8,6 +8,7 @@ export class ChartPreset {
|
|
|
8
8
|
label: string;
|
|
9
9
|
labelDefault: string;
|
|
10
10
|
icon: string;
|
|
11
|
+
index: number;
|
|
11
12
|
translations: ChartPresetTranslation[];
|
|
12
13
|
|
|
13
14
|
constructor(params: ChartPresetDTO) {
|
|
@@ -17,6 +18,7 @@ export class ChartPreset {
|
|
|
17
18
|
this.label = params.label;
|
|
18
19
|
this.labelDefault = params.labelDefault;
|
|
19
20
|
this.icon = params.icon;
|
|
21
|
+
this.index = params.index;
|
|
20
22
|
this.translations = params.translations.map(t => new ChartPresetTranslation(t));
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -28,6 +30,7 @@ export interface ChartPresetDTO {
|
|
|
28
30
|
label: string;
|
|
29
31
|
labelDefault: string;
|
|
30
32
|
icon: string;
|
|
33
|
+
index: number;
|
|
31
34
|
translations: ChartPresetTranslationDTO[];
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -36,5 +39,6 @@ export interface CreateChartPresetDTO {
|
|
|
36
39
|
hiddenCode: string;
|
|
37
40
|
labelDefault: string;
|
|
38
41
|
icon: string;
|
|
42
|
+
index: number;
|
|
39
43
|
translations: ChartPresetTranslationDTO[];
|
|
40
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
1
|
+
import type { DateType, Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
2
2
|
|
|
3
3
|
import type { ChartTimeRangeTranslationDTO, CreateChartTimeRangeTranslationDTO } from "./chartTimeRangeTranslation";
|
|
4
4
|
import { ChartTimeRangeTranslation } from "./chartTimeRangeTranslation";
|
|
@@ -29,6 +29,7 @@ export interface ChartTimeRangeDTO {
|
|
|
29
29
|
endDay: number;
|
|
30
30
|
endHour: number;
|
|
31
31
|
endMinute: number;
|
|
32
|
+
variant: DateType;
|
|
32
33
|
color: string;
|
|
33
34
|
opacity: number;
|
|
34
35
|
label: string;
|
|
@@ -43,6 +44,7 @@ export interface CreateChartTimeRangeDTO {
|
|
|
43
44
|
endDay: Days;
|
|
44
45
|
endHour: number;
|
|
45
46
|
endMinute: number;
|
|
47
|
+
variant: DateType;
|
|
46
48
|
color: string;
|
|
47
49
|
opacity: number;
|
|
48
50
|
labelDefault: string;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import type { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums";
|
|
2
2
|
|
|
3
3
|
export class ChartTimeStep {
|
|
4
|
-
use: boolean;
|
|
5
4
|
value: number;
|
|
6
5
|
unit: TimeUnit;
|
|
7
6
|
|
|
8
7
|
constructor(params: ChartTimeStepDTO) {
|
|
9
|
-
this.use = params.use;
|
|
10
8
|
this.value = params.value;
|
|
11
9
|
this.unit = params.unit as TimeUnit;
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
export interface ChartTimeStepDTO {
|
|
16
|
-
use: boolean;
|
|
17
14
|
value: number;
|
|
18
15
|
unit: number;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
export interface CreateChartTimeStepDTO {
|
|
22
|
-
use: boolean;
|
|
23
19
|
value: number;
|
|
24
20
|
unit: TimeUnit;
|
|
25
21
|
}
|
package/models/charts/index.ts
CHANGED
|
@@ -13,6 +13,8 @@ export class ConnectivityAlertInfos {
|
|
|
13
13
|
deviceOrganisationLabel: string;
|
|
14
14
|
deviceOrganisationImageId: string | null;
|
|
15
15
|
deviceOrganisationConnectivity: DeviceConnectivityInfos | null;
|
|
16
|
+
time: number;
|
|
17
|
+
lastMessageProcessedTimestamp: number;
|
|
16
18
|
triggerProcessedTimestamp: number;
|
|
17
19
|
resolveProcessedTimestamp: number | null;
|
|
18
20
|
status: AlertStatus;
|
|
@@ -27,6 +29,8 @@ export class ConnectivityAlertInfos {
|
|
|
27
29
|
this.deviceOrganisationImageId = params.deviceOrganisationImageId;
|
|
28
30
|
this.deviceOrganisationConnectivity = params.deviceOrganisationConnectivity ?
|
|
29
31
|
new DeviceConnectivityInfos({ ...params.deviceOrganisationConnectivity, id: params.deviceOrganisationId }) : null;
|
|
32
|
+
this.time = params.time;
|
|
33
|
+
this.lastMessageProcessedTimestamp = isoToEpoch(params.lastMessageProcessedTimestamp);
|
|
30
34
|
this.triggerProcessedTimestamp = isoToEpoch(params.triggerProcessedTimestamp);
|
|
31
35
|
this.resolveProcessedTimestamp = params.resolveProcessedTimestamp ?
|
|
32
36
|
isoToEpoch(params.resolveProcessedTimestamp) : null;
|
|
@@ -43,6 +47,8 @@ export interface ConnectivityAlertInfosDTO {
|
|
|
43
47
|
deviceOrganisationLabel: string;
|
|
44
48
|
deviceOrganisationImageId: string | null;
|
|
45
49
|
deviceOrganisationConnectivity: DeviceConnectivityInfosDTO | null;
|
|
50
|
+
time: number;
|
|
51
|
+
lastMessageProcessedTimestamp: string;
|
|
46
52
|
triggerProcessedTimestamp: string;
|
|
47
53
|
resolveProcessedTimestamp: string | null;
|
|
48
54
|
status: AlertStatus;
|
|
@@ -11,8 +11,8 @@ export class ConnectivityScenarioDetails extends ConnectivityScenarioInfos {
|
|
|
11
11
|
export interface ConnectivityScenarioDetailsDTO extends ConnectivityScenarioInfosDTO {
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export interface
|
|
15
|
-
|
|
14
|
+
export interface UpsertConnectivityScenarioDTO {
|
|
15
|
+
deviceOrganisationsIds: string[];
|
|
16
16
|
time: number;
|
|
17
17
|
warnDeviceManager: boolean;
|
|
18
18
|
warnOnReconnection: boolean;
|
|
@@ -10,7 +10,6 @@ export class CustomPropertyInfos {
|
|
|
10
10
|
index: number;
|
|
11
11
|
entity: PropertyEntity;
|
|
12
12
|
dataType: PropertyDataType;
|
|
13
|
-
addInInfos: boolean;
|
|
14
13
|
readOnlyCore: boolean;
|
|
15
14
|
readOnlyAdmin: boolean;
|
|
16
15
|
defaultValue: string;
|
|
@@ -29,7 +28,6 @@ export class CustomPropertyInfos {
|
|
|
29
28
|
this.index = params.index;
|
|
30
29
|
this.entity = params.entity;
|
|
31
30
|
this.dataType = params.dataType;
|
|
32
|
-
this.addInInfos = params.addInInfos;
|
|
33
31
|
this.readOnlyCore = params.readOnlyCore;
|
|
34
32
|
this.readOnlyAdmin = params.readOnlyAdmin;
|
|
35
33
|
this.defaultValue = params.defaultValue;
|
|
@@ -50,7 +48,6 @@ export class CustomPropertyInfos {
|
|
|
50
48
|
index: number;
|
|
51
49
|
entity: number;
|
|
52
50
|
dataType: number;
|
|
53
|
-
addInInfos: boolean;
|
|
54
51
|
readOnlyCore: boolean;
|
|
55
52
|
readOnlyAdmin: boolean;
|
|
56
53
|
defaultValue: string;
|
|
@@ -5,6 +5,7 @@ import type { DashboardDatePresetTranslationDTO } from "./dashboardDatePresetTra
|
|
|
5
5
|
export interface CreateDashboardDatePresetDTO {
|
|
6
6
|
hiddenCode: string;
|
|
7
7
|
labelDefault: string;
|
|
8
|
+
showInOptions: boolean;
|
|
8
9
|
startDate: string;
|
|
9
10
|
endDate: string;
|
|
10
11
|
useAutoRefresh: boolean;
|
|
@@ -7,6 +7,7 @@ import { DashboardDatePresetTranslation } from "./dashboardDatePresetTranslation
|
|
|
7
7
|
export class DashboardDatePresetInfos {
|
|
8
8
|
hiddenCode: string;
|
|
9
9
|
labelDefault: string;
|
|
10
|
+
showInOptions: boolean;
|
|
10
11
|
startDate: string;
|
|
11
12
|
endDate: string;
|
|
12
13
|
useAutoRefresh: boolean;
|
|
@@ -20,6 +21,7 @@ export class DashboardDatePresetInfos {
|
|
|
20
21
|
constructor(params: DashboardDatePresetInfosDTO) {
|
|
21
22
|
this.hiddenCode = params.hiddenCode;
|
|
22
23
|
this.labelDefault = params.labelDefault;
|
|
24
|
+
this.showInOptions = params.showInOptions;
|
|
23
25
|
this.startDate = params.startDate;
|
|
24
26
|
this.endDate = params.endDate;
|
|
25
27
|
this.useAutoRefresh = params.useAutoRefresh;
|
|
@@ -31,6 +33,7 @@ export class DashboardDatePresetInfos {
|
|
|
31
33
|
export interface DashboardDatePresetInfosDTO {
|
|
32
34
|
hiddenCode: string;
|
|
33
35
|
labelDefault: string;
|
|
36
|
+
showInOptions: boolean;
|
|
34
37
|
startDate: string;
|
|
35
38
|
endDate: string;
|
|
36
39
|
useAutoRefresh: boolean;
|
|
@@ -4,6 +4,7 @@ import type { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
|
4
4
|
export interface CreateDashboardEntityPresetDTO {
|
|
5
5
|
hiddenCode: string;
|
|
6
6
|
labelDefault: string;
|
|
7
|
+
showInOptions: boolean;
|
|
7
8
|
singleEntity: boolean;
|
|
8
9
|
entityType: EntityType;
|
|
9
10
|
entitiesFilters: string;
|
|
@@ -7,6 +7,7 @@ import type { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
|
7
7
|
export class DashboardEntityPresetInfos {
|
|
8
8
|
hiddenCode: string;
|
|
9
9
|
labelDefault: string;
|
|
10
|
+
showInOptions: boolean;
|
|
10
11
|
singleEntity: boolean;
|
|
11
12
|
entityType: EntityType;
|
|
12
13
|
entitiesFilters: string;
|
|
@@ -20,6 +21,7 @@ export class DashboardEntityPresetInfos {
|
|
|
20
21
|
constructor(params: DashboardEntityPresetInfosDTO) {
|
|
21
22
|
this.hiddenCode = params.hiddenCode;
|
|
22
23
|
this.labelDefault = params.labelDefault;
|
|
24
|
+
this.showInOptions = params.showInOptions;
|
|
23
25
|
this.singleEntity = params.singleEntity;
|
|
24
26
|
this.entityType = params.entityType;
|
|
25
27
|
this.entitiesFilters = params.entitiesFilters;
|
|
@@ -31,6 +33,7 @@ export class DashboardEntityPresetInfos {
|
|
|
31
33
|
export interface DashboardEntityPresetInfosDTO {
|
|
32
34
|
hiddenCode: string;
|
|
33
35
|
labelDefault: string;
|
|
36
|
+
showInOptions: boolean;
|
|
34
37
|
singleEntity: boolean;
|
|
35
38
|
entityType: EntityType;
|
|
36
39
|
entitiesFilters: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
|
|
3
|
+
const clean = <T>(meta: T): T => {
|
|
4
|
+
const newMeta = _.cloneDeepWith(meta, (value) => {
|
|
5
|
+
if (typeof value === "string") {
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(value as string);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return value
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return newMeta;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class DashboardShallowWidgetInfos {
|
|
18
|
+
hiddenCode: string;
|
|
19
|
+
meta: { [key: string]: string };
|
|
20
|
+
|
|
21
|
+
constructor(params: DashboardShallowWidgetInfosDTO) {
|
|
22
|
+
this.hiddenCode = params.hiddenCode;
|
|
23
|
+
this.meta = clean(params.meta);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DashboardShallowWidgetInfosDTO {
|
|
28
|
+
hiddenCode: string;
|
|
29
|
+
meta: { [key: string]: string };
|
|
30
|
+
}
|
|
@@ -1,77 +1,59 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
3
|
-
import type
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import type
|
|
8
|
-
import {
|
|
9
|
-
import type
|
|
10
|
-
import {
|
|
11
|
-
import type
|
|
12
|
-
import { DashboardVariableInfos } from "../dashboardVariables";
|
|
13
|
-
import type { DashboardShallowInfosDTO } from "./dashboardShallowInfos";
|
|
14
|
-
import { DashboardShallowInfos } from "./dashboardShallowInfos";
|
|
15
|
-
import type { DashboardTranslationDTO } from "../dashboards";
|
|
16
|
-
import { DashboardTranslation } from "../dashboards";
|
|
17
|
-
import type { WidgetInfosDTO } from "../widgets/widgetInfos";
|
|
18
|
-
import { WidgetInfos } from "../widgets/widgetInfos";
|
|
19
|
-
import type { PathCrumbDTO } from "../shared/pathCrumb";
|
|
20
|
-
import { PathCrumb } from "../shared/pathCrumb";
|
|
21
|
-
|
|
1
|
+
import { type CreateDashboardShallowEntityPresetDTO, DashboardShallowEntityPresetInfos, type DashboardShallowEntityPresetInfosDTO } from "../dashboardShallowEntityPresets";
|
|
2
|
+
import { type CreateDashboardShallowDatePresetDTO, DashboardShallowDatePresetInfos, type DashboardShallowDatePresetInfosDTO } from "../dashboardShallowDatePresets";
|
|
3
|
+
import { type CreateDashboardShallowVariableDTO, DashboardShallowVariableInfos, type DashboardShallowVariableInfosDTO } from "../dashboardShallowVariables";
|
|
4
|
+
import { type CreateDashboardShallowWidgetDTO, DashboardShallowWidgetInfos, type DashboardShallowWidgetInfosDTO } from "../dashboardShallowWidgets";
|
|
5
|
+
import { DashboardEntityPresetInfos, type DashboardEntityPresetInfosDTO } from "../dashboardEntityPresets";
|
|
6
|
+
import { DashboardDatePresetInfos, type DashboardDatePresetInfosDTO } from "../dashboardDatePresets";
|
|
7
|
+
import { DashboardVariableInfos, type DashboardVariableInfosDTO } from "../dashboardVariables";
|
|
8
|
+
import { DashboardShallowInfos, type DashboardShallowInfosDTO } from "./dashboardShallowInfos";
|
|
9
|
+
import { DashboardTranslation, type DashboardTranslationDTO } from "../dashboards";
|
|
10
|
+
import { WidgetInfos, type WidgetInfosDTO } from "../widgets/widgetInfos";
|
|
11
|
+
import { PathCrumb, type PathCrumbDTO } from "../shared/pathCrumb";
|
|
22
12
|
|
|
23
13
|
export class DashboardShallowDetails extends DashboardShallowInfos {
|
|
24
14
|
labelDefault: string;
|
|
25
15
|
translations: DashboardTranslation[];
|
|
26
16
|
path: PathCrumb[];
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
defaultDatePresetCode: string | null;
|
|
32
|
-
defaultVariableCode: string | null;
|
|
18
|
+
entityPresetCode: string | null;
|
|
19
|
+
datePresetCode: string | null;
|
|
20
|
+
variableCode: string | null;
|
|
33
21
|
defaultDatePresets: DashboardDatePresetInfos[];
|
|
34
22
|
defaultEntityPresets: DashboardEntityPresetInfos[];
|
|
35
23
|
defaultVariables: DashboardVariableInfos[];
|
|
24
|
+
defaultWidgets: WidgetInfos[];
|
|
36
25
|
|
|
37
|
-
overrideEntityPresetCode: string | null;
|
|
38
|
-
overrideDatePresetCode: string | null;
|
|
39
|
-
overrideVariableCode: string | null;
|
|
40
26
|
overrideDatePresets: DashboardShallowDatePresetInfos[];
|
|
41
27
|
overrideEntityPresets: DashboardShallowEntityPresetInfos[];
|
|
42
28
|
overrideVariables: DashboardShallowVariableInfos[];
|
|
43
|
-
|
|
44
|
-
get entityPresetCode() {
|
|
45
|
-
return this.overrideEntityPresetCode ?? this.defaultEntityPresetCode;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get datePresetCode() {
|
|
49
|
-
return this.overrideDatePresetCode ?? this.defaultDatePresetCode;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get variableCode() {
|
|
53
|
-
return this.overrideVariableCode ?? this.defaultVariableCode;
|
|
54
|
-
}
|
|
29
|
+
overrideWidgets: DashboardShallowWidgetInfos[];
|
|
55
30
|
|
|
56
31
|
get datePresets() : DashboardDatePresetInfos[] {
|
|
57
32
|
return this.defaultDatePresets.map(d => {
|
|
58
33
|
const override = this.overrideDatePresets.find(od => od.hiddenCode === d.hiddenCode);
|
|
59
34
|
return override ? new DashboardDatePresetInfos({ ...d, ...override }) : d;
|
|
60
|
-
})
|
|
35
|
+
});
|
|
61
36
|
}
|
|
62
37
|
|
|
63
38
|
get entityPresets() {
|
|
64
39
|
return this.defaultEntityPresets.map(d => {
|
|
65
40
|
const override = this.overrideEntityPresets.find(od => od.hiddenCode === d.hiddenCode);
|
|
66
41
|
return override ? new DashboardEntityPresetInfos({ ...d, ...override }) : d;
|
|
67
|
-
})
|
|
42
|
+
});
|
|
68
43
|
}
|
|
69
44
|
|
|
70
45
|
get variables() {
|
|
71
46
|
return this.defaultVariables.map(d => {
|
|
72
47
|
const override = this.overrideVariables.find(od => od.hiddenCode === d.hiddenCode);
|
|
73
48
|
return override ? new DashboardVariableInfos({ ...d, ...override }) : d;
|
|
74
|
-
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get widgets() {
|
|
53
|
+
return this.defaultWidgets.map(d => {
|
|
54
|
+
const override = this.overrideWidgets.find(od => od.widgetId === d.id);
|
|
55
|
+
return override ? new WidgetInfos({ ...d, ...override }) : d;
|
|
56
|
+
});
|
|
75
57
|
}
|
|
76
58
|
|
|
77
59
|
constructor(params: DashboardShallowDetailsDTO) {
|
|
@@ -80,43 +62,39 @@ export class DashboardShallowDetails extends DashboardShallowInfos {
|
|
|
80
62
|
this.labelDefault = params.labelDefault;
|
|
81
63
|
this.path = params.path.map(dto => new PathCrumb(dto)).sort((a, b) => b.index - a.index);
|
|
82
64
|
this.translations = params.translations.map(t => new DashboardTranslation(t));
|
|
83
|
-
this.widgets = params.widgets.map(dto => new WidgetInfos(dto));
|
|
84
65
|
|
|
85
|
-
this.overrideEntityPresetCode = params.overrideEntityPresetCode;
|
|
86
|
-
this.overrideDatePresetCode = params.overrideDatePresetCode;
|
|
87
|
-
this.overrideVariableCode = params.overrideVariableCode;
|
|
88
66
|
this.overrideDatePresets = params.overrideDatePresets.map(dto => new DashboardShallowDatePresetInfos(dto));
|
|
89
67
|
this.overrideEntityPresets = params.overrideEntityPresets.map(dto => new DashboardShallowEntityPresetInfos(dto));
|
|
90
68
|
this.overrideVariables = params.overrideVariables.map(dto => new DashboardShallowVariableInfos(dto));
|
|
69
|
+
this.overrideWidgets = params.overrideWidgets.map(dto => new DashboardShallowWidgetInfos(dto));
|
|
91
70
|
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
71
|
+
this.entityPresetCode = params.entityPresetCode;
|
|
72
|
+
this.datePresetCode = params.datePresetCode;
|
|
73
|
+
this.variableCode = params.variableCode;
|
|
95
74
|
this.defaultDatePresets = params.defaultDatePresets.map(dto => new DashboardDatePresetInfos(dto));
|
|
96
75
|
this.defaultEntityPresets = params.defaultEntityPresets.map(dto => new DashboardEntityPresetInfos(dto));
|
|
97
76
|
this.defaultVariables = params.defaultVariables.map(dto => new DashboardVariableInfos(dto));
|
|
77
|
+
this.defaultWidgets = params.defaultWidgets.map(dto => new WidgetInfos(dto));
|
|
98
78
|
}
|
|
99
79
|
}
|
|
100
80
|
|
|
101
81
|
export interface DashboardShallowDetailsDTO extends DashboardShallowInfosDTO {
|
|
102
82
|
labelDefault: string;
|
|
103
83
|
path: PathCrumbDTO[];
|
|
104
|
-
overrideEntityPresetCode: string | null;
|
|
105
|
-
overrideDatePresetCode: string | null;
|
|
106
|
-
overrideVariableCode: string | null;
|
|
107
84
|
overrideDatePresets: DashboardShallowDatePresetInfosDTO[];
|
|
108
85
|
overrideEntityPresets: DashboardShallowEntityPresetInfosDTO[];
|
|
109
86
|
overrideVariables: DashboardShallowVariableInfosDTO[];
|
|
87
|
+
overrideWidgets: DashboardShallowWidgetInfosDTO[];
|
|
110
88
|
translations: DashboardTranslationDTO[];
|
|
111
89
|
dashboardId: string;
|
|
112
90
|
scope: number;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
entityPresetCode: string | null;
|
|
92
|
+
datePresetCode: string | null;
|
|
93
|
+
variableCode: string | null;
|
|
116
94
|
defaultDatePresets: DashboardDatePresetInfosDTO[];
|
|
117
95
|
defaultEntityPresets: DashboardEntityPresetInfosDTO[];
|
|
118
96
|
defaultVariables: DashboardVariableInfosDTO[];
|
|
119
|
-
|
|
97
|
+
defaultWidgets: WidgetInfosDTO[];
|
|
120
98
|
}
|
|
121
99
|
|
|
122
100
|
export interface CreateDashboardShallowDTO {
|
|
@@ -132,12 +110,10 @@ export interface UpdateDashboardShallowDTO {
|
|
|
132
110
|
colors: string[];
|
|
133
111
|
icon: string;
|
|
134
112
|
tags: string[];
|
|
135
|
-
overrideEntityPresetCode: string | null;
|
|
136
|
-
overrideDatePresetCode: string | null;
|
|
137
|
-
overrideVariableCode: string | null;
|
|
138
113
|
overrideDatePresets: CreateDashboardShallowDatePresetDTO[];
|
|
139
114
|
overrideEntityPresets: CreateDashboardShallowEntityPresetDTO[];
|
|
140
115
|
overrideVariables: CreateDashboardShallowVariableDTO[];
|
|
116
|
+
overrideWidgets: CreateDashboardShallowWidgetDTO[];
|
|
141
117
|
translations: DashboardTranslationDTO[];
|
|
142
118
|
}
|
|
143
119
|
|
|
@@ -9,6 +9,7 @@ export class DashboardVariableInfos {
|
|
|
9
9
|
hiddenCode: string;
|
|
10
10
|
variableType: DashboardVariableType;
|
|
11
11
|
labelDefault: string;
|
|
12
|
+
showInOptions: boolean;
|
|
12
13
|
code: string;
|
|
13
14
|
value: string;
|
|
14
15
|
useOnlyAllowedValues: boolean;
|
|
@@ -23,6 +24,7 @@ export class DashboardVariableInfos {
|
|
|
23
24
|
this.hiddenCode = params.hiddenCode;
|
|
24
25
|
this.variableType = params.variableType;
|
|
25
26
|
this.labelDefault = params.labelDefault;
|
|
27
|
+
this.showInOptions = params.showInOptions;
|
|
26
28
|
this.code = params.code;
|
|
27
29
|
this.value = params.value;
|
|
28
30
|
this.useOnlyAllowedValues = params.useOnlyAllowedValues;
|
|
@@ -35,6 +37,7 @@ export interface DashboardVariableInfosDTO {
|
|
|
35
37
|
hiddenCode: string;
|
|
36
38
|
variableType: DashboardVariableType;
|
|
37
39
|
labelDefault: string;
|
|
40
|
+
showInOptions: boolean;
|
|
38
41
|
code: string;
|
|
39
42
|
value: string;
|
|
40
43
|
useOnlyAllowedValues: boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
|
|
2
|
+
import type { CreateDashboardDatePresetDTO, CreateDashboardEntityPresetDTO, CreateDashboardVariableDTO, DashboardTranslationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
|
|
4
|
+
export interface DashboardSettings {
|
|
5
|
+
folderId: string | null;
|
|
6
|
+
imageId: string | null;
|
|
7
|
+
image: string | null;
|
|
8
|
+
labelDefault: string;
|
|
9
|
+
locked: boolean;
|
|
10
|
+
code: string;
|
|
11
|
+
colors: string[];
|
|
12
|
+
icon: string;
|
|
13
|
+
tags: string[];
|
|
14
|
+
translations: DashboardTranslationDTO[];
|
|
15
|
+
entityPresetCode: string | null;
|
|
16
|
+
datePresetCode: string | null;
|
|
17
|
+
variableCode: string | null;
|
|
18
|
+
datePresets: CreateDashboardDatePresetDTO[];
|
|
19
|
+
entityPresets: CreateDashboardEntityPresetDTO[];
|
|
20
|
+
variables: CreateDashboardVariableDTO[];
|
|
21
|
+
scope: ApplicationScope;
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isoToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
2
|
+
|
|
3
|
+
export class DeviceDataDefinitionInfos {
|
|
4
|
+
id: string;
|
|
5
|
+
deviceId: string;
|
|
6
|
+
dataDefinitionId: string;
|
|
7
|
+
dataDefinitionCode: string;
|
|
8
|
+
dataDefinitionLabel: string;
|
|
9
|
+
dataCategoryCode: string;
|
|
10
|
+
dataCategoryLabel: string;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
|
|
13
|
+
constructor(params: DeviceDataDefinitionInfosDTO) {
|
|
14
|
+
this.id = params.id;
|
|
15
|
+
this.deviceId = params.deviceId;
|
|
16
|
+
this.dataDefinitionId = params.dataDefinitionId;
|
|
17
|
+
this.dataDefinitionCode = params.dataDefinitionCode;
|
|
18
|
+
this.dataDefinitionLabel = params.dataDefinitionLabel;
|
|
19
|
+
this.dataCategoryCode = params.dataCategoryCode;
|
|
20
|
+
this.dataCategoryLabel = params.dataCategoryLabel;
|
|
21
|
+
this.timestamp = isoToEpoch(params.timestamp);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface DeviceDataDefinitionInfosDTO {
|
|
26
|
+
id: string;
|
|
27
|
+
deviceId: string;
|
|
28
|
+
dataDefinitionId: string;
|
|
29
|
+
dataDefinitionCode: string;
|
|
30
|
+
dataDefinitionLabel: string;
|
|
31
|
+
dataCategoryCode: string;
|
|
32
|
+
dataCategoryLabel: string;
|
|
33
|
+
timestamp: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface DeviceDataDefinitionFilters {
|
|
37
|
+
devicesIds?: string[];
|
|
38
|
+
deviceId?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./deviceDataDefinitionInfos";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DeviceExplorerElementInfos, type DeviceExplorerElementInfosDTO } from "./deviceExplorerElementInfos";
|
|
2
|
+
|
|
3
|
+
export class DeviceExplorerElementDetails extends DeviceExplorerElementInfos {
|
|
4
|
+
|
|
5
|
+
constructor(params: DeviceExplorerElementDetailsDTO) {
|
|
6
|
+
super(params);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DeviceExplorerElementDetailsDTO extends DeviceExplorerElementInfosDTO {
|
|
11
|
+
}
|