@equinor/echo-framework 0.15.4-beta-0 → 0.15.4

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/{f4c85313e79b1662.svg → 1bd97dd2170d0f64.svg} +850 -850
  2. package/{063009f06499d102.svg → 47deeba42768c5d1.svg} +8 -8
  3. package/README.md +28 -26
  4. package/index.cjs.d.ts +2 -2
  5. package/index.cjs.js +1 -1
  6. package/package.json +4 -4
  7. package/src/index.d.ts +14 -1
  8. package/src/lib/components/prepview/Prepview.d.ts +2 -1
  9. package/src/lib/components/prepview/api/api.d.ts +1 -1
  10. package/src/lib/components/prepview/api/resources.d.ts +1 -1
  11. package/src/lib/components/prepview/common/access/request/RequestAccess.d.ts +2 -2
  12. package/src/lib/components/prepview/common/additionalInformation/AdditionalDetails.d.ts +1 -1
  13. package/src/lib/components/prepview/common/additionalInformation/tabsPanels/TabsPanels.d.ts +1 -1
  14. package/src/lib/components/prepview/context/PrepviewContext.d.ts +1 -0
  15. package/src/lib/components/prepview/panels/operations/Operations.d.ts +2 -1
  16. package/src/lib/components/prepview/types/workorder.d.ts +1 -0
  17. package/src/lib/components/requestAccess/RequestAccessButton.d.ts +9 -0
  18. package/src/lib/components/requestAccess/RequestSapAccess.d.ts +7 -0
  19. package/src/lib/hooks/index.d.ts +1 -0
  20. package/src/lib/hooks/useOpenPdfFile.d.ts +12 -0
  21. package/src/lib/services/searchItemDetails/previous.d.ts +7 -0
  22. package/src/lib/services/searchItemDetails/searchItemDetails.store.d.ts +2 -0
  23. package/src/lib/services/searchItemDetails/searchItemDetailsContainer.d.ts +2 -1
  24. package/src/lib/services/searchItemDetails/searchItemDetailsSideSheet.d.ts +7 -0
  25. package/src/lib/types/eventTypes/index.d.ts +1 -0
  26. package/src/lib/types/eventTypes/leftPanelNavigationUpdateEvent.d.ts +5 -0
  27. package/src/lib/utils/index.d.ts +2 -0
  28. package/src/lib/utils/previousUtils.d.ts +21 -0
  29. package/src/lib/utils/stringUtils.d.ts +1 -0
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.15.4-beta-0",
3
+ "version": "0.15.4",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": "0.7.0-beta-0",
5
+ "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
6
6
  "@equinor/echo-components": ">= 0.8.0 < 0.9.0",
7
- "@equinor/echo-core": "0.9.0-beta-2",
8
- "@equinor/echo-search": "0.15.0-beta-3",
7
+ "@equinor/echo-core": ">= 0.9.0 < 0.10.0",
8
+ "@equinor/echo-search": ">= 0.15.0 < 0.16.0",
9
9
  "@equinor/echo-utils": ">= 0.3.0 < 0.4.0",
10
10
  "@equinor/eds-core-react": "^0.25.0",
11
11
  "@equinor/eds-icons": "^0.17.0",
package/src/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { getPlantsInfo, getTagDetails } from './lib/services/api';
4
4
  import './lib/theme/theme.css';
5
5
  import { getLegendStatusColor } from './lib/utils/legendUtils';
6
6
  export * from './lib/components';
7
+ export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
7
8
  export * from './lib/coreApplication';
8
9
  export { RegisteredHookName } from './lib/hooks/hookLibrary';
9
10
  export { useIsCompactLayout } from './lib/hooks/useIsCompactLayout';
@@ -15,7 +16,7 @@ export { DetailedDeviceInformationProvider, detailedDeviceInformationProvider }
15
16
  export { DeviceInformation, deviceInfo } from './lib/services/deviceInformation/deviceInfo';
16
17
  export * from './lib/services/eventHubActions';
17
18
  export * from './lib/services/searchItemDetails/searchItemDetails.store';
18
- export { SearchItemDetailsContainer } from './lib/services/searchItemDetails/searchItemDetailsContainer';
19
+ export { SearchItemDetailsSideSheet } from './lib/services/searchItemDetails/searchItemDetailsSideSheet';
19
20
  export * from './lib/theme/themeConst';
20
21
  export * from './lib/types/api-echohub';
21
22
  export type { EchoHubPlant } from './lib/types/echoHubPlant';
@@ -60,6 +61,18 @@ declare const EchoFramework: Readonly<{
60
61
  } | undefined, state?: any) => void;
61
62
  useHas3dAccess(plantCode?: string | undefined): boolean;
62
63
  useIsFullScreenModeEnabled(): boolean;
64
+ useOpenPdfFile(): (args: {
65
+ instCode: string;
66
+ docNo: string;
67
+ fileId: string | number;
68
+ revNo: string;
69
+ tagNo?: string | undefined;
70
+ }) => void;
71
+ useOpenPdfFileUrl(): (args: {
72
+ instCode: string;
73
+ fileUrl: string;
74
+ tagNo?: string | undefined;
75
+ }) => void;
63
76
  usePlantAvailableIn3d(plantCode?: string | undefined): boolean;
64
77
  usePlantAvailableIn3dWeb(plantCode?: string | undefined): boolean;
65
78
  useScreenOrientation(): import("./lib/types/hookLibrary").ScreenOrientation;
@@ -2,9 +2,10 @@ import React from 'react';
2
2
  import { SideSheetOrientation } from '@equinor/echo-components';
3
3
  import { PrepviewEvents } from './context/PrepviewContext';
4
4
  interface PrepviewProps {
5
- instCode: string;
6
5
  orientation: SideSheetOrientation;
6
+ instCode?: string;
7
7
  workOrderId?: string;
8
+ workOrderOperationId?: string;
8
9
  notificationId?: string;
9
10
  punchId?: string;
10
11
  closePanel: () => void;
@@ -1,7 +1,7 @@
1
1
  import { PrepviewNotificationDto, PrepviewWorkOrderDto, PunchDetails } from '../types';
2
2
  import * as workOrderApi from './attachment';
3
3
  export { workOrderApi };
4
- export declare function getWorkOrder(instCode: string, workOrderId: string): Promise<PrepviewWorkOrderDto>;
4
+ export declare function getWorkOrder(workOrderId: string): Promise<PrepviewWorkOrderDto>;
5
5
  export declare function getNotification(instCode: string, notificationId: string): Promise<PrepviewNotificationDto>;
6
6
  export declare function getPunch(instCode: string, punchId: string): Promise<PunchDetails>;
7
7
  export declare function getWorkType(instCode: string, workOrderId: string): Promise<string[]>;
@@ -1,4 +1,4 @@
1
- export declare function getWorkOrder(instCode: string, workOrderId: string): string;
1
+ export declare function getWorkOrder(workOrderId: string): string;
2
2
  export declare function getNotification(instCode: string, notificationId: string): string;
3
3
  export declare function getPunch(instCode: string, punchId: string): string;
4
4
  export declare function getWorkTypeUrl(instCode: string, workOrderId: string): string;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  type RequestAccessProps = {
3
3
  padding?: boolean;
4
4
  };
5
- declare const RequestAccess: React.FC<RequestAccessProps>;
6
- export { RequestAccess };
5
+ export declare const RequestAccess: React.FC<RequestAccessProps>;
6
+ export {};
@@ -5,5 +5,5 @@ interface Props {
5
5
  additionalDetails: AdditionalDetailsDto;
6
6
  closePanel: () => void;
7
7
  }
8
- declare function AdditionalDetails({ workOrderDetails, notificationDetails, additionalDetails, closePanel }: Props): import("react/jsx-runtime").JSX.Element;
8
+ declare function AdditionalDetails({ workOrderDetails, notificationDetails, additionalDetails, closePanel, }: Props): import("react/jsx-runtime").JSX.Element;
9
9
  export { AdditionalDetails };
@@ -6,7 +6,7 @@ interface Props {
6
6
  additionalDetails: AdditionalDetailsDto;
7
7
  closePanel: () => void;
8
8
  }
9
- declare function TabsPanels({ workOrderDetails, notificationDetails, additionalDetails, closePanel }: Props): import("react/jsx-runtime").JSX.Element | null;
9
+ declare function TabsPanels({ workOrderDetails, notificationDetails, additionalDetails, closePanel, }: Props): import("react/jsx-runtime").JSX.Element | null;
10
10
  interface TabsListProps {
11
11
  tabListRef: React.RefObject<HTMLDivElement>;
12
12
  }
@@ -8,6 +8,7 @@ interface PrepviewContext {
8
8
  instCode: string;
9
9
  orientation: SideSheetOrientation;
10
10
  isWorkOrder: boolean;
11
+ workOrderOperationId?: string;
11
12
  events: PrepviewEvents;
12
13
  }
13
14
  export declare const PrepviewContext: React.Context<PrepviewContext>;
@@ -1,6 +1,7 @@
1
1
  import { PrepviewOperation } from '../../types';
2
2
  interface Props {
3
3
  operations: PrepviewOperation[];
4
+ workOrderId: string;
4
5
  }
5
- declare function OperationsPanel({ operations }: Props): import("react/jsx-runtime").JSX.Element;
6
+ declare function OperationsPanel({ operations, workOrderId }: Props): import("react/jsx-runtime").JSX.Element;
6
7
  export { OperationsPanel };
@@ -38,6 +38,7 @@ export type WorkOrderDetails = FetchStatus & {
38
38
  system: string;
39
39
  priority: string;
40
40
  priorityId: string;
41
+ instCode: string;
41
42
  plantId: string;
42
43
  };
43
44
  export type WorkOrderAdditionalDetails = {
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ applyForAccessUrl: string;
4
+ buttonLabel?: string;
5
+ className?: string;
6
+ onClicked?: () => void;
7
+ }
8
+ export declare const RequestAccessButton: React.FC<React.PropsWithChildren<Props>>;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type RequestSapAccessProps = {
3
+ padding?: boolean;
4
+ onClicked?: () => void;
5
+ };
6
+ export declare const RequestSapAccess: React.FC<RequestSapAccessProps>;
7
+ export {};
@@ -1,6 +1,7 @@
1
1
  export * from './useEchoHistory';
2
2
  export * from './useHas3dAccess';
3
3
  export * from './useIsFullScreenModeEnabled';
4
+ export * from './useOpenPdfFile';
4
5
  export * from './usePlantAvailableIn3d';
5
6
  export * from './usePlantAvailableIn3dWeb';
6
7
  export * from './useScreenOrientation';
@@ -0,0 +1,12 @@
1
+ export declare function useOpenPdfFile(): (args: {
2
+ instCode: string;
3
+ docNo: string;
4
+ fileId: string | number;
5
+ revNo: string;
6
+ tagNo?: string;
7
+ }) => void;
8
+ export declare function useOpenPdfFileUrl(): (args: {
9
+ instCode: string;
10
+ fileUrl: string;
11
+ tagNo?: string;
12
+ }) => void;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface PreviousProps {
3
+ title: string;
4
+ onClick: () => void;
5
+ }
6
+ export declare const Previous: React.FC<PreviousProps>;
7
+ export {};
@@ -6,6 +6,7 @@ export type SearchItemDetailsObject = {
6
6
  content: ReactNode;
7
7
  header?: ReactNode;
8
8
  subHeader?: ReactNode;
9
+ itemId: string;
9
10
  isOpen: boolean;
10
11
  };
11
12
  export type SearchItemDetailsState = {
@@ -22,5 +23,6 @@ type ShowDetailsArgs = {
22
23
  header?: ReactNode;
23
24
  subHeader?: ReactNode;
24
25
  keepLastNavigationItem?: boolean;
26
+ itemId: string;
25
27
  };
26
28
  export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import { SearchItemDetailsObject } from './searchItemDetails.store';
2
3
  interface SearchItemDetailsContainerProps {
3
- onSearchDetailsClose?: (panelKey: string) => void;
4
+ itemToDisplay: SearchItemDetailsObject;
4
5
  }
5
6
  export declare const SearchItemDetailsContainer: React.FC<SearchItemDetailsContainerProps>;
6
7
  export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { SearchItemDetailsObject } from './searchItemDetails.store';
3
+ interface SearchItemDetailsSideSheetProps {
4
+ itemToDisplay: SearchItemDetailsObject | undefined;
5
+ }
6
+ export declare const SearchItemDetailsSideSheet: React.FC<SearchItemDetailsSideSheetProps>;
7
+ export {};
@@ -1,4 +1,5 @@
1
1
  export type { FullScreenModeEvent } from './fullScreenModeEvent';
2
+ export type { LeftPanelNavigationUpdateEvent } from './leftPanelNavigationUpdateEvent';
2
3
  export type { LegendChangedEvent } from './legendEvent';
3
4
  export type { PlantEvent } from './plantEvent';
4
5
  export type { SearchItemDetailsClosedEvent } from './searchDetailsContainerEvents';
@@ -0,0 +1,5 @@
1
+ export interface LeftPanelNavigationUpdateEvent {
2
+ previousTitle?: string;
3
+ onClick?: () => void;
4
+ resetNavigation?: boolean;
5
+ }
@@ -1,3 +1,5 @@
1
1
  export * from './navigationUtils';
2
2
  export * from './plantInfo';
3
+ export * from './previousUtils';
3
4
  export * from './searchUtil';
5
+ export * from './stringUtils';
@@ -0,0 +1,21 @@
1
+ import { Panel } from '@equinor/echo-core';
2
+ import { SearchItemDetailsObject } from '../services/searchItemDetails/searchItemDetails.store';
3
+ /**
4
+ * Get the previous search item id or the previous active panel label
5
+ *
6
+ * @export
7
+ * @param {Record<string, SearchItemDetailsObject[]>} openedSearchItemsByPanel Opened search items by panel
8
+ * @param {Panel[]} modulePanels Module panels
9
+ * @param {string} activePanelKey The active panel key
10
+ * @return {*} {string} Returns the previous search item id or active panel label
11
+ */
12
+ export declare function getPreviousItemIdOrPanelTitle(openedSearchItemsByPanel: Record<string, SearchItemDetailsObject[]>, modulePanels: Panel[], activePanelKey: string): string;
13
+ /**
14
+ * Get the active panel label
15
+ *
16
+ * @export
17
+ * @param {Panel[]} modulePanels Module panels
18
+ * @param {string} activePanelKey The active panel key
19
+ * @return {*} {string} Returns the active panel label
20
+ */
21
+ export declare function getPanelTitle(modulePanels: Panel[], activePanelKey: string): string;
@@ -0,0 +1 @@
1
+ export declare function removeLeadingZeros(inputString: string): string;