@dative-gpi/foundation-core-domain 1.0.127 → 1.0.128-fix-mobile

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,10 +1,12 @@
1
- import { type DeviceExplorerElementType } from "@dative-gpi/foundation-shared-domain/enums";
1
+ import { DeviceExplorerElementType } from "@dative-gpi/foundation-shared-domain/enums";
2
2
 
3
3
  import { DeviceConnectivityDetails, type DeviceConnectivityDetailsDTO } from "../deviceConnectivities/deviceConnectivityDetails";
4
4
  import { DeviceOrganisationAlert, type DeviceOrganisationAlertDTO } from "../deviceOrganisations/deviceOrganisationAlert";
5
5
  import { DeviceStatusDetails, type DeviceStatusDetailsDTO } from "../deviceStatuses/deviceStatusDetails";
6
6
  import { ModelStatusInfos, type ModelStatusInfosDTO } from "../modelStatuses/modelStatusInfos";
7
+ import { type DeviceOrganisationInfos } from "../deviceOrganisations/deviceOrganisationInfos";
7
8
  import { PathCrumb, type PathCrumbDTO } from "../shared/pathCrumb";
9
+ import { type GroupInfos } from "../groups/groupInfos";
8
10
 
9
11
  export class DeviceExplorerElementInfos {
10
12
  id: string;
@@ -72,6 +74,37 @@ export class DeviceExplorerElementInfos {
72
74
  this.alerts = params.alerts?.map(dto => new DeviceOrganisationAlert(dto)) ?? null;
73
75
  this.worstAlert = params.worstAlert ? new DeviceOrganisationAlert(params.worstAlert) : null;
74
76
  }
77
+
78
+ static fromDeviceOrganisation = (deviceOrganisation: DeviceOrganisationInfos): DeviceExplorerElementInfos => ({
79
+ ...deviceOrganisation,
80
+ type: DeviceExplorerElementType.DeviceOrganisation,
81
+ parentId: deviceOrganisation.groupId,
82
+ icon: null,
83
+ groupsIds: null,
84
+ deviceOrganisationsIds: null,
85
+ modelsIds: null,
86
+ recursiveGroupsIds: null,
87
+ recursiveDeviceOrganisationsIds: null,
88
+ recursiveModelsIds: null
89
+ });
90
+
91
+ static fromGroup = (group: GroupInfos): DeviceExplorerElementInfos => ({
92
+ ...group,
93
+ type: DeviceExplorerElementType.Group,
94
+ manufacturerLabel: null,
95
+ articleLabel: null,
96
+ modelLabel: null,
97
+ ownerLabel: null,
98
+ managerName: null,
99
+ unrestricted: null,
100
+ online: null,
101
+ meta: null,
102
+ modelStatuses: null,
103
+ status: null,
104
+ connectivity: null,
105
+ alerts: null,
106
+ worstAlert: null
107
+ });
75
108
  }
76
109
 
77
110
  export interface DeviceExplorerElementInfosDTO {
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.127",
4
+ "version": "1.0.128-fix-mobile",
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.127",
14
- "@dative-gpi/foundation-shared-services": "1.0.127"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.128-fix-mobile",
14
+ "@dative-gpi/foundation-shared-services": "1.0.128-fix-mobile"
15
15
  },
16
- "gitHead": "b0ad78457ad86632d841709d3fc3951a8e44c667"
16
+ "gitHead": "099789bb7c9a4134f9ee0aba08d805b673cbb977"
17
17
  }