@equinor/echo-framework 0.8.4 → 0.8.7

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 (77) 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/realTimeData/hooks/useSignalR.d.ts +3 -2
  13. package/dist/hooks/useSemi.d.ts +11 -7
  14. package/dist/hooks/useTagDetails.d.ts +10 -3
  15. package/dist/index.d.ts +11 -3
  16. package/dist/services/api/api-manager.d.ts +1 -1
  17. package/dist/services/api/api-tag-details.d.ts +18 -0
  18. package/dist/services/api/api-tag-details.test.d.ts +1 -0
  19. package/dist/services/api/api-tags.d.ts +17 -0
  20. package/dist/services/api/api-tags.test.d.ts +1 -0
  21. package/dist/services/api/index.d.ts +1 -0
  22. package/dist/services/echopediaAnalyticsModule/echopediaAnalyticsModule.d.ts +1 -0
  23. package/dist/src/components/containers/layout.module.css.js +1 -1
  24. package/dist/src/components/containers/layouts.js +45 -48
  25. package/dist/src/components/contextualAppLinks/externalAppsMenu.js +4 -4
  26. package/dist/src/components/contextualAppLinks/externalLinkButtons/allExternalLinks.js +66 -11
  27. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.js +169 -0
  28. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.js +93 -0
  29. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.js +60 -5
  30. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.js +43 -11
  31. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSafeX.js +1 -1
  32. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.js +58 -11
  33. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.js +16 -5
  34. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToStid.js +1 -1
  35. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +67 -16
  36. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.js +44 -0
  37. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.module.css.js +15 -0
  38. package/dist/src/components/externalLinkButton/externalLinkButton.js +89 -34
  39. package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +5 -2
  40. package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +3 -2
  41. package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +32 -7
  42. package/dist/src/components/realTimeData/hooks/useSignalR.js +4 -2
  43. package/dist/src/coreApplication/EchoBarComponent.js +8 -9
  44. package/dist/src/coreApplication/EchoContent.js +1 -5
  45. package/dist/src/coreApplication/EchoContent.module.css.js +1 -5
  46. package/dist/src/hooks/useSemi.js +40 -14
  47. package/dist/src/hooks/useTagDetails.js +116 -45
  48. package/dist/src/icons/common/CommissionApp-icon.png.js +7 -0
  49. package/dist/src/icons/common/Evision.svg.js +3 -2
  50. package/dist/src/icons/common/Fusion.svg.js +30 -25
  51. package/dist/src/icons/common/McApp.svg.js +10 -6
  52. package/dist/src/icons/common/Notification.svg.js +82 -0
  53. package/dist/src/icons/common/ProCoSysIcon.svg.js +3 -2
  54. package/dist/src/icons/common/SapLogo.svg.js +5 -4
  55. package/dist/src/icons/common/SemiIcon.svg.js +11 -11
  56. package/dist/src/icons/common/Stid.svg.js +3 -2
  57. package/dist/src/icons/common/TR2000.svg.js +8 -6
  58. package/dist/src/icons/common/WorkOrder.svg.js +72 -0
  59. package/dist/src/icons/common/Yammer.svg.js +2 -1
  60. package/dist/src/icons/common/satos-logo.png.js +7 -0
  61. package/dist/src/index.js +15 -1
  62. package/dist/src/services/api/api-manager.js +2 -2
  63. package/dist/src/services/api/api-realtimedata.js +3 -1
  64. package/dist/src/services/api/api-tag-details.js +66 -0
  65. package/dist/src/services/api/api-tags.js +29 -0
  66. package/dist/src/services/echopediaAnalyticsModule/echopediaAnalyticsModule.js +10 -0
  67. package/dist/src/types/pingableSources.js +1 -0
  68. package/dist/src/utils/navigationUtils.js +28 -0
  69. package/dist/src/utils/plantInfo.js +1 -0
  70. package/dist/types/api-proCoSysTagResponse.d.ts +8 -0
  71. package/dist/types/pingableSources.d.ts +2 -1
  72. package/dist/utils/index.d.ts +1 -0
  73. package/dist/utils/navigationUtils.d.ts +7 -0
  74. package/dist/utils/navigationUtils.test.d.ts +1 -0
  75. package/dist/utils/plantInfo.d.ts +6 -0
  76. package/dist/utils/plantInfo.test.d.ts +1 -0
  77. package/package.json +3 -3
@@ -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,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;
@@ -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,6 +1,6 @@
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';
@@ -26,6 +26,9 @@ export declare const registerEchopediaComponent: ({ name, component }: {
26
26
  }) => void;
27
27
  declare const EchoFramework: Readonly<{
28
28
  Utils: Readonly<{
29
+ Navigation: Readonly<{
30
+ goToExternalLink: (link: string, redirect?: boolean | undefined) => void;
31
+ }>;
29
32
  Color: Readonly<{
30
33
  getLegendStatusColor: typeof getLegendStatusColor;
31
34
  }>;
@@ -35,10 +38,14 @@ declare const EchoFramework: Readonly<{
35
38
  [key: string]: string;
36
39
  } | undefined, state?: any) => void;
37
40
  useScreenOrientation(): string;
38
- useTagDetails({ tagNo, instCode }: {
41
+ useTagDetails({ instCode, tagNo }: {
39
42
  tagNo: string;
40
43
  instCode: string;
41
- }): import("@equinor/echo-search").TagDetailsDto | undefined;
44
+ }): {
45
+ tagDetails: import("@equinor/echo-search").TagDetailsDto | undefined;
46
+ isTagDetailsLoading: boolean;
47
+ hasError: boolean;
48
+ };
42
49
  useSetActiveTagNo: () => import("./types/hookLibrary").SetActiveTagNo;
43
50
  useContextMenuDataInfo: (tagNo: string, expanded: boolean, setActivePanel?: (() => void) | undefined) => import("@equinor/echo-components").DataInformation[];
44
51
  useTagData: () => import("./types/hookLibrary").TagData;
@@ -52,6 +59,7 @@ declare const EchoFramework: Readonly<{
52
59
  }>;
53
60
  APIs: Readonly<{
54
61
  getPlantsInfo: typeof getPlantsInfo;
62
+ getTagDetails: typeof getTagDetails;
55
63
  }>;
56
64
  }>;
57
65
  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,7 +6,7 @@ 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_echoContentContainer__0debO{height:100%;padding:env(safe-area-inset-top,20px) env(safe-area-inset-right,20px) env(safe-area-inset-bottom,20px) env(safe-area-inset-left,20px);width: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)}}";
10
10
  var style = {
11
11
  "echoContentContainer": "layout-module_echoContentContainer__0debO",
12
12
  "applicationWrapper": "layout-module_applicationWrapper__adzds",
@@ -16,8 +16,6 @@ require('../panel/corePanelLeft.js');
16
16
 
17
17
  require('../panel/corePanelRight.js');
18
18
 
19
- require('../../coreApplication/EchoContent.module.css.js');
20
-
21
19
  require('react-router-dom');
22
20
 
23
21
  require('@equinor/echo-components');
@@ -48,8 +46,12 @@ require('../../coreApplication/EchoEventHandler.module.css.js');
48
46
 
49
47
  var useScreenOrientation = require('../../hooks/useScreenOrientation.js');
50
48
 
49
+ require('@equinor/echo-utils');
50
+
51
51
  require('@equinor/echo-search');
52
52
 
53
+ require('../../services/echopediaAnalyticsModule/echopediaAnalyticsModule.js');
54
+
53
55
  var hookLibrary = require('../../hooks/hookLibrary.js');
54
56
 
55
57
  var layout_module = require('./layout.module.css.js');
@@ -64,111 +66,106 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
64
66
 
65
67
  var MainLayout = function MainLayout(_ref) {
66
68
  var children = _ref.children;
67
- var deviceOrientation = hookLibrary.HookLibrary.useDeviceOrientation();
69
+
70
+ var _hookLibrary$HookLibr = hookLibrary.HookLibrary.useDeviceOrientation(),
71
+ deviceOrientation = _hookLibrary$HookLibr.deviceOrientation;
72
+
68
73
  var isLandscapeDevice = deviceOrientation.landscape;
69
74
  var screenOrientation = useScreenOrientation.useScreenOrientation();
70
75
  var isWeb = !deviceOrientation.landscape && !deviceOrientation.portrait;
71
76
  var isLandscapeWeb = screenOrientation === 'landscape';
72
77
  return /*#__PURE__*/React__default["default"].createElement("div", {
73
78
  className: layout_module["default"].echoContentContainer
74
- }, isWeb ? screenOrientation === 'landscape' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
75
- isLandscape: isLandscapeWeb
76
- }) : deviceOrientation.landscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
77
- isLandscape: isLandscapeDevice
79
+ }, (isWeb && screenOrientation === 'landscape' || !isWeb && deviceOrientation.landscape) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
80
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
78
81
  }), /*#__PURE__*/React__default["default"].createElement("div", {
79
82
  className: layout_module["default"].mainLayoutWrapper
80
- }, children), ' ', isWeb ? screenOrientation === 'portrait' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
81
- isLandscape: isLandscapeWeb
82
- }) : deviceOrientation.portrait && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
83
- isLandscape: isLandscapeDevice
83
+ }, children), (isWeb && screenOrientation === 'portrait' || !isWeb && deviceOrientation.portrait) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
84
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
84
85
  }));
85
86
  };
86
87
 
87
88
  var ColorLayout = function ColorLayout(_ref2) {
88
89
  var children = _ref2.children;
89
- var deviceOrientation = hookLibrary.HookLibrary.useDeviceOrientation();
90
+
91
+ var _hookLibrary$HookLibr2 = hookLibrary.HookLibrary.useDeviceOrientation(),
92
+ deviceOrientation = _hookLibrary$HookLibr2.deviceOrientation;
93
+
90
94
  var isLandscapeDevice = deviceOrientation.landscape;
91
95
  var screenOrientation = useScreenOrientation.useScreenOrientation();
92
96
  var isWeb = !deviceOrientation.landscape && !deviceOrientation.portrait;
93
97
  var isLandscapeWeb = screenOrientation === 'landscape';
94
98
  return /*#__PURE__*/React__default["default"].createElement("div", {
95
99
  className: layout_module["default"].echoContentContainer
96
- }, ' ', isWeb ? screenOrientation === 'landscape' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
97
- isLandscape: isLandscapeWeb
98
- }) : deviceOrientation.landscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
99
- isLandscape: isLandscapeDevice
100
+ }, (isWeb && screenOrientation === 'landscape' || !isWeb && deviceOrientation.landscape) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
101
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
100
102
  }), /*#__PURE__*/React__default["default"].createElement("div", {
101
103
  className: layout_module["default"].colorLayout
102
- }, children), isWeb ? screenOrientation === 'portrait' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
103
- isLandscape: isLandscapeWeb
104
- }) : deviceOrientation.portrait && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
105
- isLandscape: isLandscapeDevice
104
+ }, children), (isWeb && screenOrientation === 'portrait' || !isWeb && deviceOrientation.portrait) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
105
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
106
106
  }));
107
107
  };
108
108
 
109
109
  var PdfViewerNative = function PdfViewerNative(_ref3) {
110
110
  var children = _ref3.children;
111
- var deviceOrientation = hookLibrary.HookLibrary.useDeviceOrientation();
111
+
112
+ var _hookLibrary$HookLibr3 = hookLibrary.HookLibrary.useDeviceOrientation(),
113
+ deviceOrientation = _hookLibrary$HookLibr3.deviceOrientation;
114
+
112
115
  var isLandscapeDevice = deviceOrientation.landscape;
113
116
  var screenOrientation = useScreenOrientation.useScreenOrientation();
114
117
  var isWeb = !deviceOrientation.landscape && !deviceOrientation.portrait;
115
118
  var isLandscapeWeb = screenOrientation === 'landscape';
116
119
  return /*#__PURE__*/React__default["default"].createElement("div", {
117
120
  className: layout_module["default"].echoContentContainer
118
- }, ' ', isWeb ? screenOrientation === 'landscape' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
119
- isLandscape: isLandscapeWeb
120
- }) : deviceOrientation.landscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
121
- isLandscape: isLandscapeDevice
121
+ }, (isWeb && screenOrientation === 'landscape' || !isWeb && deviceOrientation.landscape) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
122
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
122
123
  }), /*#__PURE__*/React__default["default"].createElement("div", {
123
124
  className: layout_module["default"].pdfViewerNative
124
- }, children), ' ', isWeb ? screenOrientation === 'portrait' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
125
- isLandscape: isLandscapeWeb
126
- }) : deviceOrientation.portrait && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
127
- isLandscape: isLandscapeDevice
125
+ }, children), ' ', (isWeb && screenOrientation === 'portrait' || !isWeb && deviceOrientation.portrait) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
126
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
128
127
  }));
129
128
  };
130
129
 
131
130
  var CameraLayout = function CameraLayout(_ref4) {
132
131
  var children = _ref4.children;
133
- var deviceOrientation = hookLibrary.HookLibrary.useDeviceOrientation();
132
+
133
+ var _hookLibrary$HookLibr4 = hookLibrary.HookLibrary.useDeviceOrientation(),
134
+ deviceOrientation = _hookLibrary$HookLibr4.deviceOrientation;
135
+
134
136
  var isLandscapeDevice = deviceOrientation.landscape;
135
137
  var screenOrientation = useScreenOrientation.useScreenOrientation();
136
138
  var isWeb = !deviceOrientation.landscape && !deviceOrientation.portrait;
137
139
  var isLandscapeWeb = screenOrientation === 'landscape';
138
140
  return /*#__PURE__*/React__default["default"].createElement("div", {
139
141
  className: layout_module["default"].echoContentContainer
140
- }, isWeb ? screenOrientation === 'landscape' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
141
- isLandscape: isLandscapeWeb
142
- }) : deviceOrientation.landscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
143
- isLandscape: isLandscapeDevice
142
+ }, (isWeb && screenOrientation === 'landscape' || !isWeb && deviceOrientation.landscape) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
143
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
144
144
  }), /*#__PURE__*/React__default["default"].createElement("div", {
145
145
  className: layout_module["default"].cameraLayout
146
- }, children), ' ', isWeb ? screenOrientation === 'portrait' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
147
- isLandscape: isLandscapeWeb
148
- }) : deviceOrientation.portrait && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
149
- isLandscape: isLandscapeDevice
150
- }), ' ');
146
+ }, children), (isWeb && screenOrientation === 'portrait' || !isWeb && deviceOrientation.portrait) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
147
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
148
+ }));
151
149
  };
152
150
 
153
151
  var DefaultLayout = function DefaultLayout(_ref5) {
154
152
  var children = _ref5.children;
155
- var deviceOrientation = hookLibrary.HookLibrary.useDeviceOrientation();
153
+
154
+ var _hookLibrary$HookLibr5 = hookLibrary.HookLibrary.useDeviceOrientation(),
155
+ deviceOrientation = _hookLibrary$HookLibr5.deviceOrientation;
156
+
156
157
  var isLandscapeDevice = deviceOrientation.landscape;
157
158
  var screenOrientation = useScreenOrientation.useScreenOrientation();
158
159
  var isWeb = !deviceOrientation.landscape && !deviceOrientation.portrait;
159
160
  var isLandscapeWeb = screenOrientation === 'landscape';
160
161
  return /*#__PURE__*/React__default["default"].createElement("div", {
161
162
  className: layout_module["default"].echoContentContainer
162
- }, isWeb ? screenOrientation === 'landscape' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
163
- isLandscape: isLandscapeWeb
164
- }) : deviceOrientation.landscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
165
- isLandscape: isLandscapeDevice
163
+ }, (isWeb && screenOrientation === 'landscape' || !isWeb && deviceOrientation.landscape) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
164
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
166
165
  }), /*#__PURE__*/React__default["default"].createElement("div", {
167
166
  className: layout_module["default"].defaultLayout
168
- }, children), isWeb ? screenOrientation === 'portrait' && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
169
- isLandscape: isLandscapeWeb
170
- }) : deviceOrientation.portrait && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
171
- isLandscape: isLandscapeDevice
167
+ }, children), (isWeb && screenOrientation === 'portrait' || !isWeb && deviceOrientation.portrait) && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
168
+ isLandscape: isWeb ? isLandscapeWeb : isLandscapeDevice
172
169
  }));
173
170
  };
174
171
 
@@ -121,7 +121,7 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
121
121
  id: menuButtonId,
122
122
  "aria-controls": appMenuOnButtonId,
123
123
  "aria-haspopup": "true",
124
- "aria-expanded": Boolean(menuState.buttonEl),
124
+ "aria-expanded": isOpen,
125
125
  onClick: function onClick() {
126
126
  isOpen ? closeMenu() : openMenu(buttonElRef);
127
127
  },
@@ -138,7 +138,7 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
138
138
  })), /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Menu, {
139
139
  id: appMenuOnButtonId,
140
140
  "aria-labelledby": menuButtonId,
141
- open: Boolean(menuState.buttonEl),
141
+ open: isOpen,
142
142
  anchorEl: buttonElRef === null || buttonElRef === void 0 ? void 0 : buttonElRef.current,
143
143
  placement: 'bottom-end',
144
144
  onClose: closeMenu,
@@ -149,9 +149,9 @@ var ExternalAppsMenu = function ExternalAppsMenu(_a) {
149
149
  onMouseLeave: function onMouseLeave() {
150
150
  closeMenu();
151
151
  }
152
- }, /*#__PURE__*/React__default["default"].createElement("div", null, externalAppLinks.map(function (AppLink) {
152
+ }, isOpen ? /*#__PURE__*/React__default["default"].createElement("div", null, externalAppLinks.map(function (AppLink) {
153
153
  return renderAppLink(AppLink.component);
154
- }), children)));
154
+ }), children) : null));
155
155
  };
156
156
 
157
157
  exports.ExternalAppsMenu = ExternalAppsMenu;