@equinor/echo-framework 0.23.2 → 0.23.4-beta-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 +8 -2
- package/package.json +6 -5
- package/src/index.d.ts +2 -2
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/components/plantSelector/plantSelector.d.ts +2 -2
- package/src/lib/components/plantSelector/plantSelectorHelper.d.ts +4 -3
- package/src/lib/components/prepview/notification/header/NotificationHeader.d.ts +1 -1
- package/src/lib/components/searchListItem/searchListItem.d.ts +86 -0
- package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemHeader.d.ts +2 -2
- package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts +2 -4
- package/src/lib/feature/equipment/components/equipmentItemHeader/linkToSapEquipment.d.ts +2 -2
- package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts +3 -4
- package/src/lib/feature/equipment/components/equipmentItemInfo/equipmentItemInfo.d.ts +2 -2
- package/src/lib/feature/equipment/components/equipmentListItem.d.ts +9 -4
- package/src/lib/feature/equipment/components/equipmentTabs/equipmentTabs.d.ts +2 -2
- package/src/lib/feature/equipment/components/fullEquipmentItem/fullEquipmentItem.d.ts +2 -2
- package/src/lib/feature/equipment/hooks/useOpenEquipmentDetails.d.ts +2 -2
- package/src/lib/feature/equipment/utils/equipmentUtils.d.ts +2 -2
- package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +1 -2
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +5 -19
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addEquipmentsToSelection.action.d.ts +6 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelectionFactory.d.ts +17 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +7 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addWorkOrdersToSelection.action.d.ts +6 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +17 -6
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullEquipment.d.ts +2 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullTag.d.ts +2 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullWorkOrder.d.ts +3 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addEquipments.action.d.ts +2 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts +2 -13
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addWorkOrders.action.d.ts +2 -6
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createAddItemsFactory.d.ts +5 -8
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +5 -4
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/initialData.d.ts +1 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +9 -18
- package/src/lib/feature/hooks/useAddTagToLegendRegistry.d.ts +2 -2
- package/src/lib/utils/highlightTextUtil.d.ts +26 -0
- package/src/lib/utils/index.d.ts +1 -0
- package/src/lib/utils/stringUtils.d.ts +5 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelection.action.d.ts +0 -18
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionNullItems.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.4-beta-0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.7.0 < 0.8.0",
|
|
6
6
|
"@equinor/echo-components": ">= 0.12.0 < 0.13.0",
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"react-router-dom": "5.3.4",
|
|
20
20
|
"zustand": ">= 4.4.7 < 5",
|
|
21
|
-
"immer": "10.1.1"
|
|
22
|
-
"ag-charts-react": ">= 11.1.1 < 12.0.0",
|
|
23
|
-
"ag-charts-community": ">= 11.1.1 < 12.0.0"
|
|
21
|
+
"immer": "10.1.1"
|
|
24
22
|
},
|
|
25
23
|
"dependencies": {
|
|
26
|
-
"dexie": "4.0.11"
|
|
24
|
+
"dexie": "4.0.11",
|
|
25
|
+
"mark.js": "8.11.1",
|
|
26
|
+
"ag-charts-community": "11.2.4",
|
|
27
|
+
"ag-charts-react": "11.2.4"
|
|
27
28
|
},
|
|
28
29
|
"main": "./index.cjs.js",
|
|
29
30
|
"type": "commonjs",
|
package/src/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from './lib/feature/globalSelection';
|
|
|
14
14
|
export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
|
|
15
15
|
export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
|
|
16
16
|
export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
|
|
17
|
-
export { GlobalSelectionCategoryId
|
|
17
|
+
export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
18
18
|
export * from './lib/feature/legacyLegend/index';
|
|
19
19
|
export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
|
|
20
20
|
export * from './lib/feature/legend/index';
|
|
@@ -47,7 +47,7 @@ export type { EchoHubPlant } from './lib/types/echoHubPlant';
|
|
|
47
47
|
export * from './lib/types/eventTypes';
|
|
48
48
|
export * from './lib/types/extensions';
|
|
49
49
|
export type { BucketPanelKey, BucketSourceKey } from './lib/types/grid/bucketSideDrawer.types';
|
|
50
|
-
export type { SetActiveTagNo, TagData } from './lib/types/hookLibrary';
|
|
50
|
+
export type { SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './lib/types/hookLibrary';
|
|
51
51
|
export type { ModelPermissions } from './lib/types/modelPermissions';
|
|
52
52
|
export { InternalApplicationLinks } from './lib/types/navigation/internalApplicationLinks';
|
|
53
53
|
export { PingableSources } from './lib/types/pingableSources';
|
|
@@ -21,6 +21,7 @@ export * from './prepviewButton/prepviewButton';
|
|
|
21
21
|
export * from './projectSelector';
|
|
22
22
|
export * from './realTimeData';
|
|
23
23
|
export * from './router';
|
|
24
|
+
export { SearchListItem } from './searchListItem/searchListItem';
|
|
24
25
|
export * from './searchMenu';
|
|
25
26
|
export * from './spinner/spinner';
|
|
26
27
|
export * from './tagNumber';
|
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Dropdown component for displaying a searchable plant selector.
|
|
4
4
|
* @param {PlantSelectorProps} {
|
|
5
|
-
* variant: The style type for the dropdown component. Either default or compact.
|
|
6
5
|
* isDisabled: Flag which decides whether the dropdown should be disabled or not.
|
|
7
6
|
* stayOnPath: Flag which decides if you should stay on your current path after selecting a plant.
|
|
7
|
+
* textSize: Size of the text in the dropdown. Can be 'small', 'medium' or 'large'.
|
|
8
|
+
* noneBackground: Flag which decides if the background of the dropdown should be transparent or not.
|
|
8
9
|
* }
|
|
9
10
|
* @return {*}
|
|
10
11
|
*/
|
|
@@ -13,7 +14,6 @@ interface PlantSelectorProps {
|
|
|
13
14
|
stayOnPath?: boolean;
|
|
14
15
|
textSize?: 'small' | 'medium' | 'large';
|
|
15
16
|
noneBackground?: boolean;
|
|
16
|
-
autoWidth?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const PlantSelector: React.FC<PlantSelectorProps>;
|
|
19
19
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plant } from '@equinor/echo-core';
|
|
2
|
-
export
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
2
|
+
export type MinimalPlant = Pick<Plant, 'instCode' | 'description' | 'sapPlantId'>;
|
|
3
|
+
export declare function filterPlant(plant: MinimalPlant, inputValue: string): boolean;
|
|
4
|
+
export declare function formatPlantOptionText(plantName: string, plantId: string | null): string;
|
|
5
|
+
export declare function handleAutoSelectOnFocus(autocompleteRef: React.RefObject<HTMLDivElement>): void;
|
|
@@ -3,5 +3,5 @@ interface NotificationHeaderProps {
|
|
|
3
3
|
notificationDetails: NotificationDetails;
|
|
4
4
|
headerAction?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare function NotificationHeader({ notificationDetails, headerAction
|
|
6
|
+
declare function NotificationHeader({ notificationDetails, headerAction }: NotificationHeaderProps): JSX.Element | null;
|
|
7
7
|
export { NotificationHeader };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SearchListItem component renders a styled list item with optional visual or icon, title, subtitle, and other customizable properties.
|
|
4
|
+
*
|
|
5
|
+
* @param {SearchListItemProps} props - The properties for the SearchListItem component.
|
|
6
|
+
* @returns {JSX.Element} The rendered SearchListItem component.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SearchListItem: React.FC<SearchListItemProps>;
|
|
9
|
+
interface VisualComponent {
|
|
10
|
+
icon?: never;
|
|
11
|
+
visual?: {
|
|
12
|
+
label: string;
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
textColor: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface IconOptions {
|
|
18
|
+
icon?: {
|
|
19
|
+
name: string;
|
|
20
|
+
color?: string;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
};
|
|
23
|
+
visual?: never;
|
|
24
|
+
}
|
|
25
|
+
type WithVisualOrIconOptions = VisualComponent | IconOptions;
|
|
26
|
+
type BaseProps = {
|
|
27
|
+
title: string;
|
|
28
|
+
subTitle?: string | React.ReactNode;
|
|
29
|
+
tertiary?: string | React.ReactNode;
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
className?: string;
|
|
32
|
+
cardClassName?: string;
|
|
33
|
+
hideActions?: boolean;
|
|
34
|
+
hideBorder?: boolean;
|
|
35
|
+
isHighlightable?: boolean;
|
|
36
|
+
itemActions?: React.ReactNode;
|
|
37
|
+
footer?: React.ReactNode;
|
|
38
|
+
};
|
|
39
|
+
type SearchListItemProps = BaseProps & WithVisualOrIconOptions;
|
|
40
|
+
export {};
|
|
41
|
+
/**
|
|
42
|
+
* Base properties for the SearchListItem component.
|
|
43
|
+
*
|
|
44
|
+
* @typedef {Object} BaseProps
|
|
45
|
+
* @property {string} title - The primary title of the list item.
|
|
46
|
+
* @property {string | React.ReactNode} [subTitle] - The secondary subtitle of the list item.
|
|
47
|
+
* @property {string | React.ReactNode} [tertiary] - The tertiary content of the list item.
|
|
48
|
+
* @property {() => void} [onClick] - Callback function triggered when the list item is clicked.
|
|
49
|
+
* @property {string} [className] - Additional CSS class for the list item wrapper.
|
|
50
|
+
* @property {string} [cardClassName] - Additional CSS class for the card element.
|
|
51
|
+
* @property {boolean} [hideActions] - Whether to hide the item actions.
|
|
52
|
+
* @property {boolean} [hideBorder] - Whether to hide the bottom border of the list item.
|
|
53
|
+
* @property {boolean} [isHighlightable] - Whether the text is highlightable.
|
|
54
|
+
* @property {React.ReactNode} [itemActions] - Custom actions to display in the list item.
|
|
55
|
+
* @property {React.ReactNode} [footer] - Footer content for the list item.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Visual component properties for the SearchListItem component.
|
|
59
|
+
*
|
|
60
|
+
* @typedef {Object} VisualComponent
|
|
61
|
+
* @property {Object} visual - Visual properties for the list item.
|
|
62
|
+
* @property {string} visual.label - The label text for the visual.
|
|
63
|
+
* @property {string} visual.backgroundColor - The background color for the visual.
|
|
64
|
+
* @property {string} visual.textColor - The text color for the visual.
|
|
65
|
+
* @property {never} [icon] - Icon should not be used when visual is provided.
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Icon options for the SearchListItem component.
|
|
69
|
+
*
|
|
70
|
+
* @typedef {Object} IconOptions
|
|
71
|
+
* @property {Object} icon - Icon properties for the list item.
|
|
72
|
+
* @property {string} icon.name - The name of the icon.
|
|
73
|
+
* @property {string} [icon.color] - The color of the icon.
|
|
74
|
+
* @property {string} [icon.backgroundColor] - The background color of the icon.
|
|
75
|
+
* @property {never} [visual] - Visual should not be used when icon is provided.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Combined type for either visual or icon options.
|
|
79
|
+
*
|
|
80
|
+
* @typedef {VisualComponent | IconOptions} WithVisualOrIconOptions
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Props for the SearchListItem component.
|
|
84
|
+
*
|
|
85
|
+
* @typedef {BaseProps & WithVisualOrIconOptions} SearchListItemProps
|
|
86
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
2
|
interface EquipmentItemHeaderProps {
|
|
3
|
-
|
|
3
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'equipmentDescription'>;
|
|
4
4
|
}
|
|
5
5
|
export declare const EquipmentItemHeader: React.FC<EquipmentItemHeaderProps>;
|
|
6
6
|
export {};
|
package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
2
|
interface EquipmentItemSubHeaderProps {
|
|
3
|
-
|
|
4
|
-
tagNo: string;
|
|
5
|
-
plantNo: string;
|
|
3
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'e3DRef' | 'categoryId' | 'tagId' | 'tagPlantId'>;
|
|
6
4
|
}
|
|
7
5
|
export declare const EquipmentItemSubHeader: React.FC<EquipmentItemSubHeaderProps>;
|
|
8
6
|
export {};
|
package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
2
|
interface ShowEquipmentIn3DButtonArgs {
|
|
3
|
-
|
|
4
|
-
tagNo: string;
|
|
3
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'e3DRef' | 'tagId'>;
|
|
5
4
|
}
|
|
6
|
-
export declare const ShowEquipmentIn3DButton: ({
|
|
5
|
+
export declare const ShowEquipmentIn3DButton: ({ equipmentProps }: ShowEquipmentIn3DButtonArgs) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { Equipment } from '../../types/equipment';
|
|
3
3
|
interface EquipmentItemInfoProps {
|
|
4
4
|
equipment: Equipment;
|
|
5
|
-
tagNo: string;
|
|
6
|
-
plantNo: string;
|
|
5
|
+
tagNo: string | undefined;
|
|
6
|
+
plantNo: string | undefined;
|
|
7
7
|
}
|
|
8
8
|
export declare const EquipmentItemInfo: React.FC<EquipmentItemInfoProps>;
|
|
9
9
|
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { Equipment } from '../types/equipment';
|
|
3
3
|
interface EquipmentListItemProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'tagId' | 'tagPlantId' | 'equipmentDescription' | 'partType'>;
|
|
5
|
+
className?: string;
|
|
6
|
+
cardClassName?: string;
|
|
7
|
+
hideActions?: boolean;
|
|
8
|
+
hideBorder?: boolean;
|
|
9
|
+
isHighlightable?: boolean;
|
|
10
|
+
itemActions?: React.ReactNode;
|
|
11
|
+
footer?: React.ReactNode;
|
|
7
12
|
}
|
|
8
13
|
export declare const EquipmentListItem: React.FC<EquipmentListItemProps>;
|
|
9
14
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Equipment } from '../../types/equipment';
|
|
2
2
|
interface EquipmentTabsProps {
|
|
3
3
|
equipment: Equipment;
|
|
4
|
-
tagNo: string;
|
|
5
|
-
plantNo: string;
|
|
4
|
+
tagNo: string | undefined;
|
|
5
|
+
plantNo: string | undefined;
|
|
6
6
|
}
|
|
7
7
|
export declare const EquipmentTabs: React.FC<EquipmentTabsProps>;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Link } from '@equinor/echo-core';
|
|
2
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
3
|
import { MeasuringPointDto } from '../../measuringPoint';
|
|
3
|
-
import { Equipment } from '../types/equipment';
|
|
4
4
|
interface OpenMeasuringPointsArgs {
|
|
5
5
|
equipmentId: string;
|
|
6
6
|
e3dRef: string;
|
|
@@ -10,7 +10,7 @@ interface OpenMeasuringPointsArgs {
|
|
|
10
10
|
tagNo: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const openEquipmentIn3dWeb: ({ equipmentId, e3dRef, goToLink, pathname, instCode, tagNo }: OpenMeasuringPointsArgs) => Promise<void>;
|
|
13
|
-
export declare const is3DEquipment: (
|
|
13
|
+
export declare const is3DEquipment: (equipmentProps: Partial<Pick<EquipmentData, "e3DRef" | "categoryId">>) => boolean;
|
|
14
14
|
export declare const sortMeasurementsInMeasuringPointsByNewestFirst: (measuringPoints: MeasuringPointDto[]) => {
|
|
15
15
|
measurements: import("../../measuringPoint").MeasurementDto[];
|
|
16
16
|
measuringPointId: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
import { GlobalSelectionCategoryId } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
3
2
|
export interface SelectionActionBarProps {
|
|
4
3
|
itemId: GlobalSelectionTypes.ItemId;
|
|
5
|
-
|
|
4
|
+
onAddItemClick: () => void;
|
|
6
5
|
className?: string;
|
|
7
6
|
}
|
|
8
7
|
export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { GlobalSelectionTypes } from './globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
import {
|
|
3
|
-
import { AddTagsReturnType, GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
|
-
type AddTagsType = <T extends boolean | undefined = undefined>(args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
5
|
-
getActionResult?: T;
|
|
6
|
-
}) => Promise<AddTagsReturnType<T>>;
|
|
2
|
+
import { GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
7
3
|
export declare const globalSelectionApi: Readonly<{
|
|
8
4
|
/**
|
|
9
5
|
* @deprecated Use globalSelectionApi.remove.itemsById() instead
|
|
@@ -59,15 +55,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
59
55
|
*/
|
|
60
56
|
listById: (args: {
|
|
61
57
|
groupId: import("dist/libs/echo-utils/src").Guid;
|
|
62
|
-
categoryId
|
|
63
|
-
* Removes all items by their IDs, from all groups, from the state.
|
|
64
|
-
*
|
|
65
|
-
* If the given item ids are in more than one group, then a confirmation dialog will be shown to confirm the action.
|
|
66
|
-
*
|
|
67
|
-
* @param {Object} args - The arguments object.
|
|
68
|
-
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - The array of item IDs to remove.
|
|
69
|
-
* @returns {void}
|
|
70
|
-
*/: GlobalSelectionCategoryId;
|
|
58
|
+
categoryId?: GlobalSelectionCategoryId;
|
|
71
59
|
}) => void;
|
|
72
60
|
}>;
|
|
73
61
|
add: Readonly<{
|
|
@@ -78,8 +66,6 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
78
66
|
* @param {AddItemArgs} args - The arguments for adding tags.
|
|
79
67
|
* @param {Array<string>} args.itemIds - The IDs of the items to add tags to.
|
|
80
68
|
* @param {boolean} [args.replaceItems=false] - Whether to replace existing items with the new tags.
|
|
81
|
-
* @param {boolean} [args.getActionResult] - Optional, temporary. Will be removed. When passed the function will return with the actionResult as well.
|
|
82
|
-
* Otherwise it just returns with ResultArray<TagSummaryDto>[]>.
|
|
83
69
|
* @returns {Promise<AddTagsResponse>} response The response of the add tags action.
|
|
84
70
|
* @returns {Array<Object>} response.tagFetchResults - The results of the tag fetch operation.
|
|
85
71
|
* @returns {string} response.actionResult - The result of the action, if 'getActionResult' is set to true. It can be the following:
|
|
@@ -88,7 +74,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
88
74
|
* - 'ItemsUpdated': Existing items were replaced with new tags.
|
|
89
75
|
* - 'ItemsAdded': New tags were added to the existing items.
|
|
90
76
|
*/
|
|
91
|
-
tags:
|
|
77
|
+
tags: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.TagId>) => import("./selectionMenu/selectionTreeStore/selectionTree.store.types").AddTagsReturnType;
|
|
92
78
|
/**
|
|
93
79
|
* Adds work orders to a specified list in the selection menu panel.
|
|
94
80
|
*
|
|
@@ -96,7 +82,8 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
96
82
|
* @param {Guid} args.groupId - Optional. The ID of the list to which the work orders should be added. If not provided, it will be added to the "Local Selection".
|
|
97
83
|
* @param {Readonly<Readonly<GlobalSelectionTypes.WorkOrderId>[]>} args.items - An array of WorkOrderId objects representing the work orders to be added.
|
|
98
84
|
*/
|
|
99
|
-
workOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) =>
|
|
85
|
+
workOrders: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => import("./selectionMenu/selectionTreeStore/selectionTree.store.types").AddWorkOrdersReturnType;
|
|
86
|
+
equipments: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.EquipmentId>) => import("./selectionMenu/selectionTreeStore/selectionTree.store.types").AddEquipmentsReturnType;
|
|
100
87
|
/**
|
|
101
88
|
* Adds items to a specified list in the selection menu panel.
|
|
102
89
|
*
|
|
@@ -201,4 +188,3 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
201
188
|
subLabel: string;
|
|
202
189
|
}) => import("dist/libs/echo-utils/src").Guid;
|
|
203
190
|
}>;
|
|
204
|
-
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const addEquipmentsToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
|
|
2
|
+
itemIds: import("../globalSelectionStore.types").GlobalSelectionTypes.EquipmentId[];
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").EquipmentData>[];
|
|
5
|
+
actionResult: import("../globalSelectionStore.types").GlobalSelectionTypes.ActionResult;
|
|
6
|
+
}>;
|
package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelectionFactory.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ResultArray } from '@equinor/echo-search';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../globalSelectionStore.types';
|
|
4
|
+
type FetchFunction<T, U> = (itemIds: Readonly<U[]>) => Promise<ResultArray<T>[]>;
|
|
5
|
+
type NullItemGenerator<T, U> = (itemId: U) => T;
|
|
6
|
+
type SetFunction = (set: (state: GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
7
|
+
export declare function addItemsToSelectionFactory<T extends GlobalSelectionItemType>(args: {
|
|
8
|
+
itemType: T;
|
|
9
|
+
fetchFunction: FetchFunction<GlobalSelectionItemTypeToDataMap[T], SelectionItemTypeToItemIdMap[T]>;
|
|
10
|
+
nullItemGenerator: NullItemGenerator<GlobalSelectionItemTypeToDataMap[T], SelectionItemTypeToItemIdMap[T]>;
|
|
11
|
+
}): (set: SetFunction, get: StoreApi<GlobalSelectionStore>["getState"], args: {
|
|
12
|
+
itemIds: SelectionItemTypeToItemIdMap[T][];
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
fetchResult: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
|
|
15
|
+
actionResult: GlobalSelectionTypes.ActionResult;
|
|
16
|
+
}>;
|
|
17
|
+
export {};
|
package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../globalSelectionStore.types';
|
|
2
|
+
export declare const addTagsToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
|
|
3
|
+
itemIds: GlobalSelectionTypes.TagId[];
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").TagSummaryDto>[];
|
|
6
|
+
actionResult: GlobalSelectionTypes.ActionResult;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const addWorkOrdersToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
|
|
2
|
+
itemIds: import("../globalSelectionStore.types").GlobalSelectionTypes.WorkOrderId[];
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").WorkOrderData>[];
|
|
5
|
+
actionResult: import("../globalSelectionStore.types").GlobalSelectionTypes.ActionResult;
|
|
6
|
+
}>;
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
|
|
1
|
+
import { EquipmentData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
|
|
2
2
|
import { Brand } from '@equinor/echo-utils';
|
|
3
3
|
import { Equipment } from '../../equipment';
|
|
4
4
|
export declare enum GlobalSelectionItemType {
|
|
@@ -8,11 +8,17 @@ export declare enum GlobalSelectionItemType {
|
|
|
8
8
|
}
|
|
9
9
|
type GlobalSelectionTagDto = TagSummaryDto;
|
|
10
10
|
type GlobalSelectionWorkOrderDto = WorkOrderData;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
type GlobalSelectionEquipmentDto = EquipmentData;
|
|
12
|
+
export type GlobalSelectionItemTypeToDataMap = {
|
|
13
|
+
[GlobalSelectionItemType.WorkOrder]: GlobalSelectionWorkOrderDto;
|
|
14
|
+
[GlobalSelectionItemType.Tag]: GlobalSelectionTagDto;
|
|
15
|
+
[GlobalSelectionItemType.Equipment]: GlobalSelectionEquipmentDto;
|
|
16
|
+
};
|
|
17
|
+
export type SelectionItemTypeToItemIdMap = {
|
|
18
|
+
[GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
|
|
19
|
+
[GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
|
|
20
|
+
[GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
|
|
21
|
+
};
|
|
16
22
|
type GlobalSelectionList<T extends GlobalSelectionItemType> = {
|
|
17
23
|
label: string;
|
|
18
24
|
type: T;
|
|
@@ -52,6 +58,9 @@ export interface GlobalSelectionStore extends GlobalSelectionStoreData {
|
|
|
52
58
|
addTagsToSelection: (args: {
|
|
53
59
|
tagIds: GlobalSelectionTypes.TagId[];
|
|
54
60
|
}) => Promise<GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>>;
|
|
61
|
+
addEquipmentsToSelection: (args: {
|
|
62
|
+
equipmentIds: GlobalSelectionTypes.EquipmentId[];
|
|
63
|
+
}) => Promise<GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>>;
|
|
55
64
|
removeItemsFromSelection: (args: {
|
|
56
65
|
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
57
66
|
}) => void;
|
|
@@ -85,6 +94,7 @@ export declare namespace GlobalSelectionTypes {
|
|
|
85
94
|
type ItemIdString = Brand<string, 'ItemIdString'>;
|
|
86
95
|
type TagDto = GlobalSelectionTagDto;
|
|
87
96
|
type WorkOrderDto = GlobalSelectionWorkOrderDto;
|
|
97
|
+
type EquipmentDto = GlobalSelectionEquipmentDto;
|
|
88
98
|
type EquipmentItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Equipment>;
|
|
89
99
|
type WorkOrderItem = GlobalSelectionGenericItem<GlobalSelectionItemType.WorkOrder>;
|
|
90
100
|
type TagItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Tag>;
|
|
@@ -100,6 +110,7 @@ export declare namespace GlobalSelectionTypes {
|
|
|
100
110
|
type ListUnion = GlobalSelectionListUnion;
|
|
101
111
|
type ItemTypeToDataMap = GlobalSelectionItemTypeToDataMap;
|
|
102
112
|
type AddTagResult = GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>;
|
|
113
|
+
type AddEquipmentsResult = GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>;
|
|
103
114
|
type ActionResult = GlobalSelectionActionResult;
|
|
104
115
|
type ItemSystemStatus = SelectionItemSystemStatus;
|
|
105
116
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { GlobalSelectionItemType } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
export declare const addEquipmentsAction: (set: (set: (state: import("../selectionTree.store.types").SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../selectionTree.store.types").SelectionTreeStore>["getState"], args: import("./selectionTree.action.types").AddItemArgs<import("../../../globalSelectionStore/globalSelectionStore.types").GlobalSelectionTypes.EquipmentId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<GlobalSelectionItemType.Equipment>>;
|
package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
4
|
-
import { SelectionTreeStore } from '../selectionTree.store.types';
|
|
5
|
-
import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
|
|
6
|
-
type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
7
|
-
export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
8
|
-
getActionResult: true;
|
|
9
|
-
}): Promise<AddItemsResponse<ResultArray<TagSummaryDto>[]>>;
|
|
10
|
-
export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
11
|
-
getActionResult?: false;
|
|
12
|
-
}): Promise<ResultArray<TagSummaryDto>[]>;
|
|
13
|
-
export {};
|
|
1
|
+
import { GlobalSelectionItemType } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
export declare const addTagsAction: (set: (set: (state: import("../selectionTree.store.types").SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../selectionTree.store.types").SelectionTreeStore>["getState"], args: import("./selectionTree.action.types").AddItemArgs<import("../../../globalSelectionStore/globalSelectionStore.types").GlobalSelectionTypes.TagId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<GlobalSelectionItemType.Tag>>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export declare const addWorkOrdersAction: (set: (set: (state: import("../selectionTree.store.types").SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../selectionTree.store.types").SelectionTreeStore>["getState"], args: import("./selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<import("@equinor/echo-search").ResultArray<unknown>[]> | {
|
|
4
|
-
fetchResults: import("@equinor/echo-search").ResultArray<WorkOrderData>[][];
|
|
5
|
-
actionResult: string;
|
|
6
|
-
}>;
|
|
1
|
+
import { GlobalSelectionItemType } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
export declare const addWorkOrdersAction: (set: (set: (state: import("../selectionTree.store.types").SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../selectionTree.store.types").SelectionTreeStore>["getState"], args: import("./selectionTree.action.types").AddItemArgs<import("../../../globalSelectionStore/globalSelectionStore.types").GlobalSelectionTypes.WorkOrderId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<GlobalSelectionItemType.WorkOrder>>;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { ResultArray } from '@equinor/echo-search';
|
|
2
2
|
import { StoreApi } from 'zustand';
|
|
3
|
-
import { GlobalSelectionAddItemResult, GlobalSelectionItemType,
|
|
3
|
+
import { GlobalSelectionAddItemResult, GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
4
4
|
import { GlobalSelectionCategoryId, SelectionTreeStore } from '../selectionTree.store.types';
|
|
5
5
|
import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
|
|
6
6
|
type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
7
|
-
export declare function addItemsActionFactory<
|
|
8
|
-
addItemToGlobalSelection: (uniqueNewItems:
|
|
9
|
-
itemType:
|
|
7
|
+
export declare function addItemsActionFactory<G_ItemType extends GlobalSelectionItemType>(args: {
|
|
8
|
+
addItemToGlobalSelection: (uniqueNewItems: SelectionItemTypeToItemIdMap[G_ItemType][]) => Promise<GlobalSelectionAddItemResult<ResultArray<GlobalSelectionItemTypeToDataMap[G_ItemType]>[]>>;
|
|
9
|
+
itemType: G_ItemType;
|
|
10
10
|
itemCategory: GlobalSelectionCategoryId;
|
|
11
11
|
categoryOrderIndex: number;
|
|
12
|
-
}): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<
|
|
13
|
-
fetchResults: ResultArray<G_ResponseData>[][];
|
|
14
|
-
actionResult: string;
|
|
15
|
-
}>;
|
|
12
|
+
}): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<SelectionItemTypeToItemIdMap[G_ItemType]>) => Promise<AddItemsResponse<G_ItemType>>;
|
|
16
13
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResultArray } from '@equinor/echo-search';
|
|
2
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
2
3
|
import { SelectionBase } from '../selectionTree.store.types';
|
|
3
4
|
export type AddByLabel = SelectionBase | {
|
|
4
5
|
label?: undefined;
|
|
@@ -9,9 +10,9 @@ export type AddItemArgs<ItemIdType extends GlobalSelectionTypes.ItemId> = {
|
|
|
9
10
|
replaceItems?: boolean;
|
|
10
11
|
getActionResult?: boolean;
|
|
11
12
|
} & AddByLabel;
|
|
12
|
-
export type AddItemsResponse<
|
|
13
|
-
fetchResults:
|
|
14
|
-
itemsAdded: Readonly<
|
|
13
|
+
export type AddItemsResponse<T extends GlobalSelectionItemType> = {
|
|
14
|
+
fetchResults: ResultArray<SelectionItemTypeToItemIdMap[T]>[];
|
|
15
|
+
itemsAdded: Readonly<SelectionItemTypeToItemIdMap[T][]>;
|
|
15
16
|
actionResult: SelectionTreeActionResult;
|
|
16
17
|
};
|
|
17
18
|
export type SelectionTreeActionResult = 'ItemsUpdated' | 'ItemsAdded' | 'NewGroupCreated' | 'NoChanges';
|