@equinor/echo-framework 0.18.10 → 0.18.11-gs-mvp-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/{47deeba42768c5d1.svg → 063009f06499d102.svg} +8 -8
- package/README.md +28 -28
- package/{1bd97dd2170d0f64.svg → f4c85313e79b1662.svg} +850 -850
- package/index.cjs.d.ts +2 -2
- package/index.cjs.js +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +2 -1
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/components/workOrderListItem/WorkOrderListItem.d.ts +14 -0
- package/src/lib/components/workOrderListItem/index.d.ts +1 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +110 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +91 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/index.d.ts +1 -0
- package/src/lib/feature/globalSelection/hooks/useGlobalSelectionLists.d.ts +4 -0
- package/src/lib/feature/globalSelection/hooks/useGlobalSelectionWorkOrders.d.ts +5 -0
- package/src/lib/feature/globalSelection/index.d.ts +4 -0
- package/src/lib/services/activeSelectionStore/activeSelectionData.hooks.d.ts +0 -10
- package/src/lib/services/activeSelectionStore/activeSelectionStore.d.ts +0 -27
- package/src/lib/services/activeSelectionStore/index.d.ts +0 -2
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { RequestProCoSysAccess } from './lib/components/requestAccess/RequestPro
|
|
|
9
9
|
export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
|
|
10
10
|
export * from './lib/coreApplication';
|
|
11
11
|
export * from './lib/feature/equipment/index';
|
|
12
|
+
export * from './lib/feature/globalSelection';
|
|
13
|
+
export type { GlobalSelectionItem, GlobalSelectionList, OptimizedWorkOrderDto } from './lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
12
14
|
export * from './lib/feature/legend/index';
|
|
13
15
|
export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
|
|
14
16
|
export * from './lib/feature/measuringPoint/index';
|
|
@@ -18,7 +20,6 @@ export { useIsCompactLayout } from './lib/hooks/useIsCompactLayout';
|
|
|
18
20
|
export { useIsFullScreenModeEnabled } from './lib/hooks/useIsFullScreenModeEnabled';
|
|
19
21
|
export { useScreenOrientation } from './lib/hooks/useScreenOrientation';
|
|
20
22
|
export { useScreenValues } from './lib/hooks/useScreenValues';
|
|
21
|
-
export * from './lib/services/activeSelectionStore';
|
|
22
23
|
export { getPlantsCachedOrApi, getPlantsFromApi } from './lib/services/api/api-plants';
|
|
23
24
|
export { RegisteredComponentName } from './lib/services/componentRegistry/componentRegistry';
|
|
24
25
|
export * from './lib/services/eventHubActions';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ColorMap, WorkOrderDateType, WorkOrderItem } from '@equinor/echo-components';
|
|
3
|
+
export interface WorkOrderListItemProps {
|
|
4
|
+
workOrder: WorkOrderItem;
|
|
5
|
+
onCardClick?: () => void;
|
|
6
|
+
itemAction?: React.ReactNode;
|
|
7
|
+
isHeader?: boolean;
|
|
8
|
+
colorMap?: ColorMap;
|
|
9
|
+
iconName?: string;
|
|
10
|
+
workOrderDateType?: WorkOrderDateType;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function WorkOrderListItem(props: WorkOrderListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { WorkOrderListItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WorkOrderListItem';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { GlobalSelectionItemType, GlobalSelectionStore, OptimizedWorkOrderDto } from './globalSelectionStore.types';
|
|
2
|
+
export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: string;
|
|
5
|
+
}>(partial: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: GlobalSelectionStore) => GlobalSelectionStore | Partial<GlobalSelectionStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "subscribe"> & {
|
|
7
|
+
subscribe: {
|
|
8
|
+
(listener: (selectedState: GlobalSelectionStore, previousSelectedState: GlobalSelectionStore) => void): () => void;
|
|
9
|
+
<U>(selector: (state: GlobalSelectionStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
10
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
11
|
+
fireImmediately?: boolean | undefined;
|
|
12
|
+
} | undefined): () => void;
|
|
13
|
+
};
|
|
14
|
+
}, "persist"> & {
|
|
15
|
+
persist: {
|
|
16
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<GlobalSelectionStore, unknown>>) => void;
|
|
17
|
+
clearStorage: () => void;
|
|
18
|
+
rehydrate: () => void | Promise<void>;
|
|
19
|
+
hasHydrated: () => boolean;
|
|
20
|
+
onHydrate: (fn: (state: GlobalSelectionStore) => void) => () => void;
|
|
21
|
+
onFinishHydration: (fn: (state: GlobalSelectionStore) => void) => () => void;
|
|
22
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<GlobalSelectionStore, unknown>>;
|
|
23
|
+
};
|
|
24
|
+
}, "setState"> & {
|
|
25
|
+
setState(nextStateOrUpdater: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: {
|
|
26
|
+
lists: {
|
|
27
|
+
label: string;
|
|
28
|
+
key: string;
|
|
29
|
+
type: GlobalSelectionItemType;
|
|
30
|
+
items: {
|
|
31
|
+
id: string;
|
|
32
|
+
type: GlobalSelectionItemType;
|
|
33
|
+
data: {
|
|
34
|
+
workOrderId: string;
|
|
35
|
+
tagId?: string | undefined;
|
|
36
|
+
tagPlantId: string;
|
|
37
|
+
workCenterId?: string | undefined;
|
|
38
|
+
workCenterPlantId: string;
|
|
39
|
+
plannerGroupId: string;
|
|
40
|
+
workOrderTypeId: string;
|
|
41
|
+
revisionCodeId: string;
|
|
42
|
+
systemId?: string | undefined;
|
|
43
|
+
isOpen: boolean;
|
|
44
|
+
hasStatusTECO: boolean;
|
|
45
|
+
hasStatusRDOP: boolean;
|
|
46
|
+
hasStatusCANC: boolean;
|
|
47
|
+
hasStatusSTRT: boolean;
|
|
48
|
+
hasStatusRDEX: boolean;
|
|
49
|
+
hasStatusPREP: boolean;
|
|
50
|
+
hasStatusPRCO: boolean;
|
|
51
|
+
title: string;
|
|
52
|
+
plantId: string;
|
|
53
|
+
planningPlantId: string;
|
|
54
|
+
sortField: string;
|
|
55
|
+
locationId: string;
|
|
56
|
+
revisionId: string;
|
|
57
|
+
basicStartDateTime?: string | null | undefined;
|
|
58
|
+
basicEndDateTime?: string | null | undefined;
|
|
59
|
+
createdDateTime?: string | null | undefined;
|
|
60
|
+
maintenanceRecord?: {
|
|
61
|
+
activeStatusIds: string;
|
|
62
|
+
completedDateTime?: string | null | undefined;
|
|
63
|
+
correctiveWorkOrderExist?: boolean | undefined;
|
|
64
|
+
correctiveWorkOrderId?: string | undefined;
|
|
65
|
+
createdDateTime: string;
|
|
66
|
+
detectionMethodGroupId?: string | undefined;
|
|
67
|
+
detectionMethodId?: string | undefined;
|
|
68
|
+
equipmentId: string;
|
|
69
|
+
failureEndDateTime?: string | null | undefined;
|
|
70
|
+
failureImpactId?: string | undefined;
|
|
71
|
+
failureMechanismGroupId?: string | undefined;
|
|
72
|
+
failureMechanismId?: string | undefined;
|
|
73
|
+
failureModeGroupId?: string | undefined;
|
|
74
|
+
failureModeId?: string | undefined;
|
|
75
|
+
failureStartDateTime?: string | null | undefined;
|
|
76
|
+
hasUnsafeFailureMode?: boolean | undefined;
|
|
77
|
+
isBreakdown?: boolean | undefined;
|
|
78
|
+
isOpen?: boolean | undefined;
|
|
79
|
+
locationId?: string | undefined;
|
|
80
|
+
maintenanceRecordTypeId?: string | undefined;
|
|
81
|
+
recordId: string;
|
|
82
|
+
requiredEndDate?: string | null | undefined;
|
|
83
|
+
systemId?: string | undefined;
|
|
84
|
+
tagId: string;
|
|
85
|
+
tagPlantId: string;
|
|
86
|
+
title: string;
|
|
87
|
+
unsafeFailureModeStatus?: string | null | undefined;
|
|
88
|
+
workCenterId?: string | undefined;
|
|
89
|
+
} | null | undefined;
|
|
90
|
+
_links: {
|
|
91
|
+
related: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
metaData: {
|
|
95
|
+
isVisible: boolean;
|
|
96
|
+
color: string;
|
|
97
|
+
};
|
|
98
|
+
}[];
|
|
99
|
+
}[];
|
|
100
|
+
addWorkOrderToSelection: (args: {
|
|
101
|
+
workOrder: OptimizedWorkOrderDto;
|
|
102
|
+
}) => void;
|
|
103
|
+
replaceWorkOrderSelection: (args: {
|
|
104
|
+
workOrders: OptimizedWorkOrderDto[];
|
|
105
|
+
}) => void;
|
|
106
|
+
resetState: () => void;
|
|
107
|
+
}) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
108
|
+
type: string;
|
|
109
|
+
} | undefined): void;
|
|
110
|
+
}>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare enum GlobalSelectionItemType {
|
|
2
|
+
WorkOrder = "WorkOrder"
|
|
3
|
+
}
|
|
4
|
+
export type GlobalSelectionList = {
|
|
5
|
+
label: string;
|
|
6
|
+
key: string;
|
|
7
|
+
type: GlobalSelectionItemType;
|
|
8
|
+
items: GlobalSelectionItem[];
|
|
9
|
+
};
|
|
10
|
+
export type GlobalSelectionItem = {
|
|
11
|
+
id: string;
|
|
12
|
+
type: GlobalSelectionItemType;
|
|
13
|
+
data: OptimizedWorkOrderDto;
|
|
14
|
+
metaData: {
|
|
15
|
+
isVisible: boolean;
|
|
16
|
+
color: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export interface GlobalSelectionStore {
|
|
20
|
+
lists: GlobalSelectionList[];
|
|
21
|
+
addWorkOrderToSelection: (args: {
|
|
22
|
+
workOrder: OptimizedWorkOrderDto;
|
|
23
|
+
}) => void;
|
|
24
|
+
replaceWorkOrderSelection: (args: {
|
|
25
|
+
workOrders: OptimizedWorkOrderDto[];
|
|
26
|
+
}) => void;
|
|
27
|
+
resetState: () => void;
|
|
28
|
+
}
|
|
29
|
+
export type OptimizedWorkOrderDto = {
|
|
30
|
+
workOrderId: string;
|
|
31
|
+
tagId?: string;
|
|
32
|
+
tagPlantId: string;
|
|
33
|
+
workCenterId?: string;
|
|
34
|
+
workCenterPlantId: string;
|
|
35
|
+
plannerGroupId: string;
|
|
36
|
+
workOrderTypeId: string;
|
|
37
|
+
revisionCodeId: string;
|
|
38
|
+
systemId?: string;
|
|
39
|
+
isOpen: boolean;
|
|
40
|
+
hasStatusTECO: boolean;
|
|
41
|
+
hasStatusRDOP: boolean;
|
|
42
|
+
hasStatusCANC: boolean;
|
|
43
|
+
hasStatusSTRT: boolean;
|
|
44
|
+
hasStatusRDEX: boolean;
|
|
45
|
+
hasStatusPREP: boolean;
|
|
46
|
+
hasStatusPRCO: boolean;
|
|
47
|
+
title: string;
|
|
48
|
+
plantId: string;
|
|
49
|
+
planningPlantId: string;
|
|
50
|
+
sortField: string;
|
|
51
|
+
locationId: string;
|
|
52
|
+
revisionId: string;
|
|
53
|
+
basicStartDateTime?: string | null;
|
|
54
|
+
basicEndDateTime?: string | null;
|
|
55
|
+
createdDateTime?: string | null;
|
|
56
|
+
maintenanceRecord?: WorkOrderMaintenanceRecord | null;
|
|
57
|
+
_links: {
|
|
58
|
+
related: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
type WorkOrderMaintenanceRecord = {
|
|
62
|
+
activeStatusIds: string;
|
|
63
|
+
completedDateTime?: string | null;
|
|
64
|
+
correctiveWorkOrderExist?: boolean;
|
|
65
|
+
correctiveWorkOrderId?: string;
|
|
66
|
+
createdDateTime: string;
|
|
67
|
+
detectionMethodGroupId?: string;
|
|
68
|
+
detectionMethodId?: string;
|
|
69
|
+
equipmentId: string;
|
|
70
|
+
failureEndDateTime?: string | null;
|
|
71
|
+
failureImpactId?: string;
|
|
72
|
+
failureMechanismGroupId?: string;
|
|
73
|
+
failureMechanismId?: string;
|
|
74
|
+
failureModeGroupId?: string;
|
|
75
|
+
failureModeId?: string;
|
|
76
|
+
failureStartDateTime?: string | null;
|
|
77
|
+
hasUnsafeFailureMode?: boolean;
|
|
78
|
+
isBreakdown?: boolean;
|
|
79
|
+
isOpen?: boolean;
|
|
80
|
+
locationId?: string;
|
|
81
|
+
maintenanceRecordTypeId?: string;
|
|
82
|
+
recordId: string;
|
|
83
|
+
requiredEndDate?: string | null;
|
|
84
|
+
systemId?: string;
|
|
85
|
+
tagId: string;
|
|
86
|
+
tagPlantId: string;
|
|
87
|
+
title: string;
|
|
88
|
+
unsafeFailureModeStatus?: string | null;
|
|
89
|
+
workCenterId?: string;
|
|
90
|
+
};
|
|
91
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GlobalSelectionItem, GlobalSelectionList, OptimizedWorkOrderDto } from './globalSelectionStore.types';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useGlobalSelectionStore } from './globalSelectionStore/globalSelectionStore';
|
|
2
|
+
export * from './globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
|
|
4
|
+
export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TagSummaryDto } from '@equinor/echo-search';
|
|
2
|
-
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
/**
|
|
4
|
-
* Get the tag summaries for those tags, which are part of the active selection.
|
|
5
|
-
* Works with deep linking: if the selected instCode is different then the instCode in the URL
|
|
6
|
-
* it will fetch the tag summaries from STID API.
|
|
7
|
-
* Otherwise it will get it from echo-search.
|
|
8
|
-
* @returns {UseQueryResult<TagSummaryDto[]>}
|
|
9
|
-
*/
|
|
10
|
-
export declare function useActiveSelectedTagSummaries(): UseQueryResult<TagSummaryDto[]>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as zustand from 'zustand';
|
|
2
|
-
export declare const useActiveSelectionStore: zustand.UseBoundStore<Omit<zustand.StoreApi<ActiveSelectionState>, "subscribe"> & {
|
|
3
|
-
subscribe: {
|
|
4
|
-
(listener: (selectedState: ActiveSelectionState, previousSelectedState: ActiveSelectionState) => void): () => void;
|
|
5
|
-
<U>(selector: (state: ActiveSelectionState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
6
|
-
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
7
|
-
fireImmediately?: boolean | undefined;
|
|
8
|
-
} | undefined): () => void;
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
export type ActiveSelectionItemType = 'tagNos' | 'workOrderIds' | 'measuringPointIds';
|
|
12
|
-
export type ActiveSelectionItems = {
|
|
13
|
-
[key in ActiveSelectionItemType]: string[];
|
|
14
|
-
};
|
|
15
|
-
export interface ActiveSelectionState {
|
|
16
|
-
items: ActiveSelectionItems;
|
|
17
|
-
userRequestAction: string | null;
|
|
18
|
-
actions: ActiveSelectionActions;
|
|
19
|
-
}
|
|
20
|
-
interface ActiveSelectionActions {
|
|
21
|
-
addToSelectionByType: (itemType: ActiveSelectionItemType, items: string[]) => void;
|
|
22
|
-
removeFromSelectionByType: (itemType: ActiveSelectionItemType, items: string[]) => void;
|
|
23
|
-
clearSelectionByType: (itemType: ActiveSelectionItemType) => void;
|
|
24
|
-
clearSelectionForAllTypes: () => void;
|
|
25
|
-
replaceSelection: (items: ActiveSelectionItems, action?: string) => void;
|
|
26
|
-
}
|
|
27
|
-
export {};
|