@equinor/echo-framework 0.25.0 → 0.25.2
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 +8 -8
- package/package.json +2 -2
- package/src/index.d.ts +5 -4
- package/src/lib/components/contextualAppLinks/hooks/useContextualAppLinksContext.d.ts +1 -1
- package/src/lib/components/notificationListItem/types/types.d.ts +1 -0
- package/src/lib/feature/globalSelection/OpenGlobalSelectionIn3DButton.utils.d.ts +14 -0
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +6 -6
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +0 -14
- package/src/lib/feature/globalSelection/index.d.ts +0 -2
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +6 -3
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +1 -1
- package/src/lib/feature/legend/legendFacade.d.ts +53 -0
- package/src/lib/feature/legend/legendStore.d.ts +12 -3
- package/src/lib/feature/legend/legendVisibleDataAsTagsStore.d.ts +41 -0
- package/src/lib/feature/legend/legendVisibleDataAsTagsStore.logic.d.ts +3 -0
- package/src/lib/feature/legend/legendVisibleDataAsTagsStore.type.d.ts +7 -0
- package/src/lib/feature/legend/legendVisibleDataStore.d.ts +15 -1
- package/src/lib/feature/legend/logic/isLegendDataIdEqualWithTag.d.ts +12 -0
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +0 -5
- package/src/lib/feature/measuringPoint/index.d.ts +1 -0
- package/src/lib/feature/workOrder/api/api-prepview-workOrder.d.ts +7 -0
- package/src/lib/feature/workOrder/components/PanelTagInfo/PanelTagInfo.d.ts +5 -0
- package/src/lib/feature/workOrder/components/PanelTagInfo/api/api-prepview-workOrder-tagInfo.d.ts +6 -0
- package/src/lib/feature/workOrder/components/PanelTagInfo/hooks/usePrepviewWorkOrderTagInfo.d.ts +6 -0
- package/src/lib/feature/workOrder/components/PanelTagInfo/types/tagInfo.d.ts +32 -0
- package/src/lib/feature/workOrder/components/WorkOrderItemDetails.d.ts +2 -2
- package/src/lib/feature/workOrder/components/WorkOrderItemHeader.d.ts +2 -6
- package/src/lib/feature/workOrder/components/WorkOrderItemHeader.types.d.ts +2 -0
- package/src/lib/feature/workOrder/components/WorkOrderItemTabInfo/WorkOrderItemTabInfo.d.ts +7 -0
- package/src/lib/feature/workOrder/hooks/usePrepviewWorkOrder.d.ts +2 -2
- package/src/lib/feature/workOrder/types/workOrder.d.ts +80 -43
- package/src/lib/feature/workOrder/utils/workOrderUtils.d.ts +2 -2
- package/src/lib/hooks/index.d.ts +1 -1
- package/src/lib/utils/handleErrors.d.ts +2 -1
- package/src/lib/feature/legend/legendUpdater.d.ts +0 -3
- package/src/lib/feature/workOrder/api/api-preview-workOrder.d.ts +0 -6
- /package/{index.cjs.d.ts → index.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.7.5 < 0.8.0",
|
|
6
6
|
"@equinor/echo-components": ">= 0.12.4 < 0.13.0",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
},
|
|
30
30
|
"main": "./index.cjs.js",
|
|
31
31
|
"type": "commonjs",
|
|
32
|
-
"types": "./index.
|
|
32
|
+
"types": "./index.d.ts"
|
|
33
33
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getLegendStatusColor } from './lib/feature/legacyLegend/utils/legendUtils';
|
|
2
2
|
import './lib/globalStyles.css';
|
|
3
|
+
import * as hooks from './lib/hooks';
|
|
3
4
|
import { getPlantsInfo, getTagDetails } from './lib/services/api';
|
|
4
5
|
export * from './lib/components';
|
|
5
6
|
export { NotificationListItem } from './lib/components/notificationListItem';
|
|
@@ -21,7 +22,7 @@ export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selecti
|
|
|
21
22
|
export * from './lib/feature/legacyLegend/index';
|
|
22
23
|
export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
|
|
23
24
|
export * from './lib/feature/legend/index';
|
|
24
|
-
export {
|
|
25
|
+
export { legendVisibleTagsSubscribeToStore } from './lib/feature/legend/legendVisibleDataAsTagsStore';
|
|
25
26
|
export type { LegendDataId, LegendEquipmentId, LegendState, LegendTagId } from './lib/feature/legend/types/legendType';
|
|
26
27
|
export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
|
|
27
28
|
export * from './lib/feature/measuringPoint/index';
|
|
@@ -84,8 +85,8 @@ declare const EchoFramework: Readonly<{
|
|
|
84
85
|
}>;
|
|
85
86
|
}>;
|
|
86
87
|
Hooks: Readonly<{
|
|
88
|
+
useClosePanelByKey: typeof hooks.useClosePanelByKey;
|
|
87
89
|
useInstCodeSafe: () => string;
|
|
88
|
-
useClosePanelByKey(panelKey?: string): () => void;
|
|
89
90
|
useEchoHistory(): (path: string, params?: {
|
|
90
91
|
[key: string]: string;
|
|
91
92
|
} | undefined, state?: any) => void;
|
|
@@ -117,12 +118,12 @@ declare const EchoFramework: Readonly<{
|
|
|
117
118
|
tagNo: string;
|
|
118
119
|
instCode: string;
|
|
119
120
|
}): {
|
|
120
|
-
tagDetails: import("
|
|
121
|
+
tagDetails: import("@equinor/echo-search").TagDetailsDto | undefined;
|
|
121
122
|
isTagDetailsLoading: boolean;
|
|
122
123
|
hasError: boolean;
|
|
123
124
|
};
|
|
124
125
|
useSetActiveTagNo: () => import("./lib/types/hookLibrary").SetActiveTagNo;
|
|
125
|
-
useContextMenuDataInfo: (tagNo: string, expanded: boolean, setActivePanel?: () => void) => import("
|
|
126
|
+
useContextMenuDataInfo: (tagNo: string, expanded: boolean, setActivePanel?: () => void) => import("@equinor/echo-components").DataInformation[];
|
|
126
127
|
useTagData: () => import("./lib/types/hookLibrary").TagData;
|
|
127
128
|
useIsContextMenuInfoLoading: () => boolean;
|
|
128
129
|
useSetActiveCommPackNo: () => import("./lib/types/hookLibrary").SetActiveCommPackNo;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PlantAndTagForOpenIn3d } from '../openItemsIn3d/logic/openItemsIn3d.utils';
|
|
2
|
+
/**
|
|
3
|
+
* Converts global selection items to plant tag pairs.
|
|
4
|
+
*
|
|
5
|
+
* This function processes different types of global selection items (Tag, WorkOrder, Equipment)
|
|
6
|
+
* and converts them into an array of `PlantAndTagForOpenIn3d` objects. It ensures that all
|
|
7
|
+
* enum cases are handled by using a switch statement and the `assertUnreachable` function.
|
|
8
|
+
*
|
|
9
|
+
* The resulting array is then filtered to remove duplicates based on the combination of
|
|
10
|
+
* `instCode`, `pdmsPlantCode`, and `tagNo`.
|
|
11
|
+
*
|
|
12
|
+
* @returns {Promise<PlantAndTagForOpenIn3d[]>} A promise that resolves to an array of plant tag pairs.
|
|
13
|
+
*/
|
|
14
|
+
export declare function convertGlobalSelectionItemsToPlantTagPairs(): Promise<PlantAndTagForOpenIn3d[]>;
|
|
@@ -27,7 +27,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
27
27
|
* @param {GlobalSelectionCategoryId} args.category - The ID of the list where the items to be removed are located.
|
|
28
28
|
*/
|
|
29
29
|
itemsById: (args: {
|
|
30
|
-
groupId?: import("
|
|
30
|
+
groupId?: import("@equinor/echo-utils").Guid;
|
|
31
31
|
categoryId: GlobalSelectionCategoryId;
|
|
32
32
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
33
33
|
}) => void;
|
|
@@ -54,7 +54,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
54
54
|
* @param {GlobalSelectionCategoryId} [args.categoryId] - The ID of the category to remove (optional).
|
|
55
55
|
*/
|
|
56
56
|
listById: (args: {
|
|
57
|
-
groupId: import("
|
|
57
|
+
groupId: import("@equinor/echo-utils").Guid;
|
|
58
58
|
categoryId?: GlobalSelectionCategoryId;
|
|
59
59
|
}) => void;
|
|
60
60
|
}>;
|
|
@@ -124,7 +124,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
124
124
|
}) => boolean;
|
|
125
125
|
findGroupByLabel: (args: {
|
|
126
126
|
label: string;
|
|
127
|
-
}) => import("
|
|
127
|
+
}) => import("@equinor/echo-utils").Guid | undefined;
|
|
128
128
|
};
|
|
129
129
|
visibility: Readonly<{
|
|
130
130
|
setByItemIds: (args: {
|
|
@@ -141,7 +141,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
141
141
|
* @param {boolean} args.isVisible - The visibility state to set for the items in the list.
|
|
142
142
|
*/
|
|
143
143
|
setById: (args: {
|
|
144
|
-
groupId: import("
|
|
144
|
+
groupId: import("@equinor/echo-utils").Guid;
|
|
145
145
|
categoryId?: GlobalSelectionCategoryId;
|
|
146
146
|
isVisible: boolean;
|
|
147
147
|
}) => void;
|
|
@@ -199,8 +199,8 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
199
199
|
*/
|
|
200
200
|
clearSelection: () => void;
|
|
201
201
|
createGroup: (args: {
|
|
202
|
-
groupId
|
|
202
|
+
groupId?: string;
|
|
203
203
|
label: string;
|
|
204
204
|
subLabel: string;
|
|
205
|
-
}) => import("
|
|
205
|
+
}) => import("@equinor/echo-utils").Guid;
|
|
206
206
|
}>;
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import { PlantAndTagForOpenIn3d } from '../../openItemsIn3d/logic/openItemsIn3d.utils';
|
|
2
1
|
import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemSystemStatus } from './globalSelectionStore.types';
|
|
3
|
-
/**
|
|
4
|
-
* Converts global selection items to plant tag pairs.
|
|
5
|
-
*
|
|
6
|
-
* This function processes different types of global selection items (Tag, WorkOrder, Equipment)
|
|
7
|
-
* and converts them into an array of `PlantAndTagForOpenIn3d` objects. It ensures that all
|
|
8
|
-
* enum cases are handled by using a switch statement and the `assertUnreachable` function.
|
|
9
|
-
*
|
|
10
|
-
* The resulting array is then filtered to remove duplicates based on the combination of
|
|
11
|
-
* `instCode`, `pdmsPlantCode`, and `tagNo`.
|
|
12
|
-
*
|
|
13
|
-
* @returns {Promise<PlantAndTagForOpenIn3d[]>} A promise that resolves to an array of plant tag pairs.
|
|
14
|
-
*/
|
|
15
|
-
export declare function convertGlobalSelectionItemsToPlantTagPairs(): Promise<PlantAndTagForOpenIn3d[]>;
|
|
16
2
|
export declare function toGlobalSelectionItem<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(item: T, type: K, systemStatus: SelectionItemSystemStatus): GlobalSelectionTypes.GenericItem<K>;
|
|
17
3
|
export declare function toGlobalSelectionItems<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(items: T[], type: K, systemStatus: SelectionItemSystemStatus): GlobalSelectionTypes.GenericItem<K>[];
|
|
18
4
|
export declare function setNotFoundStatusByItemIds(args: {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
export { MeasuringPointListItem } from '../measuringPoint/components/MeasuringPointListItem';
|
|
2
1
|
export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
|
|
3
2
|
export { globalSelectionApi } from './globalSelection.api';
|
|
4
3
|
export { globalSelectionInternal } from './globalSelection.internal';
|
|
5
4
|
export * from './globalSelectionStore/globalSelectionStore.types';
|
|
6
5
|
export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
|
|
7
|
-
export { convertGlobalSelectionItemsToPlantTagPairs } from './globalSelectionStore/globalSelectionStoreHelpers';
|
|
8
6
|
export { useGlobalSelectionByItemId } from './hooks/useGlobalSelectionByItemId';
|
|
9
7
|
export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
|
|
10
8
|
export { useGlobalSelectionItemsByType } from './hooks/useGlobalSelectionItemsByType';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ResultArray } from '@equinor/echo-search';
|
|
2
2
|
import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export type AddByGroupIdAndLabel = {
|
|
4
|
+
groupId?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
subLabel: string;
|
|
7
|
+
} | {
|
|
8
|
+
groupId?: string;
|
|
6
9
|
label?: undefined;
|
|
7
10
|
subLabel?: undefined;
|
|
8
11
|
};
|
|
@@ -46,7 +46,7 @@ export interface SelectionTreeStore {
|
|
|
46
46
|
addEquipments: (args: AddItemArgs<GlobalSelectionTypes.EquipmentId>) => AddEquipmentsReturnType;
|
|
47
47
|
addMeasuringPoints: (args: AddItemArgs<GlobalSelectionTypes.MeasuringPointId>) => AddMeasuringPointsReturnType;
|
|
48
48
|
createGroup: (args: {
|
|
49
|
-
groupId
|
|
49
|
+
groupId?: string;
|
|
50
50
|
label: string;
|
|
51
51
|
subLabel: string;
|
|
52
52
|
}) => Guid;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { legendSnapShot, useAllLegends, useLegendById } from './legendStore';
|
|
2
2
|
import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/legendCollections';
|
|
3
|
+
import { visibleDataAsTagsSnapshot } from './legendVisibleDataAsTagsStore';
|
|
4
|
+
import { isLegendDataIdEqualWithTag } from './logic/isLegendDataIdEqualWithTag';
|
|
3
5
|
import { createLegendId } from './types/legendType';
|
|
4
6
|
/**
|
|
5
7
|
* Public facade for the legend.
|
|
@@ -9,6 +11,15 @@ export declare const legendFacade: Readonly<{
|
|
|
9
11
|
inject: typeof injectLegendStrategy;
|
|
10
12
|
get: typeof getLegendStrategy;
|
|
11
13
|
};
|
|
14
|
+
store: {
|
|
15
|
+
subscribe: {
|
|
16
|
+
(listener: (selectedState: import("./legendStore").LegendStoreData & import("./legendStore").LegendStoreActions, previousSelectedState: import("./legendStore").LegendStoreData & import("./legendStore").LegendStoreActions) => void): () => void;
|
|
17
|
+
<U>(selector: (state: import("./legendStore").LegendStoreData & import("./legendStore").LegendStoreActions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
18
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
19
|
+
fireImmediately?: boolean;
|
|
20
|
+
} | undefined): () => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
12
23
|
storeSnapshot: typeof legendSnapShot;
|
|
13
24
|
legend: {
|
|
14
25
|
createId: typeof createLegendId;
|
|
@@ -48,5 +59,47 @@ export declare const legendFacade: Readonly<{
|
|
|
48
59
|
}[T][];
|
|
49
60
|
removePreviousItems?: boolean;
|
|
50
61
|
}) => void;
|
|
62
|
+
subscribe: {
|
|
63
|
+
(listener: (selectedState: import("./legendVisibleDataStore").LegendVisibleDataStore, previousSelectedState: import("./legendVisibleDataStore").LegendVisibleDataStore) => void): () => void;
|
|
64
|
+
<U>(selector: (state: import("./legendVisibleDataStore").LegendVisibleDataStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
65
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
66
|
+
fireImmediately?: boolean;
|
|
67
|
+
} | undefined): () => void;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
visibleDataAsTags: {
|
|
71
|
+
useStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>, "setState"> & {
|
|
72
|
+
setState<A extends string | {
|
|
73
|
+
type: string;
|
|
74
|
+
}>(partial: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
75
|
+
}, "subscribe"> & {
|
|
76
|
+
subscribe: {
|
|
77
|
+
(listener: (selectedState: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore, previousSelectedState: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => void): () => void;
|
|
78
|
+
<U>(selector: (state: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
79
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
80
|
+
fireImmediately?: boolean;
|
|
81
|
+
} | undefined): () => void;
|
|
82
|
+
};
|
|
83
|
+
}, "setState"> & {
|
|
84
|
+
setState(nextStateOrUpdater: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("immer").WritableDraft<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
85
|
+
type: string;
|
|
86
|
+
} | undefined): void;
|
|
87
|
+
}>;
|
|
88
|
+
snapShot: typeof visibleDataAsTagsSnapshot;
|
|
89
|
+
};
|
|
90
|
+
utils: {
|
|
91
|
+
isLegendDataIdEqualWithTag: typeof isLegendDataIdEqualWithTag;
|
|
51
92
|
};
|
|
52
93
|
}>;
|
|
94
|
+
/**
|
|
95
|
+
<PositionalLegendMarkers
|
|
96
|
+
items={visibleItemsWithPosition}
|
|
97
|
+
pdfRotation={pdfRotation}
|
|
98
|
+
currentPageScale={currentPageScale}
|
|
99
|
+
pdfZoom={pdfZoom}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
*/
|
|
103
|
+
export type { LegendStoreActions, LegendStoreData } from './legendStore';
|
|
104
|
+
export type { VisibleDataAsTagsStore } from './legendVisibleDataAsTagsStore';
|
|
105
|
+
export type { LegendVisibleDataStore } from './legendVisibleDataStore';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PersistOptions } from 'zustand/middleware';
|
|
2
2
|
import { LegendId, LegendState } from './types/legendType';
|
|
3
3
|
type LegendsDictionary = Record<LegendId, LegendState>;
|
|
4
|
-
interface LegendStoreData {
|
|
4
|
+
export interface LegendStoreData {
|
|
5
5
|
legends: LegendsDictionary;
|
|
6
6
|
}
|
|
7
|
-
interface LegendStoreActions {
|
|
8
|
-
updateLegend: (legendId: LegendId, updates: Partial<LegendState
|
|
7
|
+
export interface LegendStoreActions {
|
|
8
|
+
updateLegend: (legendId: LegendId, updates: Partial<Omit<LegendState, 'isLoading'>>) => void;
|
|
9
|
+
startLoading: (legendId: LegendId) => void;
|
|
10
|
+
finishLoading: (legendId: LegendId) => void;
|
|
9
11
|
setHiddenMarker: (args: {
|
|
10
12
|
legendId: LegendId;
|
|
11
13
|
marker: string;
|
|
@@ -49,4 +51,11 @@ export declare const useLegendStore: import("zustand").UseBoundStore<Omit<Omit<O
|
|
|
49
51
|
export declare function useLegendById(legendId: LegendId): LegendState;
|
|
50
52
|
export declare function useAllLegends(): LegendState[];
|
|
51
53
|
export declare function legendSnapShot(): LegendStore;
|
|
54
|
+
export declare const legendStoreSubscribe: {
|
|
55
|
+
(listener: (selectedState: LegendStore, previousSelectedState: LegendStore) => void): () => void;
|
|
56
|
+
<U>(selector: (state: LegendStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
57
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
58
|
+
fireImmediately?: boolean;
|
|
59
|
+
} | undefined): () => void;
|
|
60
|
+
};
|
|
52
61
|
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TagWithEquipmentId } from './legendVisibleDataAsTagsStore.type';
|
|
2
|
+
interface VisibleDataAsTagsStoreState {
|
|
3
|
+
readonly tags: TagWithEquipmentId[];
|
|
4
|
+
readonly isPending: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface VisibleDataAsTagsStoreActions {
|
|
7
|
+
/**
|
|
8
|
+
* Will add tags that are in visible data store, the rest will be discarded.
|
|
9
|
+
* This is to ensure that we only keep tags that are relevant to the current visible data
|
|
10
|
+
*/
|
|
11
|
+
updateTags: (tags: TagWithEquipmentId[]) => void;
|
|
12
|
+
setIsPending: (isPending: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface VisibleDataAsTagsStore extends VisibleDataAsTagsStoreState, VisibleDataAsTagsStoreActions {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Goal here is to convert the visible data store items (like equipment) to tags.
|
|
18
|
+
* It also includes the TagSummary, and thereby have loading state.
|
|
19
|
+
*
|
|
20
|
+
* This one might be more convenient to use than the legendVisibleDataStore.
|
|
21
|
+
*/
|
|
22
|
+
export declare const useVisibleDataAsTagsStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<VisibleDataAsTagsStore>, "setState"> & {
|
|
23
|
+
setState<A extends string | {
|
|
24
|
+
type: string;
|
|
25
|
+
}>(partial: VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore> | ((state: VisibleDataAsTagsStore) => VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
26
|
+
}, "subscribe"> & {
|
|
27
|
+
subscribe: {
|
|
28
|
+
(listener: (selectedState: VisibleDataAsTagsStore, previousSelectedState: VisibleDataAsTagsStore) => void): () => void;
|
|
29
|
+
<U>(selector: (state: VisibleDataAsTagsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
30
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
31
|
+
fireImmediately?: boolean;
|
|
32
|
+
} | undefined): () => void;
|
|
33
|
+
};
|
|
34
|
+
}, "setState"> & {
|
|
35
|
+
setState(nextStateOrUpdater: VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore> | ((state: import("immer").WritableDraft<VisibleDataAsTagsStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
36
|
+
type: string;
|
|
37
|
+
} | undefined): void;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function visibleDataAsTagsSnapshot(): VisibleDataAsTagsStore;
|
|
40
|
+
export declare function legendVisibleTagsSubscribeToStore(): void;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TagWithEquipmentId } from './legendVisibleDataAsTagsStore.type';
|
|
2
|
+
import { LegendEquipmentId } from './types/legendType';
|
|
3
|
+
export declare function fetchTagsByEquipment(equipmentIds: ReadonlyArray<LegendEquipmentId>, abortController: AbortController): Promise<TagWithEquipmentId[] | undefined>;
|
|
@@ -34,7 +34,14 @@ interface LegendVisibleDataStoreActions {
|
|
|
34
34
|
useDataByType: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
|
|
35
35
|
getAll(): LegendDataId[];
|
|
36
36
|
}
|
|
37
|
-
type LegendVisibleDataStore = LegendVisibleData & LegendVisibleDataStoreActions;
|
|
37
|
+
export type LegendVisibleDataStore = LegendVisibleData & LegendVisibleDataStoreActions;
|
|
38
|
+
export declare function getLegendVisibleDataInitialValues(): LegendVisibleData;
|
|
39
|
+
/**
|
|
40
|
+
* This is meant to be a simple store, that contains all visible data ItemIds on screen that should be visible in the legend.
|
|
41
|
+
* It should only contain ItemIds, not the actual data. Meaning we don't need to handle fetch states here like loading.
|
|
42
|
+
*
|
|
43
|
+
* LegendVisibleDataConvertedToTagsStore might be more convenient to use in the legend strategies that don't relay on the EquipmentId.
|
|
44
|
+
*/
|
|
38
45
|
export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<LegendVisibleDataStore>, "setState"> & {
|
|
39
46
|
setState<A extends string | {
|
|
40
47
|
type: string;
|
|
@@ -68,5 +75,12 @@ export declare const visibleData: {
|
|
|
68
75
|
getAll: () => LegendDataId[];
|
|
69
76
|
useByType: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
|
|
70
77
|
useAddWithAutoRemove: typeof useAddWithAutoRemove;
|
|
78
|
+
subscribe: {
|
|
79
|
+
(listener: (selectedState: LegendVisibleDataStore, previousSelectedState: LegendVisibleDataStore) => void): () => void;
|
|
80
|
+
<U>(selector: (state: LegendVisibleDataStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
81
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
82
|
+
fireImmediately?: boolean;
|
|
83
|
+
} | undefined): () => void;
|
|
84
|
+
};
|
|
71
85
|
};
|
|
72
86
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LegendDataId } from '../types/legendType';
|
|
2
|
+
interface TagWithEquipmentId {
|
|
3
|
+
tagNo: string;
|
|
4
|
+
instCode: string;
|
|
5
|
+
equipmentId: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the given `legendDataId` is equal to the provided `tag` based on their properties.
|
|
9
|
+
* It first tries to match the `equipmentId`, and if no match, it tries the `tagId`
|
|
10
|
+
*/
|
|
11
|
+
export declare function isLegendDataIdEqualWithTag(legendDataId: LegendDataId, tag: TagWithEquipmentId): boolean;
|
|
12
|
+
export {};
|
|
@@ -9,11 +9,6 @@ export interface LegendStrategy {
|
|
|
9
9
|
* A unique identifier for the legend. Use a friendly UI name since it's displayed in legend component.
|
|
10
10
|
*/
|
|
11
11
|
legendId: LegendId;
|
|
12
|
-
/**
|
|
13
|
-
* not implemented yet TODO #155599 - Data Service
|
|
14
|
-
* Idea is to notify the legend that it should batch fetch data for the given visibleItemIds, and we will automatically show loading status in UI.
|
|
15
|
-
*/
|
|
16
|
-
fetchData?: (visibleItemIds: ReadonlyArray<LegendDataId>) => Promise<void>;
|
|
17
12
|
/**
|
|
18
13
|
* Marker options that is selectable by the user.
|
|
19
14
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { failureMechanismConfig, MeasuringPointDetails, MeasuringPointHeader } from './components';
|
|
2
|
+
export { MeasuringPointListItem } from './components/MeasuringPointListItem';
|
|
2
3
|
export { useOpenMeasuringPointDetails } from './hooks';
|
|
3
4
|
export type { DocumentRelationships } from './types/documentRelationships';
|
|
4
5
|
export type { MeasurementDto, MeasuringPointDto } from './types/measuringPoint';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PrepViewWorkOrder, PrepViewWorkOrderDto } from '../types/workOrder';
|
|
2
|
+
interface WorkOrderRequest {
|
|
3
|
+
readonly workOrderId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const getPrepviewWorkOrderDetails: (args: WorkOrderRequest) => Promise<PrepViewWorkOrder>;
|
|
6
|
+
export declare const cleanupPrepviewWorkOrder: (workOrder: PrepViewWorkOrderDto) => PrepViewWorkOrder;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface PrepviewTagInfoDto {
|
|
2
|
+
id: string;
|
|
3
|
+
functionalLocation: string;
|
|
4
|
+
location?: string | null;
|
|
5
|
+
area?: string | null;
|
|
6
|
+
overallCriticality?: string | null;
|
|
7
|
+
abcIndicator?: string | null;
|
|
8
|
+
redundancy?: string | null;
|
|
9
|
+
consequenceHse?: string | null;
|
|
10
|
+
consequenceProd?: string | null;
|
|
11
|
+
consequenceCost?: string | null;
|
|
12
|
+
consequenceFail?: string | null;
|
|
13
|
+
repairStrategy?: string | null;
|
|
14
|
+
criticalSparePartDemandTime?: string | null;
|
|
15
|
+
unsafeFailure?: Array<string>;
|
|
16
|
+
}
|
|
17
|
+
export interface PrepviewTagInfo {
|
|
18
|
+
id: string;
|
|
19
|
+
functionalLocation: string;
|
|
20
|
+
location?: string;
|
|
21
|
+
area?: string;
|
|
22
|
+
overallCriticality?: string;
|
|
23
|
+
abcIndicator?: string;
|
|
24
|
+
redundancy?: string;
|
|
25
|
+
consequenceHse?: string;
|
|
26
|
+
consequenceProd?: string;
|
|
27
|
+
consequenceCost?: string;
|
|
28
|
+
consequenceFail?: string;
|
|
29
|
+
repairStrategy?: string;
|
|
30
|
+
criticalSparePartDemandTime?: string;
|
|
31
|
+
unsafeFailure?: Array<string>;
|
|
32
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrepViewWorkOrder } from '../types/workOrder';
|
|
2
2
|
interface WorkOrderItemDetailsProps {
|
|
3
|
-
readonly data:
|
|
3
|
+
readonly data: PrepViewWorkOrder;
|
|
4
4
|
}
|
|
5
5
|
export declare const WorkOrderItemDetails: (props: WorkOrderItemDetailsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkOrderItemHeaderData } from './WorkOrderItemHeader.types';
|
|
2
2
|
interface WorkOrderHeaderProps {
|
|
3
|
-
|
|
4
|
-
* TODO: We need to improve types on WorkOrderListItem before we Pick the actual properties we need for this component.
|
|
5
|
-
* Until then we will continue with the original mapWorkOrderDetailsToWorkOrderItem.
|
|
6
|
-
*/
|
|
7
|
-
readonly data: WorkOrderDetails;
|
|
3
|
+
readonly data: WorkOrderItemHeaderData;
|
|
8
4
|
}
|
|
9
5
|
export declare const WorkOrderItemHeader: (props: WorkOrderHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
6
|
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { PrepViewWorkOrder } from '../types/workOrder';
|
|
2
|
+
export type WorkOrderItemHeaderData = Pick<PrepViewWorkOrder, 'id' | 'description' | 'orderType' | 'isActive' | 'workCenterId' | 'basicFinishDateStatus' | 'requiredEndDateTime' | 'requiredEndDateStatus' | 'maintenancePlanDate' | 'basicFinishDateTime' | 'basicStartDateTime' | 'planningPlant' | 'maintenancePlant' | 'plantId'>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PrepViewWorkOrder } from '../../types/workOrder';
|
|
2
|
+
type WorkOrderItemTabInfoData = Pick<PrepViewWorkOrder, 'tagId' | 'instCode' | 'tagCategory' | 'id' | 'description' | 'workCenterId' | 'requiredEndDateTime' | 'basicFinishDateTime' | 'basicStartDateTime' | 'planningPlant' | 'maintenancePlant' | 'activeStatusIds' | 'personResponsible' | 'locationId' | 'plannerGroupId' | 'system' | 'systemId' | 'createdDateTime' | 'changedDateTime' | 'priority' | 'revisionId' | 'equipmentId' | 'longText'>;
|
|
3
|
+
interface WorkOrderItemTabInfoProps {
|
|
4
|
+
readonly data: WorkOrderItemTabInfoData;
|
|
5
|
+
}
|
|
6
|
+
export declare const WorkOrderItemTabInfo: (props: WorkOrderItemTabInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrepViewWorkOrder } from '../types/workOrder';
|
|
2
2
|
export declare function usePrepviewWorkOrder(workOrderId: string): {
|
|
3
3
|
isLoading: boolean;
|
|
4
4
|
error: Error | null;
|
|
5
|
-
workOrder?:
|
|
5
|
+
workOrder?: PrepViewWorkOrder;
|
|
6
6
|
};
|