@equinor/echo-framework 6.0.0 → 6.1.0
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/index.cjs.js +2 -2
- package/package.json +6 -6
- package/src/lib/feature/globalSelection/coordinate/coordinate.clean.d.ts +6 -0
- package/src/lib/feature/globalSelection/coordinate/coordinate.logic.d.ts +3 -0
- package/src/lib/feature/globalSelection/coordinate/coordinate.types.d.ts +19 -0
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +4 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/setRelatedTo.action.d.ts +7 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +242 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.mutableSelectionItem.d.ts +2 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.testHelpers.d.ts +5 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +25 -6
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/itemIdTypeGuards.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullCoordinate.d.ts +3 -0
- package/src/lib/feature/globalSelection/index.d.ts +1 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +18 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +3 -6
- package/src/lib/feature/globalSelection/strategies/coordinateSelection.strategy.d.ts +3 -0
- package/src/lib/services/echoViewService/echoView.type.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@equinor/echo-base": ">= 6.
|
|
6
|
-
"@equinor/echo-components": ">= 6.
|
|
7
|
-
"@equinor/echo-core": ">= 6.
|
|
8
|
-
"@equinor/echo-search": ">= 6.
|
|
9
|
-
"@equinor/echo-utils": ">= 6.
|
|
5
|
+
"@equinor/echo-base": ">= 6.1.0 < 7.0.0",
|
|
6
|
+
"@equinor/echo-components": ">= 6.1.0 < 7.0.0",
|
|
7
|
+
"@equinor/echo-core": ">= 6.1.0 < 7.0.0",
|
|
8
|
+
"@equinor/echo-search": ">= 6.1.0 < 7.0.0",
|
|
9
|
+
"@equinor/echo-utils": ">= 6.1.0 < 7.0.0",
|
|
10
10
|
"@equinor/eds-core-react": "0.49.0",
|
|
11
11
|
"@equinor/eds-icons": "0.22.0",
|
|
12
12
|
"@equinor/eds-tokens": "2.1.0",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CoordinateId } from './coordinate.types';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and coerces a CoordinateId from the API into a clean CoordinateId.
|
|
4
|
+
* Returns undefined if the data is invalid (e.g. NaN coordinates, missing fields).
|
|
5
|
+
*/
|
|
6
|
+
export declare function cleanCoordinateId(raw: CoordinateId): CoordinateId | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PlantAndTagForOpenIn3d } from '../../openItemsIn3d/logic/openItemsIn3d.utils';
|
|
2
|
+
import type { CoordinateData } from './coordinate.types';
|
|
3
|
+
export declare function coordinatesToPlantTagPairs(coordinates: ReadonlyArray<CoordinateData>): ReadonlyArray<PlantAndTagForOpenIn3d>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CoordinateId {
|
|
2
|
+
readonly x: number;
|
|
3
|
+
readonly y: number;
|
|
4
|
+
readonly z: number;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly description: string | undefined;
|
|
7
|
+
readonly instCode: string;
|
|
8
|
+
/** Echo 3D plantCode */
|
|
9
|
+
readonly plantCode: string;
|
|
10
|
+
/** Sap id */
|
|
11
|
+
readonly plantNo: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Coordinates have no additional data beyond their identifying fields,
|
|
15
|
+
* so `CoordinateData` and `CoordinateId` are intentionally the same shape.
|
|
16
|
+
* Kept as separate aliases to mirror the other selection item types
|
|
17
|
+
* (`*Id` vs `*Data`) and allow future divergence without a breaking rename.
|
|
18
|
+
*/
|
|
19
|
+
export type CoordinateData = CoordinateId;
|
|
@@ -195,6 +195,10 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
195
195
|
color: string;
|
|
196
196
|
}) => void;
|
|
197
197
|
}>;
|
|
198
|
+
setRelatedTo: (args: ReadonlyArray<{
|
|
199
|
+
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
200
|
+
readonly relatedTo: ReadonlyArray<import("./globalSelectionStore/globalSelectionStore.types").RelatedToItem>;
|
|
201
|
+
}>) => void;
|
|
198
202
|
errorStatus: Readonly<{
|
|
199
203
|
/**
|
|
200
204
|
* Sets the error status for specific items in the selection menu panel.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GlobalSelectionStore, GlobalSelectionTypes, RelatedToItem } from '../globalSelectionStore.types';
|
|
2
|
+
type SetFunction = (updater: (state: GlobalSelectionStore) => void, shouldReplace?: boolean, action?: string) => void;
|
|
3
|
+
export declare function setRelatedToAction(set: SetFunction, args: ReadonlyArray<{
|
|
4
|
+
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
5
|
+
readonly relatedTo: ReadonlyArray<RelatedToItem>;
|
|
6
|
+
}>): void;
|
|
7
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export declare const initialWorkOrderList: GlobalSelectionTypes.WorkOrderList;
|
|
|
3
3
|
export declare const initialTagList: GlobalSelectionTypes.TagList;
|
|
4
4
|
export declare const initialEquipmentList: GlobalSelectionTypes.EquipmentList;
|
|
5
5
|
export declare const initialMeasuringPointList: GlobalSelectionTypes.MeasuringPointList;
|
|
6
|
+
export declare const initialCoordinateList: GlobalSelectionTypes.CoordinateList;
|
|
6
7
|
/**
|
|
7
8
|
* The single source of truth for items stored in Global Selection.
|
|
8
9
|
* Each item is stored here once, does not store item grouping in any way.
|
|
@@ -54,6 +55,10 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
54
55
|
setAllItemsVisibility: (args: {
|
|
55
56
|
isVisible: boolean;
|
|
56
57
|
}) => void;
|
|
58
|
+
setRelatedTo: (args: ReadonlyArray<{
|
|
59
|
+
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
60
|
+
readonly relatedTo: ReadonlyArray<import("./globalSelectionStore.types").RelatedToItem>;
|
|
61
|
+
}>) => void;
|
|
57
62
|
setItemMetaData: (args: ReadonlyArray<import("./globalSelectionStore.types").GlobalSelectionItemIdMetadata>) => void;
|
|
58
63
|
resetItemErrorStatuses: () => void;
|
|
59
64
|
getStoredItemIds: () => ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
@@ -68,6 +73,15 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
68
73
|
WorkOrder: {
|
|
69
74
|
items: Map<GlobalSelectionTypes.ItemIdString, {
|
|
70
75
|
id: {
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
z: number;
|
|
79
|
+
name: string;
|
|
80
|
+
description: string | undefined;
|
|
81
|
+
instCode: string;
|
|
82
|
+
plantCode: string;
|
|
83
|
+
plantNo: string;
|
|
84
|
+
} | {
|
|
71
85
|
workOrderId: string;
|
|
72
86
|
} | {
|
|
73
87
|
instCode: string;
|
|
@@ -109,11 +123,51 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
109
123
|
errorStatus: string | undefined;
|
|
110
124
|
systemStatus: import("./globalSelectionStore.types").SelectionItemSystemStatus;
|
|
111
125
|
};
|
|
126
|
+
relatedTo?: {
|
|
127
|
+
id: {
|
|
128
|
+
x: number;
|
|
129
|
+
y: number;
|
|
130
|
+
z: number;
|
|
131
|
+
name: string;
|
|
132
|
+
description: string | undefined;
|
|
133
|
+
instCode: string;
|
|
134
|
+
plantCode: string;
|
|
135
|
+
plantNo: string;
|
|
136
|
+
} | {
|
|
137
|
+
workOrderId: string;
|
|
138
|
+
} | {
|
|
139
|
+
instCode: string;
|
|
140
|
+
tagNo: string;
|
|
141
|
+
} | {
|
|
142
|
+
internalTagType: import("..").PdmsInternalTagType;
|
|
143
|
+
plantNo: string;
|
|
144
|
+
plantCode: string;
|
|
145
|
+
instCode: string;
|
|
146
|
+
tagNo: string;
|
|
147
|
+
} | {
|
|
148
|
+
equipmentId: string;
|
|
149
|
+
} | {
|
|
150
|
+
measuringPointId: string;
|
|
151
|
+
} | {
|
|
152
|
+
key: string;
|
|
153
|
+
value: string;
|
|
154
|
+
};
|
|
155
|
+
type: import("./globalSelectionStore.types").RelatedToItemType;
|
|
156
|
+
}[] | undefined;
|
|
112
157
|
}>;
|
|
113
158
|
};
|
|
114
159
|
Tag: {
|
|
115
160
|
items: Map<GlobalSelectionTypes.ItemIdString, {
|
|
116
161
|
id: {
|
|
162
|
+
x: number;
|
|
163
|
+
y: number;
|
|
164
|
+
z: number;
|
|
165
|
+
name: string;
|
|
166
|
+
description: string | undefined;
|
|
167
|
+
instCode: string;
|
|
168
|
+
plantCode: string;
|
|
169
|
+
plantNo: string;
|
|
170
|
+
} | {
|
|
117
171
|
workOrderId: string;
|
|
118
172
|
} | {
|
|
119
173
|
instCode: string;
|
|
@@ -168,11 +222,51 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
168
222
|
errorStatus: string | undefined;
|
|
169
223
|
systemStatus: import("./globalSelectionStore.types").SelectionItemSystemStatus;
|
|
170
224
|
};
|
|
225
|
+
relatedTo?: {
|
|
226
|
+
id: {
|
|
227
|
+
x: number;
|
|
228
|
+
y: number;
|
|
229
|
+
z: number;
|
|
230
|
+
name: string;
|
|
231
|
+
description: string | undefined;
|
|
232
|
+
instCode: string;
|
|
233
|
+
plantCode: string;
|
|
234
|
+
plantNo: string;
|
|
235
|
+
} | {
|
|
236
|
+
workOrderId: string;
|
|
237
|
+
} | {
|
|
238
|
+
instCode: string;
|
|
239
|
+
tagNo: string;
|
|
240
|
+
} | {
|
|
241
|
+
internalTagType: import("..").PdmsInternalTagType;
|
|
242
|
+
plantNo: string;
|
|
243
|
+
plantCode: string;
|
|
244
|
+
instCode: string;
|
|
245
|
+
tagNo: string;
|
|
246
|
+
} | {
|
|
247
|
+
equipmentId: string;
|
|
248
|
+
} | {
|
|
249
|
+
measuringPointId: string;
|
|
250
|
+
} | {
|
|
251
|
+
key: string;
|
|
252
|
+
value: string;
|
|
253
|
+
};
|
|
254
|
+
type: import("./globalSelectionStore.types").RelatedToItemType;
|
|
255
|
+
}[] | undefined;
|
|
171
256
|
}>;
|
|
172
257
|
};
|
|
173
258
|
Equipment: {
|
|
174
259
|
items: Map<GlobalSelectionTypes.ItemIdString, {
|
|
175
260
|
id: {
|
|
261
|
+
x: number;
|
|
262
|
+
y: number;
|
|
263
|
+
z: number;
|
|
264
|
+
name: string;
|
|
265
|
+
description: string | undefined;
|
|
266
|
+
instCode: string;
|
|
267
|
+
plantCode: string;
|
|
268
|
+
plantNo: string;
|
|
269
|
+
} | {
|
|
176
270
|
workOrderId: string;
|
|
177
271
|
} | {
|
|
178
272
|
instCode: string;
|
|
@@ -212,11 +306,51 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
212
306
|
errorStatus: string | undefined;
|
|
213
307
|
systemStatus: import("./globalSelectionStore.types").SelectionItemSystemStatus;
|
|
214
308
|
};
|
|
309
|
+
relatedTo?: {
|
|
310
|
+
id: {
|
|
311
|
+
x: number;
|
|
312
|
+
y: number;
|
|
313
|
+
z: number;
|
|
314
|
+
name: string;
|
|
315
|
+
description: string | undefined;
|
|
316
|
+
instCode: string;
|
|
317
|
+
plantCode: string;
|
|
318
|
+
plantNo: string;
|
|
319
|
+
} | {
|
|
320
|
+
workOrderId: string;
|
|
321
|
+
} | {
|
|
322
|
+
instCode: string;
|
|
323
|
+
tagNo: string;
|
|
324
|
+
} | {
|
|
325
|
+
internalTagType: import("..").PdmsInternalTagType;
|
|
326
|
+
plantNo: string;
|
|
327
|
+
plantCode: string;
|
|
328
|
+
instCode: string;
|
|
329
|
+
tagNo: string;
|
|
330
|
+
} | {
|
|
331
|
+
equipmentId: string;
|
|
332
|
+
} | {
|
|
333
|
+
measuringPointId: string;
|
|
334
|
+
} | {
|
|
335
|
+
key: string;
|
|
336
|
+
value: string;
|
|
337
|
+
};
|
|
338
|
+
type: import("./globalSelectionStore.types").RelatedToItemType;
|
|
339
|
+
}[] | undefined;
|
|
215
340
|
}>;
|
|
216
341
|
};
|
|
217
342
|
MeasuringPoint: {
|
|
218
343
|
items: Map<GlobalSelectionTypes.ItemIdString, {
|
|
219
344
|
id: {
|
|
345
|
+
x: number;
|
|
346
|
+
y: number;
|
|
347
|
+
z: number;
|
|
348
|
+
name: string;
|
|
349
|
+
description: string | undefined;
|
|
350
|
+
instCode: string;
|
|
351
|
+
plantCode: string;
|
|
352
|
+
plantNo: string;
|
|
353
|
+
} | {
|
|
220
354
|
workOrderId: string;
|
|
221
355
|
} | {
|
|
222
356
|
instCode: string;
|
|
@@ -255,6 +389,114 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
255
389
|
errorStatus: string | undefined;
|
|
256
390
|
systemStatus: import("./globalSelectionStore.types").SelectionItemSystemStatus;
|
|
257
391
|
};
|
|
392
|
+
relatedTo?: {
|
|
393
|
+
id: {
|
|
394
|
+
x: number;
|
|
395
|
+
y: number;
|
|
396
|
+
z: number;
|
|
397
|
+
name: string;
|
|
398
|
+
description: string | undefined;
|
|
399
|
+
instCode: string;
|
|
400
|
+
plantCode: string;
|
|
401
|
+
plantNo: string;
|
|
402
|
+
} | {
|
|
403
|
+
workOrderId: string;
|
|
404
|
+
} | {
|
|
405
|
+
instCode: string;
|
|
406
|
+
tagNo: string;
|
|
407
|
+
} | {
|
|
408
|
+
internalTagType: import("..").PdmsInternalTagType;
|
|
409
|
+
plantNo: string;
|
|
410
|
+
plantCode: string;
|
|
411
|
+
instCode: string;
|
|
412
|
+
tagNo: string;
|
|
413
|
+
} | {
|
|
414
|
+
equipmentId: string;
|
|
415
|
+
} | {
|
|
416
|
+
measuringPointId: string;
|
|
417
|
+
} | {
|
|
418
|
+
key: string;
|
|
419
|
+
value: string;
|
|
420
|
+
};
|
|
421
|
+
type: import("./globalSelectionStore.types").RelatedToItemType;
|
|
422
|
+
}[] | undefined;
|
|
423
|
+
}>;
|
|
424
|
+
};
|
|
425
|
+
Coordinate: {
|
|
426
|
+
items: Map<GlobalSelectionTypes.ItemIdString, {
|
|
427
|
+
id: {
|
|
428
|
+
x: number;
|
|
429
|
+
y: number;
|
|
430
|
+
z: number;
|
|
431
|
+
name: string;
|
|
432
|
+
description: string | undefined;
|
|
433
|
+
instCode: string;
|
|
434
|
+
plantCode: string;
|
|
435
|
+
plantNo: string;
|
|
436
|
+
} | {
|
|
437
|
+
workOrderId: string;
|
|
438
|
+
} | {
|
|
439
|
+
instCode: string;
|
|
440
|
+
tagNo: string;
|
|
441
|
+
} | {
|
|
442
|
+
internalTagType: import("..").PdmsInternalTagType;
|
|
443
|
+
plantNo: string;
|
|
444
|
+
plantCode: string;
|
|
445
|
+
instCode: string;
|
|
446
|
+
tagNo: string;
|
|
447
|
+
} | {
|
|
448
|
+
equipmentId: string;
|
|
449
|
+
} | {
|
|
450
|
+
measuringPointId: string;
|
|
451
|
+
};
|
|
452
|
+
type: GlobalSelectionItemType.Coordinate;
|
|
453
|
+
data: {
|
|
454
|
+
x: number;
|
|
455
|
+
y: number;
|
|
456
|
+
z: number;
|
|
457
|
+
name: string;
|
|
458
|
+
description: string | undefined;
|
|
459
|
+
instCode: string;
|
|
460
|
+
plantCode: string;
|
|
461
|
+
plantNo: string;
|
|
462
|
+
};
|
|
463
|
+
metaData: {
|
|
464
|
+
color: string;
|
|
465
|
+
isHiddenByUser: boolean;
|
|
466
|
+
errorStatus: string | undefined;
|
|
467
|
+
systemStatus: import("./globalSelectionStore.types").SelectionItemSystemStatus;
|
|
468
|
+
};
|
|
469
|
+
relatedTo?: {
|
|
470
|
+
id: {
|
|
471
|
+
x: number;
|
|
472
|
+
y: number;
|
|
473
|
+
z: number;
|
|
474
|
+
name: string;
|
|
475
|
+
description: string | undefined;
|
|
476
|
+
instCode: string;
|
|
477
|
+
plantCode: string;
|
|
478
|
+
plantNo: string;
|
|
479
|
+
} | {
|
|
480
|
+
workOrderId: string;
|
|
481
|
+
} | {
|
|
482
|
+
instCode: string;
|
|
483
|
+
tagNo: string;
|
|
484
|
+
} | {
|
|
485
|
+
internalTagType: import("..").PdmsInternalTagType;
|
|
486
|
+
plantNo: string;
|
|
487
|
+
plantCode: string;
|
|
488
|
+
instCode: string;
|
|
489
|
+
tagNo: string;
|
|
490
|
+
} | {
|
|
491
|
+
equipmentId: string;
|
|
492
|
+
} | {
|
|
493
|
+
measuringPointId: string;
|
|
494
|
+
} | {
|
|
495
|
+
key: string;
|
|
496
|
+
value: string;
|
|
497
|
+
};
|
|
498
|
+
type: import("./globalSelectionStore.types").RelatedToItemType;
|
|
499
|
+
}[] | undefined;
|
|
258
500
|
}>;
|
|
259
501
|
};
|
|
260
502
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalSelectionItemType, GlobalSelectionMetaData, GlobalSelectionTypes } from './globalSelectionStore.types';
|
|
1
|
+
import { GlobalSelectionItemType, GlobalSelectionMetaData, GlobalSelectionTypes, RelatedToItem } from './globalSelectionStore.types';
|
|
2
2
|
/**
|
|
3
3
|
* This file defines mutable versions of selection items and lists for internal use in the global selection store.
|
|
4
4
|
* These types are used in Immer set() callbacks where the state is a mutable draft, allowing us to bypass
|
|
@@ -21,6 +21,7 @@ type MutableSelectionItem<T extends GlobalSelectionItemType> = {
|
|
|
21
21
|
type: T;
|
|
22
22
|
data: GlobalSelectionTypes.ItemTypeToDataMap[T];
|
|
23
23
|
metaData: Mutable<GlobalSelectionMetaData>;
|
|
24
|
+
relatedTo?: RelatedToItem[];
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* Mutable version of a selection list for store-internal Immer mutations.
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import type { EquipmentData, MeasuringPointData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
|
|
2
2
|
import { Brand } from '@equinor/echo-utils';
|
|
3
|
+
import type { CoordinateData, CoordinateId as CoordinateId_Imported } from '../coordinate/coordinate.types';
|
|
3
4
|
import type { PdmsTagId, StidTagId } from '../pdmsTag/pdmsTag.types';
|
|
4
5
|
export declare enum GlobalSelectionItemType {
|
|
5
6
|
WorkOrder = "WorkOrder",
|
|
6
7
|
Tag = "Tag",
|
|
7
8
|
Equipment = "Equipment",
|
|
8
|
-
MeasuringPoint = "MeasuringPoint"
|
|
9
|
+
MeasuringPoint = "MeasuringPoint",
|
|
10
|
+
Coordinate = "Coordinate"
|
|
9
11
|
}
|
|
10
12
|
type GlobalSelectionTagDto = TagSummaryDto;
|
|
11
13
|
type GlobalSelectionWorkOrderDto = WorkOrderData;
|
|
12
14
|
type GlobalSelectionEquipmentDto = EquipmentData;
|
|
13
15
|
type GlobalSelectionMeasuringPointDto = MeasuringPointData;
|
|
16
|
+
type GlobalSelectionCoordinateDto = CoordinateData;
|
|
14
17
|
export type GlobalSelectionItemTypeToDataMap = {
|
|
15
18
|
[GlobalSelectionItemType.WorkOrder]: GlobalSelectionWorkOrderDto;
|
|
16
19
|
[GlobalSelectionItemType.Tag]: GlobalSelectionTagDto;
|
|
17
20
|
[GlobalSelectionItemType.Equipment]: GlobalSelectionEquipmentDto;
|
|
18
21
|
[GlobalSelectionItemType.MeasuringPoint]: GlobalSelectionMeasuringPointDto;
|
|
22
|
+
[GlobalSelectionItemType.Coordinate]: GlobalSelectionCoordinateDto;
|
|
19
23
|
};
|
|
20
24
|
export type SelectionItemTypeToItemIdMap = {
|
|
21
25
|
[GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
|
|
22
26
|
[GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
|
|
23
27
|
[GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
|
|
24
28
|
[GlobalSelectionItemType.MeasuringPoint]: GlobalSelectionTypes.MeasuringPointId;
|
|
29
|
+
[GlobalSelectionItemType.Coordinate]: GlobalSelectionTypes.CoordinateId;
|
|
25
30
|
};
|
|
26
31
|
/**
|
|
27
32
|
* CustomData is a flexible key-value pair type that can be used in the relatedTo field of selection tree items.
|
|
@@ -40,6 +45,10 @@ export type RelatedToItemType = GlobalSelectionItemType | 'CustomData';
|
|
|
40
45
|
export type RelatedToItemTypeToIdMap = SelectionItemTypeToItemIdMap & {
|
|
41
46
|
readonly CustomData: CustomDataId;
|
|
42
47
|
};
|
|
48
|
+
export interface RelatedToItem {
|
|
49
|
+
readonly id: RelatedToItemTypeToIdMap[RelatedToItemType];
|
|
50
|
+
readonly type: RelatedToItemType;
|
|
51
|
+
}
|
|
43
52
|
type GlobalSelectionList<T extends GlobalSelectionItemType> = {
|
|
44
53
|
readonly items: Map<GlobalSelectionTypes.ItemIdString, GlobalSelectionGenericItem<T>>;
|
|
45
54
|
};
|
|
@@ -65,12 +74,14 @@ export type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
|
|
|
65
74
|
readonly type: T;
|
|
66
75
|
readonly data: GlobalSelectionTypes.ItemTypeToDataMap[T];
|
|
67
76
|
readonly metaData: GlobalSelectionMetaData;
|
|
77
|
+
readonly relatedTo?: RelatedToItem[];
|
|
68
78
|
};
|
|
69
79
|
type EquipmentGlobalSelectionList = GlobalSelectionTypes.List<GlobalSelectionItemType.Equipment>;
|
|
70
80
|
type WorkOrderGlobalSelectionList = GlobalSelectionTypes.List<GlobalSelectionItemType.WorkOrder>;
|
|
71
81
|
type TagGlobalSelectionList = GlobalSelectionTypes.List<GlobalSelectionItemType.Tag>;
|
|
72
82
|
type MeasuringPointGlobalSelectionList = GlobalSelectionTypes.List<GlobalSelectionItemType.MeasuringPoint>;
|
|
73
|
-
type
|
|
83
|
+
type CoordinateGlobalSelectionList = GlobalSelectionTypes.List<GlobalSelectionItemType.Coordinate>;
|
|
84
|
+
type GlobalSelectionListUnion = WorkOrderGlobalSelectionList | TagGlobalSelectionList | EquipmentGlobalSelectionList | MeasuringPointGlobalSelectionList | CoordinateGlobalSelectionList;
|
|
74
85
|
interface ItemErrorStatusUpdates {
|
|
75
86
|
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
76
87
|
readonly errorStatus: string;
|
|
@@ -99,6 +110,10 @@ export interface GlobalSelectionStore extends GlobalSelectionStoreData {
|
|
|
99
110
|
setAllItemsVisibility: (args: {
|
|
100
111
|
isVisible: boolean;
|
|
101
112
|
}) => void;
|
|
113
|
+
setRelatedTo: (args: ReadonlyArray<{
|
|
114
|
+
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
115
|
+
readonly relatedTo: ReadonlyArray<RelatedToItem>;
|
|
116
|
+
}>) => void;
|
|
102
117
|
setItemMetaData: (args: ReadonlyArray<GlobalSelectionItemIdMetadata>) => void;
|
|
103
118
|
resetItemErrorStatuses: () => void;
|
|
104
119
|
getStoredItemIds: () => ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
@@ -126,8 +141,9 @@ export declare namespace GlobalSelectionTypes {
|
|
|
126
141
|
*/
|
|
127
142
|
type TagId = StidTagId | PdmsTagId;
|
|
128
143
|
type MeasuringPointId = Pick<GlobalSelectionMeasuringPointDto, 'measuringPointId'>;
|
|
129
|
-
type
|
|
130
|
-
type
|
|
144
|
+
type CoordinateId = CoordinateId_Imported;
|
|
145
|
+
type RelatedToItemId = WorkOrderId | EquipmentId | TagId | MeasuringPointId | CoordinateId | CustomDataId;
|
|
146
|
+
type ItemId = WorkOrderId | EquipmentId | TagId | MeasuringPointId | CoordinateId;
|
|
131
147
|
type ItemIdString = Brand<string, 'ItemIdString'>;
|
|
132
148
|
type TagDto = GlobalSelectionTagDto;
|
|
133
149
|
type WorkOrderDto = GlobalSelectionWorkOrderDto;
|
|
@@ -137,9 +153,10 @@ export declare namespace GlobalSelectionTypes {
|
|
|
137
153
|
type WorkOrderItem = GlobalSelectionGenericItem<GlobalSelectionItemType.WorkOrder>;
|
|
138
154
|
type TagItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Tag>;
|
|
139
155
|
type MeasuringPointItem = GlobalSelectionGenericItem<GlobalSelectionItemType.MeasuringPoint>;
|
|
156
|
+
type CoordinateItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Coordinate>;
|
|
140
157
|
type List<T extends GlobalSelectionItemType> = GlobalSelectionList<T>;
|
|
141
|
-
type SelectionItem = EquipmentItem | WorkOrderItem | TagItem | MeasuringPointItem;
|
|
142
|
-
type SelectionItemList = EquipmentItem[] | WorkOrderItem[] | TagItem[] | MeasuringPointItem[];
|
|
158
|
+
type SelectionItem = EquipmentItem | WorkOrderItem | TagItem | MeasuringPointItem | CoordinateItem;
|
|
159
|
+
type SelectionItemList = EquipmentItem[] | WorkOrderItem[] | TagItem[] | MeasuringPointItem[] | CoordinateItem[];
|
|
143
160
|
type GenericItem<T extends GlobalSelectionItemType> = GlobalSelectionGenericItem<T>;
|
|
144
161
|
type Store = GlobalSelectionStore;
|
|
145
162
|
type ItemErrorStatusUpdate = ItemErrorStatusUpdates;
|
|
@@ -147,11 +164,13 @@ export declare namespace GlobalSelectionTypes {
|
|
|
147
164
|
type TagList = TagGlobalSelectionList;
|
|
148
165
|
type EquipmentList = EquipmentGlobalSelectionList;
|
|
149
166
|
type MeasuringPointList = MeasuringPointGlobalSelectionList;
|
|
167
|
+
type CoordinateList = CoordinateGlobalSelectionList;
|
|
150
168
|
type ListUnion = GlobalSelectionListUnion;
|
|
151
169
|
type ItemTypeToDataMap = GlobalSelectionItemTypeToDataMap;
|
|
152
170
|
type AddTagResult = GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>;
|
|
153
171
|
type AddEquipmentsResult = GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>;
|
|
154
172
|
type AddMeasuringPointResult = GlobalSelectionAddItemResult<ResultArray<MeasuringPointData>[]>;
|
|
173
|
+
type AddCoordinateResult = GlobalSelectionAddItemResult<ResultArray<CoordinateData>[]>;
|
|
155
174
|
type ActionResult = GlobalSelectionActionResult;
|
|
156
175
|
type ItemSystemStatus = SelectionItemSystemStatus;
|
|
157
176
|
}
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResultArray } from '@equinor/echo-search';
|
|
2
2
|
import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from './globalSelectionStore.types';
|
|
3
|
-
import { isEquipmentId, isMeasuringPointId, isPdmsTagId, isTagId, isWorkOrderId } from './itemIdTypeGuards';
|
|
3
|
+
import { isCoordinateId, isEquipmentId, isMeasuringPointId, isPdmsTagId, isTagId, isWorkOrderId } from './itemIdTypeGuards';
|
|
4
4
|
declare function idsEqual(itemA: GlobalSelectionTypes.ItemId, itemB: GlobalSelectionTypes.ItemId): boolean;
|
|
5
5
|
declare function mapToId(item: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemId;
|
|
6
6
|
declare function itemIdToString(itemId: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemIdString;
|
|
@@ -19,6 +19,8 @@ export declare const globalSelectionUtils: Readonly<{
|
|
|
19
19
|
isTagId: typeof isTagId;
|
|
20
20
|
/** Checks if the passed object is a PDMS `TagId` — a `TagId` with `internalTagType`, `plantNo`, and `plantCode`. */
|
|
21
21
|
isPdmsTagId: typeof isPdmsTagId;
|
|
22
|
+
/** Checks if the passed object is a global selection `CoordinateId`. */
|
|
23
|
+
isCoordinateId: typeof isCoordinateId;
|
|
22
24
|
/** Compares two global selection item IDs for equality using the registered strategy for their type. */
|
|
23
25
|
idsEqual: typeof idsEqual;
|
|
24
26
|
/** Normalizes an `ItemId` to its canonical form via the registered strategy (e.g. trims whitespace, uppercases instCode). Preserves all properties including PDMS fields. */
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemSystemStatus } from './globalSelectionStore.types';
|
|
1
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, RelatedToItem, SelectionItemSystemStatus } from './globalSelectionStore.types';
|
|
2
2
|
export declare function toGlobalSelectionItem<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(args: {
|
|
3
3
|
item: T;
|
|
4
4
|
type: K;
|
|
5
5
|
systemStatus: SelectionItemSystemStatus;
|
|
6
6
|
color?: string;
|
|
7
|
+
relatedTo?: ReadonlyArray<RelatedToItem>;
|
|
7
8
|
}): GlobalSelectionTypes.GenericItem<K>;
|
|
8
9
|
export declare function toGlobalSelectionItems<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(args: {
|
|
9
10
|
items: T[];
|
|
10
11
|
type: K;
|
|
11
12
|
systemStatus: SelectionItemSystemStatus;
|
|
12
13
|
color?: string;
|
|
14
|
+
relatedTo?: ReadonlyArray<RelatedToItem>;
|
|
13
15
|
}): GlobalSelectionTypes.GenericItem<K>[];
|
|
14
16
|
export declare function setNotFoundStatusByItemIds(args: {
|
|
15
17
|
itemType: GlobalSelectionItemType;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { PdmsTagId } from '../pdmsTag/pdmsTag.types';
|
|
2
|
-
import type { GlobalSelectionTypes } from './globalSelectionStore.types';
|
|
2
|
+
import type { CustomDataId, GlobalSelectionTypes } from './globalSelectionStore.types';
|
|
3
3
|
export declare function isWorkOrderId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.WorkOrderId;
|
|
4
4
|
export declare function isEquipmentId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.EquipmentId;
|
|
5
5
|
export declare function isTagId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.TagId;
|
|
6
6
|
export declare function isMeasuringPointId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.MeasuringPointId;
|
|
7
7
|
export declare function isPdmsTagId(itemId: GlobalSelectionTypes.ItemId): itemId is PdmsTagId;
|
|
8
|
+
export declare function isCustomDataId(itemId: GlobalSelectionTypes.RelatedToItemId): itemId is CustomDataId;
|
|
9
|
+
export declare function isCoordinateId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.CoordinateId;
|
|
@@ -3,6 +3,7 @@ export * from './selectionMenu/selectionTreeStore/selectionTree.api.types';
|
|
|
3
3
|
export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
4
|
export { isPdmsInternalTagType, PDMS_INTERNAL_TAG_TYPES } from './pdmsTag/pdmsTag.types';
|
|
5
5
|
export type { PdmsInternalTagType, PdmsTagId, PdmsTagSummaryDto, StidTagId } from './pdmsTag/pdmsTag.types';
|
|
6
|
+
export type { CoordinateData, CoordinateId } from './coordinate/coordinate.types';
|
|
6
7
|
export { useAreAllItemsVisible } from './hooks/useAreAllItemsVisible';
|
|
7
8
|
export { useGlobalSelectionByItemId } from './hooks/useGlobalSelectionByItemId';
|
|
8
9
|
export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
|
package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts
CHANGED
|
@@ -84,6 +84,15 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
|
|
|
84
84
|
label: string;
|
|
85
85
|
items: Map<import("../..").GlobalSelectionTypes.ItemIdString, {
|
|
86
86
|
id: {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
z: number;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string | undefined;
|
|
92
|
+
instCode: string;
|
|
93
|
+
plantCode: string;
|
|
94
|
+
plantNo: string;
|
|
95
|
+
} | {
|
|
87
96
|
workOrderId: string;
|
|
88
97
|
} | {
|
|
89
98
|
instCode: string;
|
|
@@ -102,6 +111,15 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
|
|
|
102
111
|
type: import("../..").GlobalSelectionItemType;
|
|
103
112
|
relatedTo?: {
|
|
104
113
|
id: {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
z: number;
|
|
117
|
+
name: string;
|
|
118
|
+
description: string | undefined;
|
|
119
|
+
instCode: string;
|
|
120
|
+
plantCode: string;
|
|
121
|
+
plantNo: string;
|
|
122
|
+
} | {
|
|
105
123
|
workOrderId: string;
|
|
106
124
|
} | {
|
|
107
125
|
instCode: string;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
import { GlobalSelectionItemType, GlobalSelectionTypes,
|
|
2
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, RelatedToItem, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
import { AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
|
|
4
4
|
export declare enum GlobalSelectionCategoryId {
|
|
5
5
|
Tags = "DEFAULT_TAG_LIST_ID",
|
|
6
6
|
WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID",
|
|
7
7
|
Equipments = "DEFAULT_EQUIPMENT_LIST_ID",
|
|
8
|
-
MeasuringPoints = "DEFAULT_MEASURING_POINT_LIST_ID"
|
|
8
|
+
MeasuringPoints = "DEFAULT_MEASURING_POINT_LIST_ID",
|
|
9
|
+
Coordinates = "DEFAULT_COORDINATE_LIST_ID"
|
|
9
10
|
}
|
|
10
11
|
export declare const globalSelectionDefaultGroupId: Guid;
|
|
11
|
-
export interface RelatedToItem {
|
|
12
|
-
readonly id: RelatedToItemTypeToIdMap[RelatedToItemType];
|
|
13
|
-
readonly type: RelatedToItemType;
|
|
14
|
-
}
|
|
15
12
|
export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
|
|
16
13
|
readonly id: SelectionItemTypeToItemIdMap[T];
|
|
17
14
|
readonly type: T;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GlobalSelectionItemType } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import type { SelectionItemTypeStrategy } from './selectionItemTypeStrategy.types';
|
|
3
|
+
export declare const coordinateSelectionStrategy: SelectionItemTypeStrategy<GlobalSelectionItemType.Coordinate>;
|
|
@@ -9,7 +9,6 @@ export interface EchoView extends EchoViewBaseItem {
|
|
|
9
9
|
readonly tagNo: string | undefined;
|
|
10
10
|
readonly search: string | undefined;
|
|
11
11
|
readonly skipOnboarding: boolean | undefined;
|
|
12
|
-
readonly useMaintenanceDevData: boolean | undefined;
|
|
13
12
|
readonly syncSettings: EchoViewSyncSettings | undefined;
|
|
14
13
|
readonly ecmPdfInspectionTool: EchoViewEcmPdfInspectionToolConfig | undefined;
|
|
15
14
|
readonly echo3D: Record<string, unknown> | undefined;
|