@equinor/echo-framework 0.20.5-beta-7 → 0.20.5-beta9
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 +1 -1
- package/package.json +2 -2
- package/src/index.d.ts +3 -5
- package/src/lib/feature/globalSelection/OpenGlobalSelectionIn3DButton.d.ts +9 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +4 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +3 -1
- package/src/lib/feature/globalSelection/hooks/useGlobalSelectionItems.d.ts +2 -0
- package/src/lib/feature/globalSelection/index.d.ts +3 -1
- package/src/lib/feature/openItemsIn3d/index.d.ts +3 -0
- package/src/lib/{components/openIn3d/OpenIn3dWarningDialog.d.ts → feature/openItemsIn3d/openIn3dWarningDialog.d.ts} +2 -2
- package/src/lib/feature/openItemsIn3d/openItemsIn3d.utils.d.ts +38 -0
- package/src/lib/feature/openItemsIn3d/openItemsIn3dDialog.d.ts +49 -0
- package/src/lib/feature/openItemsIn3d/plantNoSelectionDialog.d.ts +9 -0
- package/src/lib/utils/echopediaWebReactPortal.utils.d.ts +4 -0
- package/src/lib/utils/index.d.ts +1 -0
- package/src/lib/components/openIn3d/OpenIn3dDialogs.d.ts +0 -14
- package/src/lib/components/openIn3d/PlantNoSelectionDialog.d.ts +0 -13
- package/src/lib/components/openIn3d/index.d.ts +0 -4
- /package/src/lib/{components/openIn3d → feature/openItemsIn3d}/SelectedItemsMenu.d.ts +0 -0
- /package/src/lib/{components/openIn3d → feature/openItemsIn3d}/openIn3dMenu.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.20.5-
|
|
3
|
+
"version": "0.20.5-beta9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.7.0 < 0.8.0",
|
|
6
6
|
"@equinor/echo-components": ">= 0.11.0 < 0.12.0",
|
|
7
|
-
"@equinor/echo-core": "
|
|
7
|
+
"@equinor/echo-core": ">= 0.9.0 < 0.10.0",
|
|
8
8
|
"@equinor/echo-search": ">= 0.15.0 < 0.16.0",
|
|
9
9
|
"@equinor/echo-utils": ">= 0.4.0 < 0.5.0",
|
|
10
10
|
"@equinor/eds-core-react": "0.34.0",
|
package/src/index.d.ts
CHANGED
|
@@ -2,14 +2,10 @@ import { getLegendStatusColor } from './lib/feature/legend/utils/legendUtils';
|
|
|
2
2
|
import './lib/globalStyles.css';
|
|
3
3
|
import { getPlantsInfo, getTagDetails } from './lib/services/api';
|
|
4
4
|
export * from './lib/components';
|
|
5
|
-
export { OpenIn3dDialogs } from './lib/components/openIn3d/OpenIn3dDialogs';
|
|
6
|
-
export { OpenIn3dWarningDialog } from './lib/components/openIn3d/OpenIn3dWarningDialog';
|
|
7
|
-
export { PlantNoSelectionDialog } from './lib/components/openIn3d/PlantNoSelectionDialog';
|
|
8
|
-
export { SelectedItemsMenu } from './lib/components/openIn3d/SelectedItemsMenu';
|
|
9
5
|
export { PrepviewButton } from './lib/components/prepviewButton/prepviewButton';
|
|
6
|
+
export { useFetchPlantInfo } from './lib/components/requestAccess/hooks/fetchPlantInfo';
|
|
10
7
|
export { RequestProCoSysAccess } from './lib/components/requestAccess/RequestProCoSysAccess';
|
|
11
8
|
export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
|
|
12
|
-
export { useFetchPlantInfo } from './lib/components/requestAccess/hooks/fetchPlantInfo';
|
|
13
9
|
export { WorkOrderListItem } from './lib/components/workOrderListItem';
|
|
14
10
|
export * from './lib/coreApplication';
|
|
15
11
|
export * from './lib/feature/equipment/index';
|
|
@@ -19,6 +15,8 @@ export * from './lib/feature/legend/index';
|
|
|
19
15
|
export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
|
|
20
16
|
export * from './lib/feature/measuringPoint/index';
|
|
21
17
|
export * from './lib/feature/measuringPoint/types/measuringPoint';
|
|
18
|
+
export * from './lib/feature/openItemsIn3d';
|
|
19
|
+
export { SelectedItemsMenu } from './lib/feature/openItemsIn3d/SelectedItemsMenu';
|
|
22
20
|
export { RegisteredHookName } from './lib/hooks/hookLibrary';
|
|
23
21
|
export { useIsCompactLayout } from './lib/hooks/useIsCompactLayout';
|
|
24
22
|
export { useIsFullScreenModeEnabled } from './lib/hooks/useIsFullScreenModeEnabled';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseError } from '@equinor/echo-base';
|
|
2
|
+
interface OpenGlobalSelectionIn3DButtonProps {
|
|
3
|
+
onPlantLoadError: (args: {
|
|
4
|
+
error: Error | BaseError;
|
|
5
|
+
errorMessage: string;
|
|
6
|
+
}) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const OpenGlobalSelectionIn3DButton: ({ onPlantLoadError }: OpenGlobalSelectionIn3DButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts
CHANGED
|
@@ -53,6 +53,10 @@ export interface GlobalSelectionStore {
|
|
|
53
53
|
setNotFoundItems: (args: {
|
|
54
54
|
itemIds: Readonly<string[]>;
|
|
55
55
|
}) => void;
|
|
56
|
+
setVisibility: (args: {
|
|
57
|
+
itemId: string;
|
|
58
|
+
isVisible: boolean;
|
|
59
|
+
}) => void;
|
|
56
60
|
resetItemNotFoundStates: () => void;
|
|
57
61
|
resetState: () => void;
|
|
58
62
|
}
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlantTagPair } from '../../openItemsIn3d/openItemsIn3d.utils';
|
|
2
|
+
import { GlobalSelectionGenericItem, GlobalSelectionItem, GlobalSelectionItemErrorStatuses, GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionListUnion, GlobalSelectionStore } from './globalSelectionStore.types';
|
|
2
3
|
export declare function toGlobalSelectionItem<T extends GlobalSelectionItemTypeToDataMap[K], K extends GlobalSelectionItemType>(item: T, type: K, idSelector: (item: T) => string): GlobalSelectionGenericItem<K>;
|
|
3
4
|
export declare function toGlobalSelectionItems<T extends GlobalSelectionItemTypeToDataMap[K], K extends GlobalSelectionItemType>(items: T[], type: K, idSelector: (item: T) => string): GlobalSelectionGenericItem<K>[];
|
|
4
5
|
export declare function findGlobalSelectionListByKey(state: GlobalSelectionStore, key: string): GlobalSelectionListUnion | undefined;
|
|
5
6
|
export declare function hasGlobalSelectionItemErrorStatus<T extends GlobalSelectionItemType>(item: GlobalSelectionGenericItem<T>, status: GlobalSelectionItemErrorStatuses): boolean;
|
|
7
|
+
export declare const convertGlobalSelectionItemsToPlantTagPairs: (items: GlobalSelectionItem[]) => PlantTagPair[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { getGlobalSelectionStoreState, useGlobalSelectionStore } from './globalSelectionStore/globalSelectionStore';
|
|
2
2
|
export * from './globalSelectionStore/globalSelectionStore.types';
|
|
3
|
-
export { hasGlobalSelectionItemErrorStatus } from './globalSelectionStore/globalSelectionStore.utils';
|
|
3
|
+
export { convertGlobalSelectionItemsToPlantTagPairs, hasGlobalSelectionItemErrorStatus } from './globalSelectionStore/globalSelectionStore.utils';
|
|
4
|
+
export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
|
|
4
5
|
export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
|
|
5
6
|
export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
|
|
6
7
|
export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
|
|
8
|
+
export { OpenGlobalSelectionIn3DButton } from './OpenGlobalSelectionIn3DButton';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface OpenIn3dWarningDialogProps {
|
|
3
3
|
open: boolean;
|
|
4
|
-
|
|
4
|
+
onOKButtonClicked?: () => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const OpenIn3dWarningDialog: React.FC<OpenIn3dWarningDialogProps>;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves unique plant numbers and item number counts from an array of PlantTagPair objects.
|
|
3
|
+
*
|
|
4
|
+
* @param args - The arguments for the function.
|
|
5
|
+
* @param args.items - The array of PlantTagPair objects.
|
|
6
|
+
* @returns An object containing unique plant numbers and item number counts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getUniquePlantNosAndItemNoCounts(args: {
|
|
9
|
+
items: PlantTagPair[];
|
|
10
|
+
}): {
|
|
11
|
+
uniquePlantNos: string[];
|
|
12
|
+
itemCountsByPlantNo: Record<string, number>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves the items from the given array that have the same plant number as the selected plant number.
|
|
16
|
+
*
|
|
17
|
+
* @param selectedItems - The array of PlantTagPair objects.
|
|
18
|
+
* @param selectedPlantNo - The selected plant number.
|
|
19
|
+
* @returns An array of PlantTagPair objects that have the same plant number as the selected plant number.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getItemsForSelectedPlantNo(selectedItems: PlantTagPair[], selectedPlantNo: string): PlantTagPair[];
|
|
22
|
+
/**
|
|
23
|
+
* Checks if there are more then one unique plant numbers in the passed PlantTagPair[].
|
|
24
|
+
*
|
|
25
|
+
* @param items - The array of PlantTagPair objects to check.
|
|
26
|
+
* @returns A boolean indicating whether multiple, unique plant numbers are present in the passed array.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isMultiplePlantNoSelected(items: PlantTagPair[]): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the plant SAP ID from an array of PlantTagPair. It will return with the first, non empty plant SAP ID found.
|
|
31
|
+
* @param items - The array of PlantTagPair items.
|
|
32
|
+
* @returns The plant SAP ID if found, otherwise undefined.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getPlantSapIdFromItems(items: PlantTagPair[]): string | undefined;
|
|
35
|
+
export interface PlantTagPair {
|
|
36
|
+
plantNo: string | undefined;
|
|
37
|
+
tagNo: string | undefined;
|
|
38
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BaseError } from '@equinor/echo-base';
|
|
2
|
+
import { PlantTagPair } from './openItemsIn3d.utils';
|
|
3
|
+
/**
|
|
4
|
+
* This component is designed to facilitate the opening of items in a 3D view within the application.
|
|
5
|
+
* It manages user interactions for selecting a plant number when multiple options are available,
|
|
6
|
+
* displays warnings if there are issues with opening items in 3D, and handles scenarios where a plant is not available.
|
|
7
|
+
* Contains built in mechanism to open items in 3d, but can be disabled if the consumer wants to handle this themselves.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @param {Object} props - The properties passed to the component.
|
|
11
|
+
* @param {Array} props.items - Array of items that the user intends to open in 3D. Each item should contain necessary information for the 3D view to be rendered.
|
|
12
|
+
* @param {boolean} props.open - Boolean indicating whether the dialog should be open or closed.
|
|
13
|
+
* @param {Function} props.onPlantLoadError - Function to be called when there is an error loading the plant information. Only needed when props.disableDefault3dOpener=false.
|
|
14
|
+
* @param {Function} props.onPlantSelectionCompleted - Function to be called when the plant selection process has been completed by the user.
|
|
15
|
+
* @param {Function} props.onCancelButtonClicked - Function to be called when the user clicks the cancel button.
|
|
16
|
+
* @param {Object} props.plantNotAvailableDialogProps - Object containing properties for the dialog shown when a plant is not available. Only needed when props.disableDefault3dOpener=true.
|
|
17
|
+
* @param {boolean} [props.disableDefault3dOpener=false] - Boolean indicating whether the default mechanism to open items in 3D should be disabled.
|
|
18
|
+
*
|
|
19
|
+
* @returns {React.ReactElement} A React Element representing the OpenItemsIn3dDialog.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare const OpenItemsIn3dDialog: ({ items, open, onPlantLoadError, onPlantSelectionCompleted, onCancelButtonClicked, plantNotAvailableDialogProps, disableDefault3dOpener }: OpenItemsIn3dDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
interface BaseOpenItemsIn3dDialogProps {
|
|
24
|
+
items: PlantTagPair[];
|
|
25
|
+
onPlantSelectionCompleted: (args: {
|
|
26
|
+
plantId: string | undefined;
|
|
27
|
+
itemsForSelectedPlant: PlantTagPair[];
|
|
28
|
+
}) => void;
|
|
29
|
+
onCancelButtonClicked: () => void;
|
|
30
|
+
open: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface WithDefault3dOpener extends BaseOpenItemsIn3dDialogProps {
|
|
33
|
+
disableDefault3dOpener?: false;
|
|
34
|
+
onPlantLoadError: (args: {
|
|
35
|
+
error: Error | BaseError;
|
|
36
|
+
errorMessage: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
plantNotAvailableDialogProps?: never;
|
|
39
|
+
}
|
|
40
|
+
interface WithDefault3dOpenerDisabled extends BaseOpenItemsIn3dDialogProps {
|
|
41
|
+
disableDefault3dOpener: true;
|
|
42
|
+
plantNotAvailableDialogProps: {
|
|
43
|
+
open: boolean;
|
|
44
|
+
onCloseDialogClicked: () => void;
|
|
45
|
+
};
|
|
46
|
+
onPlantLoadError?: never;
|
|
47
|
+
}
|
|
48
|
+
type OpenItemsIn3dDialogProps = WithDefault3dOpenerDisabled | WithDefault3dOpener;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PlantTagPair } from './openItemsIn3d.utils';
|
|
2
|
+
interface PlantNoSelectionDialogProps {
|
|
3
|
+
items: PlantTagPair[];
|
|
4
|
+
onPlantSelectionConfirmed: (plantId: string, itemsForSelectedPlant: PlantTagPair[]) => void;
|
|
5
|
+
onCancelButtonClicked: () => void;
|
|
6
|
+
open: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const PlantNoSelectionDialog: ({ items, onPlantSelectionConfirmed, onCancelButtonClicked, open }: PlantNoSelectionDialogProps) => JSX.Element;
|
|
9
|
+
export {};
|
package/src/lib/utils/index.d.ts
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
interface OpenIn3dDialogsProps {
|
|
3
|
-
isOpenIn3dWarningDialogOpen: boolean;
|
|
4
|
-
isSelectPlantNoDialogOpen: boolean;
|
|
5
|
-
setIsOpenIn3dWarningDialogOpen: Dispatch<React.SetStateAction<boolean>>;
|
|
6
|
-
setIsSelectPlantNoDialogOpen: Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
-
onOKButtonClicked: () => void;
|
|
8
|
-
uniquePlantNos: string[];
|
|
9
|
-
tagNoCounts: Record<string, number>;
|
|
10
|
-
selectedPlantNo: string | undefined;
|
|
11
|
-
setSelectedPlantNo: Dispatch<SetStateAction<string | undefined>>;
|
|
12
|
-
}
|
|
13
|
-
export declare const OpenIn3dDialogs: React.FC<OpenIn3dDialogsProps>;
|
|
14
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
interface PlantNoSelectionDialogProps {
|
|
3
|
-
onOKButtonClicked: () => void;
|
|
4
|
-
open: boolean;
|
|
5
|
-
uniquePlantNos: string[];
|
|
6
|
-
selectedPlantNo: string | undefined;
|
|
7
|
-
setSelectedPlantNo: Dispatch<SetStateAction<string | undefined>>;
|
|
8
|
-
isSelectPlantNoDialogOpen: boolean;
|
|
9
|
-
setIsSelectPlantNoDialogOpen: Dispatch<SetStateAction<boolean>>;
|
|
10
|
-
tagNoCounts: Record<string, number>;
|
|
11
|
-
}
|
|
12
|
-
export declare const PlantNoSelectionDialog: React.FC<PlantNoSelectionDialogProps>;
|
|
13
|
-
export {};
|
|
File without changes
|
|
File without changes
|