@equinor/echo-framework 1.1.1 → 1.3.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.
Files changed (29) hide show
  1. package/index.cjs.js +3 -3
  2. package/package.json +11 -11
  3. package/src/index.d.ts +4 -0
  4. package/src/lib/components/contextualAppLinks/contextualAppLinks.context.d.ts +1 -1
  5. package/src/lib/components/panel/useCalculateLegendHeight.d.ts +1 -0
  6. package/src/lib/components/prepview/colors/ColorMapping.d.ts +1 -1
  7. package/src/lib/components/tagSearchDropDown/tagSearchDropDown.d.ts +1 -1
  8. package/src/lib/feature/globalSelection/globalSelection.internal.d.ts +2 -1
  9. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelectionFactory.d.ts +1 -1
  10. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +1 -1
  11. package/src/lib/feature/globalSelection/index.d.ts +2 -0
  12. package/src/lib/feature/globalSelection/selectionMenu/hooks/useFetchSelectionHistory.d.ts +5 -0
  13. package/src/lib/feature/globalSelection/selectionMenu/invalidateHistorySelectionQuery.d.ts +1 -0
  14. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/api/selectionTree.api.d.ts +3 -2
  15. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.load.utils.d.ts +13 -1
  16. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.api.types.d.ts +6 -0
  17. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +1 -0
  18. package/src/lib/feature/legend/legendVisibleDataAsTagsStore.type.d.ts +1 -1
  19. package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +1 -1
  20. package/src/lib/types/activeTag.types.d.ts +79 -0
  21. package/src/lib/types/dataAccess/dataAccessLinks.d.ts +1 -0
  22. package/src/lib/types/docType.d.ts +16 -0
  23. package/src/lib/types/notificationTypes.d.ts +10 -0
  24. package/src/lib/types/workOrderTypes.d.ts +12 -0
  25. package/src/lib/__mocks__/mockedProjects.d.ts +0 -16
  26. package/src/lib/__mocks__/mockedTags.d.ts +0 -5
  27. package/src/lib/__mocks__/mockedWorkOrders.d.ts +0 -4
  28. package/src/lib/__mocks__/plants.d.ts +0 -17
  29. package/src/lib/coreApplication/BarComponents/SelectionStatusDotIndicator.d.ts +0 -1
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 1.0.0 < 2.0.0",
6
- "@equinor/echo-components": ">= 1.0.1 < 2.0.0",
7
- "@equinor/echo-core": ">= 1.0.1 < 2.0.0",
8
- "@equinor/echo-search": ">= 1.0.1 < 2.0.0",
9
- "@equinor/echo-utils": ">= 1.1.1 < 2.0.0",
5
+ "@equinor/echo-base": ">= 1.3.0 < 2.0.0",
6
+ "@equinor/echo-components": ">= 1.3.0 < 2.0.0",
7
+ "@equinor/echo-core": ">= 1.3.0 < 2.0.0",
8
+ "@equinor/echo-search": ">= 1.3.0 < 2.0.0",
9
+ "@equinor/echo-utils": ">= 1.3.0 < 2.0.0",
10
10
  "@equinor/eds-core-react": "0.43.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
@@ -18,14 +18,14 @@
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-enterprise": "12.1.2"
21
+ "immer": "10.1.3"
23
22
  },
24
23
  "dependencies": {
25
- "dexie": "4.2.0",
24
+ "dexie": "4.2.1",
26
25
  "mark.js": "8.11.1",
27
- "ag-charts-community": "12.1.2",
28
- "ag-charts-react": "12.1.2"
26
+ "ag-charts-community": "12.2.0",
27
+ "ag-charts-react": "12.2.0",
28
+ "ag-charts-enterprise": "12.2.0"
29
29
  },
30
30
  "main": "./index.cjs.js",
31
31
  "type": "commonjs",
package/src/index.d.ts CHANGED
@@ -55,8 +55,10 @@ export * from './lib/services/leftPanelNavigation';
55
55
  export * from './lib/services/locationService/locationService';
56
56
  export { createSimpleStore } from './lib/services/stores/createSimpleStore';
57
57
  export * from './lib/services/userSetting';
58
+ export * from './lib/types/activeTag.types';
58
59
  export * from './lib/types/api-echohub';
59
60
  export { dataAccessLinks } from './lib/types/dataAccess/dataAccessLinks';
61
+ export { DocType } from './lib/types/docType';
60
62
  export type { EchoHubPlant } from './lib/types/echoHubPlant';
61
63
  export * from './lib/types/eventTypes';
62
64
  export * from './lib/types/extensions';
@@ -64,8 +66,10 @@ export type { BucketPanelKey, BucketSourceKey } from './lib/types/grid/bucketSid
64
66
  export type { SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './lib/types/hookLibrary';
65
67
  export type { ModelPermissions } from './lib/types/modelPermissions';
66
68
  export { InternalApplicationLinks } from './lib/types/navigation/internalApplicationLinks';
69
+ export { allNotificationTypes, NotificationTypes } from './lib/types/notificationTypes';
67
70
  export { PingableSources } from './lib/types/pingableSources';
68
71
  export { SearchItemDetailsType as searchItemDetailsType } from './lib/types/searchItemDetailsType';
72
+ export { allWorkOrderTypes, WorkOrderTypes } from './lib/types/workOrderTypes';
69
73
  export * from './lib/utils';
70
74
  export { getPdmsPlantCodeForTag } from './lib/utils/getPdmsPlantCodeForTag';
71
75
  export { isImage, isVideo } from './lib/utils/mediaTypeUtils';
@@ -1,4 +1,4 @@
1
- import { TagSummaryDto } from '@equinor/echo-search';
1
+ import type { TagSummaryDto } from '@equinor/echo-search';
2
2
  import React from 'react';
3
3
  export type ContextualAppLinksContextType = {
4
4
  tag: TagSummaryDto;
@@ -0,0 +1 @@
1
+ export declare const useCalculateLegendHeight: () => number;
@@ -26,7 +26,7 @@ export declare function getNotificationColorMap(currentBadgeOption: SNBadgeType
26
26
  /**
27
27
  * Converts failureImpact into failureImpactId
28
28
  */
29
- export declare function convertToFailureImpactId(failureImpact: string): "X" | "S" | "D" | "U" | "";
29
+ export declare function convertToFailureImpactId(failureImpact: string): "" | "X" | "S" | "D" | "U";
30
30
  /**
31
31
  * Used to set colorMap on Work order visuals such as ListItems
32
32
  */
@@ -1,4 +1,4 @@
1
- import { TagSummaryDto } from '@equinor/echo-search';
1
+ import type { TagSummaryDto } from '@equinor/echo-search';
2
2
  import React from 'react';
3
3
  interface TagsDropdownProps {
4
4
  tags: TagSummaryDto[];
@@ -1,5 +1,5 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { deleteSelectionId, fetchUserSelectionIds } from './selectionMenu/selectionTreeStore/api/selectionTree.api';
2
+ import { deleteSelectionId, fetchSelectionHistory, fetchUserSelectionIds } from './selectionMenu/selectionTreeStore/api/selectionTree.api';
3
3
  /**
4
4
  * Internal that should only be used by echopedia
5
5
  */
@@ -7,6 +7,7 @@ export declare const globalSelectionInternal: Readonly<{
7
7
  loadFromApi: typeof loadFromApi;
8
8
  deleteSelectionId: typeof deleteSelectionId;
9
9
  fetchUserSelectionIds: typeof fetchUserSelectionIds;
10
+ fetchSelectionHistory: typeof fetchSelectionHistory;
10
11
  }>;
11
12
  declare function loadFromApi(idToLoad: Guid): Promise<boolean>;
12
13
  export {};
@@ -1,4 +1,4 @@
1
- import { ResultArray } from '@equinor/echo-search';
1
+ import type { ResultArray } from '@equinor/echo-search';
2
2
  import { StoreApi } from 'zustand';
3
3
  import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../globalSelectionStore.types';
4
4
  type FetchFunction<T, U> = (itemIds: Readonly<U[]>) => Promise<{
@@ -1,4 +1,4 @@
1
- import { EquipmentData, MeasuringPointData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
1
+ import type { EquipmentData, MeasuringPointData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
2
2
  import { Brand } from '@equinor/echo-utils';
3
3
  export declare enum GlobalSelectionItemType {
4
4
  WorkOrder = "WorkOrder",
@@ -11,6 +11,7 @@ export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesB
11
11
  export { useCurrentSelectionId } from './selectionMenu/hooks/useCurrentSelectionId';
12
12
  export { useGlobalSelectionGroups } from './selectionMenu/hooks/useGlobalSelectionGroups';
13
13
  export { useMostUsedSelectionColorByIds } from './selectionMenu/hooks/useSelectionColorFrequency';
14
+ export { useFetchSelectionHistory } from './selectionMenu/hooks/useFetchSelectionHistory';
14
15
  export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
15
16
  export { globalSelectionApi } from './globalSelection.api';
16
17
  export { globalSelectionInternal } from './globalSelection.internal';
@@ -19,5 +20,6 @@ export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStor
19
20
  export { OpenGlobalSelectionIn3DButton } from './OpenGlobalSelectionIn3DButton';
20
21
  export { convertGlobalSelectionItemsToPlantTagPairs } from './OpenGlobalSelectionIn3DButton.utils';
21
22
  export { saveEquipmentAsNewSelectionToApi } from './selectionMenu/selectionTreeStore/api/selectionTree.equipment';
23
+ export { invalidateHistorySelectionQuery } from './selectionMenu/invalidateHistorySelectionQuery';
22
24
  export { SelectionColorConflictDialog } from './selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog';
23
25
  export { simulatedSelectionTreeApiError } from './selectionMenu/selectionTreeStore/persist/devOnlySimulateOffline';
@@ -0,0 +1,5 @@
1
+ export declare const historySelectionQueryKey = "historySelection";
2
+ export declare const useFetchSelectionHistory: () => {
3
+ status: "error" | "success" | "pending";
4
+ data: import("../selectionTreeStore/selectionTree.api.types").ApiSelectionHistory[] | undefined;
5
+ };
@@ -0,0 +1 @@
1
+ export declare const invalidateHistorySelectionQuery: () => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { ApiSelectionTreeRoot, ApiSelectionTreeRootBase } from '../selectionTree.api.types';
2
+ import { ApiSelectionHistory, ApiSelectionTreeRoot, ApiSelectionTreeRootBase } from '../selectionTree.api.types';
3
3
  import { SelectionGroup } from '../selectionTree.store.types';
4
4
  /**
5
5
  * Maps the selection tree data to the API format.
@@ -15,5 +15,6 @@ export declare function saveSelectionTreeToApi(args: {
15
15
  itemToSave: ApiSelectionTreeRootBase;
16
16
  }): Promise<Guid | undefined>;
17
17
  export declare function fetchSelectionTreeById(id: string): Promise<ApiSelectionTreeRoot | undefined>;
18
+ export declare function fetchSelectionHistory(): Promise<ApiSelectionHistory[] | undefined>;
18
19
  export declare function fetchUserSelectionIds(): Promise<Guid[]>;
19
- export declare function deleteSelectionId(id: string): Promise<void>;
20
+ export declare function deleteSelectionId(id: Guid): Promise<void>;
@@ -1,5 +1,6 @@
1
- import { ApiSelectionGroup, ApiSelectionTreeRootBase } from '../selectionTree.api.types';
2
1
  import { GlobalSelectionItemType, GlobalSelectionObject, GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
2
+ import { ApiSelectionGroup, ApiSelectionTreeRootBase } from '../selectionTree.api.types';
3
+ import { SelectionGroup } from '../selectionTree.store.types';
3
4
  /**
4
5
  * Processes API selection tree data and organizes item IDs by their types.
5
6
  *
@@ -40,3 +41,14 @@ export declare function createListsByTypeFromApiData({ data }: {
40
41
  * @returns A new array of selection groups with colors assigned to items as needed.
41
42
  */
42
43
  export declare function applyColorsOnSelectionApiData(groups: ApiSelectionGroup[]): ApiSelectionGroup[];
44
+ /**
45
+ * Builds an array of `SelectionGroup` objects from the provided API selection tree root.
46
+ *
47
+ * This function maps the API data structure into the application's selection tree format,
48
+ * transforming each group and its categories accordingly. It also ensures that the local
49
+ * selection group is inserted at the correct position within the resulting array.
50
+ *
51
+ * @param root - The root object from the API containing selection tree data.
52
+ * @returns An array of `SelectionGroup` objects constructed from the API data, with the local selection group positioned as specified.
53
+ */
54
+ export declare function buildSelectionTreeFromApi(root: ApiSelectionTreeRootBase): SelectionGroup[];
@@ -31,4 +31,10 @@ export interface ApiSelectionTreeItem {
31
31
  readonly id: ApiSelectionTreeItemId;
32
32
  readonly metaData?: ApiGlobalSelectionMetaData;
33
33
  }
34
+ export interface ApiSelectionHistory {
35
+ readonly id: Guid;
36
+ readonly lastChangedUtc: Date;
37
+ readonly totalItems: number;
38
+ }
34
39
  export declare function cleanApiSelectionTreeRoot(root: ApiSelectionTreeRoot): ApiSelectionTreeRoot;
40
+ export declare function cleanApiSelectionHistory(roots: ApiSelectionHistory[]): ApiSelectionHistory[];
@@ -29,6 +29,7 @@ export interface SelectionTreeData {
29
29
  currentSelectionId?: Guid;
30
30
  readonly groups: SelectionGroup[];
31
31
  }
32
+ export declare const itemTypeToCategoryId: Record<GlobalSelectionItemType, GlobalSelectionCategoryId>;
32
33
  export interface SelectionTreeStore extends SelectionTreeData {
33
34
  setCurrentSelectionId: (args: {
34
35
  guid: Guid | undefined;
@@ -1,4 +1,4 @@
1
- import { TagSummaryDto } from '@equinor/echo-search';
1
+ import type { TagSummaryDto } from '@equinor/echo-search';
2
2
  export interface TagWithEquipmentId {
3
3
  readonly tagNo: string;
4
4
  readonly instCode: string;
@@ -1,4 +1,4 @@
1
- import { MeasuringPointData } from '@equinor/echo-search';
1
+ import type { MeasuringPointData } from '@equinor/echo-search';
2
2
  export interface MeasurementDto {
3
3
  measurementId: string;
4
4
  measuringPointId: string;
@@ -0,0 +1,79 @@
1
+ import { DocType } from './docType';
2
+ import { NotificationTypes } from './notificationTypes';
3
+ import { WorkOrderTypes } from './workOrderTypes';
4
+ /**
5
+ * Enum representing the different types of accordions available for tag information display,
6
+ * in the Search Panel, for a given active tag.
7
+ *
8
+ * @remarks
9
+ * This enum is used to specify the type of information section (accordion) shown for a tag,
10
+ * such as general tag information, 3D model view, bolt tension details, measuring points, or work permits.
11
+ *
12
+ * @enum
13
+ * @property {string} TagInformation - Accordion for general tag information.
14
+ * @property {string} E3D - Accordion for 3D model visualization.
15
+ * @property {string} BoltTension - Accordion for bolt tension details.
16
+ * @property {string} MeasuringPoints - Accordion for measuring point information.
17
+ * @property {string} WorkPermit - Accordion for work permit details.
18
+ */
19
+ export declare enum TagInfoAccordionTypes {
20
+ TagInformation = "Tag information",
21
+ E3D = "E3D",
22
+ BoltTension = "Bolt tension",
23
+ MeasuringPoints = "Measuring Point",
24
+ WorkPermit = "WorkPermit"
25
+ }
26
+ export declare enum ProCoSysChecklistGroup {
27
+ CPCL = "CPCL",
28
+ MCCR = "MCCR",
29
+ P = "Preservation",
30
+ RL = "RunningLogs",
31
+ DCCL = "DeCommissioningCheckList",
32
+ FAIL = "Unknown Form Group"
33
+ }
34
+ export { NotificationTypes, WorkOrderTypes };
35
+ export type TagItemSubTabType = TagInfoAccordionTypes | WorkOrderTypes | NotificationTypes | ProCoSysChecklistGroup | DocType | string;
36
+ export declare enum NonDocTabs {
37
+ Info = "Info",
38
+ Documents = "Docs",
39
+ RealTime = "Real time",
40
+ Media = "Media",
41
+ WorkOrders = "Work Orders",
42
+ Notifications = "Notifs.",
43
+ WorkPermits = "Work Permits",
44
+ Punch = "Punch",
45
+ Checklist = "Checklist",
46
+ MeasuringPoints = "Measuring Points",
47
+ EquipmentInfo = "Equip.",
48
+ IocAnnotations = "IOC Annotations"
49
+ }
50
+ export type TagItemContentTabsType = NonDocTabs | DocType;
51
+ /**
52
+ * Arguments for setting the active tag in the application.
53
+ *
54
+ * Used by the returned function of useSetActiveTagNo() hook.
55
+ *
56
+ * @property tagNo - The unique identifier of the tag to activate.
57
+ * @property activeTagTab - (Optional) The currently active tab for the tag item.
58
+ * @property activeTagSubTab - (Optional) The currently active sub-tab for the tag item.
59
+ * @property instCode - (Optional) The instrument code associated with the tag.
60
+ * @property activePanelKey - (Optional) The key of the panel to activate.
61
+ * @property keepLastNavigationItem - (Optional) Whether to keep the last navigation item in the navigation stack.
62
+ * @property openInPanel - (Optional) Whether to open the tag in a panel.
63
+ * @property displayMessageOnItemNotFound - (Optional) Whether to display a message if the tag item is not found.
64
+ * @property allowToggle - (Optional) Whether toggling the active state is allowed.
65
+ * @property omitTagNoFromUrl - (Optional, deprecated) Used only by echo maps. Planned for removal when echo-maps is no longer part of echo.
66
+ */
67
+ export type SetActiveTagNoArgs = {
68
+ tagNo: string;
69
+ activeTagTab?: TagItemContentTabsType;
70
+ activeTagSubTab?: TagItemSubTabType;
71
+ instCode?: string;
72
+ activePanelKey?: string;
73
+ keepLastNavigationItem?: boolean;
74
+ openInPanel?: boolean;
75
+ displayMessageOnItemNotFound?: boolean;
76
+ allowToggle?: boolean;
77
+ /** @deprecated Used only by echo maps. Planned for removal when echo-maps is no longer part of echo. */
78
+ omitTagNoFromUrl?: boolean;
79
+ };
@@ -44,3 +44,4 @@ export declare const dataAccessLinks: {
44
44
  url: string;
45
45
  };
46
46
  };
47
+ export declare function createPlantNameQueryParam(plantName: string): string;
@@ -0,0 +1,16 @@
1
+ export declare enum DocType {
2
+ pid = "pid",
3
+ processFlowDiagram = "processFlowDiagram",
4
+ iso = "iso",
5
+ did = "did",
6
+ scd = "scd",
7
+ causeEffect = "causeEffect",
8
+ fpds = "fpds",
9
+ layout = "layout",
10
+ loop = "loop",
11
+ blockDiagram = "blockDiagram",
12
+ wire = "wire",
13
+ detail = "detail",
14
+ opl = "opl",
15
+ other = "other"
16
+ }
@@ -0,0 +1,10 @@
1
+ export declare enum NotificationTypes {
2
+ M1 = "M1",
3
+ M2 = "M2",
4
+ M3 = "M3",
5
+ M4 = "M4",
6
+ M5 = "M5",
7
+ M6 = "M6",
8
+ M9 = "M9"
9
+ }
10
+ export declare const allNotificationTypes: ReadonlyArray<NotificationTypes>;
@@ -0,0 +1,12 @@
1
+ export declare enum WorkOrderTypes {
2
+ PM01 = "PM01",
3
+ PM02 = "PM02",
4
+ PM03 = "PM03",
5
+ PM04 = "PM04",
6
+ PM05 = "PM05",
7
+ PM06 = "PM06",
8
+ PM10 = "PM10",
9
+ PM15 = "PM15",
10
+ PM20 = "PM20"
11
+ }
12
+ export declare const allWorkOrderTypes: ReadonlyArray<WorkOrderTypes>;
@@ -1,16 +0,0 @@
1
- export declare const mockedProjects: {
2
- projectCode: string;
3
- stidDeliveryCode: number;
4
- description: string;
5
- isRevProject: string;
6
- filter: {
7
- value: string;
8
- text: string;
9
- };
10
- instCode: string;
11
- insertedDate: string;
12
- insertedBy: string;
13
- updatedDate: string;
14
- updatedBy: string;
15
- validFlg: string;
16
- }[];
@@ -1,5 +0,0 @@
1
- import { TagSummaryDto } from '@equinor/echo-search';
2
- export declare const mockedArchivedTags: TagSummaryDto[];
3
- export declare const mockedNonArchivedTags: TagSummaryDto[];
4
- export declare const mockedTags: TagSummaryDto[];
5
- export declare const estimatedTagCount: number;
@@ -1,4 +0,0 @@
1
- import { WorkOrderDetailsDto } from '@equinor/echo-search';
2
- export declare const mockedOpenWorkOrders: WorkOrderDetailsDto[];
3
- export declare const mockedClosedWorkOrders: WorkOrderDetailsDto[];
4
- export declare const mockedWorkOrders: WorkOrderDetailsDto[];
@@ -1,17 +0,0 @@
1
- /**
2
- * Start Mock Data
3
- *
4
- * Just some quick data as a Proof of Concept.
5
- * When continuing on this, we should extract it to a data folder,
6
- * and have helper functions for getting the data in the handlers below.
7
- */
8
- export interface Plant {
9
- instCode: string;
10
- hasTr2000: boolean;
11
- description: string;
12
- sapPlantId: string;
13
- proCoSysPlantId: string;
14
- }
15
- export declare const mockedInstCodeName = "MockedInstCode";
16
- export declare const mockedSapPlantId = "1234";
17
- export declare const plants: Plant[];
@@ -1 +0,0 @@
1
- export declare function SelectionStatusDotIndicator(): import("react/jsx-runtime").JSX.Element | null;