@equinor/echo-framework 0.9.11 → 0.9.14

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 (182) hide show
  1. package/dist/components/appLinks/applinkUtils.d.ts +2 -0
  2. package/dist/components/appLinks/applinkUtils.test.d.ts +1 -0
  3. package/dist/index.js +3 -0
  4. package/package.json +42 -39
  5. package/dist/_virtual/_tslib.js +0 -67
  6. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -25
  7. package/dist/node_modules/@equinor/eds-icons/dist/icons.esm.js +0 -5285
  8. package/dist/node_modules/@microsoft/signalr/dist/esm/AbortController.js +0 -54
  9. package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +0 -96
  10. package/dist/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +0 -47
  11. package/dist/node_modules/@microsoft/signalr/dist/esm/Errors.js +0 -287
  12. package/dist/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +0 -283
  13. package/dist/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +0 -86
  14. package/dist/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +0 -20
  15. package/dist/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +0 -82
  16. package/dist/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +0 -1169
  17. package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +0 -1346
  18. package/dist/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +0 -165
  19. package/dist/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +0 -33
  20. package/dist/node_modules/@microsoft/signalr/dist/esm/ILogger.js +0 -37
  21. package/dist/node_modules/@microsoft/signalr/dist/esm/ITransport.js +0 -37
  22. package/dist/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +0 -179
  23. package/dist/node_modules/@microsoft/signalr/dist/esm/Loggers.js +0 -35
  24. package/dist/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +0 -448
  25. package/dist/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +0 -238
  26. package/dist/node_modules/@microsoft/signalr/dist/esm/Subject.js +0 -99
  27. package/dist/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +0 -45
  28. package/dist/node_modules/@microsoft/signalr/dist/esm/Utils.js +0 -435
  29. package/dist/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +0 -264
  30. package/dist/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +0 -133
  31. package/dist/node_modules/history/esm/history.js +0 -498
  32. package/dist/node_modules/resolve-pathname/esm/resolve-pathname.js +0 -73
  33. package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -36
  34. package/dist/node_modules/tiny-invariant/dist/tiny-invariant.esm.js +0 -23
  35. package/dist/node_modules/tiny-warning/dist/tiny-warning.esm.js +0 -26
  36. package/dist/src/components/appLinks/AppLinks.js +0 -38
  37. package/dist/src/components/appLinks/AppLinks.module.css.js +0 -14
  38. package/dist/src/components/appLinks/linkButton/linkButton.js +0 -45
  39. package/dist/src/components/containers/layout.module.css.js +0 -25
  40. package/dist/src/components/containers/layouts.js +0 -62
  41. package/dist/src/components/contextualAppLinks/contextualAppLinks.context.js +0 -20
  42. package/dist/src/components/contextualAppLinks/contextualAppLinks.js +0 -47
  43. package/dist/src/components/contextualAppLinks/externalAppsMenu.js +0 -157
  44. package/dist/src/components/contextualAppLinks/externalAppsMenu.module.css.js +0 -16
  45. package/dist/src/components/contextualAppLinks/externalLinkButtons/allExternalLinks.js +0 -127
  46. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkButtons.helpers.js +0 -169
  47. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToCommApp.js +0 -95
  48. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToMcApp.js +0 -95
  49. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToProCoSys.js +0 -84
  50. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSafeX.js +0 -38
  51. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSap.js +0 -110
  52. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToSemiDoc.js +0 -59
  53. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToStid.js +0 -40
  54. package/dist/src/components/contextualAppLinks/externalLinkButtons/externalLinkToTr2000.js +0 -114
  55. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.js +0 -44
  56. package/dist/src/components/contextualAppLinks/externalLinkButtons/iconButtonSpinner.module.css.js +0 -15
  57. package/dist/src/components/contextualAppLinks/hooks/useContextualAppLinks.js +0 -52
  58. package/dist/src/components/contextualAppLinks/hooks/useContextualAppLinksContext.js +0 -36
  59. package/dist/src/components/contextualAppLinks/index.js +0 -22
  60. package/dist/src/components/contextualAppLinks/internalAppLinks.js +0 -115
  61. package/dist/src/components/contextualAppLinks/linkButton.js +0 -57
  62. package/dist/src/components/echoLogo/echoLogo.js +0 -30
  63. package/dist/src/components/echoLogo/echoLogo.module.css.js +0 -15
  64. package/dist/src/components/errorBoundary/components/chunkLoadErrorMessage.js +0 -64
  65. package/dist/src/components/errorBoundary/components/chunkLoadErrorMessage.module.css.js +0 -17
  66. package/dist/src/components/errorBoundary/components/errorBoundaryBaseMessage.js +0 -85
  67. package/dist/src/components/errorBoundary/components/errorBoundaryBaseMessage.module.css.js +0 -19
  68. package/dist/src/components/errorBoundary/components/notificationCardWithLogo.js +0 -55
  69. package/dist/src/components/errorBoundary/components/notificationCardWithLogo.module.css.js +0 -19
  70. package/dist/src/components/errorBoundary/errorBoundary.js +0 -100
  71. package/dist/src/components/externalLinkButton/externalLinkButton.js +0 -310
  72. package/dist/src/components/externalLinkButton/externalLinkButton.module.css.js +0 -23
  73. package/dist/src/components/footer/footer.js +0 -42
  74. package/dist/src/components/footer/footer.module.css.js +0 -17
  75. package/dist/src/components/lazyLoading/appLoadingIndicator.js +0 -34
  76. package/dist/src/components/lazyLoading/appLoadingIndicator.module.css.js +0 -15
  77. package/dist/src/components/lazyLoading/lazyLoadedAppWrapper.js +0 -40
  78. package/dist/src/components/mediator/mediator.js +0 -32
  79. package/dist/src/components/pageMenu/Navigation/applicationList.js +0 -35
  80. package/dist/src/components/pageMenu/Navigation/applicationList.module.css.js +0 -17
  81. package/dist/src/components/pageMenu/accordionItem.module.css.js +0 -16
  82. package/dist/src/components/pageMenu/defaultAccordionItem.js +0 -61
  83. package/dist/src/components/pageMenu/pageMenu.js +0 -141
  84. package/dist/src/components/pageMenu/pageMenu.module.css.js +0 -17
  85. package/dist/src/components/pageMenu/pageMenuDrawerItem.js +0 -77
  86. package/dist/src/components/pageMenu/pageMenuDrawerItem.module.css.js +0 -20
  87. package/dist/src/components/pageMenu/settings/asset.js +0 -40
  88. package/dist/src/components/pageMenu/settings/profile.js +0 -62
  89. package/dist/src/components/pageMenu/settings/settings.js +0 -41
  90. package/dist/src/components/pageMenu/settings/settings.module.css.js +0 -25
  91. package/dist/src/components/pageMenu/version/version.js +0 -88
  92. package/dist/src/components/pageMenu/version/version.module.css.js +0 -14
  93. package/dist/src/components/panel/corePanelIcon.js +0 -31
  94. package/dist/src/components/panel/corePanelLeft.js +0 -91
  95. package/dist/src/components/panel/corePanelLeft.module.css.js +0 -19
  96. package/dist/src/components/panel/corePanelRight.js +0 -95
  97. package/dist/src/components/panel/corePanelRight.module.css.js +0 -18
  98. package/dist/src/components/panelButton/panelButton.js +0 -124
  99. package/dist/src/components/panelButton/panelButton.module.css.js +0 -25
  100. package/dist/src/components/plantSelector/plantSelector.js +0 -137
  101. package/dist/src/components/projectSelector/ProcosysProjectSelector.js +0 -115
  102. package/dist/src/components/projectSelector/ProcosysProjectSelector.module.css.js +0 -14
  103. package/dist/src/components/realTimeData/RealTimePopoverButton.js +0 -168
  104. package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.js +0 -83
  105. package/dist/src/components/realTimeData/components/IMSDropdown/RealTimeIMSDropdown.module.css.js +0 -15
  106. package/dist/src/components/realTimeData/components/connectorForIMSTag/IMSConnector.module.css.js +0 -17
  107. package/dist/src/components/realTimeData/components/connectorForIMSTag/RealTimeConnectorForIMSTag.js +0 -149
  108. package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.js +0 -75
  109. package/dist/src/components/realTimeData/components/contextButton/RealTimeContextButton.module.css.js +0 -15
  110. package/dist/src/components/realTimeData/components/contextPopover/Popover.js +0 -37
  111. package/dist/src/components/realTimeData/components/contextPopover/Popover.module.css.js +0 -15
  112. package/dist/src/components/realTimeData/hooks/useRealTimeHub.js +0 -124
  113. package/dist/src/components/realTimeData/hooks/useSignalR.js +0 -175
  114. package/dist/src/components/realTimeData/hooks/useSignalRListener.js +0 -22
  115. package/dist/src/components/router/echoRoute.js +0 -45
  116. package/dist/src/components/router/echoRouter.js +0 -30
  117. package/dist/src/components/router/echoWrapper.js +0 -33
  118. package/dist/src/components/router/routes.js +0 -46
  119. package/dist/src/components/router/useLayout.js +0 -32
  120. package/dist/src/components/searchMenu/searchMenu.js +0 -46
  121. package/dist/src/components/searchMenu/searchMenu.module.css.js +0 -16
  122. package/dist/src/components/tagNumber/tagNo.module.css.js +0 -14
  123. package/dist/src/components/tagNumber/tagNumber.js +0 -38
  124. package/dist/src/components/toaster/toaster.js +0 -43
  125. package/dist/src/components/toaster/toaster.module.css.js +0 -15
  126. package/dist/src/components/toaster/toasters.js +0 -101
  127. package/dist/src/coreApplication/EchoContent.js +0 -32
  128. package/dist/src/coreApplication/EchoContentPanels.js +0 -40
  129. package/dist/src/coreApplication/EchoEventHandler.js +0 -79
  130. package/dist/src/coreApplication/EchoEventHandler.module.css.js +0 -14
  131. package/dist/src/globalStyles.css.js +0 -6
  132. package/dist/src/hooks/hookLibrary.js +0 -86
  133. package/dist/src/hooks/index.js +0 -12
  134. package/dist/src/hooks/useEchoHistory.js +0 -38
  135. package/dist/src/hooks/useLongPress.js +0 -37
  136. package/dist/src/hooks/useSemi.js +0 -100
  137. package/dist/src/hooks/useTagDetails.js +0 -153
  138. package/dist/src/icons/common/CommissionApp-icon.png.js +0 -7
  139. package/dist/src/icons/common/Evision.svg.js +0 -68
  140. package/dist/src/icons/common/Fusion.svg.js +0 -111
  141. package/dist/src/icons/common/McApp.svg.js +0 -70
  142. package/dist/src/icons/common/Notification.svg.js +0 -81
  143. package/dist/src/icons/common/ProCoSysIcon.svg.js +0 -68
  144. package/dist/src/icons/common/Robim.svg.js +0 -66
  145. package/dist/src/icons/common/SX-logo.png.js +0 -7
  146. package/dist/src/icons/common/SapLogo.svg.js +0 -95
  147. package/dist/src/icons/common/SemiIcon.svg.js +0 -82
  148. package/dist/src/icons/common/Stid.svg.js +0 -65
  149. package/dist/src/icons/common/TR2000.svg.js +0 -73
  150. package/dist/src/icons/common/WorkOrder.svg.js +0 -71
  151. package/dist/src/icons/common/Yammer.svg.js +0 -65
  152. package/dist/src/icons/common/satos-logo.png.js +0 -7
  153. package/dist/src/icons/edsIons.js +0 -15
  154. package/dist/src/icons/equinor-logo.js +0 -62
  155. package/dist/src/icons/logo_ee.js +0 -37
  156. package/dist/src/icons/search.js +0 -35
  157. package/dist/src/index.js +0 -209
  158. package/dist/src/index2.js +0 -201
  159. package/dist/src/services/api/api-manager.js +0 -190
  160. package/dist/src/services/api/api-plantinfo.js +0 -196
  161. package/dist/src/services/api/api-plants.js +0 -75
  162. package/dist/src/services/api/api-realtimedata.js +0 -55
  163. package/dist/src/services/api/api-tag-details.js +0 -69
  164. package/dist/src/services/api/api-tags.js +0 -88
  165. package/dist/src/services/api/api-version.js +0 -124
  166. package/dist/src/services/componentRegistry/componentRegistry.js +0 -69
  167. package/dist/src/services/echopediaAnalyticsModule/echopediaAnalyticsModule.js +0 -10
  168. package/dist/src/services/eventCallbacks/plantChanged.js +0 -42
  169. package/dist/src/services/eventHubActions/toastActions.js +0 -18
  170. package/dist/src/theme/themeConst.js +0 -75
  171. package/dist/src/types/extensions.js +0 -10
  172. package/dist/src/types/legend.js +0 -58
  173. package/dist/src/types/pingableSources.js +0 -11
  174. package/dist/src/utils/copyText.js +0 -67
  175. package/dist/src/utils/eventHandlerUtils.js +0 -11
  176. package/dist/src/utils/legendUtils.js +0 -168
  177. package/dist/src/utils/navigationUtils.js +0 -28
  178. package/dist/src/utils/plantInfo.js +0 -535
  179. package/dist/src/utils/plantsDataUtils.js +0 -35
  180. package/dist/src/utils/projectSelectorUtils.js +0 -19
  181. package/dist/src/utils/startup.js +0 -89
  182. package/dist/src/utils/taskCache.js +0 -89
@@ -1,169 +0,0 @@
1
- 'use strict';
2
-
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
5
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
-
7
- Object.defineProperty(exports, '__esModule', {
8
- value: true
9
- });
10
-
11
- var _tslib = require('../../../../_virtual/_tslib.js');
12
-
13
- var EchoCore = require('@equinor/echo-core');
14
-
15
- var apiTagDetails = require('../../../services/api/api-tag-details.js');
16
-
17
- var apiTags = require('../../../services/api/api-tags.js');
18
-
19
- var echopediaAnalyticsModule = require('../../../services/echopediaAnalyticsModule/echopediaAnalyticsModule.js');
20
-
21
- var toastActions = require('../../../services/eventHubActions/toastActions.js');
22
-
23
- function _interopDefaultLegacy(e) {
24
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
25
- 'default': e
26
- };
27
- }
28
-
29
- var EchoCore__default = /*#__PURE__*/_interopDefaultLegacy(EchoCore);
30
- /**
31
- * Specific tool for external link buttons to help build URLS for deep linking into ProCoSys web app.
32
- * Fetches both tag details and tag information from ProCoSys.
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
- * @returns {GetTagDetailsAndProCoSysDataResult} response - The returned promise will resolve once both API calls are resolved. (with Promise.all)
38
- * @returns {TagDetailsDto} response.tagDetails - Result of tag details API call.
39
- * @returns {ProCoSysApiTag} response.proCoSysTag - Tag related information from the ProCoSys system.
40
- * @returns {hasError} response.hasError - indicates if there were any errors during the API calls. The exception is handled under the hood.
41
- */
42
-
43
-
44
- function getTagDetailsAndProCoSysData(_ref) {
45
- var tagNo = _ref.tagNo,
46
- instCode = _ref.instCode;
47
- return _tslib.__awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
48
- var tagDetailsPromise, proCoSysTagPromise, response;
49
- return _regeneratorRuntime().wrap(function _callee$(_context) {
50
- while (1) {
51
- switch (_context.prev = _context.next) {
52
- case 0:
53
- tagDetailsPromise = apiTagDetails.getTagDetails({
54
- tagNo: tagNo,
55
- instCode: instCode
56
- });
57
- proCoSysTagPromise = apiTags.getTagFromProCoSys({
58
- tagNo: tagNo,
59
- instCode: instCode
60
- });
61
- response = {
62
- tagDetails: undefined,
63
- proCoSysTag: undefined,
64
- hasError: false
65
- };
66
- _context.next = 5;
67
- return Promise.all([tagDetailsPromise, proCoSysTagPromise].map(function (actualPromise, i) {
68
- return actualPromise["catch"](function (error) {
69
- error.index = i;
70
- throw error;
71
- });
72
- })).then(function (responses) {
73
- response.tagDetails = responses[0];
74
- response.proCoSysTag = responses[1].find(function (item) {
75
- return item.isMaster;
76
- });
77
-
78
- if (!response.proCoSysTag) {
79
- toastActions.displayToast({
80
- message: "Tag with number ".concat(response.tagDetails.tagNo, " does not exists in ProCoSys.")
81
- });
82
- response.hasError = true;
83
- }
84
- }, function (error) {
85
- var errorSource = error.index === 0 ? 'tag details' : 'ProCoSys tag data';
86
- var errorMessage = "Failed to fetch ".concat(errorSource, " for tagNo: ").concat(tagNo, " with instCode: ").concat(instCode, ". Please try again later.");
87
- delete error.index;
88
- EchoCore__default["default"].handleErrors && EchoCore__default["default"].handleErrors(error, echopediaAnalyticsModule.echopediaAnalyticsModule);
89
- toastActions.displayToast({
90
- message: errorMessage
91
- });
92
- response.hasError = true;
93
- });
94
-
95
- case 5:
96
- return _context.abrupt("return", response);
97
-
98
- case 6:
99
- case "end":
100
- return _context.stop();
101
- }
102
- }
103
- }, _callee);
104
- }));
105
- }
106
- /**
107
- * Wraps the 'getTagDetails' function. Handles and logs any Error thrown by it whi;e displaying an error message toast.
108
- * Use 'getTagDetails' if you want complete freedom on how you handle any exceptions.
109
- *
110
- * If there were any errors during the API call, the returned value will have a 'hasError' flag set to 'true'.
111
- *
112
- * @param {Object} params
113
- * @param {string} params.tagNo The tag number to query.
114
- * @param {string} params.instCode Plant installation code for the given tag.
115
- * @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.
116
- * @returns {getTagDetailsWithErrorHandlingResponse} response
117
- * @returns {TagDetailsDto} response.tagDetails - Result of tag details API call.
118
- * @returns {hasError} response.hasError - indicates if there were any errors during the API call.
119
- */
120
-
121
-
122
- function getTagDetailsWithErrorHandling(_ref2) {
123
- var tagNo = _ref2.tagNo,
124
- instCode = _ref2.instCode;
125
- return _tslib.__awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
126
- var result;
127
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
128
- while (1) {
129
- switch (_context2.prev = _context2.next) {
130
- case 0:
131
- result = {
132
- tagDetails: undefined,
133
- hasError: false
134
- };
135
- _context2.prev = 1;
136
- _context2.next = 4;
137
- return apiTagDetails.getTagDetails({
138
- tagNo: tagNo,
139
- instCode: instCode
140
- });
141
-
142
- case 4:
143
- result.tagDetails = _context2.sent;
144
- _context2.next = 12;
145
- break;
146
-
147
- case 7:
148
- _context2.prev = 7;
149
- _context2.t0 = _context2["catch"](1);
150
- EchoCore__default["default"].handleErrors && EchoCore__default["default"].handleErrors(_context2.t0, echopediaAnalyticsModule.echopediaAnalyticsModule);
151
- toastActions.displayToast({
152
- message: "Failed to fetch tag details for tagNo: ".concat(tagNo, " with instCode: ").concat(instCode, ". Please try again alter.")
153
- });
154
- result.hasError = true;
155
-
156
- case 12:
157
- return _context2.abrupt("return", result);
158
-
159
- case 13:
160
- case "end":
161
- return _context2.stop();
162
- }
163
- }
164
- }, _callee2, null, [[1, 7]]);
165
- }));
166
- }
167
-
168
- exports.getTagDetailsAndProCoSysData = getTagDetailsAndProCoSysData;
169
- exports.getTagDetailsWithErrorHandling = getTagDetailsWithErrorHandling;
@@ -1,95 +0,0 @@
1
- 'use strict';
2
-
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
5
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
-
7
- Object.defineProperty(exports, '__esModule', {
8
- value: true
9
- });
10
-
11
- var _tslib = require('../../../../_virtual/_tslib.js');
12
-
13
- var EchoCore = require('@equinor/echo-core');
14
-
15
- var React = require('react');
16
-
17
- var externalLinkButton = require('../../externalLinkButton/externalLinkButton.js');
18
-
19
- var externalLinkButtons_helpers = require('./externalLinkButtons.helpers.js');
20
-
21
- function _interopDefaultLegacy(e) {
22
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
23
- 'default': e
24
- };
25
- }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
- /**
29
- * External link button to Commissioning web app.
30
- *
31
- * @param {string} tagNo The tag's number to open in the Comm app.
32
- * @param {string} instCode Plant installation code.
33
- * @returns {React.FC<ExternalLinkToMcAppProps>} React component.
34
- */
35
-
36
-
37
- var ExternalLinkToCommApp = function ExternalLinkToCommApp(_ref) {
38
- var tagNo = _ref.tagNo,
39
- instCode = _ref.instCode;
40
- var proCoSysPlantCode = EchoCore.useProCoSysPlantId();
41
-
42
- function createUrl(params) {
43
- return _tslib.__awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
44
- var _yield$externalLinkBu, tagDetails, proCoSysTag, hasError;
45
-
46
- return _regeneratorRuntime().wrap(function _callee$(_context) {
47
- while (1) {
48
- switch (_context.prev = _context.next) {
49
- case 0:
50
- _context.next = 2;
51
- return externalLinkButtons_helpers.getTagDetailsAndProCoSysData(Object.assign({}, params));
52
-
53
- case 2:
54
- _yield$externalLinkBu = _context.sent;
55
- tagDetails = _yield$externalLinkBu.tagDetails;
56
- proCoSysTag = _yield$externalLinkBu.proCoSysTag;
57
- hasError = _yield$externalLinkBu.hasError;
58
- return _context.abrupt("return", hasError ? undefined : "https://apps.procosys.com/comm/".concat(proCoSysPlantCode, "/").concat(tagDetails === null || tagDetails === void 0 ? void 0 : tagDetails.projectCode, "/Tag/").concat(proCoSysTag === null || proCoSysTag === void 0 ? void 0 : proCoSysTag.id));
59
-
60
- case 7:
61
- case "end":
62
- return _context.stop();
63
- }
64
- }
65
- }, _callee);
66
- }));
67
- }
68
-
69
- return /*#__PURE__*/React__default["default"].createElement(externalLinkButton.ExternalLinkButton, {
70
- buttonName: "Comm App",
71
- buttonIcon: "CommApp",
72
- getUrlToOpen: function getUrlToOpen() {
73
- return _tslib.__awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
74
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75
- while (1) {
76
- switch (_context2.prev = _context2.next) {
77
- case 0:
78
- return _context2.abrupt("return", createUrl({
79
- tagNo: tagNo,
80
- instCode: instCode
81
- }));
82
-
83
- case 1:
84
- case "end":
85
- return _context2.stop();
86
- }
87
- }
88
- }, _callee2);
89
- }));
90
- },
91
- buttonStyle: externalLinkButton.ExternalLinkButtonStyle.Rounded
92
- });
93
- };
94
-
95
- exports.ExternalLinkToCommApp = ExternalLinkToCommApp;
@@ -1,95 +0,0 @@
1
- 'use strict';
2
-
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
5
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
-
7
- Object.defineProperty(exports, '__esModule', {
8
- value: true
9
- });
10
-
11
- var _tslib = require('../../../../_virtual/_tslib.js');
12
-
13
- var EchoCore = require('@equinor/echo-core');
14
-
15
- var React = require('react');
16
-
17
- var externalLinkButton = require('../../externalLinkButton/externalLinkButton.js');
18
-
19
- var externalLinkButtons_helpers = require('./externalLinkButtons.helpers.js');
20
-
21
- function _interopDefaultLegacy(e) {
22
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
23
- 'default': e
24
- };
25
- }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
- /**
29
- * External link button to Mechanical Completion web app.
30
- *
31
- * @param {string} tagNo The tag's number to open in McApp.
32
- * @param {string} instCode Plant installation code.
33
- * @returns {React.FC<ExternalLinkToMcAppProps>} React component.
34
- */
35
-
36
-
37
- var ExternalLinkToMcApp = function ExternalLinkToMcApp(_ref) {
38
- var tagNo = _ref.tagNo,
39
- instCode = _ref.instCode;
40
- var proCoSysPlantCode = EchoCore.useProCoSysPlantId();
41
-
42
- function createUrl(params) {
43
- return _tslib.__awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
44
- var _yield$externalLinkBu, tagDetails, proCoSysTag, hasError;
45
-
46
- return _regeneratorRuntime().wrap(function _callee$(_context) {
47
- while (1) {
48
- switch (_context.prev = _context.next) {
49
- case 0:
50
- _context.next = 2;
51
- return externalLinkButtons_helpers.getTagDetailsAndProCoSysData(Object.assign({}, params));
52
-
53
- case 2:
54
- _yield$externalLinkBu = _context.sent;
55
- tagDetails = _yield$externalLinkBu.tagDetails;
56
- proCoSysTag = _yield$externalLinkBu.proCoSysTag;
57
- hasError = _yield$externalLinkBu.hasError;
58
- return _context.abrupt("return", hasError ? undefined : "https://apps.procosys.com/mc/".concat(proCoSysPlantCode, "/").concat(tagDetails === null || tagDetails === void 0 ? void 0 : tagDetails.projectCode, "/Tag/").concat(proCoSysTag === null || proCoSysTag === void 0 ? void 0 : proCoSysTag.id));
59
-
60
- case 7:
61
- case "end":
62
- return _context.stop();
63
- }
64
- }
65
- }, _callee);
66
- }));
67
- }
68
-
69
- return /*#__PURE__*/React__default["default"].createElement(externalLinkButton.ExternalLinkButton, {
70
- buttonName: "Mc App",
71
- buttonIcon: "McApp",
72
- getUrlToOpen: function getUrlToOpen() {
73
- return _tslib.__awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
74
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75
- while (1) {
76
- switch (_context2.prev = _context2.next) {
77
- case 0:
78
- return _context2.abrupt("return", createUrl({
79
- tagNo: tagNo,
80
- instCode: instCode
81
- }));
82
-
83
- case 1:
84
- case "end":
85
- return _context2.stop();
86
- }
87
- }
88
- }, _callee2);
89
- }));
90
- },
91
- buttonStyle: externalLinkButton.ExternalLinkButtonStyle.Rounded
92
- });
93
- };
94
-
95
- exports.ExternalLinkToMcApp = ExternalLinkToMcApp;
@@ -1,84 +0,0 @@
1
- 'use strict';
2
-
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
5
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
-
7
- Object.defineProperty(exports, '__esModule', {
8
- value: true
9
- });
10
-
11
- var _tslib = require('../../../../_virtual/_tslib.js');
12
-
13
- var EchoCore = require('@equinor/echo-core');
14
-
15
- var React = require('react');
16
-
17
- var externalLinkButton = require('../../externalLinkButton/externalLinkButton.js');
18
-
19
- var externalLinkButtons_helpers = require('./externalLinkButtons.helpers.js');
20
-
21
- function _interopDefaultLegacy(e) {
22
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
23
- 'default': e
24
- };
25
- }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
- /**
29
- * External link button to ProCoSys.
30
- *
31
- * @param {string} tagNo The tag's number to open in ProCoSys.
32
- * @param {TagDetailsDto} tagDetails The given tags detailed information.
33
- * @returns {React.FC<ExternalLinkToProCoSysProps>} React component.
34
- */
35
-
36
-
37
- var ExternalLinkToProCoSys = function ExternalLinkToProCoSys(_ref) {
38
- var tagNo = _ref.tagNo,
39
- instCode = _ref.instCode;
40
- var proCoSysPlantCode = EchoCore.useProCoSysPlantId();
41
-
42
- function createUrl(params) {
43
- return _tslib.__awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
44
- var _yield$externalLinkBu, tagDetails, hasError;
45
-
46
- return _regeneratorRuntime().wrap(function _callee$(_context) {
47
- while (1) {
48
- switch (_context.prev = _context.next) {
49
- case 0:
50
- _context.next = 2;
51
- return externalLinkButtons_helpers.getTagDetailsWithErrorHandling({
52
- tagNo: params.tagNo,
53
- instCode: params.instCode
54
- });
55
-
56
- case 2:
57
- _yield$externalLinkBu = _context.sent;
58
- tagDetails = _yield$externalLinkBu.tagDetails;
59
- hasError = _yield$externalLinkBu.hasError;
60
- return _context.abrupt("return", hasError ? undefined : "https://procosys.equinor.com/".concat(proCoSysPlantCode, "/Link/TAG?TagNo=").concat(tagNo, "&project=").concat(tagDetails === null || tagDetails === void 0 ? void 0 : tagDetails.projectCode));
61
-
62
- case 6:
63
- case "end":
64
- return _context.stop();
65
- }
66
- }
67
- }, _callee);
68
- }));
69
- }
70
-
71
- return /*#__PURE__*/React__default["default"].createElement(externalLinkButton.ExternalLinkButton, {
72
- buttonName: "ProCoSys",
73
- buttonIcon: "ProCoSys",
74
- getUrlToOpen: function getUrlToOpen() {
75
- return createUrl({
76
- tagNo: tagNo,
77
- instCode: instCode
78
- });
79
- },
80
- buttonStyle: externalLinkButton.ExternalLinkButtonStyle.Rounded
81
- });
82
- };
83
-
84
- exports.ExternalLinkToProCoSys = ExternalLinkToProCoSys;
@@ -1,38 +0,0 @@
1
- 'use strict';
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, '__esModule', {
6
- value: true
7
- });
8
-
9
- var React = require('react');
10
-
11
- var externalLinkButton = require('../../externalLinkButton/externalLinkButton.js');
12
-
13
- function _interopDefaultLegacy(e) {
14
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
15
- 'default': e
16
- };
17
- }
18
-
19
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
- /**
21
- * External link button to SafeX.
22
- *
23
- * @param {TagSummaryDto} tag The tag to open in SafeX.
24
- * @returns {React.FC<ExternalLinkToSafeXProps>} React component.
25
- */
26
-
27
-
28
- var ExternalLinkToSafeX = function ExternalLinkToSafeX(_ref) {
29
- var tag = _ref.tag;
30
- return /*#__PURE__*/React__default["default"].createElement(externalLinkButton.ExternalLinkButton, {
31
- buttonName: "SafeX",
32
- buttonIcon: "SafeX",
33
- linkTo: "https://safex.equinor.com/search?keyword=".concat(tag.description),
34
- buttonStyle: externalLinkButton.ExternalLinkButtonStyle.Rounded
35
- });
36
- };
37
-
38
- exports.ExternalLinkToSafeX = ExternalLinkToSafeX;