@pega/react-sdk-components 0.23.17 → 0.23.19

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 (165) hide show
  1. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  2. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +20 -3
  3. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  4. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
  5. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +1 -2
  6. package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
  7. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
  8. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +23 -40
  9. package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
  10. package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
  11. package/lib/components/field/AutoComplete/AutoComplete.js +5 -5
  12. package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
  13. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  14. package/lib/components/field/Checkbox/Checkbox.js +5 -5
  15. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  16. package/lib/components/field/Currency/Currency.d.ts.map +1 -1
  17. package/lib/components/field/Currency/Currency.js +21 -6
  18. package/lib/components/field/Currency/Currency.js.map +1 -1
  19. package/lib/components/field/Currency/currency-utils.d.ts +11 -0
  20. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -0
  21. package/lib/components/field/Currency/currency-utils.js +60 -0
  22. package/lib/components/field/Currency/currency-utils.js.map +1 -0
  23. package/lib/components/field/Date/Date.d.ts.map +1 -1
  24. package/lib/components/field/Date/Date.js +17 -6
  25. package/lib/components/field/Date/Date.js.map +1 -1
  26. package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
  27. package/lib/components/field/DateTime/DateTime.js +16 -7
  28. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  29. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  30. package/lib/components/field/Decimal/Decimal.js +5 -5
  31. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  32. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  33. package/lib/components/field/Dropdown/Dropdown.js +5 -5
  34. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  35. package/lib/components/field/Email/Email.js +5 -5
  36. package/lib/components/field/Email/Email.js.map +1 -1
  37. package/lib/components/field/Integer/Integer.d.ts.map +1 -1
  38. package/lib/components/field/Integer/Integer.js +5 -5
  39. package/lib/components/field/Integer/Integer.js.map +1 -1
  40. package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
  41. package/lib/components/field/Percentage/Percentage.js +5 -5
  42. package/lib/components/field/Percentage/Percentage.js.map +1 -1
  43. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  44. package/lib/components/field/Phone/Phone.js +5 -5
  45. package/lib/components/field/Phone/Phone.js.map +1 -1
  46. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  47. package/lib/components/field/RadioButtons/RadioButtons.js +5 -5
  48. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  49. package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
  50. package/lib/components/field/SemanticLink/SemanticLink.js +5 -1
  51. package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
  52. package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
  53. package/lib/components/field/TextArea/TextArea.js +5 -5
  54. package/lib/components/field/TextArea/TextArea.js.map +1 -1
  55. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  56. package/lib/components/field/TextInput/TextInput.js +5 -5
  57. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  58. package/lib/components/field/Time/Time.d.ts.map +1 -1
  59. package/lib/components/field/Time/Time.js +5 -5
  60. package/lib/components/field/Time/Time.js.map +1 -1
  61. package/lib/components/field/URL/URL.d.ts.map +1 -1
  62. package/lib/components/field/URL/URL.js +5 -5
  63. package/lib/components/field/URL/URL.js.map +1 -1
  64. package/lib/components/helpers/authManager.d.ts.map +1 -1
  65. package/lib/components/helpers/authManager.js +1 -0
  66. package/lib/components/helpers/authManager.js.map +1 -1
  67. package/lib/components/helpers/date-format-utils.d.ts +13 -0
  68. package/lib/components/helpers/date-format-utils.d.ts.map +1 -0
  69. package/lib/components/helpers/date-format-utils.js +59 -0
  70. package/lib/components/helpers/date-format-utils.js.map +1 -0
  71. package/lib/components/helpers/event-utils.js +1 -1
  72. package/lib/components/helpers/event-utils.js.map +1 -1
  73. package/lib/components/helpers/formatters/Currency.js +11 -5
  74. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  75. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  76. package/lib/components/helpers/formatters/common.js +6 -1
  77. package/lib/components/helpers/formatters/common.js.map +1 -1
  78. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  79. package/lib/components/helpers/formatters/index.js +4 -0
  80. package/lib/components/helpers/formatters/index.js.map +1 -1
  81. package/lib/components/helpers/template-utils.d.ts +14 -0
  82. package/lib/components/helpers/template-utils.d.ts.map +1 -0
  83. package/lib/components/helpers/template-utils.js +65 -0
  84. package/lib/components/helpers/template-utils.js.map +1 -0
  85. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  86. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +53 -54
  87. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  88. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  89. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +3 -49
  90. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  91. package/lib/components/infra/MultiStep/MultiStep.css +4 -18
  92. package/lib/components/infra/NavBar/NavBar.d.ts +1 -1
  93. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  94. package/lib/components/infra/NavBar/NavBar.js +57 -121
  95. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  96. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  97. package/lib/components/infra/RootContainer/RootContainer.js +0 -50
  98. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  99. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  100. package/lib/components/infra/Stages/Stages.js +1 -2
  101. package/lib/components/infra/Stages/Stages.js.map +1 -1
  102. package/lib/components/infra/View/View.d.ts.map +1 -1
  103. package/lib/components/infra/View/View.js +13 -4
  104. package/lib/components/infra/View/View.js.map +1 -1
  105. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  106. package/lib/components/template/AppShell/AppShell.js +2 -323
  107. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  108. package/lib/components/template/CaseSummary/CaseSummary.js +1 -1
  109. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  110. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  111. package/lib/components/template/CaseView/CaseView.js +2 -3
  112. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  113. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  114. package/lib/components/template/DefaultForm/DefaultForm.js +6 -1
  115. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  116. package/lib/components/template/Details/Details/Details.d.ts +2 -0
  117. package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
  118. package/lib/components/template/Details/Details/Details.js +35 -18
  119. package/lib/components/template/Details/Details/Details.js.map +1 -1
  120. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +12 -1
  121. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
  122. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +43 -27
  123. package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
  124. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +12 -1
  125. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
  126. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +43 -25
  127. package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
  128. package/lib/components/template/ListView/DefaultViewMeta.d.ts +91 -0
  129. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -0
  130. package/lib/components/template/ListView/DefaultViewMeta.js +208 -0
  131. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -0
  132. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  133. package/lib/components/template/ListView/ListView.js +147 -83
  134. package/lib/components/template/ListView/ListView.js.map +1 -1
  135. package/lib/components/template/ListView/hooks.d.ts +2 -0
  136. package/lib/components/template/ListView/hooks.d.ts.map +1 -0
  137. package/lib/components/template/ListView/hooks.js +73 -0
  138. package/lib/components/template/ListView/hooks.js.map +1 -0
  139. package/lib/components/template/ListView/utils.d.ts +63 -0
  140. package/lib/components/template/ListView/utils.d.ts.map +1 -0
  141. package/lib/components/template/ListView/utils.js +537 -0
  142. package/lib/components/template/ListView/utils.js.map +1 -0
  143. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +12 -1
  144. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
  145. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +45 -29
  146. package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
  147. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  148. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -20
  149. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  150. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +12 -1
  151. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
  152. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +45 -29
  153. package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
  154. package/lib/components/widget/Attachment/Attachment.css +7 -0
  155. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  156. package/lib/components/widget/Attachment/Attachment.js +25 -2
  157. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  158. package/lib/components/widget/SummaryItem/SummaryItem.js +1 -1
  159. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  160. package/lib/doc/KeyReleaseUpdates.md +33 -0
  161. package/package.json +1 -1
  162. package/lib/components/template/utils.d.ts +0 -3
  163. package/lib/components/template/utils.d.ts.map +0 -1
  164. package/lib/components/template/utils.js +0 -22
  165. package/lib/components/template/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RootContainer.js","sourceRoot":"","sources":["../../../../src/components/infra/RootContainer/RootContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC/F,kEAAkE;AAClE,OAAO,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,6DAA6D;AAC7D,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,KAAK,MAAM,qBAAqB,CAAC;A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AAM,IAAI,QAAQ,EAAE;QACnB,oDAAoD;QACtD,6EAA6E;QAC7E,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAClD,eAAe;QACf,iBAAiB;QACjB,sEAAsE;QACtE,yBAAyB;QACzB,kBAAkB;QAElB,OAAO,CACL,6BAAK,EAAE,EAAC,gBAAgB;YAEtB,oBAAC,GAAG,IAAC,SAAS,EAAC,QAAQ;gBAAC,oBAAC,gBAAgB,OAAG,CAAM,CAC9C,CACP,CAAC;KACH;SAAM;QACL,eAAe;QACf,iBAAiB;QACjB,iCAAiC;QACjC,mCAAmC;QACnC,sEAAsE;QACtE,kBAAkB;QAClB,OAAO,CACL,6BAAK,EAAE,EAAC,gBAAgB;YACtB,+EAAsD,CAClD,CACP,CAAC;KACH;AACH,CAAC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,aAAa,CAAC,SAAS,GAAG;IACxB,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,aAAa,EAAE,SAAS,CAAC,MAAM;IAC/B,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC;QAC3B,IAAI,EAAE,SAAS,CAAC,MAAM;QACtB,aAAa,EAAE,SAAS,CAAC,KAAK;QAC9B,KAAK,EAAE,SAAS,CAAC,MAAM;KACxB,CAAC;IACF,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAE,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAE,CAAC,CAAC;CACzF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { useMemo, useRef, useState, useEffect, useContext, createElement } from \"react\";\n// import { Banner, ModalManager } from \"@pega/cosmos-react-core\";\nimport PropTypes, { object } from \"prop-types\";\nimport isEqual from 'lodash.isequal';\n// import ReAuthMessageModal from \"../ReAuthenticationModal\";\nimport { Box, CircularProgress } from \"@material-ui/core\";\nimport createPConnectComponent from \"../../../bridge/react_pconnect\";\nimport { LazyMap as LazyComponentMap } from \"../../../components_map\";\nimport StoreContext from \"../../../bridge/Context/StoreContext\";\nimport Utils from '../../helpers/utils';\n\ndeclare const PCore;\n\n//\n// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with\n// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and\n// is totally at your own risk.\n//\n\n\nconst renderingModes = [\"portal\", \"view\"];\n\nfunction usePrevious(value) {\n const ref = useRef(null);\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\nfunction getItemView(routingInfo, renderingMode) {\n const viewConfigs: any = [];\n if (routingInfo && renderingModes.includes(renderingMode)) {\n const { accessedOrder, items }: {accessedOrder: any, items:any } = routingInfo;\n if (accessedOrder && items) {\n const key = accessedOrder[accessedOrder.length - 1];\n if (\n items[key] &&\n items[key].view &&\n !Utils.isEmptyObject(items[key].view)\n ) {\n viewConfigs.push(items[key]);\n }\n }\n }\n return viewConfigs;\n}\n\nconst RootContainer = (props) => {\n const {\n getPConnect,\n renderingMode,\n children,\n skeleton,\n httpMessages,\n routingInfo\n } = props;\n\n const { displayOnlyFA, isMashup } = useContext(StoreContext);\n\n\n const pConn = getPConnect();\n\n const options = { \"context\": \"app\" };\n if (isMashup) {\n options[\"context\"] = \"root\";\n }\n\n // Used for embedded mode\n // let newPConn: any;\n const [componentName, setComponentName] = useState(\"\");\n\n useEffect( () => {\n // debugging/investigation help\n // console.log(`componentName change: ${componentName} triggering a re-render`);\n }, [componentName] );\n\n // debugging/investigation help\n // console.log(`RootContainer props.routingInfo: ${JSON.stringify(routingInfo)}`);\n\n // const bannerRef = useRef(null);\n let hasBanner = false;\n let banners: any = null;\n const messages = httpMessages\n ? httpMessages.map((msg) => msg.message)\n : httpMessages;\n\n hasBanner = messages && messages.length > 0;\n banners = hasBanner && (<div>RootContainer: trying to emit Banner with {messages}</div>);\n // && (\n // <Banner\n // ref={bannerRef}\n // id=\"appShellBanner\"\n // variant=\"urgent\"\n // heading=\"Error\"\n // onDismiss={() =>\n // pConn.clearErrorMessages({\n // category: \"HTTP\",\n // context: \"root\"\n // })\n // }\n // messages={messages}\n // />\n // );\n\n const MemoizedModalViewContainer = useMemo(() => {\n return createElement(\n createPConnectComponent(),\n PCore.createPConnect({\n meta: {\n type: \"ModalViewContainer\",\n config: {\n name: \"modal\"\n }\n },\n options\n })\n );\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const MemoizedPreviewViewContainer = useMemo(() => {\n return createElement(\n createPConnectComponent(),\n PCore.createPConnect({\n meta: {\n type: \"PreviewViewContainer\",\n config: {\n name: \"preview\"\n }\n },\n options\n })\n );\n }, []);\n\n\n //\n function getNoPortalContent() {\n let noPortalContent: any;\n\n switch (componentName) {\n case \"View\":\n noPortalContent = <div>getNoPortalContent: RootContainer wants to render View in noPortal mode</div>\n break;\n\n case \"ViewContainer\": {\n const configProps = pConn.getConfigProps();\n const viewContConfig = {\n \"meta\": {\n \"type\": \"ViewContainer\",\n \"config\": configProps\n },\n options\n };\n const theViewCont = PCore.createPConnect(viewContConfig);\n // Add in displayOnlyFA if prop is on RootContainer\n if (displayOnlyFA) {\n theViewCont[\"displayOnlyFA\"] = true;\n }\n\n const theViewContainerAsReact = createElement(createPConnectComponent(), theViewCont);\n\n noPortalContent = theViewContainerAsReact;\n break;\n }\n\n default:\n noPortalContent = <div>getNoPortalContent: RootContainer wants to render NO componentName in noPortal mode</div>\n break;\n\n }\n\n return noPortalContent;\n }\n\n\n // const rootViewRef: any = useRef(null);\n let rootView : any;\n let rootViewConfig: any = null;\n\n useEffect(() => {\n const { containers } = PCore.getStore().getState();\n const items = Object.keys(containers).filter((item) =>\n item.includes(\"root\")\n );\n PCore.getContainerUtils().getContainerAPI().addContainerItems(items);\n }, [routingInfo]);\n\n // const { store } = useConstellationContext();\n const items: any = getItemView(routingInfo, renderingMode);\n\n if (items.length > 0) {\n rootViewConfig = {\n meta: items[0].view,\n options: {\n context: items[0].context\n }\n };\n }\n const prevRootConfig = usePrevious(rootViewConfig);\n\n if (\n renderingModes.includes(renderingMode) &&\n messages &&\n routingInfo &&\n routingInfo?.accessedOrder.length === 0\n ) {\n return <div id=\"root-container\">{banners}</div>;\n }\n\n if (items.length > 0) {\n const itemView = items[0].view;\n const currentRootConfig = {\n meta: itemView,\n options: {\n context: items[0].context\n }\n };\n\n if (!isEqual(currentRootConfig, prevRootConfig)) {\n rootView = createElement(\n createPConnectComponent(),\n PCore.createPConnect(currentRootConfig)\n );\n }\n\n // interior was\n // <ModalManager>\n // {rootViewRef.current}\n // {MemoisedModalViewContainer}\n // {MemoizedPreviewViewContainer}\n // <ReAuthMessageModal openModal={false} key=\"reauthMessageModel\" />\n // </ModalManager> */}\n\n // debugging/investigation help\n // console.log(`rootView.props.getPConnect().getComponentName(): ${rootView.props.getPConnect().getComponentName()}`);\n\n return (\n <div id=\"ModalManager\">\n {rootView}\n {MemoizedModalViewContainer}\n <div id=\"MemoizedPreviewViewContainer\"></div>\n <div id=\"ReAuthMessageModal\"></div>\n </div>\n );\n\n }\n else if (renderingMode === \"noPortal\") {\n // eslint-disable-next-line no-console\n console.log(`RootContainer rendering in noPortal mode`);\n\n const theChildren = pConn.getChildren();\n if (theChildren && (theChildren.length === 1)) {\n // this.createdPConnect = theChildren[0];\n // this.createdPConnect = null;\n const localPConn = theChildren[0].getPConnect();\n // newPConn = pConn;\n const localCompName = localPConn.getComponentName()\n if (componentName !== localCompName) {\n setComponentName(localCompName);\n }\n }\n\n const noPortalContent = getNoPortalContent();\n\n return noPortalContent;\n }\n else if (children && children.length > 0) {\n // interior was\n // <ModalManager>\n // {httpMessages ? <div id=\"root-container\">{banners}</div> : \"\"}\n // {children}\n // {MemoizedModalViewContainer}\n // <ReAuthMessageModal openModal={false} key=\"reauthMessageModel\" />\n // {MemoizedPreviewViewContainer}\n // </ModalManager>\n\n return (\n <React.Fragment>\n <div>RootContainer: Has children. Trying to show ModalManager with children, etc.</div>\n {children}\n {MemoizedModalViewContainer}\n </React.Fragment>\n\n );\n } else if (skeleton) {\n // TODO: need to update once skeletons are available\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const LoadingComponent = LazyComponentMap[skeleton];\n // interior was\n // <ModalManager>\n // <ReAuthMessageModal openModal={false} key=\"reauthMessageModel\" />\n // <LoadingComponent />\n // </ModalManager>\n\n return (\n <div id=\"root-container\">\n {/* <div>RootContainer: Trying to show skeleton</div> */}\n <Box textAlign=\"center\"><CircularProgress /></Box>\n </div>\n );\n } else {\n // interior was\n // <ModalManager>\n // {MemoisedModalViewContainer}\n // {MemoizedPreviewViewContainer}\n // <ReAuthMessageModal openModal={false} key=\"reauthMessageModel\" />\n // </ModalManager>\n return (\n <div id=\"root-container\">\n <div>RootContainer: Should be ModalManager, etc.</div>\n </div>\n );\n }\n};\n\nRootContainer.defaultProps = {\n getPConnect: null,\n renderingMode: null,\n children: null,\n routingInfo: object\n};\n\nRootContainer.propTypes = {\n getPConnect: PropTypes.func,\n renderingMode: PropTypes.string,\n routingInfo: PropTypes.shape({\n type: PropTypes.string,\n accessedOrder: PropTypes.array,\n items: PropTypes.object\n }),\n children: PropTypes.arrayOf(PropTypes.oneOfType( [PropTypes.object, PropTypes.string ]))\n};\n\nexport default RootContainer;\n"]}
1
+ {"version":3,"file":"RootContainer.js","sourceRoot":"","sources":["../../../../src/components/infra/RootContainer/RootContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC/F,kEAAkE;AAClE,OAAO,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,6DAA6D;AAC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E,EAAC,gBAAgB;YACtB,+EAAsD,CAClD,CACP,CAAC;KACH;AACH,CAAC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,aAAa,CAAC,SAAS,GAAG;IACxB,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,aAAa,EAAE,SAAS,CAAC,MAAM;IAC/B,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC;QAC3B,IAAI,EAAE,SAAS,CAAC,MAAM;QACtB,aAAa,EAAE,SAAS,CAAC,KAAK;QAC9B,KAAK,EAAE,SAAS,CAAC,MAAM;KACxB,CAAC;IACF,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAE,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAE,CAAC,CAAC;CACzF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { useMemo, useRef, useState, useEffect, useContext, createElement } from \"react\";\n// import { Banner, ModalManager } from \"@pega/cosmos-react-core\";\nimport PropTypes, { object } from \"prop-types\";\nimport isEqual from 'lodash.isequal';\n// import ReAuthMessageModal from \"../ReAuthenticationModal\";\nimport { Box, CircularProgress } from \"@material-ui/core\";\nimport createPConnectComponent from \"../../../bridge/react_pconnect\";\nimport { LazyMap as LazyComponentMap } from \"../../../components_map\";\nimport StoreContext from \"../../../bridge/Context/StoreContext\";\nimport Utils from '../../helpers/utils';\n\ndeclare const PCore;\n\n//\n// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with\n// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and\n// is totally at your own risk.\n//\n\n\nconst renderingModes = [\"portal\", \"view\"];\n\nfunction usePrevious(value) {\n const ref = useRef(null);\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\nfunction getItemView(routingInfo, renderingMode) {\n const viewConfigs: any = [];\n if (routingInfo && renderingModes.includes(renderingMode)) {\n const { accessedOrder, items }: {accessedOrder: any, items:any } = routingInfo;\n if (accessedOrder && items) {\n const key = accessedOrder[accessedOrder.length - 1];\n if (\n items[key] &&\n items[key].view &&\n !Utils.isEmptyObject(items[key].view)\n ) {\n viewConfigs.push(items[key]);\n }\n }\n }\n return viewConfigs;\n}\n\nconst RootContainer = (props) => {\n const {\n getPConnect,\n renderingMode,\n children,\n skeleton,\n httpMessages,\n routingInfo\n } = props;\n\n const { displayOnlyFA, isMashup } = useContext(StoreContext);\n\n\n const pConn = getPConnect();\n\n const options = { \"context\": \"app\" };\n if (isMashup) {\n options[\"context\"] = \"root\";\n }\n\n const [componentName, setComponentName] = useState(\"\");\n\n useEffect( () => {\n // debugging/investigation help\n // console.log(`componentName change: ${componentName} triggering a re-render`);\n }, [componentName] );\n\n // debugging/investigation help\n // console.log(`RootContainer props.routingInfo: ${JSON.stringify(routingInfo)}`);\n\n let hasBanner = false;\n let banners: any = null;\n const messages = httpMessages\n ? httpMessages.map((msg) => msg.message)\n : httpMessages;\n\n hasBanner = messages && messages.length > 0;\n banners = hasBanner && (<div>RootContainer: trying to emit Banner with {messages}</div>);\n\n const MemoizedModalViewContainer = useMemo(() => {\n return createElement(\n createPConnectComponent(),\n PCore.createPConnect({\n meta: {\n type: \"ModalViewContainer\",\n config: {\n name: \"modal\"\n }\n },\n options\n })\n );\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const MemoizedPreviewViewContainer = useMemo(() => {\n return createElement(\n createPConnectComponent(),\n PCore.createPConnect({\n meta: {\n type: \"PreviewViewContainer\",\n config: {\n name: \"preview\"\n }\n },\n options\n })\n );\n }, []);\n\n\n //\n function getNoPortalContent() {\n let noPortalContent: any;\n\n switch (componentName) {\n case \"View\":\n noPortalContent = <div>getNoPortalContent: RootContainer wants to render View in noPortal mode</div>\n break;\n\n case \"ViewContainer\": {\n const configProps = pConn.getConfigProps();\n const viewContConfig = {\n \"meta\": {\n \"type\": \"ViewContainer\",\n \"config\": configProps\n },\n options\n };\n const theViewCont = PCore.createPConnect(viewContConfig);\n // Add in displayOnlyFA if prop is on RootContainer\n if (displayOnlyFA) {\n theViewCont[\"displayOnlyFA\"] = true;\n }\n\n const theViewContainerAsReact = createElement(createPConnectComponent(), theViewCont);\n\n noPortalContent = theViewContainerAsReact;\n break;\n }\n\n default:\n noPortalContent = <div>getNoPortalContent: RootContainer wants to render NO componentName in noPortal mode</div>\n break;\n\n }\n\n return noPortalContent;\n }\n\n\n let rootView : any;\n let rootViewConfig: any = null;\n\n useEffect(() => {\n const { containers } = PCore.getStore().getState();\n const items = Object.keys(containers).filter((item) =>\n item.includes(\"root\")\n );\n PCore.getContainerUtils().getContainerAPI().addContainerItems(items);\n }, [routingInfo]);\n\n const items: any = getItemView(routingInfo, renderingMode);\n\n if (items.length > 0) {\n rootViewConfig = {\n meta: items[0].view,\n options: {\n context: items[0].context\n }\n };\n }\n const prevRootConfig = usePrevious(rootViewConfig);\n\n if (\n renderingModes.includes(renderingMode) &&\n messages &&\n routingInfo &&\n routingInfo?.accessedOrder.length === 0\n ) {\n return <div id=\"root-container\">{banners}</div>;\n }\n\n if (items.length > 0) {\n const itemView = items[0].view;\n const currentRootConfig = {\n meta: itemView,\n options: {\n context: items[0].context\n }\n };\n\n if (!isEqual(currentRootConfig, prevRootConfig)) {\n rootView = createElement(\n createPConnectComponent(),\n PCore.createPConnect(currentRootConfig)\n );\n }\n\n // debugging/investigation help\n // console.log(`rootView.props.getPConnect().getComponentName(): ${rootView.props.getPConnect().getComponentName()}`);\n\n return (\n <div id=\"ModalManager\">\n {rootView}\n {MemoizedModalViewContainer}\n <div id=\"MemoizedPreviewViewContainer\"></div>\n <div id=\"ReAuthMessageModal\"></div>\n </div>\n );\n\n }\n else if (renderingMode === \"noPortal\") {\n // eslint-disable-next-line no-console\n console.log(`RootContainer rendering in noPortal mode`);\n\n const theChildren = pConn.getChildren();\n if (theChildren && (theChildren.length === 1)) {\n const localPConn = theChildren[0].getPConnect();\n const localCompName = localPConn.getComponentName()\n if (componentName !== localCompName) {\n setComponentName(localCompName);\n }\n }\n\n const noPortalContent = getNoPortalContent();\n\n return noPortalContent;\n }\n else if (children && children.length > 0) {\n return (\n <React.Fragment>\n <div>RootContainer: Has children. Trying to show ModalManager with children, etc.</div>\n {children}\n {MemoizedModalViewContainer}\n </React.Fragment>\n\n );\n } else if (skeleton) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const LoadingComponent = LazyComponentMap[skeleton];\n\n return (\n <div id=\"root-container\">\n {/* <div>RootContainer: Trying to show skeleton</div> */}\n <Box textAlign=\"center\"><CircularProgress /></Box>\n </div>\n );\n } else {\n return (\n <div id=\"root-container\">\n <div>RootContainer: Should be ModalManager, etc.</div>\n </div>\n );\n }\n};\n\nRootContainer.defaultProps = {\n getPConnect: null,\n renderingMode: null,\n children: null,\n routingInfo: object\n};\n\nRootContainer.propTypes = {\n getPConnect: PropTypes.func,\n renderingMode: PropTypes.string,\n routingInfo: PropTypes.shape({\n type: PropTypes.string,\n accessedOrder: PropTypes.array,\n items: PropTypes.object\n }),\n children: PropTypes.arrayOf(PropTypes.oneOfType( [PropTypes.object, PropTypes.string ]))\n};\n\nexport default RootContainer;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Stages.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/Stages/Stages.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,YAAY,CAAC;AAwDnC,iBAAwB,MAAM,CAAC,KAAK,KAAA,eAwDnC;kBAxDuB,MAAM;;;;;;eAAN,MAAM"}
1
+ {"version":3,"file":"Stages.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/Stages/Stages.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAwDnC,iBAAwB,MAAM,CAAC,KAAK,KAAA,eAwDnC;kBAxDuB,MAAM;;;;;;eAAN,MAAM"}
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- // import { Stages as CosmosStages } from "@pega/cosmos-react-work";
3
2
  import PropTypes from "prop-types";
4
3
  import { Breadcrumbs, Card, Typography } from "@material-ui/core";
5
4
  import DoubleArrowIcon from '@material-ui/icons/DoubleArrow';
@@ -43,7 +42,7 @@ function getFilteredStages(stages) {
43
42
  return stages.filter((stage) => stage.type !== "Alternate" ||
44
43
  (stage.type === "Alternate" && stage.visited_status === "active"));
45
44
  }
46
- /* TODO - this component should be refactored and not exposed as top level Nebula component -
45
+ /* TODO - this component should be refactored and not exposed as top level DX Component -
47
46
  the stages should be created as part of the CaseView */
48
47
  export default function Stages(props) {
49
48
  const classes = useStyles();
@@ -1 +1 @@
1
- {"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../../src/components/infra/Stages/Stages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,oEAAoE;AACpE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAC7D,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QACJ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5B,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,UAAU,E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Y,QAAQ,EAAC,SAAS,EAAE,oBAAC,eAAe,IAAC,SAAS,EAAE,OAAO,CAAC,aAAa,GAAI,IACrG,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7B,OAAO,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CACU,CAAA;IAChB,CAAC;IAED,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,IAItC,SAAS,CAAC,SAAS,CAAC,CAChB,CACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,SAAS,GAAG;IACjB,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,UAAU;CACvD,CAAC","sourcesContent":["import React from \"react\";\n// import { Stages as CosmosStages } from \"@pega/cosmos-react-work\";\nimport PropTypes from \"prop-types\";\nimport { Breadcrumbs, Card, Typography } from \"@material-ui/core\";\nimport DoubleArrowIcon from '@material-ui/icons/DoubleArrow';\nimport DoneIcon from '@material-ui/icons/Done';\nimport { makeStyles } from '@material-ui/core/styles';\n\ndeclare const PCore: any;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n completedStage: {\n color: theme.palette.text.primary,\n },\n currentStage: {\n color: theme.palette.info.dark,\n fontWeight: 600,\n },\n futureStage: {\n color: theme.palette.text.secondary,\n },\n separatorIcon: {\n color: theme.palette.text.disabled,\n }\n\n}));\n\n\n/**\n * API to filter out the alternate stages which are not in active and return all other stages\n * @param {Array} stages - Stages of a case type\n *\n * @returns {Array} - Returns stages which are non alternate stages and alternate stage which is active.\n */\nfunction getFilteredStages(stages) {\n if (!Array.isArray(stages)) {\n return [];\n }\n\n return stages.filter(\n (stage) =>\n stage.type !== \"Alternate\" ||\n (stage.type === \"Alternate\" && stage.visited_status === \"active\")\n );\n}\n\n/* TODO - this component should be refactored and not exposed as top level Nebula component -\n the stages should be created as part of the CaseView */\nexport default function Stages(props) {\n const classes = useStyles();\n\n const { getPConnect, stages } = props;\n const pConn = getPConnect();\n\n const filteredStages = getFilteredStages(stages);\n const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID);\n const stagesObj = filteredStages.map((stage, index, arr) => {\n const theID = stage.ID || stage.id;\n return {\n name: stage.name,\n id: theID,\n complete: stage.visited_status === \"completed\",\n current: (theID === currentStageID),\n last: (index === arr.length - 1),\n };\n });\n\n // debugging/investigation help\n // console.log(`Stages: current: ${currentStageID} stagesObj: ${JSON.stringify(stagesObj)}`);\n\n function getStage(stage, index) {\n // Removing nested ternary for lint\n // const theClass = stage.current ? classes.currentStage : (stage.complete ? classes.completedStage : classes.futureStage);\n let theClass;\n if (stage.current) {\n theClass = classes.currentStage;\n } else if (stage.complete) {\n theClass = classes.completedStage;\n } else {\n theClass = classes.futureStage;\n }\n\n return <span key={index}>\n {stage.complete ? <DoneIcon color=\"disabled\" fontSize=\"small\" /> : null}\n <Typography variant=\"h5\" component=\"span\" display=\"inline\" className={theClass}>{stage.name}</Typography>\n </span>;\n }\n\n function getStages(inStages) {\n return <Breadcrumbs aria-label=\"stages\" separator={<DoubleArrowIcon className={classes.separatorIcon} />}>\n {inStages.map((stage, index) => {\n return getStage(stage, index);\n })}\n </Breadcrumbs>\n }\n\n return (\n <Card id=\"Stages\" className={classes.root}>\n {/* Stages<br />\n currentStageID: {currentStageID}<br />\n {JSON.stringify(stagesObj)}<br /><br /> */}\n {getStages(stagesObj)}\n </Card>\n )\n}\n\nStages.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n stages: PropTypes.arrayOf(PropT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AU;IACtC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,UAAU;CACvD,CAAC","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Breadcrumbs, Card, Typography } from \"@material-ui/core\";\nimport DoubleArrowIcon from '@material-ui/icons/DoubleArrow';\nimport DoneIcon from '@material-ui/icons/Done';\nimport { makeStyles } from '@material-ui/core/styles';\n\ndeclare const PCore: any;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n completedStage: {\n color: theme.palette.text.primary,\n },\n currentStage: {\n color: theme.palette.info.dark,\n fontWeight: 600,\n },\n futureStage: {\n color: theme.palette.text.secondary,\n },\n separatorIcon: {\n color: theme.palette.text.disabled,\n }\n\n}));\n\n\n/**\n * API to filter out the alternate stages which are not in active and return all other stages\n * @param {Array} stages - Stages of a case type\n *\n * @returns {Array} - Returns stages which are non alternate stages and alternate stage which is active.\n */\nfunction getFilteredStages(stages) {\n if (!Array.isArray(stages)) {\n return [];\n }\n\n return stages.filter(\n (stage) =>\n stage.type !== \"Alternate\" ||\n (stage.type === \"Alternate\" && stage.visited_status === \"active\")\n );\n}\n\n/* TODO - this component should be refactored and not exposed as top level DX Component -\n the stages should be created as part of the CaseView */\nexport default function Stages(props) {\n const classes = useStyles();\n\n const { getPConnect, stages } = props;\n const pConn = getPConnect();\n\n const filteredStages = getFilteredStages(stages);\n const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID);\n const stagesObj = filteredStages.map((stage, index, arr) => {\n const theID = stage.ID || stage.id;\n return {\n name: stage.name,\n id: theID,\n complete: stage.visited_status === \"completed\",\n current: (theID === currentStageID),\n last: (index === arr.length - 1),\n };\n });\n\n // debugging/investigation help\n // console.log(`Stages: current: ${currentStageID} stagesObj: ${JSON.stringify(stagesObj)}`);\n\n function getStage(stage, index) {\n // Removing nested ternary for lint\n // const theClass = stage.current ? classes.currentStage : (stage.complete ? classes.completedStage : classes.futureStage);\n let theClass;\n if (stage.current) {\n theClass = classes.currentStage;\n } else if (stage.complete) {\n theClass = classes.completedStage;\n } else {\n theClass = classes.futureStage;\n }\n\n return <span key={index}>\n {stage.complete ? <DoneIcon color=\"disabled\" fontSize=\"small\" /> : null}\n <Typography variant=\"h5\" component=\"span\" display=\"inline\" className={theClass}>{stage.name}</Typography>\n </span>;\n }\n\n function getStages(inStages) {\n return <Breadcrumbs aria-label=\"stages\" separator={<DoubleArrowIcon className={classes.separatorIcon} />}>\n {inStages.map((stage, index) => {\n return getStage(stage, index);\n })}\n </Breadcrumbs>\n }\n\n return (\n <Card id=\"Stages\" className={classes.root}>\n {/* Stages<br />\n currentStageID: {currentStageID}<br />\n {JSON.stringify(stagesObj)}<br /><br /> */}\n {getStages(stagesObj)}\n </Card>\n )\n}\n\nStages.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n stages: PropTypes.arrayOf(PropTypes.object).isRequired\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAWnC,OAAO,YAAY,CAAC;AASpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,eAuGjC;kBAvGuB,IAAI;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
1
+ {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAWnC,OAAO,YAAY,CAAC;AAkBpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,eAqGjC;kBArGuB,IAAI;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  // import { LazyMap as LazyComponentMap } from "../../components_map";
5
5
  import { SdkComponentMap } from '../../../bridge/helpers/sdk_component_map';
6
6
  import ErrorBoundary from '../ErrorBoundary';
7
- import { getAllFields } from '../../template/utils';
7
+ import { getAllFields } from '../../helpers/template-utils';
8
8
  // Need to import any templates that we might render
9
9
  import './View.css';
10
10
  //
@@ -13,6 +13,15 @@ import './View.css';
13
13
  // is totally at your own risk.
14
14
  //
15
15
  const FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide'];
16
+ const NO_HEADER_TEMPLATES = [
17
+ 'SubTabs',
18
+ 'SimpleTable',
19
+ 'Details',
20
+ 'DetailsTwoColumn',
21
+ 'DetailsThreeColumn',
22
+ 'NarrowWideDetails',
23
+ 'WideNarrowDetails'
24
+ ];
16
25
  export default function View(props) {
17
26
  const { children, template, getPConnect, mode } = props;
18
27
  let { label, showLabel = false } = props;
@@ -51,7 +60,7 @@ export default function View(props) {
51
60
  ViewTemplate = ErrorBoundary;
52
61
  }
53
62
  }
54
- if (template === "ListView") {
63
+ if (template === 'ListView') {
55
64
  // special case for ListView - add in a prop
56
65
  const bInForm = true;
57
66
  props = { ...props, bInForm };
@@ -78,7 +87,7 @@ export default function View(props) {
78
87
  /* name */ id: 'label', style: { marginBlockStart: '1rem' }, className: 'grid-column' }, RenderedTemplate));
79
88
  }
80
89
  return (React.createElement("div", { className: 'grid-column' },
81
- showLabel && template !== 'SubTabs' && template !== 'SimpleTable' && template !== 'Details' && (React.createElement("div", { className: 'template-title-container' },
90
+ showLabel && !NO_HEADER_TEMPLATES.includes(template) && (React.createElement("div", { className: 'template-title-container' },
82
91
  React.createElement("span", null, label))),
83
92
  RenderedTemplate));
84
93
  }
@@ -108,7 +117,7 @@ View.propTypes = {
108
117
  mode: PropTypes.string,
109
118
  title: PropTypes.string
110
119
  };
111
- // Adapted from Nebula/Constellation to add in additional props for some templates
120
+ // Adapted from Constellation DX Component to add in additional props for some templates
112
121
  View.additionalProps = (state, getPConnect) => {
113
122
  const thePConn = getPConnect();
114
123
  const { template } = thePConn.getConfigProps();
@@ -1 +1 @@
1
- {"version":3,"file":"View.js","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,wDAAwD;AACxD,sEAAsE;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,oDAAoD;AAEpD,OAAO,YAAY,CAAC;AACpB,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAAE;AAEF,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAE5F,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK;IAChC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACxD,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAEzC,0HAA0H;IAC1H,gFAAgF;IAEhF,MAAM,cAAc,GAAG,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC;IACzD,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,KAAK,CAAC;IACtC,SAAS,GAAG,cAAc,CAAC,SAAS,IAAI,SAAS,CAAC;IAElD,MAAM,kBAAkB,GAAG,IAAI,KAAK,UAAU,CAAC,CAAC,mFAAmF;IACnI,IAAI,kBAAkB,IAAI,SAAS,KAAK,SAAS,EAAE;QACjD,SAAS,GAAG,IAAI,CAAC;KAClB;IAED,qEAAqE;IACrE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F,kFAAkF;AAClF,IAAI,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAE/C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,QAAQ,QAAQ,EAAE;QAChB,KAAK,aAAa;YAChB,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnC,gDAAgD;YAChD,MAAM,WAAW,GAAG;gBAClB,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;gBAC3B,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;aAC9B,CAAC;YACF,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM;QAER,KAAK,SAAS;YACZ,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,MAAM;QAER;YACE,MAAM;KACT;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n// import { FieldGroup } from \"@pega/cosmos-react-core\";\n// import { LazyMap as LazyComponentMap } from \"../../components_map\";\n\nimport { SdkComponentMap } from '../../../bridge/helpers/sdk_component_map';\nimport ErrorBoundary from '../ErrorBoundary';\n\nimport { getAllFields } from '../../template/utils';\n\n// Need to import any templates that we might render\n\nimport './View.css';\n//\n// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with\n// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and\n// is totally at your own risk.\n//\n\nconst FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide'];\n\nexport default function View(props) {\n const { children, template, getPConnect, mode } = props;\n let { label, showLabel = false } = props;\n\n // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views\n // Putting this logic here instead of copy/paste in every Form template index.js\n\n const inheritedProps = getPConnect().getInheritedProps();\n label = inheritedProps.label || label;\n showLabel = inheritedProps.showLabel || showLabel;\n\n const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible\n if (isEmbeddedDataView && showLabel === undefined) {\n showLabel = true;\n }\n\n // As long as the template is defined in the dependencies of the view\n // it will be loaded, otherwise fall back to single column\n // JA - React SDK not using LazyComponentMap yet\n if (template /* && LazyComponentMap[template] */) {\n // const ViewTemplate = LazyComponentMap[template];\n let ViewTemplate: any;\n\n if (SdkComponentMap) {\n // This is the node_modules version of react_pconnect!\n const theLocalComponent = SdkComponentMap.getLocalComponentMap()[template];\n if ( theLocalComponent !== undefined) {\n // eslint-disable-next-line no-console\n console.log(`View component found ${template}: Local`);\n ViewTemplate = theLocalComponent\n } else {\n const thePegaProvidedComponent = SdkComponentMap.getPegaProvidedComponentMap()[template];\n if ( thePegaProvidedComponent !== undefined) {\n // console.log(`View component found ${template}: Pega-provided`);\n ViewTemplate = thePegaProvidedComponent;\n } else {\n // eslint-disable-next-line no-console\n console.error(`View component can't find template type ${template}`);\n ViewTemplate = ErrorBoundary;\n }\n }\n\n if (template === \"ListView\") {\n // special case for ListView - add in a prop\n const bInForm = true;\n props = { ...props, bInForm};\n }\n } else {\n\n // eslint-disable-next-line no-console\n console.warn(`View: SdkComponentMap expected but not found.`)\n\n // eslint-disable-next-line no-console\n console.error(`View: Trying to render an unknown template: ${template}`);\n\n }\n\n // for debugging/investigation\n // console.log(`View rendering template: ${template}`);\n\n // spreading because all props should go to the template\n let RenderedTemplate = <ViewTemplate {...props}>{children}</ViewTemplate>;\n\n if (FORMTEMPLATES.includes(template) && showLabel) {\n // Original:\n // RenderedTemplate = (\n // <FieldGroup name={label} style={{ marginBlockStart: \"1rem\" }}>\n // {RenderedTemplate}\n // </FieldGroup>\n // );\n RenderedTemplate = (\n <div\n data-name='RenderedTemplate'\n data-template-type={template}\n /* name */ id='label'\n style={{ marginBlockStart: '1rem' }}\n className='grid-column'\n >\n {RenderedTemplate}\n </div>\n );\n }\n\n return (\n <div className='grid-column'>\n {showLabel && template !== 'SubTabs' && template !== 'SimpleTable' && template !== 'Details' && (\n <div className='template-title-container'>\n <span>{label}</span>\n </div>\n )}\n {RenderedTemplate}\n </div>\n );\n }\n\n // debugging/investigation help\n // console.log(`View about to render React.Fragment for children: ${children}`);\n\n if (children) {\n return <>{children}</>;\n } else {\n return <div id='View'>View has no children.</div>;\n }\n}\n\nView.defaultProps = {\n label: undefined,\n showLabel: undefined,\n mode: undefined\n};\n\nView.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.array\n ]) /* array might be empty */,\n template: PropTypes.string /* .isRequired */,\n getPConnect: PropTypes.func.isRequired,\n label: PropTypes.string,\n showLabel: PropTypes.bool,\n mode: PropTypes.string,\n title: PropTypes.string\n};\n\n// Adapted from Nebula/Constellation to add in additional props for some templates\nView.additionalProps = (state, getPConnect) => {\n const thePConn = getPConnect();\n const { template } = thePConn.getConfigProps();\n\n let propObj = {};\n let allFields = {};\n\n switch (template) {\n case 'CaseSummary':\n allFields = getAllFields(thePConn);\n // eslint-disable-next-line no-case-declarations\n const unresFields = {\n primaryFields: allFields[0],\n secondaryFields: allFields[1]\n };\n propObj = thePConn.resolveConfigProps(unresFields);\n break;\n\n case 'Details':\n allFields = getAllFields(thePConn);\n propObj = { fields: allFields[0] };\n break;\n\n default:\n break;\n }\n\n return propObj;\n};\n"]}
1
+ {"version":3,"file":"View.js","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,wDAAwD;AACxD,sEAAsE;AAEtE,OAAO,EAAE,eAAe,EAA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;IACjB,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,QAAQ,QAAQ,EAAE;QAChB,KAAK,aAAa;YAChB,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnC,gDAAgD;YAChD,MAAM,WAAW,GAAG;gBAClB,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;gBAC3B,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;aAC9B,CAAC;YACF,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM;QAER,KAAK,SAAS;YACZ,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,MAAM;QAER;YACE,MAAM;KACT;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n// import { FieldGroup } from \"@pega/cosmos-react-core\";\n// import { LazyMap as LazyComponentMap } from \"../../components_map\";\n\nimport { SdkComponentMap } from '../../../bridge/helpers/sdk_component_map';\nimport ErrorBoundary from '../ErrorBoundary';\n\nimport { getAllFields } from '../../helpers/template-utils';\n\n// Need to import any templates that we might render\n\nimport './View.css';\n//\n// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with\n// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and\n// is totally at your own risk.\n//\n\nconst FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide'];\nconst NO_HEADER_TEMPLATES = [\n 'SubTabs',\n 'SimpleTable',\n 'Details',\n 'DetailsTwoColumn',\n 'DetailsThreeColumn',\n 'NarrowWideDetails',\n 'WideNarrowDetails'\n];\n\nexport default function View(props) {\n const { children, template, getPConnect, mode } = props;\n let { label, showLabel = false } = props;\n\n // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views\n // Putting this logic here instead of copy/paste in every Form template index.js\n\n const inheritedProps = getPConnect().getInheritedProps();\n label = inheritedProps.label || label;\n showLabel = inheritedProps.showLabel || showLabel;\n\n const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible\n if (isEmbeddedDataView && showLabel === undefined) {\n showLabel = true;\n }\n\n // As long as the template is defined in the dependencies of the view\n // it will be loaded, otherwise fall back to single column\n // JA - React SDK not using LazyComponentMap yet\n if (template /* && LazyComponentMap[template] */) {\n // const ViewTemplate = LazyComponentMap[template];\n let ViewTemplate: any;\n\n if (SdkComponentMap) {\n // This is the node_modules version of react_pconnect!\n const theLocalComponent = SdkComponentMap.getLocalComponentMap()[template];\n if (theLocalComponent !== undefined) {\n // eslint-disable-next-line no-console\n console.log(`View component found ${template}: Local`);\n ViewTemplate = theLocalComponent;\n } else {\n const thePegaProvidedComponent = SdkComponentMap.getPegaProvidedComponentMap()[template];\n if (thePegaProvidedComponent !== undefined) {\n // console.log(`View component found ${template}: Pega-provided`);\n ViewTemplate = thePegaProvidedComponent;\n } else {\n // eslint-disable-next-line no-console\n console.error(`View component can't find template type ${template}`);\n ViewTemplate = ErrorBoundary;\n }\n }\n\n if (template === 'ListView') {\n // special case for ListView - add in a prop\n const bInForm = true;\n props = { ...props, bInForm };\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(`View: SdkComponentMap expected but not found.`);\n\n // eslint-disable-next-line no-console\n console.error(`View: Trying to render an unknown template: ${template}`);\n }\n\n // for debugging/investigation\n // console.log(`View rendering template: ${template}`);\n\n // spreading because all props should go to the template\n let RenderedTemplate = <ViewTemplate {...props}>{children}</ViewTemplate>;\n\n if (FORMTEMPLATES.includes(template) && showLabel) {\n // Original:\n // RenderedTemplate = (\n // <FieldGroup name={label} style={{ marginBlockStart: \"1rem\" }}>\n // {RenderedTemplate}\n // </FieldGroup>\n // );\n RenderedTemplate = (\n <div\n data-name='RenderedTemplate'\n data-template-type={template}\n /* name */ id='label'\n style={{ marginBlockStart: '1rem' }}\n className='grid-column'\n >\n {RenderedTemplate}\n </div>\n );\n }\n\n return (\n <div className='grid-column'>\n {showLabel && !NO_HEADER_TEMPLATES.includes(template) && (\n <div className='template-title-container'>\n <span>{label}</span>\n </div>\n )}\n {RenderedTemplate}\n </div>\n );\n }\n\n // debugging/investigation help\n // console.log(`View about to render React.Fragment for children: ${children}`);\n\n if (children) {\n return <>{children}</>;\n } else {\n return <div id='View'>View has no children.</div>;\n }\n}\n\nView.defaultProps = {\n label: undefined,\n showLabel: undefined,\n mode: undefined\n};\n\nView.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.array\n ]) /* array might be empty */,\n template: PropTypes.string /* .isRequired */,\n getPConnect: PropTypes.func.isRequired,\n label: PropTypes.string,\n showLabel: PropTypes.bool,\n mode: PropTypes.string,\n title: PropTypes.string\n};\n\n// Adapted from Constellation DX Component to add in additional props for some templates\nView.additionalProps = (state, getPConnect) => {\n const thePConn = getPConnect();\n const { template } = thePConn.getConfigProps();\n\n let propObj = {};\n let allFields = {};\n\n switch (template) {\n case 'CaseSummary':\n allFields = getAllFields(thePConn);\n // eslint-disable-next-line no-case-declarations\n const unresFields = {\n primaryFields: allFields[0],\n secondaryFields: allFields[1]\n };\n propObj = thePConn.resolveConfigProps(unresFields);\n break;\n\n case 'Details':\n allFields = getAllFields(thePConn);\n propObj = { fields: allFields[0] };\n break;\n\n default:\n break;\n }\n\n return propObj;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../../src/components/template/AppShell/AppShell.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAenC,OAAO,gBAAgB,CAAC;AAyBxB,iBAAwB,QAAQ,CAAC,KAAK,KAAA,eA0XrC;kBA1XuB,QAAQ;;;;;;;;;;;;;;eAAR,QAAQ"}
1
+ {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../../src/components/template/AppShell/AppShell.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,gBAAgB,CAAC;AAqBxB,iBAAwB,QAAQ,CAAC,KAAK,KAAA,eAyDrC;kBAzDuB,QAAQ;;;;;;;;;;;;;;eAAR,QAAQ"}
@@ -2,16 +2,8 @@ import React, { useEffect, useState } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
  import { NavContext } from '../../helpers/reactContextHelpers';
5
- // import {
6
- // Avatar,
7
- // Toaster,
8
- // Banner,
9
- // AppShell as CosmosAppShell
10
- // } from "@pega/cosmos-react-core";
11
- // import createPConnectComponent from "../../../bridge/react_pconnect";
12
- // import { buildRecentList, onRecentClickHandler } from "./Recents/utils";
13
5
  import './AppShell.css';
14
- // AppShell can emit NavBar and ViewContainer
6
+ // AppShell can emit NavBar
15
7
  import NavBar from '../../infra/NavBar';
16
8
  const useStyles = makeStyles((theme) => ({
17
9
  root: {
@@ -25,286 +17,13 @@ const useStyles = makeStyles((theme) => ({
25
17
  marginRight: theme.spacing(2),
26
18
  },
27
19
  }));
28
- /*
29
- * The wrapper handles knowing how to take in just children and mapping
30
- * to the Cosmos template. This could be a combination of things but it knows...
31
- */
32
20
  export default function AppShell(props) {
33
21
  const { pages, caseTypes, showAppName, children, getPConnect, } = props;
34
22
  const [open, setOpen] = useState(true);
35
23
  const pConn = getPConnect();
36
- // const actionsAPI = pConn.getActionsApi();
37
24
  const envInfo = PCore.getEnvironmentInfo();
38
- // const bannerRef = useRef(null);
39
- // const hasBanner = httpMessages && httpMessages.length ? httpMessages.length > 0 : false;
40
25
  const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : "";
41
26
  const classes = useStyles();
42
- // let banners = null;
43
- // banners = hasBanner && (
44
- // <Banner
45
- // ref={bannerRef}
46
- // id="appShellBanner"
47
- // variant="urgent"
48
- // heading="Error"
49
- // onDismiss={() =>
50
- // pConn.clearErrorMessages({
51
- // category: "HTTP",
52
- // context: null
53
- // })
54
- // }
55
- // messages={httpMessages}
56
- // />
57
- // );
58
- // useEffect(() => {
59
- // if (hasBanner && bannerRef.current) {
60
- // bannerRef.current.focus();
61
- // window.scrollTo(0, bannerRef.current.offsetTop);
62
- // }
63
- // }, [hasBanner]);
64
- /**
65
- *
66
- * Function to dispatch a show page action for the page links in
67
- * the left nav of the app shell
68
- *
69
- * @param {string} searchString Name of view to show
70
- */
71
- // function showSearchResults(searchString) {
72
- // if (searchString === "") {
73
- // actionsAPI.showPage("pySearchPage", "Data-Portal");
74
- // return;
75
- // }
76
- // const searchTerm = searchString.replace(/['"]+/g, "");
77
- // PCore.getDataApiUtils()
78
- // .getData(
79
- // "D_pySearch",
80
- // `{"dataViewParameters": {"SearchString": "${encodeURIComponent(
81
- // searchTerm
82
- // )}"}}`
83
- // )
84
- // .then((response) => {
85
- // if (
86
- // response.data.data !== null &&
87
- // response.data.resultCount === 1 &&
88
- // response.data.data[0].pyID === searchTerm
89
- // ) {
90
- // /* This is a match for a work item - then we will open it */
91
- // pConn
92
- // .getActionsApi()
93
- // .openWorkByHandle(
94
- // response.data.data[0].pzInsKey,
95
- // response.data.data[0].pzCategoryActionKeys
96
- // );
97
- // return;
98
- // }
99
- // // window.searchResults = {
100
- // // searchString: searchTerm,
101
- // // results: response.data
102
- // // };
103
- // actionsAPI.showPage("pySearchPage", "Data-Portal");
104
- // });
105
- // }
106
- /**
107
- *
108
- * Function to dispatch a show page action for the page links in
109
- * the left nav of the app shell
110
- *
111
- * @param {string} viewName Name of view to show
112
- * @param {string} className Pega Applies to class of the page
113
- */
114
- // function showPage(viewName, className) {
115
- // actionsAPI.showPage(viewName, className);
116
- // }
117
- /**
118
- *
119
- * Function to dispatch a create work action
120
- * @param {string} className - placeholder string of case type being created
121
- */
122
- // function createWork(className) {
123
- // actionsAPI
124
- // .createWork(className)
125
- // .catch((error) =>
126
- // // eslint-disable-next-line no-console
127
- // console.log("Error in case creation: ", error?.message)
128
- // );
129
- // }
130
- /**
131
- * Returns the Custome Component for each active case
132
- */
133
- // const VisualComponent = useCallback(
134
- // (context) => {
135
- // if (activeCases && activeCases.length > 0) {
136
- // const meta = PCore.getViewResources().fetchViewResources(
137
- // "pyCaseVisual",
138
- // getPConnect(),
139
- // PCore.getStoreValue(".caseTypeID", "caseInfo", context)
140
- // );
141
- // if (meta?.config && !meta.config.defaultVisual) {
142
- // const config = {
143
- // meta,
144
- // options: {
145
- // context,
146
- // pageReference: "caseInfo.content"
147
- // }
148
- // };
149
- // const visualConfig = PCore.createPConnect(config);
150
- // return React.createElement(createPConnectComponent(), visualConfig);
151
- // }
152
- // }
153
- // return undefined;
154
- // },
155
- // [getPConnect, activeCases]
156
- // );
157
- /**
158
- * Transforms the active cases information into the model that cosmos expect.
159
- */
160
- // function getActiveCases() {
161
- // if (activeCases) {
162
- // const activeCaseLinks = [];
163
- // activeCases.forEach((activeCase) => {
164
- // const { caseID, className, workID, active, context } = activeCase;
165
- // // activeCaseLinks.push({
166
- // // onDismiss: () => {
167
- // // PCore.getContainerUtils().closeContainerItem(
168
- // // activeCase.containerItemID
169
- // // );
170
- // // },
171
- // // key: caseID,
172
- // // name: caseID,
173
- // // onClick: () => {
174
- // // actionsAPI.openWorkByHandle(workID, className);
175
- // // },
176
- // // active,
177
- // // visual: VisualComponent(context)
178
- // // });
179
- // });
180
- // return activeCaseLinks;
181
- // }
182
- // return activeCases;
183
- // }
184
- /**
185
- * Translate Pega Data Page into the model that Cosmos expects
186
- *
187
- * Example:
188
- * pxPageViewIcon: "pi pi-home-solid"
189
- * pxURLPath: "Home"
190
- * pyClassName: "Data-Portal"
191
- * pyLabel: "Home"
192
- * pyRuleName: "pyHome"
193
- */
194
- // const links = !pages
195
- // ? []
196
- // : pages.map((page) => {
197
- // return {
198
- // name: page.pyLabel,
199
- // icon: page.pxPageViewIcon.replace("pi pi-", ""),
200
- // onClick: () => showPage(page.pyRuleName, page.pyClassName)
201
- // };
202
- // });
203
- // const userName = envInfo.getOperatorName();
204
- // const imageKey = envInfo.getOperatorImageInsKey();
205
- // const logOffAction = () => {
206
- // actionsAPI.logout().then(() => window?.top?.location?.reload());
207
- // };
208
- // const getOperator = () => {
209
- // const operatorActions = [
210
- // [{ text: "Logoff", id: "1", onClick: logOffAction }]
211
- // ];
212
- // if (imageKey) {
213
- // return {
214
- // avatar: (
215
- // <div id="AvatarWithImageKey">Avatar with image key</div>
216
- // // <Avatar
217
- // // name={userName}
218
- // // imageSrc={getPConnect().getImagePath(imageKey)}
219
- // // />
220
- // ),
221
- // actions: operatorActions,
222
- // name: userName
223
- // };
224
- // }
225
- // return {
226
- // avatar: (
227
- // <div id="Avatar">Avatar</div>
228
- // // <Avatar name={userName}>
229
- // // {userName
230
- // // .split(" ")
231
- // // .map((i) => i.charAt(0))
232
- // // .join("")
233
- // // .toUpperCase()}
234
- // // </Avatar>
235
- // ),
236
- // actions: operatorActions,
237
- // name: userName
238
- // };
239
- // };
240
- /**
241
- * Translate Case Types page into what is expected by Cosmos
242
- *
243
- * Example:
244
- * pyClassName: ""
245
- * pyFlowType: ""
246
- * pyLabel: "No case types defined"
247
- */
248
- // const cases = !caseTypes
249
- // ? []
250
- // : caseTypes.map((caseType) => {
251
- // let action = {};
252
- // // Only add actions to entries with a class name to create so in case of empty message no action is added
253
- // if (caseType.pyClassName) {
254
- // action = { onClick: () => createWork(caseType.pyClassName) };
255
- // }
256
- // return {
257
- // name: caseType.pyLabel,
258
- // ...action
259
- // };
260
- // });
261
- // const [recents, setRecents] = useState([]);
262
- // const [searchVal, setSearchVal] = useState("");
263
- // // default the icon to be empty. This will cause the image to be initially broken.
264
- // const [iconURL, setIconURL] = useState("");
265
- // useEffect(() => {
266
- // // using the default icon then fetch it from the static folder (not auth involved)
267
- // if (
268
- // !portalLogo ||
269
- // portalLogo.toLowerCase().includes("pzpega-logo-mark") ||
270
- // portalLogo.toLowerCase().includes("py-logo")
271
- // ) {
272
- // setIconURL(
273
- // `${PCore.getAssetLoader().getStaticServerUrl()}static/py-logo.svg`
274
- // );
275
- // }
276
- // // not using default icon to fetch it using the way which uses authentication
277
- // else {
278
- // PCore.getAssetLoader()
279
- // .getSvcImage(portalLogo)
280
- // .then((data) => {
281
- // setIconURL(window.URL.createObjectURL(data));
282
- // })
283
- // .catch(() => {
284
- // console.error(
285
- // `Unable to load the image for the portal logo/icon with the insName:${portalLogo}`
286
- // );
287
- // });
288
- // }
289
- // }, [portalLogo]);
290
- /**
291
- * To fetch recents and translate items into what Cosmos expects
292
- */
293
- // const fetchRecents = () => {
294
- // actionsAPI.getRecents(15).then((response) => {
295
- // const recentsitems = response.data.recents;
296
- // // setRecents(buildRecentList(recentsitems));
297
- // });
298
- // };
299
- /**
300
- * To handle on click of any recent item after the drawer is open
301
- *
302
- * @param {*} id : Recent item unique id
303
- */
304
- // const onItemClick = (id, e) => {
305
- // e.preventDefault();
306
- // // onRecentClickHandler(id, actionsAPI);
307
- // };
308
27
  // useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
309
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
310
29
  const [appName, setAppName] = useState("");
@@ -332,58 +51,18 @@ export default function AppShell(props) {
332
51
  return (React.createElement(NavContext.Provider, { value: { open, setOpen } },
333
52
  React.createElement("div", { id: "AppShell", className: classes.root },
334
53
  React.createElement(NavBar, { pConn: getPConnect(), appName: appNameToDisplay, pages: pages, caseTypes: caseTypes }),
335
- React.createElement("div", { className: classes.content }, children)))
336
- // <Toaster dismissAfter={3000}>
337
- // <CosmosAppShell
338
- // {...{
339
- // appInfo: {
340
- // imageSrc: `${iconURL}`,
341
- // appName: `${appNameToDisplay}`,
342
- // portalName
343
- // },
344
- // recents: {
345
- // items: recents,
346
- // onDrawerOpen: fetchRecents,
347
- // onItemClick
348
- // },
349
- // searchInput: {
350
- // onSearchChange: (value) => {
351
- // setSearchVal(value);
352
- // },
353
- // onSearchSubmit: (value) => {
354
- // showSearchResults(value.trim());
355
- // setSearchVal("");
356
- // },
357
- // value: searchVal
358
- // },
359
- // caseTypes: cases,
360
- // links,
361
- // cases: getActiveCases(),
362
- // operator: getOperator()
363
- // }}
364
- // main={[children]}
365
- // banners={banners}
366
- // className="app-shell"
367
- // />
368
- // </Toaster>
369
- );
54
+ React.createElement("div", { className: classes.content }, children))));
370
55
  }
371
56
  AppShell.defaultProps = {
372
57
  pages: [],
373
58
  caseTypes: [],
374
59
  children: [],
375
- // httpMessages: [],
376
- // activeCases: null
377
60
  };
378
61
  AppShell.propTypes = {
379
- // portalName: PropTypes.string/* .isRequired */,
380
- // portalLogo: PropTypes.string/* .isRequired */,
381
62
  showAppName: PropTypes.bool /* .isRequired */,
382
63
  pages: PropTypes.arrayOf(PropTypes.object),
383
64
  caseTypes: PropTypes.arrayOf(PropTypes.object),
384
65
  children: PropTypes.arrayOf(PropTypes.node),
385
66
  getPConnect: PropTypes.func.isRequired,
386
- // httpMessages: PropTypes.arrayOf(PropTypes.string),
387
- // activeCases: PropTypes.arrayOf(PropTypes.object)
388
67
  };
389
68
  //# sourceMappingURL=AppShell.js.map