@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,66 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ });
6
+
7
+ var _tslib = require('../../../_virtual/_tslib.js');
8
+
9
+ var echoBase = require('@equinor/echo-base');
10
+
11
+ var echoSearch = require('@equinor/echo-search');
12
+ /**
13
+ * Wraps Search.Tags.getTagDetailsAsync(), and throws proper NotFoundError if search was unable to find the given tag.
14
+ * It also converts Search's result.error responses to proper errors and throws them.
15
+ *
16
+ * @param {Object} param
17
+ * @param {string} params.tagNo The tag number to query.
18
+ * @param {string} params.instCode Plant installation code for the given tag.
19
+ * @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.
20
+ * @throws {NotFoundError} NotFoundError when there are no matches for the tagNo instCode pair.
21
+ * @throws {BaseError} In any other failed API call.
22
+ * @returns {Promise<TagDetailsDto>} Promise resolving in tag details DTO.
23
+ */
24
+
25
+
26
+ function getTagDetails(_ref) {
27
+ var tagNo = _ref.tagNo,
28
+ instCode = _ref.instCode,
29
+ abortSignal = _ref.abortSignal;
30
+ return _tslib.__awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
31
+ var result;
32
+ return regeneratorRuntime.wrap(function _callee$(_context) {
33
+ while (1) {
34
+ switch (_context.prev = _context.next) {
35
+ case 0:
36
+ _context.next = 2;
37
+ return echoSearch.Search.Tags.getTagDetailsAsync(tagNo, instCode, abortSignal);
38
+
39
+ case 2:
40
+ result = _context.sent;
41
+ echoSearch.resultHelper.throwIfError(result);
42
+
43
+ if (result.value) {
44
+ _context.next = 6;
45
+ break;
46
+ }
47
+
48
+ throw new echoBase.NotFoundError({
49
+ message: "Could not find ".concat(instCode, " ").concat(tagNo),
50
+ httpStatusCode: 404,
51
+ url: 'getTagDetails'
52
+ });
53
+
54
+ case 6:
55
+ return _context.abrupt("return", result.value);
56
+
57
+ case 7:
58
+ case "end":
59
+ return _context.stop();
60
+ }
61
+ }
62
+ }, _callee);
63
+ }));
64
+ }
65
+
66
+ exports.getTagDetails = getTagDetails;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ });
6
+
7
+ var apiManager = require('./api-manager.js');
8
+ /**
9
+ * Fetches tag information from ProCoSys.
10
+ *
11
+ * @param {Object} param
12
+ * @param {string} params.tagNo The tag number to query.
13
+ * @param {string} params.instCode Plant installation code for the given tag.
14
+ * @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.
15
+ * @throws {BaseError} If the response can't be parsed to JSON.
16
+ * @throws {Error} In any other API call issues.
17
+ * @returns {Promise<TProCoSysApiTag[]>} Promise resolving in array of tags.
18
+ */
19
+
20
+
21
+ function getTagFromProCoSys(_ref) {
22
+ var instCode = _ref.instCode,
23
+ tagNo = _ref.tagNo,
24
+ abortSignal = _ref.abortSignal;
25
+ var url = "".concat(apiManager.baseApiUrl, "/").concat(instCode, "/tags/procosys?tagNo=").concat(tagNo);
26
+ return apiManager.request(url, [], abortSignal);
27
+ }
28
+
29
+ exports.getTagFromProCoSys = getTagFromProCoSys;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ });
6
+
7
+ var EchoCore = require('@equinor/echo-core');
8
+
9
+ var echopediaAnalyticsModule = EchoCore.analytics.createAnalyticsModule('ep');
10
+ exports.echopediaAnalyticsModule = echopediaAnalyticsModule;
@@ -7,4 +7,5 @@ exports.PingableSources = void 0;
7
7
 
8
8
  (function (PingableSources) {
9
9
  PingableSources["Sap"] = "https://p03web.statoil.no/sap/public/icmandir/its/lsgui/images/img/splashscreen_corbu.png";
10
+ PingableSources["Statos"] = "https://satos.equinor.com/files/4/bilder/johan_svedrup.png";
10
11
  })(exports.PingableSources || (exports.PingableSources = {}));
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ });
6
+
7
+ var echopediaAnalyticsModule = require('../services/echopediaAnalyticsModule/echopediaAnalyticsModule.js');
8
+ /**
9
+ * Helper function to execute a redirection to an outer source.
10
+ *
11
+ * @param {string} link Link to navigate to.
12
+ * @param {boolean} redirect Set this to 'true' to load the given url to navigate to in the current tab / window.
13
+ */
14
+
15
+
16
+ var goToExternalLink = function goToExternalLink(link, redirect) {
17
+ echopediaAnalyticsModule.echopediaAnalyticsModule.trackEventBy('ExternalLink', 'Opened', {
18
+ linkTo: link
19
+ });
20
+
21
+ if (redirect) {
22
+ window.location.href = link;
23
+ } else {
24
+ window.open(link, '_blank');
25
+ }
26
+ };
27
+
28
+ exports.goToExternalLink = goToExternalLink;
@@ -528,3 +528,4 @@ exports.getPlant = getPlant;
528
528
  exports.getPlantBySapId = getPlantBySapId;
529
529
  exports.getPlantCodesOnInstallation = getPlantCodesOnInstallation;
530
530
  exports.getPlantsOnInstallation = getPlantsOnInstallation;
531
+ exports.setPlantInfo = setPlantInfo;
@@ -0,0 +1,8 @@
1
+ export declare type ProCoSysApiTag = {
2
+ id: number;
3
+ tagNo: string;
4
+ description: string;
5
+ isMaster: boolean;
6
+ projectName: string;
7
+ registerId: string;
8
+ };
@@ -1,3 +1,4 @@
1
1
  export declare enum PingableSources {
2
- Sap = "https://p03web.statoil.no/sap/public/icmandir/its/lsgui/images/img/splashscreen_corbu.png"
2
+ Sap = "https://p03web.statoil.no/sap/public/icmandir/its/lsgui/images/img/splashscreen_corbu.png",
3
+ Statos = "https://satos.equinor.com/files/4/bilder/johan_svedrup.png"
3
4
  }
@@ -1 +1,2 @@
1
+ export * from './navigationUtils';
1
2
  export * from './plantInfo';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Helper function to execute a redirection to an outer source.
3
+ *
4
+ * @param {string} link Link to navigate to.
5
+ * @param {boolean} redirect Set this to 'true' to load the given url to navigate to in the current tab / window.
6
+ */
7
+ export declare const goToExternalLink: (link: string, redirect?: boolean | undefined) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,10 @@
1
1
  import { EchoHubPlant } from '../types/echoHubPlant';
2
+ /**
3
+ * Method for setting echo hub plant information in local storage under the key echoHubPlantInfo
4
+ *
5
+ * @param {EchoHubPlant[]} plants list of plant information to add to local storage
6
+ */
7
+ export declare function setPlantInfo(plants: EchoHubPlant[]): void;
2
8
  /**
3
9
  * Method for getting echo hub plant information from local storage.
4
10
  * If plant information is not in local storage, then this method will try to fetch the information
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.8.4",
3
+ "version": "0.8.7",
4
4
  "description": "Modules and components for EchoWeb, utilizing EchoCore",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "@equinor/echo-components": "^0.4.0",
39
39
  "@equinor/echo-core": "^0.6.11",
40
40
  "@equinor/echo-search": "^0.12.1",
41
- "@equinor/echo-utils": "^0.2.9",
41
+ "@equinor/echo-utils": "^0.2.11",
42
42
  "@equinor/eds-core-react": "^0.19.0",
43
43
  "react": "^17.0.2",
44
44
  "react-dom": "^17.0.2",
@@ -55,7 +55,7 @@
55
55
  "@equinor/echo-scripts": "^0.1.5",
56
56
  "@equinor/echo-search": "^0.12.1",
57
57
  "@equinor/echo-update": "^1.3.0",
58
- "@equinor/echo-utils": "^0.2.9",
58
+ "@equinor/echo-utils": "^0.2.10",
59
59
  "@equinor/eds-core-react": "^0.19.0",
60
60
  "@modular-css/rollup": "^28.0.0",
61
61
  "@rollup/plugin-babel": "^5.3.1",