@pega/react-sdk-components 0.23.18 → 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 (32) hide show
  1. package/lib/components/helpers/authManager.d.ts.map +1 -1
  2. package/lib/components/helpers/authManager.js +1 -0
  3. package/lib/components/helpers/authManager.js.map +1 -1
  4. package/lib/components/helpers/event-utils.js +1 -1
  5. package/lib/components/helpers/event-utils.js.map +1 -1
  6. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  7. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +2 -2
  8. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  9. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  10. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +3 -49
  11. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  12. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  13. package/lib/components/infra/RootContainer/RootContainer.js +0 -50
  14. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  15. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  16. package/lib/components/infra/Stages/Stages.js +1 -2
  17. package/lib/components/infra/Stages/Stages.js.map +1 -1
  18. package/lib/components/infra/View/View.js +1 -1
  19. package/lib/components/infra/View/View.js.map +1 -1
  20. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  21. package/lib/components/template/AppShell/AppShell.js +2 -323
  22. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  23. package/lib/components/template/CaseSummary/CaseSummary.js +1 -1
  24. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  25. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  26. package/lib/components/template/ListView/ListView.js +5 -39
  27. package/lib/components/template/ListView/ListView.js.map +1 -1
  28. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  29. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -20
  30. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  31. package/lib/doc/KeyReleaseUpdates.md +33 -0
  32. package/package.json +1 -1
@@ -44,8 +44,6 @@ const RootContainer = (props) => {
44
44
  if (isMashup) {
45
45
  options["context"] = "root";
46
46
  }
47
- // Used for embedded mode
48
- // let newPConn: any;
49
47
  const [componentName, setComponentName] = useState("");
50
48
  useEffect(() => {
51
49
  // debugging/investigation help
@@ -53,7 +51,6 @@ const RootContainer = (props) => {
53
51
  }, [componentName]);
54
52
  // debugging/investigation help
55
53
  // console.log(`RootContainer props.routingInfo: ${JSON.stringify(routingInfo)}`);
56
- // const bannerRef = useRef(null);
57
54
  let hasBanner = false;
58
55
  let banners = null;
59
56
  const messages = httpMessages
@@ -63,21 +60,6 @@ const RootContainer = (props) => {
63
60
  banners = hasBanner && (React.createElement("div", null,
64
61
  "RootContainer: trying to emit Banner with ",
65
62
  messages));
66
- // && (
67
- // <Banner
68
- // ref={bannerRef}
69
- // id="appShellBanner"
70
- // variant="urgent"
71
- // heading="Error"
72
- // onDismiss={() =>
73
- // pConn.clearErrorMessages({
74
- // category: "HTTP",
75
- // context: "root"
76
- // })
77
- // }
78
- // messages={messages}
79
- // />
80
- // );
81
63
  const MemoizedModalViewContainer = useMemo(() => {
82
64
  return createElement(createPConnectComponent(), PCore.createPConnect({
83
65
  meta: {
@@ -132,7 +114,6 @@ const RootContainer = (props) => {
132
114
  }
133
115
  return noPortalContent;
134
116
  }
135
- // const rootViewRef: any = useRef(null);
136
117
  let rootView;
137
118
  let rootViewConfig = null;
138
119
  useEffect(() => {
@@ -140,7 +121,6 @@ const RootContainer = (props) => {
140
121
  const items = Object.keys(containers).filter((item) => item.includes("root"));
141
122
  PCore.getContainerUtils().getContainerAPI().addContainerItems(items);
142
123
  }, [routingInfo]);
143
- // const { store } = useConstellationContext();
144
124
  const items = getItemView(routingInfo, renderingMode);
145
125
  if (items.length > 0) {
146
126
  rootViewConfig = {
@@ -168,13 +148,6 @@ const RootContainer = (props) => {
168
148
  if (!isEqual(currentRootConfig, prevRootConfig)) {
169
149
  rootView = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig));
170
150
  }
171
- // interior was
172
- // <ModalManager>
173
- // {rootViewRef.current}
174
- // {MemoisedModalViewContainer}
175
- // {MemoizedPreviewViewContainer}
176
- // <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
177
- // </ModalManager> */}
178
151
  // debugging/investigation help
179
152
  // console.log(`rootView.props.getPConnect().getComponentName(): ${rootView.props.getPConnect().getComponentName()}`);
180
153
  return (React.createElement("div", { id: "ModalManager" },
@@ -188,10 +161,7 @@ const RootContainer = (props) => {
188
161
  console.log(`RootContainer rendering in noPortal mode`);
189
162
  const theChildren = pConn.getChildren();
190
163
  if (theChildren && (theChildren.length === 1)) {
191
- // this.createdPConnect = theChildren[0];
192
- // this.createdPConnect = null;
193
164
  const localPConn = theChildren[0].getPConnect();
194
- // newPConn = pConn;
195
165
  const localCompName = localPConn.getComponentName();
196
166
  if (componentName !== localCompName) {
197
167
  setComponentName(localCompName);
@@ -201,39 +171,19 @@ const RootContainer = (props) => {
201
171
  return noPortalContent;
202
172
  }
203
173
  else if (children && children.length > 0) {
204
- // interior was
205
- // <ModalManager>
206
- // {httpMessages ? <div id="root-container">{banners}</div> : ""}
207
- // {children}
208
- // {MemoizedModalViewContainer}
209
- // <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
210
- // {MemoizedPreviewViewContainer}
211
- // </ModalManager>
212
174
  return (React.createElement(React.Fragment, null,
213
175
  React.createElement("div", null, "RootContainer: Has children. Trying to show ModalManager with children, etc."),
214
176
  children,
215
177
  MemoizedModalViewContainer));
216
178
  }
217
179
  else if (skeleton) {
218
- // TODO: need to update once skeletons are available
219
180
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
220
181
  const LoadingComponent = LazyComponentMap[skeleton];
221
- // interior was
222
- // <ModalManager>
223
- // <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
224
- // <LoadingComponent />
225
- // </ModalManager>
226
182
  return (React.createElement("div", { id: "root-container" },
227
183
  React.createElement(Box, { textAlign: "center" },
228
184
  React.createElement(CircularProgress, null))));
229
185
  }
230
186
  else {
231
- // interior was
232
- // <ModalManager>
233
- // {MemoisedModalViewContainer}
234
- // {MemoizedPreviewViewContainer}
235
- // <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
236
- // </ModalManager>
237
187
  return (React.createElement("div", { id: "root-container" },
238
188
  React.createElement("div", null, "RootContainer: Should be ModalManager, etc.")));
239
189
  }
@@ -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;AAIxC,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAAE;AAGF,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE1C,SAAS,WAAW,CAAC,KAAK;IACxB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAA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,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;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;AACh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EF,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,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5B,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3B,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;KAC/B;IACD,cAAc,EAAE;QACd,KAAK,EAAE,KAAK,CAAC,OAAO,C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,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(PropTypes.object).isRequired\n};\n"]}
1
+ {"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../../src/components/infra/Stages/Stages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,IAAI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ACjC;aAAM,IAAI,KAAK,CAAC,QAAQ,EAAE;YACzB,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC;SACnC;aAAM;YACL,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;SAChC;QAED,OAAO,8BAAM,GAAG,EAAE,KAAK;YAClB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAC,QAAQ,IAAC,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI;YACvE,oBAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAE,QAAQ,IAAG,KAAK,CAAC,IAAI,CAAc,CACpG,CAAC;IACZ,CAAC;IAED,SAAS,SAAS,CAAC,QAAQ;QACzB,OAAO,oBAAC,WAAW,kBAAY,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\";\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"]}
@@ -117,7 +117,7 @@ View.propTypes = {
117
117
  mode: PropTypes.string,
118
118
  title: PropTypes.string
119
119
  };
120
- // 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
121
121
  View.additionalProps = (state, getPConnect) => {
122
122
  const thePConn = getPConnect();
123
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,8BAA8B,CAAC;AAE5D,oDAAoD;AAEpD,OAAO,YAAY,CAAC;AACpB,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAAE;AAEF,MAAM,aAAa,GAAG,CAAC,WA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AC;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 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,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,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;AAC5F,MAAM,mBAAmB,GAAG;IAC1B,SAAS;IACT,a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Z,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"}