@equinor/echo-framework 0.20.5-beta-8 → 0.20.5-beta12

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.
Files changed (57) hide show
  1. package/index.cjs.js +1 -1
  2. package/package.json +4 -3
  3. package/src/index.d.ts +9 -5
  4. package/src/lib/components/fullScreenButtons/FullScreenChip.d.ts +0 -1
  5. package/src/lib/components/fullScreenButtons/FullScreenModeButton.d.ts +0 -1
  6. package/src/lib/components/fullScreenButtons/FullScreenModeChip.d.ts +5 -0
  7. package/src/lib/components/fullScreenButtons/index.d.ts +1 -1
  8. package/src/lib/components/index.d.ts +1 -1
  9. package/src/lib/components/tagSearchDropDown/index.d.ts +1 -0
  10. package/src/lib/components/tagSearchDropDown/tagSearchDropDown.d.ts +9 -0
  11. package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts +1 -2
  12. package/src/lib/feature/equipment/types/equipment.d.ts +2 -2
  13. package/src/lib/feature/equipment/utils/equipmentUtils.d.ts +1 -2
  14. package/src/lib/feature/globalSelection/OpenGlobalSelectionIn3DButton.d.ts +9 -0
  15. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +19 -4
  16. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +2 -0
  17. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +10 -0
  18. package/src/lib/feature/globalSelection/hooks/useGlobalSelectionItems.d.ts +2 -0
  19. package/src/lib/feature/globalSelection/index.d.ts +3 -1
  20. package/src/lib/feature/measuringPoint/components/index.d.ts +0 -1
  21. package/src/lib/feature/measuringPoint/index.d.ts +1 -1
  22. package/src/lib/feature/openItemsIn3d/index.d.ts +4 -0
  23. package/src/lib/feature/openItemsIn3d/logic/convertToPlantTagPairs.d.ts +10 -0
  24. package/src/lib/feature/openItemsIn3d/logic/createEcho3dInternalLink.d.ts +11 -0
  25. package/src/lib/feature/openItemsIn3d/logic/openItemsIn3d.utils.d.ts +45 -0
  26. package/src/lib/{components/openIn3d/OpenIn3dWarningDialog.d.ts → feature/openItemsIn3d/openIn3dWarningDialog.d.ts} +2 -2
  27. package/src/lib/feature/openItemsIn3d/openItemsIn3dDialog.d.ts +42 -0
  28. package/src/lib/feature/openItemsIn3d/plantNoSelectionDialog.d.ts +10 -0
  29. package/src/lib/hooks/index.d.ts +1 -0
  30. package/src/lib/hooks/useFetchInstCodeBySapPlantId.d.ts +3 -0
  31. package/src/lib/services/dataLayerPanel/dataLayerPanel.store.d.ts +43 -0
  32. package/src/lib/services/dataLayerPanel/index.d.ts +1 -0
  33. package/src/lib/types/echoHubPlant.d.ts +1 -1
  34. package/src/lib/utils/echopediaWebReactPortal.utils.d.ts +4 -0
  35. package/src/lib/utils/getPdmsPlantCodeForTag.d.ts +6 -0
  36. package/src/lib/utils/index.d.ts +2 -1
  37. package/src/lib/utils/openIn3d/tagLists.d.ts +10 -4
  38. package/src/lib/utils/plantInfo.d.ts +9 -20
  39. package/src/lib/utils/workOrderUtils.d.ts +1 -0
  40. package/src/lib/components/echo3DButton/3dButtonUtils.d.ts +0 -12
  41. package/src/lib/components/echo3DButton/OpenIn3dDropdown.d.ts +0 -11
  42. package/src/lib/components/echo3DButton/echo3DButton.d.ts +0 -18
  43. package/src/lib/components/echo3DButton/echo3DIconButton.d.ts +0 -26
  44. package/src/lib/components/echo3DButton/icons/E3DWebBetaIcon.d.ts +0 -6
  45. package/src/lib/components/echo3DButton/index.d.ts +0 -2
  46. package/src/lib/components/echo3DButton/missingEcho3dAccessDialog.d.ts +0 -8
  47. package/src/lib/components/echo3DButton/plantNotAvailableInfo.d.ts +0 -6
  48. package/src/lib/components/echo3DButton/useGetOpenIn3d.d.ts +0 -5
  49. package/src/lib/components/echo3DButton/useGoToEcho3DWebLink.d.ts +0 -1
  50. package/src/lib/components/fullScreenButtons/FullScreenButton.d.ts +0 -7
  51. package/src/lib/components/openIn3d/OpenIn3dDialogs.d.ts +0 -14
  52. package/src/lib/components/openIn3d/PlantNoSelectionDialog.d.ts +0 -13
  53. package/src/lib/components/openIn3d/index.d.ts +0 -4
  54. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointDetails.logic.d.ts +0 -2
  55. package/src/lib/utils/tagUtils.d.ts +0 -26
  56. /package/src/lib/{components/openIn3d → feature/openItemsIn3d}/SelectedItemsMenu.d.ts +0 -0
  57. /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-beta-8",
3
+ "version": "0.20.5-beta12",
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": "^0.20.5-beta-5",
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",
@@ -21,5 +21,6 @@
21
21
  "react-swipeable": "7.0.1"
22
22
  },
23
23
  "main": "./index.cjs.js",
24
- "type": "commonjs"
24
+ "type": "commonjs",
25
+ "types": "./index.cjs.d.ts"
25
26
  }
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,9 @@ 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 { createEcho3dInternalLink } from './lib/feature/openItemsIn3d/logic/createEcho3dInternalLink';
20
+ export { SelectedItemsMenu } from './lib/feature/openItemsIn3d/SelectedItemsMenu';
22
21
  export { RegisteredHookName } from './lib/hooks/hookLibrary';
23
22
  export { useIsCompactLayout } from './lib/hooks/useIsCompactLayout';
24
23
  export { useIsFullScreenModeEnabled } from './lib/hooks/useIsFullScreenModeEnabled';
@@ -26,6 +25,7 @@ export { useScreenOrientation } from './lib/hooks/useScreenOrientation';
26
25
  export { useScreenValues } from './lib/hooks/useScreenValues';
27
26
  export { getPlantsCachedOrApi, getPlantsFromApi } from './lib/services/api/api-plants';
28
27
  export { RegisteredComponentName } from './lib/services/componentRegistry/componentRegistry';
28
+ export * from './lib/services/dataLayerPanel';
29
29
  export * from './lib/services/eventHubActions';
30
30
  export * from './lib/services/leftPanelNavigation';
31
31
  export * from './lib/theme/themeConst';
@@ -40,6 +40,7 @@ export { InternalApplicationLinks } from './lib/types/navigation/internalApplica
40
40
  export { PingableSources } from './lib/types/pingableSources';
41
41
  export { SearchItemDetailsType as searchItemDetailsType } from './lib/types/searchItemDetailsType';
42
42
  export * from './lib/utils';
43
+ export { getPdmsPlantCodeForTag } from './lib/utils/getPdmsPlantCodeForTag';
43
44
  export { convertPathNameToReadableString } from './lib/utils/moduleNameUtils';
44
45
  export * from './lib/utils/startup';
45
46
  export declare const registerEchopediaComponent: ({ name, component }: {
@@ -67,6 +68,9 @@ declare const EchoFramework: Readonly<{
67
68
  useEchoHistory(): (path: string, params?: {
68
69
  [key: string]: string;
69
70
  } | undefined, state?: any) => void;
71
+ useFetchInstCodeBySapPlantId: (args: {
72
+ sapPlantId: string | undefined;
73
+ }) => string | undefined;
70
74
  useHas3dAccess(plantCode?: string): boolean;
71
75
  useIsFullScreenModeEnabled(): boolean;
72
76
  useOpenPdfFile(): (args: {
@@ -5,4 +5,3 @@ export interface FullScreenChipProps {
5
5
  onDelete: () => void;
6
6
  }
7
7
  export declare const FullScreenChip: React.FC<FullScreenChipProps>;
8
- export default FullScreenChip;
@@ -1,3 +1,2 @@
1
1
  import React from 'react';
2
2
  export declare const FullScreenModeButton: React.FC;
3
- export default FullScreenModeButton;
@@ -0,0 +1,5 @@
1
+ interface FullScreenModeChipProps {
2
+ className?: string;
3
+ }
4
+ export declare const FullScreenModeChip: ({ className }: FullScreenModeChipProps) => false | import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,3 +1,3 @@
1
- export * from './FullScreenButton';
2
1
  export * from './FullScreenChip';
3
2
  export * from './FullScreenModeButton';
3
+ export * from './FullScreenModeChip';
@@ -2,7 +2,6 @@ export * from './appLinks';
2
2
  export * from './containers';
3
3
  export * from './contextualAppLinks/externalLinkButtons/index';
4
4
  export { ContextualAppLinks } from './contextualAppLinks/index';
5
- export * from './echo3DButton';
6
5
  export * from './echoLogo';
7
6
  export * from './errorBoundary';
8
7
  export * from './externalLinkButton/externalLinkButton';
@@ -24,5 +23,6 @@ export * from './router';
24
23
  export * from './searchMenu';
25
24
  export * from './spinner/spinner';
26
25
  export * from './tagNumber';
26
+ export * from './tagSearchDropDown';
27
27
  export * from './toaster';
28
28
  export { WorkOrderListItem } from './workOrderListItem';
@@ -0,0 +1 @@
1
+ export * from './tagSearchDropDown';
@@ -0,0 +1,9 @@
1
+ import { TagSummaryDto } from '@equinor/echo-search';
2
+ import React from 'react';
3
+ interface TagsDropdownProps {
4
+ tags: TagSummaryDto[];
5
+ onTagSelected: (tag: TagSummaryDto) => void;
6
+ loadingTags?: boolean;
7
+ }
8
+ export declare const TagsDropdown: React.FC<TagsDropdownProps>;
9
+ export {};
@@ -2,7 +2,6 @@ import { Equipment } from '../../types/equipment';
2
2
  interface ShowEquipmentIn3DButtonArgs {
3
3
  equipment: Equipment;
4
4
  tagNo: string;
5
- plantNo: string;
6
5
  }
7
- export declare const ShowEquipmentIn3DButton: ({ equipment, tagNo, plantNo }: ShowEquipmentIn3DButtonArgs) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const ShowEquipmentIn3DButton: ({ equipment, tagNo }: ShowEquipmentIn3DButtonArgs) => import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -25,8 +25,8 @@ export interface Equipment {
25
25
  readonly serialNo: string;
26
26
  readonly surfaceItems?: string;
27
27
  readonly systemStatusIds: string[];
28
- readonly tagId?: string;
29
- readonly tagPlantId?: string;
28
+ readonly tagId: string | undefined;
29
+ readonly tagPlantId: string | undefined;
30
30
  readonly userStatusIds: string[];
31
31
  }
32
32
  export declare enum EquipmentCategoryId {
@@ -8,9 +8,8 @@ interface OpenMeasuringPointsArgs {
8
8
  pathname: string;
9
9
  instCode: string;
10
10
  tagNo: string;
11
- plantNo: string;
12
11
  }
13
- export declare const openEquipmentIn3dWeb: ({ equipmentId, e3dRef, goToLink, pathname, instCode, tagNo, plantNo }: OpenMeasuringPointsArgs) => Promise<void>;
12
+ export declare const openEquipmentIn3dWeb: ({ equipmentId, e3dRef, goToLink, pathname, instCode, tagNo }: OpenMeasuringPointsArgs) => Promise<void>;
14
13
  export declare const is3DEquipment: (equipment: Equipment) => boolean;
15
14
  export declare const sortMeasurementsInMeasuringPointsByNewestFirst: (measuringPoints: MeasuringPointDto[]) => {
16
15
  measuringPointId: string;
@@ -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 {};
@@ -37,7 +37,7 @@ export type TagGlobalSelectionList = GlobalSelectionList<GlobalSelectionItemType
37
37
  export type GlobalSelectionListUnion = WorkOrderGlobalSelectionList | TagGlobalSelectionList | EquipmentGlobalSelectionList;
38
38
  export declare enum GlobalSelectionItemErrorStatuses {
39
39
  NotFoundInActiveEchoModule = "NotFoundInActiveEchoModule",
40
- UnableToDisplay = "UnableToDisplay"
40
+ NotShownInActiveEchoModule = "NotShownInActiveEchoModule"
41
41
  }
42
42
  export interface GlobalSelectionStore {
43
43
  lists: GlobalSelectionListUnion[];
@@ -50,15 +50,30 @@ export interface GlobalSelectionStore {
50
50
  removeItemFromSelection: (args: {
51
51
  itemId: string;
52
52
  }) => void;
53
- setNotFoundItems: (args: {
54
- itemIds: Readonly<string[]>;
53
+ setVisibilityList: (args: {
54
+ listKey: string;
55
+ isVisible: boolean;
56
+ }) => void;
57
+ setVisibility: (args: {
58
+ itemId: string;
59
+ isVisible: boolean;
55
60
  }) => void;
56
61
  resetItemNotFoundStates: () => void;
57
62
  resetState: () => void;
63
+ setStatusForItems: (args: {
64
+ itemIds: string[];
65
+ status: GlobalSelectionItemErrorStatuses;
66
+ }) => void;
67
+ /**
68
+ *@deprecated This method is deprecated. Use `setStatusForItems` instead, with `GlobalSelectionItemErrorStatuses.NotFoundInActiveEchoModule`.
69
+ */
70
+ setNotFoundItems: (args: {
71
+ itemIds: string[];
72
+ }) => void;
58
73
  }
59
74
  export type OptimizedWorkOrderDto = {
60
75
  workOrderId: string;
61
- tagId?: string;
76
+ tagId: string | undefined;
62
77
  tagPlantId: string;
63
78
  workCenterId?: string;
64
79
  workCenterPlantId: string;
@@ -1,5 +1,7 @@
1
+ import { PlantAndTagForOpenIn3d } from '../../openItemsIn3d/logic/openItemsIn3d.utils';
1
2
  import { GlobalSelectionGenericItem, 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 function convertGlobalSelectionItemsToPlantTagPairs(): Promise<PlantAndTagForOpenIn3d[]>;
@@ -0,0 +1,10 @@
1
+ declare function allWorkOrders(): import("./globalSelectionStore.types").OptimizedWorkOrderDto[];
2
+ declare function allTags(): import("dist/libs/echo-search/src").TagSummaryDto[];
3
+ declare function allEquipments(): import("../../equipment").Equipment[];
4
+ export declare const globalSelectionStoreHelpers: {
5
+ allTags: typeof allTags;
6
+ allEquipments: typeof allEquipments;
7
+ allWorkOrders: typeof allWorkOrders;
8
+ snapshot: () => import("./globalSelectionStore.types").GlobalSelectionStore;
9
+ };
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { GlobalSelectionItem } from '../globalSelectionStore/globalSelectionStore.types';
2
+ export declare const useGlobalSelectionItems: () => GlobalSelectionItem[];
@@ -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,5 +1,4 @@
1
1
  export { failureMechanismConfig } from './failureMechanism.config';
2
2
  export { MeasuringPointDetails } from './measuringPointDetails/measuringPointDetails';
3
- export { getInstCodeForSapPlantId } from './measuringPointDetails/measuringPointDetails.logic';
4
3
  export { MeasuringPointHeader } from './measuringPointHeader/measuringPointHeader';
5
4
  export { MeasuringPointItem } from './measuringPointItem';
@@ -1,3 +1,3 @@
1
- export { MeasuringPointDetails, MeasuringPointHeader, MeasuringPointItem, failureMechanismConfig, getInstCodeForSapPlantId } from './components';
1
+ export { MeasuringPointDetails, MeasuringPointHeader, MeasuringPointItem, failureMechanismConfig } from './components';
2
2
  export { useOpenMeasuringPointDetails } from './hooks';
3
3
  export type { MeasurementDto, MeasuringPointDto } from './types/measuringPoint';
@@ -0,0 +1,4 @@
1
+ export { workOrdersToPlantTagPairs } from './logic/convertToPlantTagPairs';
2
+ export type { Plant3dInfo, PlantAndTagForOpenIn3d } from './logic/openItemsIn3d.utils';
3
+ export { OpenItemsIn3dDialog } from './openItemsIn3dDialog';
4
+ export { SelectedItemsMenu } from './SelectedItemsMenu';
@@ -0,0 +1,10 @@
1
+ import { PlantAndTagForOpenIn3d } from './openItemsIn3d.utils';
2
+ export interface WorkOrderTag {
3
+ tagPlantId: string | undefined;
4
+ tagId: string | undefined;
5
+ }
6
+ export declare function tagToPlantTagPairs(selectedWorkOrders: {
7
+ tagNo: string;
8
+ instCode: string;
9
+ }[]): Promise<PlantAndTagForOpenIn3d[]>;
10
+ export declare function workOrdersToPlantTagPairs(selectedWorkOrders: WorkOrderTag[]): Promise<PlantAndTagForOpenIn3d[]>;
@@ -0,0 +1,11 @@
1
+ export declare function createEcho3dInternalLink(instCode: string, params: {
2
+ tagNo?: string;
3
+ pdmsPlantCode?: string;
4
+ equipmentId?: string;
5
+ e3dRef?: string;
6
+ tagArea?: string;
7
+ measuringPointIds?: ReadonlyArray<string>;
8
+ }): {
9
+ echo3d: string;
10
+ params: string;
11
+ };
@@ -0,0 +1,45 @@
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 getUniquePlantsWithItemCount(args: {
9
+ items: PlantAndTagForOpenIn3d[];
10
+ }): Plant3dInfoCount[];
11
+ /**
12
+ * Retrieves the items from the given array that have the same plant number as the selected plant number.
13
+ *
14
+ * @param selectedItems - The array of PlantTagPair objects.
15
+ * @param selectedPlantNo - The selected plant number.
16
+ * @returns An array of PlantTagPair objects that have the same plant number as the selected plant number.
17
+ */
18
+ export declare function getItemsForSelectedPlantNo(selectedItems: PlantAndTagForOpenIn3d[], selectedPlantNo: string): PlantAndTagForOpenIn3d[];
19
+ /**
20
+ * Checks if there are more then one unique plant numbers in the passed PlantTagPair[].
21
+ *
22
+ * @param items - The array of PlantTagPair objects to check.
23
+ * @returns A boolean indicating whether multiple, unique plant numbers are present in the passed array.
24
+ */
25
+ export declare function isMultiplePlantNoSelected(items: PlantAndTagForOpenIn3d[]): boolean;
26
+ /**
27
+ * Retrieves the plant SAP ID from an array of PlantTagPair. It will return with the first, non empty plant SAP ID found.
28
+ * @param items - The array of PlantTagPair items.
29
+ * @returns The plant SAP ID if found, otherwise undefined.
30
+ */
31
+ export declare function getFirstPlantSapIdFromItems(items: PlantAndTagForOpenIn3d[]): string | undefined;
32
+ export interface Plant3dInfo {
33
+ instCode: string;
34
+ sapId: string | undefined;
35
+ pdmsPlantCode: string | undefined;
36
+ }
37
+ export interface Plant3dInfoCount extends Plant3dInfo {
38
+ count: number;
39
+ }
40
+ export interface PlantAndTagForOpenIn3d {
41
+ instCode: string;
42
+ pdmsPlantCode: string | undefined;
43
+ plantNo: string | undefined;
44
+ tagNo: string | undefined;
45
+ }
@@ -1,7 +1,7 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
1
+ import React from 'react';
2
2
  interface OpenIn3dWarningDialogProps {
3
3
  open: boolean;
4
- setIsOpenIn3dWarningDialogOpen: Dispatch<SetStateAction<boolean>>;
4
+ onOKButtonClicked?: () => void;
5
5
  }
6
6
  export declare const OpenIn3dWarningDialog: React.FC<OpenIn3dWarningDialogProps>;
7
7
  export {};
@@ -0,0 +1,42 @@
1
+ import { Plant3dInfo, PlantAndTagForOpenIn3d } from './logic/openItemsIn3d.utils';
2
+ /**
3
+ * This component is designed to facilitate the opening of items in a 3D view within the application.
4
+ * It manages user interactions for selecting a plant number when multiple options are available,
5
+ * displays warnings if there are issues with opening items in 3D, and handles scenarios where a plant is not available.
6
+ * Contains built in mechanism to open items in 3d, but can be disabled if the consumer wants to handle this themselves.
7
+ *
8
+ * @component
9
+ * @param {Object} props - The properties passed to the component.
10
+ * @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.
11
+ * @param {boolean} props.open - Boolean indicating whether the dialog should be open or closed.
12
+ * @param {Function} props.onPlantSelectionCompleted - Function to be called when the plant selection process has been completed by the user.
13
+ * @param {Function} props.onCancelButtonClicked - Function to be called when the user clicks the cancel button.
14
+ * @param {Object} props.plantNotAvailableDialogProps - Object containing properties for the dialog shown when a plant is not available. Only needed when props.disableDefault3dOpener=true.
15
+ * @param {boolean} [props.disableDefault3dOpener=false] - Boolean indicating whether the default mechanism to open items in 3D should be disabled.
16
+ *
17
+ * @returns {React.ReactElement} A React Element representing the OpenItemsIn3dDialog.
18
+ *
19
+ */
20
+ export declare const OpenItemsIn3dDialog: ({ getItems, open, onPlantSelectionCompleted, onCancelButtonClicked, plantNotAvailableDialogProps, disableDefault3dOpener }: OpenItemsIn3dDialogProps) => import("react/jsx-runtime").JSX.Element;
21
+ interface BaseOpenItemsIn3dDialogProps {
22
+ getItems: () => Promise<PlantAndTagForOpenIn3d[]>;
23
+ onPlantSelectionCompleted: (args: {
24
+ selectedPlant: Plant3dInfo;
25
+ }) => void;
26
+ onCancelButtonClicked: () => void;
27
+ open: boolean;
28
+ }
29
+ interface WithDefault3dOpener extends BaseOpenItemsIn3dDialogProps {
30
+ disableDefault3dOpener?: false;
31
+ plantNotAvailableDialogProps?: never;
32
+ }
33
+ interface WithDefault3dOpenerDisabled extends BaseOpenItemsIn3dDialogProps {
34
+ disableDefault3dOpener: true;
35
+ plantNotAvailableDialogProps: {
36
+ open: boolean;
37
+ onCloseDialogClicked: () => void;
38
+ };
39
+ onPlantLoadError?: never;
40
+ }
41
+ type OpenItemsIn3dDialogProps = WithDefault3dOpenerDisabled | WithDefault3dOpener;
42
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Plant3dInfo, PlantAndTagForOpenIn3d } from './logic/openItemsIn3d.utils';
2
+ interface PlantNoSelectionDialogProps {
3
+ getItems: () => Promise<PlantAndTagForOpenIn3d[]>;
4
+ onPlantSelectionConfirmed: (selectedPlantNo: Plant3dInfo) => void;
5
+ onCancelButtonClicked: () => void;
6
+ onSetIsWarningDialogOpen: () => void;
7
+ open: boolean;
8
+ }
9
+ export declare const PlantNoSelectionDialog: ({ getItems, onPlantSelectionConfirmed, onCancelButtonClicked, onSetIsWarningDialogOpen, open }: PlantNoSelectionDialogProps) => JSX.Element | null;
10
+ export {};
@@ -1,4 +1,5 @@
1
1
  export * from './useEchoHistory';
2
+ export * from './useFetchInstCodeBySapPlantId';
2
3
  export * from './useHas3dAccess';
3
4
  export * from './useIsFullScreenModeEnabled';
4
5
  export * from './useOpenPdfFile';
@@ -0,0 +1,3 @@
1
+ export declare const useFetchInstCodeBySapPlantId: (args: {
2
+ sapPlantId: string | undefined;
3
+ }) => string | undefined;
@@ -0,0 +1,43 @@
1
+ interface PanelUserSettings {
2
+ readonly isTagsVisible: boolean;
3
+ readonly isWorkOrdersVisible: boolean;
4
+ }
5
+ interface DataLayerPanelState {
6
+ readonly isOpen: boolean;
7
+ readonly userSettings: PanelUserSettings;
8
+ }
9
+ interface DataLayerPanelActions {
10
+ togglePanel: () => void;
11
+ toggleWorkOrders: () => void;
12
+ toggleTags: () => void;
13
+ }
14
+ type DataLayerPanelStore = DataLayerPanelState & DataLayerPanelActions;
15
+ export declare const useDataLayerPanelStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<DataLayerPanelStore>, "setState"> & {
16
+ setState<A extends string | {
17
+ type: string;
18
+ }>(partial: DataLayerPanelStore | Partial<DataLayerPanelStore> | ((state: DataLayerPanelStore) => DataLayerPanelStore | Partial<DataLayerPanelStore>), replace?: boolean | undefined, action?: A | undefined): void;
19
+ }, "subscribe"> & {
20
+ subscribe: {
21
+ (listener: (selectedState: DataLayerPanelStore, previousSelectedState: DataLayerPanelStore) => void): () => void;
22
+ <U>(selector: (state: DataLayerPanelStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
23
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
24
+ fireImmediately?: boolean;
25
+ } | undefined): () => void;
26
+ };
27
+ }, "persist"> & {
28
+ persist: {
29
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<DataLayerPanelStore, unknown>>) => void;
30
+ clearStorage: () => void;
31
+ rehydrate: () => Promise<void> | void;
32
+ hasHydrated: () => boolean;
33
+ onHydrate: (fn: (state: DataLayerPanelStore) => void) => () => void;
34
+ onFinishHydration: (fn: (state: DataLayerPanelStore) => void) => () => void;
35
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<DataLayerPanelStore, unknown>>;
36
+ };
37
+ }, "setState"> & {
38
+ setState(nextStateOrUpdater: DataLayerPanelStore | Partial<DataLayerPanelStore> | ((state: import("immer").WritableDraft<DataLayerPanelStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
39
+ type: string;
40
+ } | undefined): void;
41
+ }>;
42
+ export declare function dataLayerStoreSnapshot(): DataLayerPanelStore;
43
+ export {};
@@ -0,0 +1 @@
1
+ export * from './dataLayerPanel.store';
@@ -6,6 +6,6 @@ export interface EchoHubPlant {
6
6
  operationArea: string;
7
7
  availableInEcho3D: boolean;
8
8
  availableInEcho3DWebReveal: boolean;
9
- sapId: number;
9
+ sapId?: number;
10
10
  ayelixSiteId?: number;
11
11
  }
@@ -0,0 +1,4 @@
1
+ export declare const echopediaWebReactPortalUtils: Readonly<{
2
+ portalId: "echopedia-web--dialog-container";
3
+ domSelector: HTMLElement;
4
+ }>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns the pdms plant code for the tagSummary.
3
+ */
4
+ export declare function getPdmsPlantCodeForTag(tag: {
5
+ pdmsPlantCode: string | undefined;
6
+ }): string | undefined;
@@ -1,3 +1,4 @@
1
+ export { echopediaWebReactPortalUtils } from './echopediaWebReactPortal.utils';
1
2
  export * from './formatTimeHelpers';
2
3
  export * from './navigationUtils';
3
4
  export * from './openIn3d';
@@ -5,4 +6,4 @@ export * from './plantInfo';
5
6
  export * from './previousUtils';
6
7
  export * from './searchUtil';
7
8
  export * from './stringUtils';
8
- export * from './tagUtils';
9
+ export * from './workOrderUtils';
@@ -1,5 +1,4 @@
1
1
  import { TemporaryEchoHubListDto, TemporaryHubResultsList } from '../../types/api-echohub';
2
- import { EchoHubPlant } from '../../types/echoHubPlant';
3
2
  export declare const getTemporarilyEchoHubListFor3d: (instCode: string, request: TemporaryEchoHubListDto, abortSignal?: AbortSignal | undefined, withoutBaseUrl?: boolean) => Promise<{
4
3
  app3dUrl: string;
5
4
  web3dUrl: string;
@@ -17,12 +16,19 @@ export type HubListReturnType = {
17
16
  * @export
18
17
  * @param {string} sourceModuleName name of the source module name
19
18
  * @param {string} createdBy created by (e.g: user email)
20
- * @param {EchoHubPlant} plant plant
19
+ * @param {string} plantCode pdmsPlantCode from stid tag
21
20
  * @param {TemporaryHubResultsList[]} tagList tag list
22
21
  * @param {string} source source (e.g: Echo)
23
- * @param {number} timeToLiveSeconds time to live (in seconds) for the temporary list
24
22
 
25
23
  * @return {*} {TemporaryEchoHubListDto} temporary tag list object
26
24
  */
27
- export declare const generateTemporaryTagListObject: (ObjectsToSendTo3d: ObjectsToSendTo3dTypes, sourceModuleName: string, createdBy: string, plant: EchoHubPlant, tagList: TemporaryHubResultsList[], source: string, section?: string | undefined, timeToLiveSeconds?: number) => TemporaryEchoHubListDto;
25
+ export declare const generateTemporaryTagListObject: (args: {
26
+ ObjectsToSendTo3d: ObjectsToSendTo3dTypes;
27
+ sourceModuleName: string;
28
+ createdBy: string;
29
+ plantCode: string;
30
+ tagList: TemporaryHubResultsList[];
31
+ source: string;
32
+ section?: string;
33
+ }) => TemporaryEchoHubListDto;
28
34
  export declare function getRandomColor(): string;
@@ -29,30 +29,19 @@ export declare function getPlantsOnInstallation(instCode: string): Promise<EchoH
29
29
  */
30
30
  export declare function getAllPlants(): Promise<EchoHubPlant[]>;
31
31
  /**
32
- * Filters out a single plant information for a installation code from a lost of plant information
33
- *
34
- * @export
35
- * @param {EchoHubPlant[]} plantInfo list of plant information to filter from
36
- * @param {string} instCode installation code to filter list with
37
- * @param {string} [plantIdentificator] alternative way of filtering the provided plant information
38
- * @return {*} {(EchoHubPlant | null)} Returns a single plant information or null if no match was found
32
+ * Returns all echo hub plant for given sap id, or undefined if not found.
33
+ * Note: There may exist multiple echo hub plants with the same sap id: DRA where both DRS and DRE has sap id 1150.
34
+ * Instead use getEchoHubPlantForTag or getPlantCodeForTag if possible, or useFetchInstCodeBySapPlantId.
39
35
  */
40
- export declare function getPlant(plantInfo: EchoHubPlant[], instCode: string, plantIdentificator?: string): EchoHubPlant | null;
41
- /**
42
- * Gets plant information from a given sap id
43
- *
44
- * @export
45
- * @param {string} sapId Sap id to look for
46
- * @return {*} {(Promise<EchoHubPlant | null>)} Returns a single plant information or null if no match was found
47
- */
48
- export declare function getPlantBySapId(sapId: string): Promise<EchoHubPlant | null>;
36
+ export declare function allEchoHubPlantsBySapId(item: {
37
+ sapId: string | undefined;
38
+ }): Promise<EchoHubPlant[] | undefined>;
39
+ export declare function instCodeBySapId(sapId: string): Promise<string | undefined>;
40
+ export declare function instCodeByPlantCode(pdmsPlantCode: string): Promise<string | undefined>;
49
41
  /**
50
42
  * Gets all plant codes for a given installation code
51
- * @export
52
- * @param {string} instCode installation code to look for
53
- * @return {*} {Promise<string[]>} list of plant codes for the given installation
54
43
  */
55
- export declare function getPlantCodesOnInstallation(instCode: string): Promise<string[]>;
44
+ export declare function allPlantCodesOnInstallation(instCode: string): Promise<string[]>;
56
45
  /**
57
46
  * Method for checking a users access to a given installation
58
47
  *
@@ -0,0 +1 @@
1
+ export declare function getColorForWorkOrderTypeId(workOrderTypeId: string): string;
@@ -1,12 +0,0 @@
1
- import { TagDetailsDto } from '@equinor/echo-search';
2
- export declare enum ApplicationLinks {
3
- Launch3D = "echo://",
4
- Echo3dWeb = "/echo3d"
5
- }
6
- export declare enum OpenIn3DOption {
7
- App = "App",
8
- Web = "Web"
9
- }
10
- export declare const getEcho3DAppLink: (tagDetailsInput: TagDetailsDto | undefined) => Promise<string>;
11
- export declare const getApplyForEchoAccessUrl: (instCode: string, tagDetails?: TagDetailsDto) => Promise<string>;
12
- export declare const getParamsFor3DWeb: (instCode: string, tagDetails: TagDetailsDto | undefined, tagNo: string | undefined) => Promise<string>;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- interface OpenIn3dDropdownProps {
3
- anchorRef: React.RefObject<HTMLButtonElement>;
4
- plantIsAvailableIn3d: boolean;
5
- plantIsAvailableIn3dWeb: boolean;
6
- setShow3dDropdown: React.Dispatch<React.SetStateAction<boolean>>;
7
- openIn3dWeb: (event: React.MouseEvent) => void;
8
- openIn3dApp: (event: React.MouseEvent) => void;
9
- }
10
- declare const OpenIn3dDropdown: React.FC<OpenIn3dDropdownProps>;
11
- export default OpenIn3dDropdown;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- interface Echo3DButtonProps {
3
- instCode: string;
4
- enabled?: boolean;
5
- openInNewWindow?: boolean;
6
- }
7
- /**
8
- *
9
- * Component for rendering 3D buttons. Will display both echo 3D web and echo 3D (App) button
10
- * By using the 'enabled' attribute, you can control if the button should be enabled or not.
11
- * @param {Echo3DButtonProps} {
12
- * enabled,
13
- * openInNewWindow
14
- * }
15
- * @return {*}
16
- */
17
- export declare const Echo3DButton: React.FC<Echo3DButtonProps>;
18
- export {};