@equinor/echo-framework 0.19.2 → 0.20.3

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 (33) hide show
  1. package/index.cjs.js +1 -1
  2. package/package.json +1 -1
  3. package/src/index.d.ts +1 -2
  4. package/src/lib/components/prepview/common/additionalInformation/NotificationAdditionalDetails.d.ts +6 -0
  5. package/src/lib/components/prepview/common/additionalInformation/WOAdditionalDetails.d.ts +6 -0
  6. package/src/lib/components/requestAccess/RequestProCoSysAccess.d.ts +1 -0
  7. package/src/lib/components/requestAccess/hooks/fetchPlantInfo.d.ts +2 -0
  8. package/src/lib/components/spinner/tabSpinner.d.ts +1 -0
  9. package/src/lib/feature/equipment/api/api-equipmentWithMeasuringPoints.d.ts +2 -1
  10. package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemHeader.d.ts +2 -3
  11. package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts +2 -1
  12. package/src/lib/feature/equipment/components/equipmentItemInfo/equipmentItemInfo.d.ts +8 -0
  13. package/src/lib/feature/equipment/components/{equipmentInfoItem.d.ts → equipmentListItem.d.ts} +2 -2
  14. package/src/lib/feature/equipment/components/equipmentTabs/MeasuringPointsForEquipmentItem.d.ts +9 -0
  15. package/src/lib/feature/equipment/components/equipmentTabs/equipmentTabs.d.ts +4 -5
  16. package/src/lib/feature/equipment/components/fullEquipmentItem/fullEquipmentItem.d.ts +8 -0
  17. package/src/lib/feature/equipment/components/index.d.ts +3 -3
  18. package/src/lib/feature/equipment/hooks/useEquipmentWithMeasuringPoints.d.ts +7 -2
  19. package/src/lib/feature/equipment/index.d.ts +1 -2
  20. package/src/lib/feature/equipment/types/equipment.d.ts +20 -12
  21. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +10 -0
  22. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +12 -5
  23. package/src/lib/feature/globalSelection/hooks/useGlobalSelectionLists.d.ts +1 -11
  24. package/src/lib/feature/globalSelection/hooks/useGlobalSelectionTags.d.ts +6 -0
  25. package/src/lib/feature/globalSelection/hooks/useGlobalSelectionWorkOrders.d.ts +2 -2
  26. package/src/lib/feature/globalSelection/index.d.ts +2 -1
  27. package/src/lib/feature/{measuringPoint/components/measuringPointDetails → hooks}/useAddTagToLegendRegistry.d.ts +1 -1
  28. package/src/lib/components/prepview/common/additionalInformation/AdditionalDetails.d.ts +0 -7
  29. package/src/lib/components/prepview/common/additionalInformation/tabsPanels/NotificationPanels.d.ts +0 -6
  30. package/src/lib/components/prepview/common/additionalInformation/tabsPanels/TabsPanels.d.ts +0 -12
  31. package/src/lib/components/prepview/common/additionalInformation/tabsPanels/WorkOrderPanels.d.ts +0 -6
  32. package/src/lib/components/prepview/common/additionalInformation/tabsPanels/index.d.ts +0 -1
  33. package/src/lib/feature/equipment/components/equipmentItemDetails/equipmentItemDetails.d.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.19.2",
3
+ "version": "0.20.3",
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",
package/src/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { getEquipmentWithMeasuringPointsFromApi } from './lib/feature/equipment/api/api-equipmentWithMeasuringPoints';
3
2
  import { getLegendStatusColor } from './lib/feature/legend/utils/legendUtils';
4
3
  import './lib/globalStyles.css';
5
4
  import { getPlantsInfo, getTagDetails } from './lib/services/api';
@@ -11,6 +10,7 @@ export { SelectedItemsMenu } from './lib/components/openIn3d/SelectedItemsMenu';
11
10
  export { PrepviewButton } from './lib/components/prepviewButton/prepviewButton';
12
11
  export { RequestProCoSysAccess } from './lib/components/requestAccess/RequestProCoSysAccess';
13
12
  export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
13
+ export { useFetchPlantInfo } from './lib/components/requestAccess/hooks/fetchPlantInfo';
14
14
  export { WorkOrderListItem } from './lib/components/workOrderListItem';
15
15
  export * from './lib/coreApplication';
16
16
  export * from './lib/feature/equipment/index';
@@ -128,7 +128,6 @@ declare const EchoFramework: Readonly<{
128
128
  web3dUrl: string;
129
129
  }>;
130
130
  createTemporarilyEchoHubListFor3D: (request: import("./lib/types/api-echohub").TemporaryEchoHubListDto, abortSignal?: AbortSignal | undefined) => Promise<import("./lib/types/api-echohub").TemporaryHubListCreatedResponse>;
131
- getEquipmentWithMeasuringPointsFromApi: typeof getEquipmentWithMeasuringPointsFromApi;
132
131
  }>;
133
132
  }>;
134
133
  export default EchoFramework;
@@ -0,0 +1,6 @@
1
+ import type { NotificationDetails } from '../../types';
2
+ interface Props {
3
+ notificationDetails: NotificationDetails;
4
+ }
5
+ declare function NotificationAdditionalDetails({ notificationDetails }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export { NotificationAdditionalDetails };
@@ -0,0 +1,6 @@
1
+ import type { WorkOrderDetails } from '../../types';
2
+ interface Props {
3
+ workOrderDetails?: WorkOrderDetails;
4
+ }
5
+ declare function WOAdditionalDetails({ workOrderDetails }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ export { WOAdditionalDetails };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  type RequestProCoSysAccessProps = {
3
3
  className?: string;
4
4
  onClicked?: () => void;
5
+ plantName?: string;
5
6
  };
6
7
  export declare const RequestProCoSysAccess: React.FC<RequestProCoSysAccessProps>;
7
8
  export {};
@@ -0,0 +1,2 @@
1
+ import { EchoHubPlant } from '../../../types/echoHubPlant';
2
+ export declare const useFetchPlantInfo: (instCode: string, handleError: (error: unknown) => void) => EchoHubPlant[] | undefined;
@@ -0,0 +1 @@
1
+ export declare const TabSpinner: () => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { EquipmentWithMeasuringPoints } from '../types/equipmentWithMeasuringPoints';
2
- export declare function getEquipmentWithMeasuringPointsFromApi({ equipmentId }: {
2
+ export declare function getEquipmentFromApi({ equipmentId, includeMeasuringPoints }: {
3
3
  equipmentId: string;
4
+ includeMeasuringPoints?: boolean;
4
5
  }): Promise<EquipmentWithMeasuringPoints[]>;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import { Equipment } from '../../types/equipment';
2
3
  interface EquipmentItemHeaderProps {
3
- equipmentId: string;
4
- tagNo: string;
5
- plantNo: string;
4
+ equipment: Equipment;
6
5
  }
7
6
  export declare const EquipmentItemHeader: React.FC<EquipmentItemHeaderProps>;
8
7
  export {};
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import { Equipment } from '../../types/equipment';
2
3
  interface EquipmentItemSubHeaderProps {
3
- equipmentId: string;
4
+ equipment: Equipment;
4
5
  tagNo: string;
5
6
  plantNo: string;
6
7
  }
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { Equipment } from '../../types/equipment';
3
+ interface EquipmentItemInfoProps {
4
+ equipment: Equipment;
5
+ tagNo: string;
6
+ }
7
+ export declare const EquipmentItemInfo: React.FC<EquipmentItemInfoProps>;
8
+ export {};
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Equipment } from '../types/equipment';
3
- interface EquipmentItemProps {
3
+ interface EquipmentListItemProps {
4
4
  equipment: Equipment;
5
5
  tagNo: string;
6
6
  plantNo: string;
7
7
  }
8
- export declare const EquipmentInfoItem: React.FC<EquipmentItemProps>;
8
+ export declare const EquipmentListItem: React.FC<EquipmentListItemProps>;
9
9
  export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export interface MeasuringPointsPanelProps {
3
+ equipmentId: string;
4
+ onLoadUpdate?: (args: {
5
+ isLoading: boolean;
6
+ numberOfItemsLoaded?: number;
7
+ }) => void;
8
+ }
9
+ export declare const MeasuringPointsForEquipmentItem: React.FC<MeasuringPointsPanelProps>;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- export interface EquipmentAccordionContentProps {
3
- equipmentId: string;
2
+ import { Equipment } from '../../types/equipment';
3
+ export interface EquipmentTabsProps {
4
+ equipment: Equipment;
4
5
  tagNo: string;
5
- plantNo: string;
6
- showAdditionalInfo?: boolean;
7
6
  }
8
- export declare const EquipmentTabs: React.FC<EquipmentAccordionContentProps>;
7
+ export declare const EquipmentTabs: React.FC<EquipmentTabsProps>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface FullEquipmentItemProps {
3
+ equipmentId: string;
4
+ tagNo: string;
5
+ plantNo: string;
6
+ }
7
+ export declare const FullEquipmentItem: React.FC<FullEquipmentItemProps>;
8
+ export {};
@@ -1,4 +1,4 @@
1
- export { EquipmentTabs } from './equipmentTabs/equipmentTabs';
2
1
  export { EquipmentItemHeader } from './equipmentItemHeader/equipmentItemHeader';
3
- export { EquipmentInfoItem } from './equipmentInfoItem';
4
- export { EquipmentItemDetails } from './equipmentItemDetails/equipmentItemDetails';
2
+ export { EquipmentItemInfo } from './equipmentItemInfo/equipmentItemInfo';
3
+ export { EquipmentListItem } from './equipmentListItem';
4
+ export { EquipmentTabs } from './equipmentTabs/equipmentTabs';
@@ -1,4 +1,9 @@
1
+ import { EquipmentWithMeasuringPoints } from '../types/equipmentWithMeasuringPoints';
2
+ export declare function useEquipmentWithoutMeasuringPoints(equipmentId: string): {
3
+ status: 'error' | 'success' | 'pending';
4
+ equipmentWithMeasuringPoints: EquipmentWithMeasuringPoints[];
5
+ };
1
6
  export declare function useEquipmentWithMeasuringPoints(equipmentId: string): {
2
- status: "error" | "success" | "pending";
3
- equipmentWithMeasuringPoints: import("..").EquipmentWithMeasuringPoints[];
7
+ status: 'error' | 'success' | 'pending';
8
+ equipmentWithMeasuringPoints: EquipmentWithMeasuringPoints[];
4
9
  };
@@ -1,5 +1,4 @@
1
- export { getEquipmentWithMeasuringPointsFromApi } from './api/api-equipmentWithMeasuringPoints';
2
- export { EquipmentInfoItem, EquipmentItemDetails, EquipmentItemHeader, EquipmentTabs } from './components';
1
+ export { EquipmentItemHeader, EquipmentItemInfo, EquipmentListItem, EquipmentTabs } from './components';
3
2
  export { useOpenEquipmentDetails } from './hooks/useOpenEquipmentDetails';
4
3
  export type { Equipment } from './types/equipment';
5
4
  export type { EquipmentWithMeasuringPoints } from './types/equipmentWithMeasuringPoints';
@@ -1,25 +1,33 @@
1
1
  export interface Equipment {
2
- readonly equipmentId: string;
2
+ readonly activeStatusIds: string[];
3
+ readonly area?: string;
4
+ readonly categoryId?: string;
5
+ readonly changedDate?: string;
6
+ readonly coatingSystemByDesign?: string;
7
+ readonly coatingSystemForMaintenance?: string;
8
+ readonly createdDate?: string;
9
+ readonly cuiItem?: string;
10
+ readonly e3DRef?: string;
3
11
  readonly equipmentDescription: string;
4
- readonly maintenancePlantId: string;
12
+ readonly equipmentId: string;
13
+ readonly equipmentsStatus: string[];
5
14
  readonly functionalLocationId: string;
15
+ readonly insulationClass?: string;
16
+ readonly locationId: string;
17
+ readonly maintenancePlantId: string;
6
18
  readonly manufacturer: string;
19
+ readonly materialDescription?: string;
20
+ readonly materialGroup?: string;
7
21
  readonly materialNo: string;
22
+ readonly nominalPipeSize?: string;
8
23
  readonly modelNo: string;
9
24
  readonly partNo: string;
10
25
  readonly serialNo: string;
11
- readonly tagPlantId?: string;
12
- readonly tagId?: string;
13
- readonly locationId: string;
14
- readonly area?: string;
15
- readonly categoryId?: string;
16
- readonly activeStatusIds: string[];
26
+ readonly surfaceItems?: string;
17
27
  readonly systemStatusIds: string[];
28
+ readonly tagId?: string;
29
+ readonly tagPlantId?: string;
18
30
  readonly userStatusIds: string[];
19
- readonly equipmentsStatus: string[];
20
- readonly changedDate?: string;
21
- readonly createdDate?: string;
22
- readonly e3DRef?: string;
23
31
  }
24
32
  export declare enum EquipmentCategoryId {
25
33
  L = "L",
@@ -16,3 +16,13 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
16
16
  type: string;
17
17
  } | undefined): void;
18
18
  }>;
19
+ /**
20
+ * Determine if a given list has any items being loaded.
21
+ * @param {string} listKey Global selection item list identifier
22
+ * @returns {boolean}
23
+ */
24
+ export declare function useIsGlobalSelectionListLoading(listKey: string): boolean;
25
+ /**
26
+ * Get a snapshot of the current global selection store state.
27
+ */
28
+ export declare function getGlobalSelectionStoreState(): GlobalSelectionStore;
@@ -5,21 +5,22 @@ export declare enum GlobalSelectionItemType {
5
5
  Tag = "Tag",
6
6
  Equipment = "Equipment"
7
7
  }
8
- interface ItemTypeToDataMap {
8
+ export interface GlobalSelectionItemTypeToDataMap {
9
9
  WorkOrder: OptimizedWorkOrderDto;
10
10
  Tag: TagSummaryDto;
11
11
  Equipment: Equipment;
12
12
  }
13
- type GlobalSelectionList<T extends GlobalSelectionItemType> = {
13
+ export type GlobalSelectionList<T extends GlobalSelectionItemType> = {
14
14
  label: string;
15
15
  key: string;
16
16
  type: T;
17
17
  items: GlobalSelectionGenericItem<T>[];
18
+ itemsBeingLoaded: string[];
18
19
  };
19
20
  export type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
20
21
  id: string;
21
22
  type: T;
22
- data: ItemTypeToDataMap[T];
23
+ data: GlobalSelectionItemTypeToDataMap[T];
23
24
  metaData: {
24
25
  color: string;
25
26
  isHiddenByUser: boolean;
@@ -32,8 +33,8 @@ export type TagGlobalSelectionListItem = GlobalSelectionGenericItem<GlobalSelect
32
33
  export type GlobalSelectionItem = WorkOrderGlobalSelectionListItem | TagGlobalSelectionListItem | EquipmentGlobalSelectionListItem;
33
34
  type EquipmentGlobalSelectionList = GlobalSelectionList<GlobalSelectionItemType.Equipment>;
34
35
  export type WorkOrderGlobalSelectionList = GlobalSelectionList<GlobalSelectionItemType.WorkOrder>;
35
- type TagGlobalSelectionList = GlobalSelectionList<GlobalSelectionItemType.Tag>;
36
- type GlobalSelectionListUnion = WorkOrderGlobalSelectionList | TagGlobalSelectionList | EquipmentGlobalSelectionList;
36
+ export type TagGlobalSelectionList = GlobalSelectionList<GlobalSelectionItemType.Tag>;
37
+ export type GlobalSelectionListUnion = WorkOrderGlobalSelectionList | TagGlobalSelectionList | EquipmentGlobalSelectionList;
37
38
  export declare enum GlobalSelectionItemErrorStatuses {
38
39
  NotFoundInActiveEchoModule = "NotFoundInActiveEchoModule",
39
40
  UnableToDisplay = "UnableToDisplay"
@@ -43,9 +44,15 @@ export interface GlobalSelectionStore {
43
44
  addWorkOrderToSelection: (args: {
44
45
  workOrder: OptimizedWorkOrderDto;
45
46
  }) => void;
47
+ addTagToSelection: (args: {
48
+ tagId: string;
49
+ }) => void;
46
50
  replaceWorkOrderSelection: (args: {
47
51
  workOrders: OptimizedWorkOrderDto[];
48
52
  }) => void;
53
+ removeItemFromSelection: (args: {
54
+ itemId: string;
55
+ }) => void;
49
56
  setNotFoundItems: (args: {
50
57
  itemIds: string[];
51
58
  }) => void;
@@ -1,14 +1,4 @@
1
1
  /**
2
2
  * Hook for returning all lists stored in the global selection.
3
3
  */
4
- export declare function useGlobalSelectionLists(): (import("..").WorkOrderGlobalSelectionList | {
5
- label: string;
6
- key: string;
7
- type: import("..").GlobalSelectionItemType.Tag;
8
- items: import("..").GlobalSelectionGenericItem<import("..").GlobalSelectionItemType.Tag>[];
9
- } | {
10
- label: string;
11
- key: string;
12
- type: import("..").GlobalSelectionItemType.Equipment;
13
- items: import("..").GlobalSelectionGenericItem<import("..").GlobalSelectionItemType.Equipment>[];
14
- })[];
4
+ export declare function useGlobalSelectionLists(): import("..").GlobalSelectionListUnion[];
@@ -0,0 +1,6 @@
1
+ import { TagGlobalSelectionListItem } from '../globalSelectionStore/globalSelectionStore.types';
2
+ /**
3
+ * Returns with the stored Tags from the global selection store
4
+ * @returns {TagGlobalSelectionListItem[]} Array of Tags with some global selection meta data.
5
+ */
6
+ export declare function useGlobalSelectionTags(): TagGlobalSelectionListItem[];
@@ -1,6 +1,6 @@
1
1
  import { WorkOrderGlobalSelectionListItem } from '../globalSelectionStore/globalSelectionStore.types';
2
2
  /**
3
- * Returns with the stored Work Orders in the global selection
4
- * @returns {Partial<WorkOrderDto>[]} Array of Work Orders
3
+ * Returns with the stored Work Orders from the global selection store
4
+ * @returns {WorkOrderGlobalSelectionListItem[]} Array of Work Orders
5
5
  */
6
6
  export declare function useGlobalSelectionWorkOrders(): WorkOrderGlobalSelectionListItem[];
@@ -1,5 +1,6 @@
1
- export { useGlobalSelectionStore } from './globalSelectionStore/globalSelectionStore';
1
+ export { getGlobalSelectionStoreState, useGlobalSelectionStore } from './globalSelectionStore/globalSelectionStore';
2
2
  export * from './globalSelectionStore/globalSelectionStore.types';
3
3
  export * from './globalSelectionStore/globalSelectionStore.utils';
4
4
  export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
5
+ export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
5
6
  export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
@@ -1,4 +1,4 @@
1
- import { LegendItemStatus } from '../../../legend';
1
+ import { LegendItemStatus } from '../legend';
2
2
  /**
3
3
  * @deprecated Don't use this - the current legend registry service is a heavily outdated solution,
4
4
  * we shouldn't increase the tech dept even further.
@@ -1,7 +0,0 @@
1
- import type { NotificationDetails, WorkOrderDetails } from '../../types';
2
- interface Props {
3
- workOrderDetails?: WorkOrderDetails;
4
- notificationDetails?: NotificationDetails;
5
- }
6
- declare function AdditionalDetails({ workOrderDetails, notificationDetails, }: Props): import("react/jsx-runtime").JSX.Element;
7
- export { AdditionalDetails };
@@ -1,6 +0,0 @@
1
- import { NotificationDetails } from '../../../types';
2
- interface NotificationPanelsProps {
3
- details: NotificationDetails;
4
- }
5
- declare function NotificationPanels({ details }: NotificationPanelsProps): import("react/jsx-runtime").JSX.Element;
6
- export { NotificationPanels };
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { NotificationDetails, WorkOrderDetails } from '../../../types';
3
- interface Props {
4
- workOrderDetails?: WorkOrderDetails;
5
- notificationDetails?: NotificationDetails;
6
- }
7
- declare function TabsPanels({ workOrderDetails, notificationDetails }: Props): import("react/jsx-runtime").JSX.Element | null;
8
- interface TabsListProps {
9
- tabListRef: React.RefObject<HTMLDivElement>;
10
- }
11
- declare function TabsList({ tabListRef }: TabsListProps): import("react/jsx-runtime").JSX.Element | null;
12
- export { TabsList, TabsPanels };
@@ -1,6 +0,0 @@
1
- import { WorkOrderDetails } from '../../../types';
2
- interface WorkOrderPanelsProps {
3
- details: WorkOrderDetails;
4
- }
5
- declare function WorkOrderPanels({ details }: WorkOrderPanelsProps): import("react/jsx-runtime").JSX.Element;
6
- export { WorkOrderPanels };
@@ -1 +0,0 @@
1
- export * from './TabsPanels';
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { Equipment } from '../../types/equipment';
3
- interface EquipmentAccordionContentProps {
4
- equipment: Equipment;
5
- tagNo: string;
6
- plantNo: string;
7
- showAdditionalInfo?: boolean;
8
- }
9
- export declare const EquipmentItemDetails: React.FC<EquipmentAccordionContentProps>;
10
- export {};