@equinor/echo-framework 1.2.0 → 1.3.1

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 1.2.0 < 2.0.0",
6
- "@equinor/echo-components": ">= 1.2.0 < 2.0.0",
7
- "@equinor/echo-core": ">= 1.2.0 < 2.0.0",
8
- "@equinor/echo-search": ">= 1.2.0 < 2.0.0",
9
- "@equinor/echo-utils": ">= 1.2.0 < 2.0.0",
5
+ "@equinor/echo-base": ">= 1.3.1 < 2.0.0",
6
+ "@equinor/echo-components": ">= 1.3.1 < 2.0.0",
7
+ "@equinor/echo-core": ">= 1.3.1 < 2.0.0",
8
+ "@equinor/echo-search": ">= 1.3.1 < 2.0.0",
9
+ "@equinor/echo-utils": ">= 1.3.1 < 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;
@@ -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, fetchSelectionHistory, fetchUserSelectionIds } from './selectionMenu/selectionTreeStore/api/selectionTree.api';
2
+ import { createSelection, deleteSelectionId, fetchSelectionHistory, fetchUserSelectionIds } from './selectionMenu/selectionTreeStore/api/selectionTree.api';
3
3
  /**
4
4
  * Internal that should only be used by echopedia
5
5
  */
@@ -8,6 +8,7 @@ export declare const globalSelectionInternal: Readonly<{
8
8
  deleteSelectionId: typeof deleteSelectionId;
9
9
  fetchUserSelectionIds: typeof fetchUserSelectionIds;
10
10
  fetchSelectionHistory: typeof fetchSelectionHistory;
11
+ createSelection: typeof createSelection;
11
12
  }>;
12
13
  declare function loadFromApi(idToLoad: Guid): Promise<boolean>;
13
14
  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",
@@ -1,4 +1,5 @@
1
1
  export * from './globalSelectionStore/globalSelectionStore.types';
2
+ export * from './selectionMenu/selectionTreeStore/selectionTree.api.types';
2
3
  export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
3
4
  export { useAreAllItemsVisible } from './hooks/useAreAllItemsVisible';
4
5
  export { useGlobalSelectionByItemId } from './hooks/useGlobalSelectionByItemId';
@@ -9,9 +10,9 @@ export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
9
10
  export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
10
11
  export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
11
12
  export { useCurrentSelectionId } from './selectionMenu/hooks/useCurrentSelectionId';
13
+ export { useFetchSelectionHistory } from './selectionMenu/hooks/useFetchSelectionHistory';
12
14
  export { useGlobalSelectionGroups } from './selectionMenu/hooks/useGlobalSelectionGroups';
13
15
  export { useMostUsedSelectionColorByIds } from './selectionMenu/hooks/useSelectionColorFrequency';
14
- export { useFetchSelectionHistory } from './selectionMenu/hooks/useFetchSelectionHistory';
15
16
  export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
16
17
  export { globalSelectionApi } from './globalSelection.api';
17
18
  export { globalSelectionInternal } from './globalSelection.internal';
@@ -19,7 +20,7 @@ export { SELECTION_COLOR_PICKER_COLORS } from './globalSelectionColorService';
19
20
  export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
20
21
  export { OpenGlobalSelectionIn3DButton } from './OpenGlobalSelectionIn3DButton';
21
22
  export { convertGlobalSelectionItemsToPlantTagPairs } from './OpenGlobalSelectionIn3DButton.utils';
22
- export { saveEquipmentAsNewSelectionToApi } from './selectionMenu/selectionTreeStore/api/selectionTree.equipment';
23
23
  export { invalidateHistorySelectionQuery } from './selectionMenu/invalidateHistorySelectionQuery';
24
+ export { saveEquipmentAsNewSelectionToApi } from './selectionMenu/selectionTreeStore/api/selectionTree.equipment';
24
25
  export { SelectionColorConflictDialog } from './selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog';
25
26
  export { simulatedSelectionTreeApiError } from './selectionMenu/selectionTreeStore/persist/devOnlySimulateOffline';
@@ -1,5 +1,5 @@
1
1
  export declare const historySelectionQueryKey = "historySelection";
2
2
  export declare const useFetchSelectionHistory: () => {
3
3
  status: "error" | "success" | "pending";
4
- data: import("../selectionTreeStore/selectionTree.api.types").ApiSelectionHistory[] | undefined;
4
+ data: import("../..").ApiSelectionHistory[] | undefined;
5
5
  };
@@ -18,3 +18,4 @@ export declare function fetchSelectionTreeById(id: string): Promise<ApiSelection
18
18
  export declare function fetchSelectionHistory(): Promise<ApiSelectionHistory[] | undefined>;
19
19
  export declare function fetchUserSelectionIds(): Promise<Guid[]>;
20
20
  export declare function deleteSelectionId(id: Guid): Promise<void>;
21
+ export declare function createSelection(selection: string): Promise<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;
@@ -9,11 +9,11 @@ export interface TagIdPlantId {
9
9
  * Groups the input work orders by their `instCode`, fetches additional tag information asynchronously,
10
10
  * and returns an array of objects containing plant and tag details for use in 3D visualization.
11
11
  *
12
- * @param selectedWorkOrders - A readonly array of objects, each containing a `tagNo` and an `instCode`.
12
+ * @param selectedTags - A readonly array of objects, each containing a `tagNo` and an `instCode`.
13
13
  * @returns A promise that resolves to an array of `PlantAndTagForOpenIn3d` objects, each containing
14
14
  * `instCode`, `pdmsPlantCode`, `tagNo`, and `plantNo` properties.
15
15
  */
16
- export declare function tagToPlantTagPairs(selectedWorkOrders: ReadonlyArray<{
16
+ export declare function tagToPlantTagPairs(selectedTags: ReadonlyArray<{
17
17
  tagNo: string;
18
18
  instCode: string;
19
19
  }>): Promise<PlantAndTagForOpenIn3d[]>;
@@ -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
+ };
@@ -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[];