@equinor/echo-framework 0.24.0-beta-1 → 0.24.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.24.0-beta-1",
3
+ "version": "0.24.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
6
- "@equinor/echo-components": ">= 0.12.0 < 0.13.0",
7
- "@equinor/echo-core": ">= 0.9.0 < 0.10.0",
8
- "@equinor/echo-search": "0.15.17-beta-0",
9
- "@equinor/echo-utils": ">= 0.4.0 < 0.5.0",
5
+ "@equinor/echo-base": ">= 0.7.5 < 0.8.0",
6
+ "@equinor/echo-components": ">= 0.12.4 < 0.13.0",
7
+ "@equinor/echo-core": ">= 0.9.19 < 0.10.0",
8
+ "@equinor/echo-search": ">= 0.15.7 < 0.16.0",
9
+ "@equinor/echo-utils": ">= 0.4.11 < 0.5.0",
10
10
  "@equinor/eds-core-react": "0.43.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
@@ -1,6 +1,5 @@
1
- import { NotificationDetails, PrepviewAttachment, PrepviewDocumentGroup, PrepviewHistory, PrepviewObject, PrepviewOperation, PrepviewSafety, PrepviewTagInformation, PunchDetails, SubseaNotificationDetails, SubseaWorkOrderDetails, WorkOrderDetails, WorkOrderEquipment } from '../types';
1
+ import { NotificationDetails, PrepviewAttachment, PrepviewDocumentGroup, PrepviewHistory, PrepviewObject, PrepviewOperation, PrepviewSafety, PrepviewTagInformation, PunchDetails, SubseaNotificationDetails, WorkOrderDetails, WorkOrderEquipment } from '../types';
2
2
  export declare function getWorkOrderDetails(workOrderId: string): Promise<WorkOrderDetails>;
3
- export declare function getSubseaWorkOrderDetails(workOrderId: string): Promise<SubseaWorkOrderDetails>;
4
3
  export declare function getWorkType(workOrderId: string): Promise<string[]>;
5
4
  export declare function getNotificationDetails(notificationId: string): Promise<NotificationDetails>;
6
5
  export declare function getSubseaNotificationDetails(notificationId: string): Promise<SubseaNotificationDetails>;
@@ -1,5 +1,4 @@
1
1
  export declare function getWorkOrder(workOrderId: string): string;
2
- export declare function getSubseaWorkOrder(workOrderId: string): string;
3
2
  export declare function getWorkTypeUrl(workOrderId: string): string;
4
3
  export declare function getNotification(maintenanceRecordId: string): string;
5
4
  export declare function getSubseaNotification(maintenanceRecordId: string): string;
@@ -44,11 +44,6 @@ export type PlantReference = {
44
44
  label: string;
45
45
  typeLabel: string;
46
46
  };
47
- export type SubseaWorkOrderDetails = FetchStatus & {
48
- hasPrts: boolean;
49
- hasB30Document: boolean;
50
- recordTypeIds?: string[];
51
- };
52
47
  export type PrepviewOperation = {
53
48
  operationNumber: string;
54
49
  title: string;
@@ -0,0 +1,3 @@
1
+ import { WorkOrderItem } from '@equinor/echo-components';
2
+ import { WorkOrderDetails } from '../../types';
3
+ export declare function mapWorkOrderDetailsToWorkOrderItem(details: WorkOrderDetails): WorkOrderItem;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Internal that should only be used by echopedia
3
+ */
4
+ export declare const globalSelectionInternal: Readonly<{
5
+ loadFromApi: typeof loadFromApi;
6
+ }>;
7
+ declare function loadFromApi(idToLoad: string): void;
8
+ export {};
@@ -20,7 +20,7 @@ export declare const initialEquipmentList: GlobalSelectionTypes.EquipmentList;
20
20
  *
21
21
  * For accessing and using global selection features, use the globalSelectionApi from echo-framework.
22
22
  */
23
- export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
23
+ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
24
24
  setState<A extends string | {
25
25
  type: string;
26
26
  }>(partial: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: GlobalSelectionStore) => GlobalSelectionStore | Partial<GlobalSelectionStore>), replace?: boolean | undefined, action?: A | undefined): void;
@@ -32,16 +32,6 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
32
32
  fireImmediately?: boolean;
33
33
  } | undefined): () => void;
34
34
  };
35
- }, "persist"> & {
36
- persist: {
37
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<GlobalSelectionStore, GlobalSelectionStore>>) => void;
38
- clearStorage: () => void;
39
- rehydrate: () => Promise<void> | void;
40
- hasHydrated: () => boolean;
41
- onHydrate: (fn: (state: GlobalSelectionStore) => void) => () => void;
42
- onFinishHydration: (fn: (state: GlobalSelectionStore) => void) => () => void;
43
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<GlobalSelectionStore, GlobalSelectionStore>>;
44
- };
45
35
  }, "setState"> & {
46
36
  setState(nextStateOrUpdater: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: import("immer").WritableDraft<GlobalSelectionStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
47
37
  type: string;
@@ -1,5 +1,6 @@
1
1
  export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
2
2
  export { globalSelectionApi } from './globalSelection.api';
3
+ export { globalSelectionInternal } from './globalSelection.internal';
3
4
  export * from './globalSelectionStore/globalSelectionStore.types';
4
5
  export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
5
6
  export { convertGlobalSelectionItemsToPlantTagPairs } from './globalSelectionStore/globalSelectionStoreHelpers';
@@ -0,0 +1,7 @@
1
+ import { PersistedSelectionGroup } from '../selectionTree.store.types';
2
+ export declare function fetchSelectionTreeById(id: string): Promise<PersistedSelectionTreeDto | undefined>;
3
+ interface PersistedSelectionTreeDto {
4
+ readonly id: string;
5
+ readonly data: PersistedSelectionGroup[];
6
+ }
7
+ export {};
@@ -1,8 +1,10 @@
1
1
  import { PersistOptions } from 'zustand/middleware';
2
2
  import { SelectionTreeStore } from './selectionTree.store.types';
3
- declare function loadAndPopulateStore(store: SelectionTreeStore): Promise<void>;
3
+ declare function loadAndPopulateStoreFromDisk(store: SelectionTreeStore): Promise<void>;
4
+ declare function loadAndPopulateStoreFromApi(store: SelectionTreeStore, idToLoad: string): Promise<void>;
4
5
  export declare const selectionTreeRepository: {
5
- loadAndPopulateStore: typeof loadAndPopulateStore;
6
+ loadAndPopulateStoreFromDisk: typeof loadAndPopulateStoreFromDisk;
7
+ loadAndPopulateStoreFromApi: typeof loadAndPopulateStoreFromApi;
6
8
  persistOptions: PersistOptions<SelectionTreeStore, SelectionTreeStore>;
7
9
  };
8
10
  export {};
@@ -8,33 +8,33 @@ export declare enum GlobalSelectionCategoryId {
8
8
  }
9
9
  export declare const globalSelectionDefaultGroupId: Guid;
10
10
  export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
11
- id: SelectionItemTypeToItemIdMap[T];
12
- type: T;
11
+ readonly id: SelectionItemTypeToItemIdMap[T];
12
+ readonly type: T;
13
13
  };
14
14
  export interface SelectionBase {
15
- label: string;
16
- subLabel: string;
15
+ readonly label: string;
16
+ readonly subLabel: string;
17
17
  }
18
18
  export interface SelectionCategory {
19
- id: GlobalSelectionCategoryId;
20
- label: string;
19
+ readonly id: GlobalSelectionCategoryId;
20
+ readonly label: string;
21
21
  items: Map<GlobalSelectionTypes.ItemIdString, SelectionTreeItem<GlobalSelectionItemType>>;
22
22
  }
23
23
  export interface PersistedSelectionCategory {
24
- id: GlobalSelectionCategoryId;
25
- label: string;
26
- items: SelectionTreeItem<GlobalSelectionItemType>[];
24
+ readonly id: GlobalSelectionCategoryId;
25
+ readonly label: string;
26
+ readonly items: SelectionTreeItem<GlobalSelectionItemType>[];
27
27
  }
28
28
  export interface SelectionGroup extends SelectionBase {
29
- id: Guid;
30
- categories: SelectionCategory[];
29
+ readonly id: Guid;
30
+ readonly categories: SelectionCategory[];
31
31
  }
32
32
  export interface PersistedSelectionGroup extends SelectionBase {
33
- id: Guid;
34
- categories: PersistedSelectionCategory[];
33
+ readonly id: Guid;
34
+ readonly categories: PersistedSelectionCategory[];
35
35
  }
36
36
  export interface SelectionTreeData {
37
- groups: SelectionGroup[];
37
+ readonly groups: SelectionGroup[];
38
38
  }
39
39
  export interface SelectionTreeStore {
40
40
  groups: SelectionGroup[];
@@ -1 +1,3 @@
1
- export default function handleErrors(exception: Error | unknown): void;
1
+ export default function handleErrors(exception: Error | unknown, options?: {
2
+ userFriendlyErrorMessage: string;
3
+ }): void;
@@ -1,8 +0,0 @@
1
- import { PersistOptions } from 'zustand/middleware';
2
- import { GlobalSelectionStore } from './globalSelectionStore.types';
3
- declare function loadAndPopulateStoreMetadata(store: GlobalSelectionStore): Promise<void>;
4
- export declare const globalSelectionRepository: {
5
- loadAndPopulateStoreMetadata: typeof loadAndPopulateStoreMetadata;
6
- persistOptions: PersistOptions<GlobalSelectionStore, GlobalSelectionStore>;
7
- };
8
- export {};