@equinor/echo-framework 0.8.5 → 0.8.8

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 (96) hide show
  1. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.d.ts +47 -0
  2. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.test.d.ts +1 -0
  3. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.d.ts +14 -0
  4. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.d.ts +3 -1
  5. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.d.ts +1 -2
  6. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.d.ts +3 -0
  7. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.d.ts +4 -0
  8. package/dist/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.d.ts +2 -0
  9. package/dist/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.d.ts +18 -0
  10. package/dist/components/contextualAppLinks/externalLinkButtons/index.d.ts +1 -0
  11. package/dist/components/externalLinkButton/externalLinkButton.d.ts +16 -7
  12. package/dist/components/panel/corePanelLeft.d.ts +1 -4
  13. package/dist/components/panel/corePanelRight.d.ts +1 -4
  14. package/dist/components/realTimeData/hooks/useSignalR.d.ts +3 -2
  15. package/dist/coreApplication/EchoContent.d.ts +0 -1
  16. package/dist/coreApplication/index.d.ts +0 -1
  17. package/dist/hooks/hookLibrary.d.ts +2 -8
  18. package/dist/hooks/index.d.ts +0 -1
  19. package/dist/hooks/useSemi.d.ts +11 -7
  20. package/dist/hooks/useTagDetails.d.ts +10 -3
  21. package/dist/index.d.ts +12 -7
  22. package/dist/services/api/api-manager.d.ts +1 -1
  23. package/dist/services/api/api-tag-details.d.ts +18 -0
  24. package/dist/services/api/api-tag-details.test.d.ts +1 -0
  25. package/dist/services/api/api-tags.d.ts +17 -0
  26. package/dist/services/api/api-tags.test.d.ts +1 -0
  27. package/dist/services/api/index.d.ts +1 -0
  28. package/dist/services/echopediaAnalyticsModule/echopediaAnalyticsModule.d.ts +1 -0
  29. package/dist/src/components/containers/layout.module.css.js +1 -4
  30. package/dist/src/components/containers/layouts.js +10 -127
  31. package/dist/src/components/contextualAppLinks/externalAppsMenu.js +4 -4
  32. package/dist/src/components/contextualAppLinks/externalLinkButtons/allExternalLinks.js +66 -11
  33. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.js +169 -0
  34. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.js +93 -0
  35. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.js +60 -5
  36. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.js +43 -11
  37. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSafeX.js +1 -1
  38. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.js +58 -11
  39. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.js +16 -5
  40. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToStid.js +1 -1
  41. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +67 -16
  42. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.js +44 -0
  43. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.module.css.js +15 -0
  44. package/dist/src/components/externalLinkButton/externalLinkButton.js +95 -34
  45. package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +5 -2
  46. package/dist/src/components/footer/footer.module.css.js +1 -1
  47. package/dist/src/components/panel/corePanelLeft.js +2 -5
  48. package/dist/src/components/panel/corePanelLeft.module.css.js +1 -1
  49. package/dist/src/components/panel/corePanelRight.js +2 -5
  50. package/dist/src/components/panel/corePanelRight.module.css.js +1 -1
  51. package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +3 -2
  52. package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +32 -7
  53. package/dist/src/components/realTimeData/hooks/useSignalR.js +4 -2
  54. package/dist/src/coreApplication/EchoContent.js +2 -11
  55. package/dist/src/globalStyles.css.js +1 -1
  56. package/dist/src/hooks/hookLibrary.js +0 -9
  57. package/dist/src/hooks/index.js +0 -3
  58. package/dist/src/hooks/useSemi.js +40 -14
  59. package/dist/src/hooks/useTagDetails.js +116 -45
  60. package/dist/src/icons/common/CommissionApp-icon.png.js +7 -0
  61. package/dist/src/icons/common/Evision.svg.js +3 -2
  62. package/dist/src/icons/common/Fusion.svg.js +30 -25
  63. package/dist/src/icons/common/McApp.svg.js +10 -6
  64. package/dist/src/icons/common/Notification.svg.js +82 -0
  65. package/dist/src/icons/common/ProCoSysIcon.svg.js +3 -2
  66. package/dist/src/icons/common/Robim.svg.js +67 -0
  67. package/dist/src/icons/common/SapLogo.svg.js +5 -4
  68. package/dist/src/icons/common/SemiIcon.svg.js +11 -11
  69. package/dist/src/icons/common/Stid.svg.js +3 -2
  70. package/dist/src/icons/common/TR2000.svg.js +8 -6
  71. package/dist/src/icons/common/WorkOrder.svg.js +72 -0
  72. package/dist/src/icons/common/Yammer.svg.js +2 -1
  73. package/dist/src/icons/common/satos-logo.png.js +7 -0
  74. package/dist/src/index.js +15 -7
  75. package/dist/src/services/api/api-manager.js +2 -2
  76. package/dist/src/services/api/api-realtimedata.js +3 -1
  77. package/dist/src/services/api/api-tag-details.js +66 -0
  78. package/dist/src/services/api/api-tags.js +29 -0
  79. package/dist/src/services/echopediaAnalyticsModule/echopediaAnalyticsModule.js +10 -0
  80. package/dist/src/types/pingableSources.js +1 -0
  81. package/dist/src/utils/navigationUtils.js +28 -0
  82. package/dist/src/utils/plantInfo.js +1 -0
  83. package/dist/types/api-proCoSysTagResponse.d.ts +8 -0
  84. package/dist/types/hookLibrary.d.ts +0 -4
  85. package/dist/types/pingableSources.d.ts +2 -1
  86. package/dist/utils/index.d.ts +1 -0
  87. package/dist/utils/navigationUtils.d.ts +7 -0
  88. package/dist/utils/navigationUtils.test.d.ts +1 -0
  89. package/dist/utils/plantInfo.d.ts +6 -0
  90. package/dist/utils/plantInfo.test.d.ts +1 -0
  91. package/package.json +3 -3
  92. package/dist/coreApplication/EchoBarComponent.d.ts +0 -6
  93. package/dist/hooks/useScreenOrientation.d.ts +0 -1
  94. package/dist/src/coreApplication/EchoBarComponent.js +0 -190
  95. package/dist/src/coreApplication/EchoContent.module.css.js +0 -21
  96. package/dist/src/hooks/useScreenOrientation.js +0 -50
@@ -0,0 +1,47 @@
1
+ import { TagDetailsDto } from '@equinor/echo-search';
2
+ import { ProCoSysApiTag } from '../../../types/api-proCoSysTagResponse';
3
+ declare type GetTagDetailsAndProCoSysDataResult = {
4
+ tagDetails: TagDetailsDto | undefined;
5
+ proCoSysTag: ProCoSysApiTag | undefined;
6
+ hasError: boolean;
7
+ };
8
+ /**
9
+ * Specific tool for external link buttons to help build URLS for deep linking into ProCoSys web app.
10
+ * Fetches both tag details and tag information from ProCoSys.
11
+ *
12
+ * @param {Object} params
13
+ * @param {string} params.tagNo The tag number to query.
14
+ * @param {string} params.instCode Plant installation code for the given tag.
15
+ * @returns {GetTagDetailsAndProCoSysDataResult} response - The returned promise will resolve once both API calls are resolved. (with Promise.all)
16
+ * @returns {TagDetailsDto} response.tagDetails - Result of tag details API call.
17
+ * @returns {ProCoSysApiTag} response.proCoSysTag - Tag related information from the ProCoSys system.
18
+ * @returns {hasError} response.hasError - indicates if there were any errors during the API calls. The exception is handled under the hood.
19
+ */
20
+ export declare function getTagDetailsAndProCoSysData({ tagNo, instCode }: {
21
+ tagNo: any;
22
+ instCode: any;
23
+ }): Promise<GetTagDetailsAndProCoSysDataResult>;
24
+ declare type getTagDetailsWithErrorHandlingResponse = {
25
+ tagDetails: TagDetailsDto | undefined;
26
+ hasError: boolean;
27
+ };
28
+ /**
29
+ * Wraps the 'getTagDetails' function. Handles and logs any Error thrown by it whi;e displaying an error message toast.
30
+ * Use 'getTagDetails' if you want complete freedom on how you handle any exceptions.
31
+ *
32
+ * If there were any errors during the API call, the returned value will have a 'hasError' flag set to 'true'.
33
+ *
34
+ * @param {Object} params
35
+ * @param {string} params.tagNo The tag number to query.
36
+ * @param {string} params.instCode Plant installation code for the given tag.
37
+ * @param {AbortSignal} params.abortSignal A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
38
+ * @returns {getTagDetailsWithErrorHandlingResponse} response
39
+ * @returns {TagDetailsDto} response.tagDetails - Result of tag details API call.
40
+ * @returns {hasError} response.hasError - indicates if there were any errors during the API call.
41
+ */
42
+ export declare function getTagDetailsWithErrorHandling({ tagNo, instCode, abortSignal }: {
43
+ tagNo: string;
44
+ instCode?: string;
45
+ abortSignal?: AbortSignal;
46
+ }): Promise<getTagDetailsWithErrorHandlingResponse>;
47
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ declare type ExternalLinkToCommAppProps = {
3
+ tagNo: string;
4
+ instCode: string;
5
+ };
6
+ /**
7
+ * External link button to Commissioning web app.
8
+ *
9
+ * @param {string} tagNo The tag's number to open in the Comm app.
10
+ * @param {string} instCode Plant installation code.
11
+ * @returns {React.FC<ExternalLinkToMcAppProps>} React component.
12
+ */
13
+ export declare const ExternalLinkToCommApp: React.FC<ExternalLinkToCommAppProps>;
14
+ export {};
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  declare type ExternalLinkToMcAppProps = {
3
3
  tagNo: string;
4
+ instCode: string;
4
5
  };
5
6
  /**
6
- * External link button to McApp.
7
+ * External link button to Mechanical Completion web app.
7
8
  *
8
9
  * @param {string} tagNo The tag's number to open in McApp.
10
+ * @param {string} instCode Plant installation code.
9
11
  * @returns {React.FC<ExternalLinkToMcAppProps>} React component.
10
12
  */
11
13
  export declare const ExternalLinkToMcApp: React.FC<ExternalLinkToMcAppProps>;
@@ -5,10 +5,9 @@ declare type ExternalLinkToProCoSysProps = {
5
5
  };
6
6
  /**
7
7
  * External link button to ProCoSys.
8
- * Will only render if the passed tagNo has any tag details in the actually selected plant.
9
8
  *
10
9
  * @param {string} tagNo The tag's number to open in ProCoSys.
11
- * @param {string} instCode Plant installation code.
10
+ * @param {TagDetailsDto} tagDetails The given tags detailed information.
12
11
  * @returns {React.FC<ExternalLinkToProCoSysProps>} React component.
13
12
  */
14
13
  export declare const ExternalLinkToProCoSys: React.FC<ExternalLinkToProCoSysProps>;
@@ -2,13 +2,16 @@ import React from 'react';
2
2
  declare type ExternalLinkToSapProps = {
3
3
  tagNo: string;
4
4
  instCode: string;
5
+ loadingStatusCallback?: (isLoading: boolean) => void;
5
6
  };
6
7
  /**
7
8
  * External link button to SAP.
8
9
  * Will only render if the passed tagNo has any tag details in the actually selected plant and SAP is available.
10
+ * It pings SAP to determine whether is available or not.
9
11
  *
10
12
  * @param {string} tagNo The tag's number to open in SAP.
11
13
  * @param {string} instCode Plant installation code.
14
+ * @param {(isLoading: boolean) => void} loadingStatusCallback Callback which provides an 'isLoading' param reflecting the actual loading state of the ping to SAP.
12
15
  * @returns {React.FC<ExternalLinkToSapProps>} React component.
13
16
  */
14
17
  export declare const ExternalLinkToSap: React.FC<ExternalLinkToSapProps>;
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  declare type ExternalLinkToSemiDocProps = {
3
3
  tagNo: string;
4
+ instCode: string;
5
+ loadingStatusCallback?: (isLoading: boolean) => void;
4
6
  };
5
7
  /**
6
8
  * External link button to SemiDoc.
7
9
  * Will only render if Semi is available for the passed tagNo.
8
10
  *
9
11
  * @param {string} tagNo The tag's number to open in Semi.
12
+ * @param {string} instCode Plant installation code.
13
+ * @param {(isLoading: boolean) => void} loadingStatusCallback Callback which provides an 'isLoading' param reflecting the actual API call state for checking Semi availability.
10
14
  * @returns {React.FC<ExternalLinkToSemiDocProps>} React component.
11
15
  */
12
16
  export declare const ExternalLinkToSemiDoc: React.FC<ExternalLinkToSemiDocProps>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  declare type ExternalLinkToTr2000Props = {
3
3
  tagNo: string;
4
4
  instCode: string;
5
+ loadingStatusCallback?: (isLoading: boolean) => void;
5
6
  };
6
7
  /**
7
8
  * External link button to TR2000.
@@ -9,6 +10,7 @@ declare type ExternalLinkToTr2000Props = {
9
10
  *
10
11
  * @param {string} tagNo The tag's number to open in TR2000.
11
12
  * @param {string} instCode Plant installation code.
13
+ * @param {(isLoading: boolean) => void} loadingStatusCallback Callback which provides an 'isLoading' param reflecting the actual API call state for checking TR2000 availability.
12
14
  * @returns {React.FC<ExternalLinkToTr2000Props>} React component.
13
15
  */
14
16
  export declare const ExternalLinkToTr2000: React.FC<ExternalLinkToTr2000Props>;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ declare type SpinnerProps = {
3
+ size?: 16 | 24 | 32 | 40 | 48;
4
+ customClassNames?: {
5
+ spinner?: string;
6
+ container?: string;
7
+ };
8
+ };
9
+ /**
10
+ * Local component for external link buttons. Provides a spinner overlay for any icon buttons, which might have any async calls.
11
+ * @param {Object} param
12
+ * @param {number} param.size The size of the spinner. Default value is 24.
13
+ * @param {Object} param.customClassNames Optional custom class names to customize the component's parts.
14
+ * @param {string} param.customClassNames.spinner Class name applied on the spinner.
15
+ * @param {string} param.customClassNames.container Class name applied on the container element.
16
+ */
17
+ export declare const IconButtonSpinner: ({ customClassNames, size }: SpinnerProps) => JSX.Element;
18
+ export {};
@@ -1,3 +1,4 @@
1
+ export * from './externalLinkToCommApp';
1
2
  export * from './externalLinkToMcApp';
2
3
  export * from './externalLinkToProCoSys';
3
4
  export * from './externalLinkToSafeX';
@@ -1,18 +1,26 @@
1
1
  import React from 'react';
2
- interface ExternalLinkButtonProps {
2
+ declare type ExternalLinkButtonProps = AsyncButtonProps | SyncButtonProps;
3
+ declare type AsyncButtonProps = BaseProps & {
4
+ linkTo?: never;
5
+ getUrlToOpen: (...args: any[]) => Promise<string | undefined>;
6
+ };
7
+ declare type SyncButtonProps = BaseProps & {
8
+ linkTo: string;
9
+ getUrlToOpen?: never;
10
+ };
11
+ declare type BaseProps = {
3
12
  buttonName: string;
4
13
  buttonIcon: string;
5
- linkTo: string;
6
14
  hideText?: boolean;
7
15
  redirect?: boolean;
8
16
  buttonStyle?: ExternalLinkButtonStyle;
9
- getUrlToOpen?: () => Promise<string>;
10
17
  disabledColor?: boolean;
11
18
  disabledButton?: boolean;
12
19
  hoverText?: string;
13
- }
20
+ };
14
21
  export declare enum ExternalLinkButtonStyle {
15
- Rounded = "Rounded"
22
+ Rounded = "Rounded",
23
+ Large = "Large"
16
24
  }
17
25
  /**
18
26
  *
@@ -23,11 +31,12 @@ export declare enum ExternalLinkButtonStyle {
23
31
  * @param {boolean} props.hideText Optional. If set to `true`, will hide `buttonName`.
24
32
  * @param {boolean} props.redirect Optional. If set to `true`, the app will not open in a new tab / window, but in the current one.
25
33
  * @param {ExternalLinkButtonStyle} props.buttonStyle Optional.
26
- * @param {() => Promise<string>} props.getUrlToOpen Optional. Function () => Promise<string>. Custom async function to be called to handle the navigation.
34
+ * @param {(...args) => Promise<string | undefined>} props.getUrlToOpen Optional. Pass this custom async function to create a URL based on async data.
35
+ * Return with 'undefined' to prevent any navigation. (Useful when the API call fails)
27
36
  * @param {boolean} props.disabledColor Optional. If set to `true`, the button will show disabled color. (If not Rounded button style is used)
28
37
  * @param {boolean} props.disabledButton Optional.
29
38
  * @param {string} props.hoverText Optional. Applies only if Rounded button style is applied.
30
39
  * @returns {React.FC<ExternalLinkButtonProps>} React component.
31
40
  */
32
- declare const ExternalLinkButton: React.FC<ExternalLinkButtonProps>;
41
+ export declare const ExternalLinkButton: React.FC<ExternalLinkButtonProps>;
33
42
  export default ExternalLinkButton;
@@ -1,6 +1,3 @@
1
1
  import React from 'react';
2
- interface CorePanelLeftProps {
3
- isToggleButtonVisible?: boolean;
4
- }
5
- declare const CorePanelLeft: React.FC<CorePanelLeftProps>;
2
+ declare const CorePanelLeft: React.FC;
6
3
  export default CorePanelLeft;
@@ -1,6 +1,3 @@
1
1
  import React from 'react';
2
- interface CorePanelRightProps {
3
- isToggleButtonVisible?: boolean;
4
- }
5
- declare const _default: React.NamedExoticComponent<CorePanelRightProps>;
2
+ declare const _default: React.NamedExoticComponent<{}>;
6
3
  export default _default;
@@ -1,8 +1,9 @@
1
1
  import { HubConnection } from '@microsoft/signalr';
2
2
  export interface SignalRState {
3
- connection?: HubConnection;
4
- status: string;
5
3
  loading: boolean;
4
+ status: 'ok' | 'error';
5
+ connection?: HubConnection;
6
+ statusCode?: number;
6
7
  message?: string;
7
8
  }
8
9
  declare function useSignalR(hubUrl: string): SignalRState;
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  interface CorePanelsProps {
3
3
  children: React.ReactNode;
4
4
  Legend?: React.FC;
5
- isToggleButtonVisible?: boolean;
6
5
  }
7
6
  export declare const EchoContent: React.FC<CorePanelsProps>;
8
7
  export {};
@@ -1,4 +1,3 @@
1
- export * from './EchoBarComponent';
2
1
  export * from './EchoContent';
3
2
  export * from './EchoContentPanels';
4
3
  export * from './EchoEventHandler';
@@ -1,13 +1,12 @@
1
1
  import { DataInformation } from '@equinor/echo-components';
2
- import { DeviceOrientation, SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './../types/hookLibrary';
2
+ import { SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './../types/hookLibrary';
3
3
  export declare enum RegisteredHookName {
4
4
  useSetActiveTagNo = "useSetActiveTagNo",
5
5
  useContextMenuDataInfo = "useContextMenuDataInfo",
6
6
  useTagData = "useTagData",
7
7
  useIsContextMenuInfoLoading = "useIsContextMenuInfoLoading",
8
8
  useSetActiveCommPackNo = "useSetActiveCommPackNo",
9
- useSetActiveMcPackNo = "useSetActiveMcPackNo",
10
- useDeviceOrientation = "useDeviceOrientation"
9
+ useSetActiveMcPackNo = "useSetActiveMcPackNo"
11
10
  }
12
11
  export declare const HookLibrary: Readonly<{
13
12
  /**
@@ -47,9 +46,4 @@ export declare const HookLibrary: Readonly<{
47
46
  * @returns {SetActiveMcPackNo}
48
47
  */
49
48
  useSetActiveMcPackNo: () => SetActiveMcPackNo;
50
- /**
51
- * Hook for detecting device orientation from native devices.
52
- * @returns {DeviceOrientation}
53
- */
54
- useDeviceOrientation: () => DeviceOrientation;
55
49
  }>;
@@ -1,3 +1,2 @@
1
1
  export * from './useEchoHistory';
2
- export * from './useScreenOrientation';
3
2
  export * from './useTagDetails';
@@ -1,17 +1,21 @@
1
- declare type Semi = {
2
- isSemiDocumentAvailable: boolean;
3
- semiDocumentId: string;
4
- };
5
1
  /**
6
2
  * Provides information about Semi document for a given tag.
7
3
  *
8
- * @param {{ tagNo: string }} params
9
- * @param {string} params.tagNo Tag number in question.
4
+ * @param {{ tagNo: string; instCode: string }} params
5
+ * @param {string} params.tagNo The given tag's number.
6
+ * @param {string} params.instCode Plant's inst code.
10
7
  * @returns {Semi} object
11
8
  * @returns {boolean} object.isSemiDocumentAvailable - Will be set to true if the tag has Semi document.
12
9
  * @returns {string} object.semiDocumentId - If there's a document for the given tag, this will be set.
10
+ * @returns {boolean} object.isSemiLoading - Indicates if Semi is performing an API call (to get tag details)
13
11
  */
14
- export declare function useSemi({ tagNo }: {
12
+ export declare function useSemi({ tagNo, instCode }: {
15
13
  tagNo: string;
14
+ instCode: string;
16
15
  }): Semi;
16
+ declare type Semi = {
17
+ isSemiDocumentAvailable: boolean;
18
+ semiDocumentId: string;
19
+ isSemiLoading: boolean;
20
+ };
17
21
  export {};
@@ -5,9 +5,16 @@ import { TagDetailsDto } from '@equinor/echo-search';
5
5
  * @param {{ tagNo: string; instCode: string }} params
6
6
  * @param {string} params.tagNo The given tag's number.
7
7
  * @param {string} params.instCode Plant's inst code.
8
- * @returns {TagDetailsDto | undefined} TagDetailsDto or undefined
8
+ * @returns {Object} response
9
+ * @returns {TagDetailsDto | undefined} response.tagDetails
10
+ * @returns {boolean} response.isLoading Whether tag details API call is loading or not.
11
+ * @returns {boolean} response.hasError If the API call had any issues, this will be set to 'true'
9
12
  */
10
- export declare function useTagDetails({ tagNo, instCode }: {
13
+ export declare function useTagDetails({ instCode, tagNo }: {
11
14
  tagNo: string;
12
15
  instCode: string;
13
- }): TagDetailsDto | undefined;
16
+ }): {
17
+ tagDetails: TagDetailsDto | undefined;
18
+ isTagDetailsLoading: boolean;
19
+ hasError: boolean;
20
+ };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,18 @@
1
1
  /// <reference types="react" />
2
2
  import './globalStyles.css';
3
- import { getPlantsInfo } from './services/api/api-plantinfo';
3
+ import { getPlantsInfo, getTagDetails } from './services/api';
4
4
  import './theme/theme.css';
5
5
  import { getLegendStatusColor } from './utils/legendUtils';
6
6
  export * from './components';
7
7
  export * from './coreApplication';
8
8
  export { RegisteredHookName } from './hooks/hookLibrary';
9
- export { useScreenOrientation } from './hooks/useScreenOrientation';
10
9
  export { RegisteredComponentName } from './services/componentRegistry/componentRegistry';
11
10
  export * from './services/eventHubActions';
12
11
  export * from './theme/themeConst';
13
12
  export type { EchoHubPlant } from './types/echoHubPlant';
14
13
  export * from './types/eventTypes';
15
14
  export * from './types/extensions';
16
- export type { DeviceOrientation, SetActiveTagNo, TagData } from './types/hookLibrary';
15
+ export type { SetActiveTagNo, TagData } from './types/hookLibrary';
17
16
  export { LegendStatus, LegendType } from './types/legend';
18
17
  export type { ModelPermissions } from './types/modelPermissions';
19
18
  export { PingableSources } from './types/pingableSources';
@@ -26,6 +25,9 @@ export declare const registerEchopediaComponent: ({ name, component }: {
26
25
  }) => void;
27
26
  declare const EchoFramework: Readonly<{
28
27
  Utils: Readonly<{
28
+ Navigation: Readonly<{
29
+ goToExternalLink: (link: string, redirect?: boolean | undefined) => void;
30
+ }>;
29
31
  Color: Readonly<{
30
32
  getLegendStatusColor: typeof getLegendStatusColor;
31
33
  }>;
@@ -34,24 +36,27 @@ declare const EchoFramework: Readonly<{
34
36
  useEchoHistory(): (path: string, params?: {
35
37
  [key: string]: string;
36
38
  } | undefined, state?: any) => void;
37
- useScreenOrientation(): string;
38
- useTagDetails({ tagNo, instCode }: {
39
+ useTagDetails({ instCode, tagNo }: {
39
40
  tagNo: string;
40
41
  instCode: string;
41
- }): import("@equinor/echo-search").TagDetailsDto | undefined;
42
+ }): {
43
+ tagDetails: import("@equinor/echo-search").TagDetailsDto | undefined;
44
+ isTagDetailsLoading: boolean;
45
+ hasError: boolean;
46
+ };
42
47
  useSetActiveTagNo: () => import("./types/hookLibrary").SetActiveTagNo;
43
48
  useContextMenuDataInfo: (tagNo: string, expanded: boolean, setActivePanel?: (() => void) | undefined) => import("@equinor/echo-components").DataInformation[];
44
49
  useTagData: () => import("./types/hookLibrary").TagData;
45
50
  useIsContextMenuInfoLoading: () => boolean;
46
51
  useSetActiveCommPackNo: () => import("./types/hookLibrary").SetActiveCommPackNo;
47
52
  useSetActiveMcPackNo: () => import("./types/hookLibrary").SetActiveMcPackNo;
48
- useDeviceOrientation: () => import("./types/hookLibrary").DeviceOrientation;
49
53
  }>;
50
54
  EchopediaComponentLibrary: Readonly<{
51
55
  getTagItem: () => import("react").FunctionComponent<any>;
52
56
  }>;
53
57
  APIs: Readonly<{
54
58
  getPlantsInfo: typeof getPlantsInfo;
59
+ getTagDetails: typeof getTagDetails;
55
60
  }>;
56
61
  }>;
57
62
  export default EchoFramework;
@@ -1,2 +1,2 @@
1
1
  export declare const baseApiUrl: string;
2
- export declare function request<T>(url: string, requestType: T): Promise<T>;
2
+ export declare function request<T>(url: string, requestType: T, abortSignal?: AbortSignal): Promise<T>;
@@ -0,0 +1,18 @@
1
+ import { TagDetailsDto } from '@equinor/echo-search';
2
+ /**
3
+ * Wraps Search.Tags.getTagDetailsAsync(), and throws proper NotFoundError if search was unable to find the given tag.
4
+ * It also converts Search's result.error responses to proper errors and throws them.
5
+ *
6
+ * @param {Object} param
7
+ * @param {string} params.tagNo The tag number to query.
8
+ * @param {string} params.instCode Plant installation code for the given tag.
9
+ * @param {AbortSignal} params.abortSignal A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
10
+ * @throws {NotFoundError} NotFoundError when there are no matches for the tagNo instCode pair.
11
+ * @throws {BaseError} In any other failed API call.
12
+ * @returns {Promise<TagDetailsDto>} Promise resolving in tag details DTO.
13
+ */
14
+ export declare function getTagDetails({ tagNo, instCode, abortSignal }: {
15
+ tagNo: string;
16
+ instCode?: string;
17
+ abortSignal?: AbortSignal;
18
+ }): Promise<TagDetailsDto>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ProCoSysApiTag } from '../../types/api-proCoSysTagResponse';
2
+ /**
3
+ * Fetches tag information from ProCoSys.
4
+ *
5
+ * @param {Object} param
6
+ * @param {string} params.tagNo The tag number to query.
7
+ * @param {string} params.instCode Plant installation code for the given tag.
8
+ * @param {AbortSignal} params.abortSignal A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
9
+ * @throws {BaseError} If the response can't be parsed to JSON.
10
+ * @throws {Error} In any other API call issues.
11
+ * @returns {Promise<TProCoSysApiTag[]>} Promise resolving in array of tags.
12
+ */
13
+ export declare function getTagFromProCoSys({ instCode, tagNo, abortSignal }: {
14
+ instCode: string;
15
+ tagNo: string;
16
+ abortSignal?: AbortSignal;
17
+ }): Promise<ProCoSysApiTag[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  export * from './api-plantinfo';
2
+ export { getTagDetails } from './api-tag-details';
@@ -0,0 +1 @@
1
+ export declare const echopediaAnalyticsModule: import("@equinor/echo-core").AnalyticsModule;
@@ -6,9 +6,8 @@ Object.defineProperty(exports, '__esModule', {
6
6
 
7
7
  var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
8
8
 
9
- var css_248z = ".layout-module_echoContentContainer__0debO{height:100%}.layout-module_applicationWrapper__adzds{animation:layout-module_fadeIn__-OF4H 2s;background-color:#fff;background-image:url(../../images/frontpage-brand-placeholder-vert.jpg);background-size:cover;height:100%;overflow:auto;position:relative;width:100%}@keyframes layout-module_fadeIn__-OF4H{0%{opacity:0}to{opacity:1}}@media screen and (min-width:640px){.layout-module_applicationWrapper__adzds{background-image:none}}.layout-module_mainLayoutWrapper__4kuIT{height:100%;overflow:hidden;width:100%}.layout-module_bgTransparent__bBfb-{background-color:transparent}.layout-module_footerDisclaimer__-F6dv{font-size:.7rem}.layout-module_footerLogo__CBb-F{max-height:2.5rem}.layout-module_fullBodyHeight__hQfe5{min-height:calc(100vh - 75px)!important;padding-bottom:16px}.layout-module_navbarBrand__2IOPY{color:red}::selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}.layout-module_colorLayout__VHJcU{background-color:#eaf4f9;height:100%;overflow:hidden;position:relative;width:100%}.layout-module_pdfViewerNative__hnAgy{background-color:#323639;height:100%;overflow:hidden;padding-top:6.5rem;position:relative;width:100%}.layout-module_cameraLayout__iVPug{background-color:\"transparent\"}.layout-module_cameraLayout__iVPug,.layout-module_defaultLayout__3MIwa{height:100%;position:relative;width:100%}.layout-module_noPadding__7amV4{padding:0}.layout-module_noMargin__1eUBf{margin:0}@media screen and (orientation:landscape) and (max-width:927px){.layout-module_echoContentContainer__0debO{display:flex;flex-direction:row}.layout-module_applicationWrapper__adzds,.layout-module_cameraLayout__iVPug,.layout-module_colorLayout__VHJcU,.layout-module_defaultLayout__3MIwa,.layout-module_pdfViewerNative__hnAgy{width:calc(100% - 48px)}}@media screen and (orientation:portrait) and (max-width:767px){.layout-module_applicationWrapper__adzds,.layout-module_cameraLayout__iVPug,.layout-module_colorLayout__VHJcU,.layout-module_defaultLayout__3MIwa,.layout-module_pdfViewerNative__hnAgy{height:calc(100% - 48px)}}";
9
+ var css_248z = ".layout-module_applicationWrapper__adzds{animation:layout-module_fadeIn__-OF4H 2s;background-color:#fff;background-image:url(../../images/frontpage-brand-placeholder-vert.jpg);background-size:cover;height:100%;overflow:auto;width:100%}@keyframes layout-module_fadeIn__-OF4H{0%{opacity:0}to{opacity:1}}@media screen and (min-width:640px){.layout-module_applicationWrapper__adzds{background-image:none}}.layout-module_mainLayoutWrapper__4kuIT{height:100%;overflow:hidden;width:100%}.layout-module_bgTransparent__bBfb-{background-color:transparent}.layout-module_footerDisclaimer__-F6dv{font-size:.7rem}.layout-module_footerLogo__CBb-F{max-height:2.5rem}.layout-module_fullBodyHeight__hQfe5{min-height:calc(100vh - 75px)!important;padding-bottom:16px}.layout-module_navbarBrand__2IOPY{color:red}::selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}.layout-module_colorLayout__VHJcU{background-color:#eaf4f9;height:100%;overflow:hidden;position:relative;width:100%}.layout-module_pdfViewerNative__hnAgy{background-color:#323639;height:100%;overflow:hidden;padding-top:6.5rem;position:relative;width:100%}.layout-module_noPadding__7amV4{padding:0}.layout-module_noMargin__1eUBf{margin:0}";
10
10
  var style = {
11
- "echoContentContainer": "layout-module_echoContentContainer__0debO",
12
11
  "applicationWrapper": "layout-module_applicationWrapper__adzds",
13
12
  "fadeIn": "layout-module_fadeIn__-OF4H",
14
13
  "mainLayoutWrapper": "layout-module_mainLayoutWrapper__4kuIT",
@@ -19,8 +18,6 @@ var style = {
19
18
  "navbarBrand": "layout-module_navbarBrand__2IOPY",
20
19
  "colorLayout": "layout-module_colorLayout__VHJcU",
21
20
  "pdfViewerNative": "layout-module_pdfViewerNative__hnAgy",
22
- "cameraLayout": "layout-module_cameraLayout__iVPug",
23
- "defaultLayout": "layout-module_defaultLayout__3MIwa",
24
21
  "noPadding": "layout-module_noPadding__7amV4",
25
22
  "noMargin": "layout-module_noMargin__1eUBf"
26
23
  };