@pega/react-sdk-components 0.23.20 → 0.23.22

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 (63) hide show
  1. package/lib/components/designSystemExtension/Banner/Banner.css +35 -0
  2. package/lib/components/designSystemExtension/Banner/Banner.d.ts +4 -0
  3. package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -0
  4. package/lib/components/designSystemExtension/Banner/Banner.js +18 -0
  5. package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -0
  6. package/lib/components/designSystemExtension/Banner/index.d.ts +2 -0
  7. package/lib/components/designSystemExtension/Banner/index.d.ts.map +1 -0
  8. package/lib/components/designSystemExtension/Banner/index.js +2 -0
  9. package/lib/components/designSystemExtension/Banner/index.js.map +1 -0
  10. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  11. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +1 -2
  12. package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  13. package/lib/components/field/Currency/Currency.d.ts.map +1 -1
  14. package/lib/components/field/Currency/Currency.js +2 -1
  15. package/lib/components/field/Currency/Currency.js.map +1 -1
  16. package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
  17. package/lib/components/field/DateTime/DateTime.js +6 -7
  18. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  19. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  20. package/lib/components/helpers/template-utils.js +4 -3
  21. package/lib/components/helpers/template-utils.js.map +1 -1
  22. package/lib/components/infra/Assignment/Assignment.d.ts +1 -1
  23. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  24. package/lib/components/infra/Assignment/Assignment.js +42 -42
  25. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  26. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  27. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +7 -6
  28. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  29. package/lib/components/template/AppShell/AppShell.d.ts +1 -1
  30. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  31. package/lib/components/template/AppShell/AppShell.js +108 -14
  32. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  33. package/lib/components/template/BannerPage/BannerPage.d.ts +26 -0
  34. package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -0
  35. package/lib/components/template/BannerPage/BannerPage.js +41 -0
  36. package/lib/components/template/BannerPage/BannerPage.js.map +1 -0
  37. package/lib/components/template/BannerPage/index.d.ts +2 -0
  38. package/lib/components/template/BannerPage/index.d.ts.map +1 -0
  39. package/lib/components/template/BannerPage/index.js +2 -0
  40. package/lib/components/template/BannerPage/index.js.map +1 -0
  41. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  42. package/lib/components/template/Confirmation/Confirmation.js +20 -6
  43. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  44. package/lib/components/template/WssNavBar/WssNavBar.css +5 -0
  45. package/lib/components/template/WssNavBar/WssNavBar.d.ts +4 -0
  46. package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -0
  47. package/lib/components/template/WssNavBar/WssNavBar.js +83 -0
  48. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -0
  49. package/lib/components/template/WssNavBar/index.d.ts +2 -0
  50. package/lib/components/template/WssNavBar/index.d.ts.map +1 -0
  51. package/lib/components/template/WssNavBar/index.js +2 -0
  52. package/lib/components/template/WssNavBar/index.js.map +1 -0
  53. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  54. package/lib/components/widget/Attachment/Attachment.js +4 -4
  55. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  56. package/lib/components/widget/ToDo/ToDo.d.ts +2 -0
  57. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  58. package/lib/components/widget/ToDo/ToDo.js +32 -21
  59. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  60. package/lib/sdk-pega-component-map.d.ts +6 -0
  61. package/lib/sdk-pega-component-map.js +7 -1
  62. package/lib/sdk-pega-component-map.js.map +1 -1
  63. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerPage.js","sourceRoot":"","sources":["../../../../src/components/template/BannerPage/BannerPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK;IACtC,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,eAAe,EACf,eAAe,EACf,SAAS,EACV,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,MAAM,EACf,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAChB,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAChB,MAAM,EAAE;YACN,OAAO,EAAE,UAAU;YACnB,eAAe;YACf,KAAK,EAAE,OAAO;YACd,OAAO;YACP,eAAe;YACf,SAAS;SACV,GACD,CACH,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,SAAS,GAAG;IACrB,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,UAAU;IACtD,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,UAAU,EAAE,SAAS,CAAC,MAAM;IAC5B,eAAe,EAAE,SAAS,CAAC,MAAM;IACjC,eAAe,EAAE,SAAS,CAAC,MAAM;IACjC,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG;IACxB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,OAAO;IACnB,eAAe,EAAE,EAAE;IACnB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,KAAK;CACjB,CAAC","sourcesContent":["import { useMemo, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport Banner from '../../designSystemExtension/Banner';\nimport React from 'react';\n\n/*\n * BannerPage template.\n */\nexport default function BannerPage(props) {\n const {\n children,\n layout,\n heading,\n message,\n imageTheme,\n backgroundImage,\n backgroundColor,\n tintImage\n } = props;\n\n const childArray = useMemo(() => {\n return Children.toArray(children);\n }, [children]);\n\n return (\n <Banner\n variant={layout}\n a={childArray[0]}\n b={childArray[1]}\n banner={{\n variant: imageTheme,\n backgroundColor,\n title: heading,\n message,\n backgroundImage,\n tintImage\n }}\n />\n );\n}\n\nBannerPage.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n layout: PropTypes.string,\n heading: PropTypes.string,\n message: PropTypes.string,\n imageTheme: PropTypes.string,\n backgroundImage: PropTypes.string,\n backgroundColor: PropTypes.string,\n tintImage: PropTypes.bool\n};\n\nBannerPage.defaultProps = {\n layout: 'two-column',\n heading: '',\n message: '',\n imageTheme: 'light',\n backgroundImage: '',\n backgroundColor: '',\n tintImage: false\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './BannerPage';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/template/BannerPage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './BannerPage';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/template/BannerPage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { default } from './BannerPage';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAIA,OAAO,SAAS,MAAM,YAAY,CAAC;AASnC,iBAAwB,YAAY,CAAC,KAAK,KAAA,sBAwDzC;kBAxDuB,YAAY;;;;;;;;;;;;;;;eAAZ,YAAY"}
1
+ {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAIA,OAAO,SAAS,MAAM,YAAY,CAAC;AAsBnC,iBAAwB,YAAY,CAAC,KAAK,KAAA,sBA6DzC;kBA7DuB,YAAY;;;;;;;;;;;;;;;eAAZ,YAAY"}
@@ -1,14 +1,27 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  /* eslint-disable no-unused-vars */
3
3
  /* eslint-disable no-nested-ternary */
4
- import { Fragment, useState } from 'react';
4
+ import { useState } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import React from 'react';
7
7
  import { getToDoAssignments } from '../../infra/Containers/FlowContainer/helpers';
8
8
  import ToDo from '../../widget/ToDo';
9
9
  import Details from '../Details/Details';
10
- import { Button } from '@material-ui/core';
10
+ import { Button, Card, makeStyles } from '@material-ui/core';
11
+ const useStyles = makeStyles(theme => ({
12
+ root: {
13
+ paddingRight: theme.spacing(1),
14
+ paddingLeft: theme.spacing(1),
15
+ paddingTop: theme.spacing(1),
16
+ paddingBottom: theme.spacing(1),
17
+ marginRight: theme.spacing(1),
18
+ marginLeft: theme.spacing(1),
19
+ marginTop: theme.spacing(1),
20
+ marginBottom: theme.spacing(1)
21
+ }
22
+ }));
11
23
  export default function Confirmation(props) {
24
+ const classes = useStyles();
12
25
  const CONSTS = PCore.getConstants();
13
26
  const [showConfirmView, setShowConfirmView] = useState(true);
14
27
  const { showTasks, getPConnect, datasource } = props;
@@ -26,12 +39,13 @@ export default function Confirmation(props) {
26
39
  const toDoList = getToDoAssignments(getPConnect());
27
40
  const detailProps = { ...props, showLabel: false };
28
41
  const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;
29
- return showConfirmView ? (React.createElement(Fragment, null,
30
- React.createElement("h2", null, props.showLabel ? props.label : ''),
42
+ return showConfirmView ? (React.createElement(Card, { className: classes.root },
43
+ React.createElement("h2", { id: 'confirm-label' }, props.showLabel ? props.label : ''),
31
44
  showDetails ? React.createElement(Details, { ...detailProps }) : undefined,
32
- showTasks ? (toDoList && toDoList.length > 0 ? (React.createElement(ToDo, { ...todoProps, datasource: { source: toDoList }, getPConnect: getPConnect, type: CONSTS.TODO, headerText: 'Open Tasks' })) : undefined) : undefined,
45
+ showTasks ? (toDoList && toDoList.length > 0 ? (React.createElement(ToDo, { ...todoProps, datasource: { source: toDoList }, getPConnect: getPConnect, type: CONSTS.TODO, headerText: 'Open Tasks', isConfirm: true })) : undefined) : undefined,
33
46
  React.createElement("div", { style: { display: 'flex', justifyContent: 'flex-end' } },
34
- React.createElement(Button, { variant: 'contained', color: 'primary', onClick: onConfirmViewClose }, "Done")))) : toDoList && toDoList.length > 0 ? (React.createElement(ToDo, { ...props, datasource: { source: toDoList }, getPConnect: getPConnect, type: CONSTS.TODO, headerText: 'Tasks' })) : null;
47
+ React.createElement(Button, { variant: 'contained', color: 'primary', onClick: onConfirmViewClose }, "Done")))) : toDoList && toDoList.length > 0 ? (React.createElement(Card, { className: classes.root },
48
+ React.createElement(ToDo, { ...props, datasource: { source: toDoList }, getPConnect: getPConnect, type: CONSTS.TODO, headerText: 'Tasks', isConfirm: true }))) : null;
35
49
  }
36
50
  Confirmation.defaultProps = {
37
51
  datasource: undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,mCAAmC;AACnC,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK;IACxC,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IACpC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,sEAAsE;IACtE,sEAAsE;IACtE,MAAM,SAAS,GAAG,UAAU,EAAE,MAAM,CAAC;IACrC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,MAAM,qBAAqB,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,0BAA0B,CAChF,WAAW,EAAE,CAAC,SAAS,EAAE,CAC1B,CAAC;IACF,MAAM,QAAQ,GAAG,KAAK,CAAC,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CAAC,CAAC,CAAC,SAAS;QACb,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE;YACzD,oBAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,kBAAkB,WAE9D,CACL,CACG,CACZ,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACpC,oBAAC,IAAI,OACC,KAAK,EACT,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAChC,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,UAAU,EAAC,OAAO,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,YAAY,CAAC,YAAY,GAAG;IAC1B,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF,YAAY,CAAC,SAAS,GAAG;IACvB,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC7C,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-nested-ternary */\nimport { Fragment, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getToDoAssignments } from '../../infra/Containers/FlowContainer/helpers';\nimport ToDo from '../../widget/ToDo';\nimport Details from '../Details/Details';\nimport { Button } from '@material-ui/core';\n\ndeclare const PCore;\n\nexport default function Confirmation(props) {\n const CONSTS = PCore.getConstants();\n const [showConfirmView, setShowConfirmView] = useState(true);\n const { showTasks, getPConnect, datasource } = props;\n // Get the inherited props from the parent to determine label settings\n // Not using whatsNext at the moment, need to figure out the use of it\n const whatsNext = datasource?.source;\n const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';\n const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(\n getPConnect().getTarget()\n );\n const rootInfo = PCore.getContainerUtils().getContainerItemData(\n getPConnect().getTarget(),\n activeContainerItemID\n );\n const onConfirmViewClose = () => {\n setShowConfirmView(false);\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,\n rootInfo\n );\n };\n const todoProps = { ...props, renderTodoInConfirm: true };\n const toDoList = getToDoAssignments(getPConnect());\n const detailProps = { ...props, showLabel: false };\n const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;\n return showConfirmView ? (\n <Fragment>\n <h2>{props.showLabel ? props.label : ''}</h2>\n {showDetails ? <Details {...detailProps} /> : undefined}\n {showTasks ? (\n toDoList && toDoList.length > 0 ? (\n <ToDo\n {...todoProps}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Open Tasks'\n />\n ) : undefined\n ) : undefined}\n <div style={{ display: 'flex', justifyContent: 'flex-end' }}>\n <Button variant='contained' color='primary' onClick={onConfirmViewClose}>\n Done\n </Button>\n </div>\n </Fragment>\n ) : toDoList && toDoList.length > 0 ? (\n <ToDo\n {...props}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Tasks'\n />\n ) : null;\n}\n\nConfirmation.defaultProps = {\n datasource: undefined,\n label: '',\n showLabel: true\n};\n\nConfirmation.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n datasource: PropTypes.objectOf(PropTypes.any),\n label: PropTypes.string,\n showLabel: PropTypes.bool\n};\n"]}
1
+ {"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,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I,CAAC,UAAU;IACtC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC7C,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-nested-ternary */\nimport { Fragment, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getToDoAssignments } from '../../infra/Containers/FlowContainer/helpers';\nimport ToDo from '../../widget/ToDo';\nimport Details from '../Details/Details';\nimport { Button, Card, makeStyles } from '@material-ui/core';\n\ndeclare const PCore;\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}));\n\nexport default function Confirmation(props) {\n const classes = useStyles();\n const CONSTS = PCore.getConstants();\n const [showConfirmView, setShowConfirmView] = useState(true);\n const { showTasks, getPConnect, datasource } = props;\n // Get the inherited props from the parent to determine label settings\n // Not using whatsNext at the moment, need to figure out the use of it\n const whatsNext = datasource?.source;\n const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';\n const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(\n getPConnect().getTarget()\n );\n const rootInfo = PCore.getContainerUtils().getContainerItemData(\n getPConnect().getTarget(),\n activeContainerItemID\n );\n const onConfirmViewClose = () => {\n setShowConfirmView(false);\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,\n rootInfo\n );\n };\n const todoProps = { ...props, renderTodoInConfirm: true };\n const toDoList = getToDoAssignments(getPConnect());\n const detailProps = { ...props, showLabel: false };\n const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;\n return showConfirmView ? (\n <Card className={classes.root}>\n <h2 id='confirm-label'>{props.showLabel ? props.label : ''}</h2>\n {showDetails ? <Details {...detailProps} /> : undefined}\n {showTasks ? (\n toDoList && toDoList.length > 0 ? (\n <ToDo\n {...todoProps}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Open Tasks'\n isConfirm\n />\n ) : undefined\n ) : undefined}\n <div style={{ display: 'flex', justifyContent: 'flex-end' }}>\n <Button variant='contained' color='primary' onClick={onConfirmViewClose}>\n Done\n </Button>\n </div>\n </Card>\n ) : toDoList && toDoList.length > 0 ? (\n <Card className={classes.root}>\n <ToDo\n {...props}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Tasks'\n isConfirm\n />\n </Card>\n ) : null;\n}\n\nConfirmation.defaultProps = {\n datasource: undefined,\n label: '',\n showLabel: true\n};\n\nConfirmation.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n datasource: PropTypes.objectOf(PropTypes.any),\n label: PropTypes.string,\n showLabel: PropTypes.bool\n};\n"]}
@@ -0,0 +1,5 @@
1
+ .link-style {
2
+ color: white !important;
3
+ text-transform: capitalize !important;
4
+ font-size: 1rem !important;
5
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './WssNavBar.css';
3
+ export default function WssNavBar(props: any): JSX.Element;
4
+ //# sourceMappingURL=WssNavBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WssNavBar.d.ts","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/WssNavBar.tsx"],"names":[],"mappings":";AAWA,OAAO,iBAAiB,CAAC;AAuBzB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,KAAA,eA0GtC"}
@@ -0,0 +1,83 @@
1
+ import React, { useState } from 'react';
2
+ import { makeStyles } from '@material-ui/core/styles';
3
+ import AppBar from '@material-ui/core/AppBar';
4
+ import Box from '@material-ui/core/Box';
5
+ import Toolbar from '@material-ui/core/Toolbar';
6
+ import Container from '@material-ui/core/Container';
7
+ import { IconButton, Menu, MenuItem, Typography } from '@material-ui/core';
8
+ import { Button } from '@material-ui/core';
9
+ import Avatar from '@material-ui/core/Avatar';
10
+ import MenuIcon from '@material-ui/icons/Menu';
11
+ import { logout } from '../../helpers/authManager';
12
+ import './WssNavBar.css';
13
+ const useStyles = makeStyles(theme => ({
14
+ root: {
15
+ display: 'flex'
16
+ },
17
+ content: {
18
+ flexGrow: 1,
19
+ height: '100vh',
20
+ marginLeft: theme.spacing(2),
21
+ marginRight: theme.spacing(2)
22
+ },
23
+ appListLogo: {
24
+ width: '3.6rem'
25
+ },
26
+ appName: {
27
+ color: 'white',
28
+ marginLeft: theme.spacing(2),
29
+ marginRight: theme.spacing(4),
30
+ fontSize: '1.5rem'
31
+ }
32
+ }));
33
+ export default function WssNavBar(props) {
34
+ const { appInfo, navLinks, operator, navDisplayOptions } = props;
35
+ const { alignment } = navDisplayOptions;
36
+ const classes = useStyles();
37
+ const [anchorElNav, setAnchorElNav] = useState(null);
38
+ const [anchorElUser, setAnchorElUser] = useState(null);
39
+ const handleOpenNavMenu = (event) => {
40
+ setAnchorElNav(event.currentTarget);
41
+ };
42
+ const handleOpenUserMenu = (event) => {
43
+ setAnchorElUser(event.currentTarget);
44
+ };
45
+ const handleCloseNavMenu = () => {
46
+ setAnchorElNav(null);
47
+ };
48
+ const handleCloseUserMenu = () => {
49
+ setAnchorElUser(null);
50
+ };
51
+ return (React.createElement("div", { id: 'NavBar' },
52
+ React.createElement(AppBar, { position: 'static', color: 'primary' },
53
+ React.createElement(Container, { maxWidth: 'xl' },
54
+ React.createElement(Toolbar, { disableGutters: true },
55
+ React.createElement(Button, { style: { textTransform: 'capitalize' }, onClick: appInfo.onClick },
56
+ React.createElement("img", { src: appInfo.imageSrc, className: classes.appListLogo }),
57
+ React.createElement("span", { className: classes.appName }, appInfo.appName)),
58
+ React.createElement(Box, { sx: { flexGrow: 1, display: { xs: 'flex', md: 'none' } } },
59
+ React.createElement(IconButton, { size: 'small', "aria-label": 'account of current user', "aria-controls": 'menu-appbar', "aria-haspopup": 'true', onClick: handleOpenNavMenu, color: 'inherit' },
60
+ React.createElement(MenuIcon, null)),
61
+ React.createElement(Menu, { id: 'menu-appbar', anchorEl: anchorElNav, anchorOrigin: {
62
+ vertical: 'bottom',
63
+ horizontal: 'left'
64
+ }, keepMounted: true, transformOrigin: {
65
+ vertical: 'top',
66
+ horizontal: 'left'
67
+ }, open: Boolean(anchorElNav), onClose: handleCloseNavMenu }, navLinks.map(link => (React.createElement(MenuItem, { key: link.text, onClick: link.onClick },
68
+ React.createElement(Typography, null, link.text)))))),
69
+ React.createElement(Box, { sx: { flexGrow: 1, display: { xs: 'none', md: 'flex' } }, style: { justifyContent: alignment } }, navLinks.map(link => (React.createElement(Button, { className: 'link-style', key: link.text, onClick: link.onClick }, link.text)))),
70
+ React.createElement(Box, { sx: { flexGrow: 0 } },
71
+ React.createElement(IconButton, { onClick: handleOpenUserMenu },
72
+ React.createElement(Avatar, null, operator.currentUserInitials)),
73
+ React.createElement(Menu, { id: 'menu-appbar', anchorEl: anchorElUser, anchorOrigin: {
74
+ vertical: 'top',
75
+ horizontal: 'right'
76
+ }, keepMounted: true, transformOrigin: {
77
+ vertical: 'top',
78
+ horizontal: 'right'
79
+ }, open: Boolean(anchorElUser), onClose: handleCloseUserMenu },
80
+ React.createElement(MenuItem, { onClick: logout },
81
+ React.createElement(Typography, null, "Logout")))))))));
82
+ }
83
+ //# sourceMappingURL=WssNavBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WssNavBar.js","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/WssNavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,C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AU,CACpC;wBACb,oBAAC,IAAI,IACH,EAAE,EAAC,aAAa,EAChB,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE;gCACZ,QAAQ,EAAE,KAAK;gCACf,UAAU,EAAE,OAAO;6BACpB,EACD,WAAW,QACX,eAAe,EAAE;gCACf,QAAQ,EAAE,KAAK;gCACf,UAAU,EAAE,OAAO;6BACpB,EACD,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,EAC3B,OAAO,EAAE,mBAAmB;4BAE5B,oBAAC,QAAQ,IAAC,OAAO,EAAE,MAAM;gCACvB,oBAAC,UAAU,iBAAoB,CACtB,CACN,CACH,CACE,CACA,CACL,CACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport AppBar from '@material-ui/core/AppBar';\nimport Box from '@material-ui/core/Box';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Container from '@material-ui/core/Container';\nimport { IconButton, Menu, MenuItem, Typography } from '@material-ui/core';\nimport { Button } from '@material-ui/core';\nimport Avatar from '@material-ui/core/Avatar';\nimport MenuIcon from '@material-ui/icons/Menu';\nimport { logout } from '../../helpers/authManager';\nimport './WssNavBar.css';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex'\n },\n content: {\n flexGrow: 1,\n height: '100vh',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2)\n },\n appListLogo: {\n width: '3.6rem'\n },\n appName: {\n color: 'white',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(4),\n fontSize: '1.5rem'\n }\n}));\n\nexport default function WssNavBar(props) {\n const { appInfo, navLinks, operator, navDisplayOptions } = props;\n const { alignment } = navDisplayOptions;\n const classes = useStyles();\n\n const [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);\n const [anchorElUser, setAnchorElUser] = useState<null | HTMLElement>(null);\n\n const handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorElNav(event.currentTarget);\n };\n const handleOpenUserMenu = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorElUser(event.currentTarget);\n };\n\n const handleCloseNavMenu = () => {\n setAnchorElNav(null);\n };\n\n const handleCloseUserMenu = () => {\n setAnchorElUser(null);\n };\n\n return (\n <div id='NavBar'>\n <AppBar position='static' color='primary'>\n <Container maxWidth='xl'>\n <Toolbar disableGutters>\n <Button style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>\n <img src={appInfo.imageSrc} className={classes.appListLogo} />\n <span className={classes.appName}>{appInfo.appName}</span>\n </Button>\n <Box sx={{ flexGrow: 1, display: { xs: 'flex', md: 'none' } }}>\n <IconButton\n size='small'\n aria-label='account of current user'\n aria-controls='menu-appbar'\n aria-haspopup='true'\n onClick={handleOpenNavMenu}\n color='inherit'\n >\n <MenuIcon />\n </IconButton>\n <Menu\n id='menu-appbar'\n anchorEl={anchorElNav}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left'\n }}\n keepMounted\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left'\n }}\n open={Boolean(anchorElNav)}\n onClose={handleCloseNavMenu}\n >\n {navLinks.map(link => (\n <MenuItem key={link.text} onClick={link.onClick}>\n <Typography>{link.text}</Typography>\n </MenuItem>\n ))}\n </Menu>\n </Box>\n\n <Box\n sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }}\n style={{ justifyContent: alignment }}\n >\n {navLinks.map(link => (\n <Button className='link-style' key={link.text} onClick={link.onClick}>\n {link.text}\n </Button>\n ))}\n </Box>\n\n <Box sx={{ flexGrow: 0 }}>\n <IconButton onClick={handleOpenUserMenu}>\n <Avatar>{operator.currentUserInitials}</Avatar>\n </IconButton>\n <Menu\n id='menu-appbar'\n anchorEl={anchorElUser}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n keepMounted\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n open={Boolean(anchorElUser)}\n onClose={handleCloseUserMenu}\n >\n <MenuItem onClick={logout}>\n <Typography>Logout</Typography>\n </MenuItem>\n </Menu>\n </Box>\n </Toolbar>\n </Container>\n </AppBar>\n </div>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './WssNavBar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './WssNavBar';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { default } from './WssNavBar';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;AAW1B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,KAAA,eAwcvC"}
1
+ {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;AAW1B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,KAAA,eAucvC"}
@@ -367,12 +367,12 @@ export default function Attachment(props) {
367
367
  isArrayDeepMerge: false
368
368
  });
369
369
  }
370
- PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, resetAttachmentStoredState, caseID);
371
- return () => {
372
- PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);
373
- };
374
370
  }
375
371
  }
372
+ PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, resetAttachmentStoredState, caseID);
373
+ return () => {
374
+ PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);
375
+ };
376
376
  }, []);
377
377
  let content = (React.createElement("div", { className: 'file-div' },
378
378
  file.inProgress && (React.createElement("div", { className: "progress-div" },
@@ -1 +1 @@
1
- {"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACzI,OAAO,kBAAkB,CAAC;AAC1B,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAIlC,SAAS,yBAAyB,CAAC,OAAO;IACxC,OAAO,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK;IACtC,MAAM,EAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAC1C,wGAAwG;IACxG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnC,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CA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C9E,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,eAAe,IAAE,QAAQ,CAAO;QACtD,+BAAO,OAAO,EAAE,QAAQ;YACtB,+BACE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC1B,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,WAAW,GACrB;YACF,oBAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,kBAElD,CACH,CACN,CACP,CAAC;IAEF,IAAI,IAAI,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;QAClG,OAAO,GAAG,CACR;YACI,IAAI,CAAC,YAAY,IAAI,CAAC,oBAAC,WAAW,gBAAW,IAAI,CAAC,KAAK,CAAC,WAAW,6BAA2B,mBAAmB,GAAgB,CAAC;YAClI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,oBAAC,WAAW,yBAAmB,OAAO,cAAW,IAAI,CAAC,KAAK,CAAC,WAAW,6BAA2B,mBAAmB,GAAgB,CAAC,CAC3J,CAEP,CAAC;KACH;IAED,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,8BAAM,SAAS,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,IAAG,KAAK,CAAQ;QACxE,qCAAU,OAAO,CAAW,CACxB,CACP,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable react/jsx-boolean-value */\n\nimport { Button } from '@material-ui/core';\nimport React, { useState, useEffect } from 'react';\nimport { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize, getIconForAttachment } from '../../helpers/attachmentHelpers';\nimport './Attachment.css';\nimport SummaryList from '../SummaryList'\nimport { CircularProgress } from \"@material-ui/core\";\nimport download from \"downloadjs\";\n\ndeclare const PCore: any;\n\nfunction getCurrentAttachmentsList(context) {\n return PCore.getStoreValue('.attachmentsList', 'context_data', context) || [];\n}\n\nexport default function Attachment(props) {\n const {value, getPConnect, label} = props;\n /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */\n let { required, disabled } = props;\n [required, disabled] = [required, disabled].map(\n prop => prop === true || (typeof prop === 'string' && prop === 'true')\n );\n let arFileList$: Array<any> = [];\n const pConn = getPConnect();\n const caseID = PCore.getStoreValue('.pyID', 'caseInfo.content', pConn.getContextName());\n let fileTemp: any = {};\n\n let categoryName = '';\n if (value && value.pyCategoryName) {\n categoryName = value.pyCategoryName;\n }\n\n let valueRef = pConn.getStateProps().value;\n valueRef = valueRef.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const [file, setFile] = useState(fileTemp);\n\n const resetAttachmentStoredState = () => {\n PCore.getStateUtils().updateState(pConn.getContextName(), 'attachmentsList', undefined, {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n });\n };\n\n const fileDownload = (data, fileName, ext) => {\n const fileData = ext ? `${fileName}.${ext}` : fileName;\n download(atob(data), fileData);\n };\n\n function _downloadFileFromList(fileObj: any) {\n PCore.getAttachmentUtils()\n .downloadAttachment(fileObj.pzInsKey, pConn.getContextName())\n .then((content) => {\n const extension = fileObj.pyAttachName.split(\".\").pop();\n fileDownload(content.data, fileObj.pyFileName, extension);\n })\n .catch(() => {});\n }\n\n function setNewFiles(arFiles) {\n let index = 0;\n for (const item of arFiles) {\n if (!validateMaxSize(item, 5)) {\n item.error = true;\n item.meta = \"File is too big. Max allowed size is 5MB.\";\n }\n item.mimeType = item.type;\n item.icon = getIconFromFileType(item.type);\n item.ID = `${new Date().getTime()}I${index}`;\n index+=1;\n }\n return arFiles;\n }\n\n function getFiles(arFiles: Array<any>) {\n return setNewFiles(arFiles);\n }\n\n function getNewListUtilityItemProps({\n att,\n cancelFile,\n downloadFile,\n deleteFile,\n removeFile\n }) {\n let actions;\n if (att.progress && att.progress !== 100) {\n actions = [\n {\n id: `Cancel-${att.ID}`,\n text: \"Cancel\",\n icon: \"times\",\n onClick: cancelFile\n }\n ];\n } else if (att.links) {\n const isFile = att.type === \"FILE\";\n const ID = att.ID.replace(/\\s/gi, \"\");\n const actionsMap = new Map([\n [\n \"download\",\n {\n id: `download-${ID}`,\n text: isFile ? \"Download\" : \"Open\",\n icon: isFile ? \"download\" : \"open\",\n onClick: downloadFile\n }\n ],\n [\n \"delete\",\n {\n id: `Delete-${ID}`,\n text: \"Delete\",\n icon: \"trash\",\n onClick: deleteFile\n }\n ]\n ]);\n actions = [];\n actionsMap.forEach((action, actionKey) => {\n if (att.links[actionKey]) {\n actions.push(action);\n }\n });\n } else if (att.error) {\n actions = [\n {\n id: `Remove-${att.ID}`,\n text: \"Remove\",\n icon: \"trash\",\n onClick: removeFile\n }\n ];\n }\n return {\n id: att.ID,\n visual: {\n icon: getIconForAttachment(att),\n progress: att.progress === 100 ? undefined: att.progress,\n },\n primary: {\n type: att.type,\n name: att.error ? att.fileName : att.name,\n icon: \"trash\",\n click: removeFile,\n },\n secondary: {\n text: att.meta,\n error: att.error\n },\n actions\n };\n };\n\n const onFileAdded = (event) => {\n const addedFile = event.target.files[0];\n setFile({\n props: {\n name: addedFile.name,\n icon: getIconFromFileType(addedFile.type),\n },\n inProgress: true\n });\n const arFiles$ = getFiles(event.target.files);\n const myFiles: any = Array.from(arFiles$);\n\n const onUploadProgress = () => {};\n\n const errorHandler = (isFetchCanceled) => {\n return (error) => {\n if (!isFetchCanceled(error)) {\n let uploadFailMsg = pConn.getLocalizedValue('Something went wrong');\n if (error.response && error.response.data && error.response.data.errorDetails) {\n uploadFailMsg = pConn.getLocalizedValue(error.response.data.errorDetails[0].localizedValue);\n }\n myFiles[0].meta = uploadFailMsg;\n myFiles[0].error = true;\n myFiles[0].fileName = pConn.getLocalizedValue('Unable to upload file');\n arFileList$ = myFiles.map((att) => {\n return getNewListUtilityItemProps({\n att,\n downloadFile: null,\n cancelFile: null,\n deleteFile: null,\n removeFile: null\n });\n });\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList$\n },\n inProgress: false,\n attachmentUploaded: true,\n showMenuIcon: false\n };\n });\n }\n throw error;\n };\n };\n\n PCore.getAttachmentUtils()\n .uploadAttachment(\n myFiles[0],\n onUploadProgress,\n errorHandler,\n pConn.getContextName()\n )\n .then((fileRes) => {\n let reqObj;\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n reqObj = {\n type: \"File\",\n attachmentFieldName: valueRef,\n category: categoryName,\n ID: fileRes.ID\n };\n pConn.attachmentsInfo = reqObj;\n } else {\n reqObj = {\n type: \"File\",\n label: valueRef,\n category: categoryName,\n handle: fileRes.ID,\n ID: fileRes.clientFileID\n };\n const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName()).filter(\n (f) => f.label !== valueRef\n );\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, reqObj],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n }\n const fieldName = pConn.getStateProps().value;\n const context = pConn.getContextName();\n\n PCore.getMessageManager().clearMessages({\n type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n myFiles[0].meta = \"Uploaded Successfully\";\n\n arFileList$ = myFiles.map((att) => {\n return getNewListUtilityItemProps({\n att,\n downloadFile: null,\n cancelFile: null,\n deleteFile: null,\n removeFile: null\n });\n });\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList$\n },\n inProgress: false,\n attachmentUploaded: true,\n showMenuIcon: false\n };\n });\n })\n\n .catch(() => {\n // just catching the rethrown error at uploadAttachment\n // to handle Unhandled rejections\n });\n };\n\n function _removeFileFromList(item: any, list) {\n const arFileList = file.props ? file.props.arFileList$ : list;\n const fileIndex = arFileList.findIndex(element => element?.id === item?.id);\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n if (value) {\n pConn.attachmentsInfo = {\n type: \"File\",\n attachmentFieldName: valueRef,\n delete: true\n };\n }\n if (fileIndex > -1) { arFileList.splice(parseInt(fileIndex, 10), 1) };\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList\n },\n };\n });\n } else {\n const attachmentsList = [];\n const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName()).filter(\n (f) => f.label !== valueRef\n );\n if (value && value.pxResults && +value.pyCount > 0) {\n const deletedFile = {\n type: \"File\",\n label: valueRef,\n delete: true,\n responseProps: {\n pzInsKey: arFileList[fileIndex].id\n },\n };\n // updating the redux store to help form-handler in passing the data to delete the file from server\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, deletedFile],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n } else {\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, ...attachmentsList],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n }\n if (fileIndex > -1) { arFileList.splice(parseInt(fileIndex, 10), 1) };\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList\n },\n };\n });\n }\n }\n\n useEffect(() => {\n if (value && value.pxResults && +value.pyCount > 0) {\n fileTemp = buildFilePropsFromResponse(value.pxResults[0]);\n\n if (fileTemp.responseProps) {\n if (!pConn.attachmentsInfo) {\n pConn.attachmentsInfo = {\n type: \"File\",\n attachmentFieldName: valueRef,\n category: categoryName\n };\n }\n\n if (fileTemp.responseProps.pzInsKey && !fileTemp.responseProps.pzInsKey.includes(\"temp\")) {\n\n fileTemp.props.type = fileTemp.responseProps.pyMimeFileExtension;\n fileTemp.props.mimeType = fileTemp.responseProps.pyMimeFileExtension;\n fileTemp.props.ID = fileTemp.responseProps.pzInsKey;\n // create the actions for the \"more\" menu on the attachment\n const arMenuList: Array<any> = [];\n let oMenu: any = {};\n\n oMenu.icon = \"download\";\n oMenu.text = \"Download\";\n oMenu.onClick = () => { _downloadFileFromList(value.pxResults[0])}\n arMenuList.push(oMenu);\n oMenu = {};\n oMenu.icon = \"trash\";\n oMenu.text = \"Delete\";\n oMenu.onClick = () => { _removeFileFromList(arFileList$[0], arFileList$)}\n arMenuList.push(oMenu);\n\n arFileList$.push(getNewListUtilityItemProps({\n att: fileTemp.props,\n downloadFile: null,\n cancelFile: null,\n deleteFile: null,\n removeFile: null\n }));\n arFileList$[0].actions = arMenuList;\n\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList$\n },\n inProgress: false,\n attachmentUploaded: true,\n showMenuIcon: true\n };\n });\n }\n\n if (fileTemp) {\n const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName());\n const index = currentAttachmentList.findIndex(element => element.props.ID === fileTemp.props.ID);\n let tempFiles: any = [];\n if (index < 0) {\n tempFiles = [fileTemp];\n }\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, ...tempFiles],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n }\n\n PCore.getPubSubUtils().subscribe(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,\n resetAttachmentStoredState,\n caseID\n );\n return () => {\n PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);\n };\n }\n }\n }, []);\n\n let content = (\n <div className='file-div'>\n {file.inProgress && (<div className=\"progress-div\"><CircularProgress /></div>)}\n <div hidden={true} id=\"attachment-ID\">{valueRef}</div>\n <label htmlFor={valueRef}>\n <input\n style={{ display: 'none' }}\n id={valueRef}\n name='upload-photo'\n type='file'\n required={required}\n onChange={onFileAdded}\n />\n <Button variant='outlined' color='primary' component=\"span\">\n Upload file\n </Button>\n </label>\n </div>\n );\n\n if (file && file.attachmentUploaded && file.props.arFileList$ && file.props.arFileList$.length > 0) {\n content = (\n <div>\n {file.showMenuIcon && (<SummaryList arItems$={file.props.arFileList$} menuIconOverrideAction$={_removeFileFromList}></SummaryList>)}\n {!file.showMenuIcon && (<SummaryList menuIconOverride$='trash' arItems$={file.props.arFileList$} menuIconOverrideAction$={_removeFileFromList}></SummaryList>)}\n </div>\n\n );\n }\n\n return (\n <div className='file-upload-container'>\n <span className={`label ${required ? 'file-label' : ''}`}>{label}</span>\n <section>{content}</section>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACzI,OAAO,kBAAkB,CAAC;AAC1B,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAIlC,SAAS,yBAAyB,CAAC,OAAO;IACxC,OAAO,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK;IACtC,MAAM,EAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAC1C,wGAAwG;IACxG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnC,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ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AAG,CAAM,CAAC;QAC9E,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,eAAe,IAAE,QAAQ,CAAO;QACtD,+BAAO,OAAO,EAAE,QAAQ;YACtB,+BACE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC1B,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,WAAW,GACrB;YACF,oBAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,kBAElD,CACH,CACN,CACP,CAAC;IAEF,IAAI,IAAI,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;QAClG,OAAO,GAAG,CACR;YACI,IAAI,CAAC,YAAY,IAAI,CAAC,oBAAC,WAAW,gBAAW,IAAI,CAAC,KAAK,CAAC,WAAW,6BAA2B,mBAAmB,GAAgB,CAAC;YAClI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,oBAAC,WAAW,yBAAmB,OAAO,cAAW,IAAI,CAAC,KAAK,CAAC,WAAW,6BAA2B,mBAAmB,GAAgB,CAAC,CAC3J,CAEP,CAAC;KACH;IAED,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,8BAAM,SAAS,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,IAAG,KAAK,CAAQ;QACxE,qCAAU,OAAO,CAAW,CACxB,CACP,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable react/jsx-boolean-value */\n\nimport { Button } from '@material-ui/core';\nimport React, { useState, useEffect } from 'react';\nimport { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize, getIconForAttachment } from '../../helpers/attachmentHelpers';\nimport './Attachment.css';\nimport SummaryList from '../SummaryList'\nimport { CircularProgress } from \"@material-ui/core\";\nimport download from \"downloadjs\";\n\ndeclare const PCore: any;\n\nfunction getCurrentAttachmentsList(context) {\n return PCore.getStoreValue('.attachmentsList', 'context_data', context) || [];\n}\n\nexport default function Attachment(props) {\n const {value, getPConnect, label} = props;\n /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */\n let { required, disabled } = props;\n [required, disabled] = [required, disabled].map(\n prop => prop === true || (typeof prop === 'string' && prop === 'true')\n );\n let arFileList$: Array<any> = [];\n const pConn = getPConnect();\n const caseID = PCore.getStoreValue('.pyID', 'caseInfo.content', pConn.getContextName());\n let fileTemp: any = {};\n\n let categoryName = '';\n if (value && value.pyCategoryName) {\n categoryName = value.pyCategoryName;\n }\n\n let valueRef = pConn.getStateProps().value;\n valueRef = valueRef.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const [file, setFile] = useState(fileTemp);\n\n const resetAttachmentStoredState = () => {\n PCore.getStateUtils().updateState(pConn.getContextName(), 'attachmentsList', undefined, {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n });\n };\n\n const fileDownload = (data, fileName, ext) => {\n const fileData = ext ? `${fileName}.${ext}` : fileName;\n download(atob(data), fileData);\n };\n\n function _downloadFileFromList(fileObj: any) {\n PCore.getAttachmentUtils()\n .downloadAttachment(fileObj.pzInsKey, pConn.getContextName())\n .then((content) => {\n const extension = fileObj.pyAttachName.split(\".\").pop();\n fileDownload(content.data, fileObj.pyFileName, extension);\n })\n .catch(() => {});\n }\n\n function setNewFiles(arFiles) {\n let index = 0;\n for (const item of arFiles) {\n if (!validateMaxSize(item, 5)) {\n item.error = true;\n item.meta = \"File is too big. Max allowed size is 5MB.\";\n }\n item.mimeType = item.type;\n item.icon = getIconFromFileType(item.type);\n item.ID = `${new Date().getTime()}I${index}`;\n index+=1;\n }\n return arFiles;\n }\n\n function getFiles(arFiles: Array<any>) {\n return setNewFiles(arFiles);\n }\n\n function getNewListUtilityItemProps({\n att,\n cancelFile,\n downloadFile,\n deleteFile,\n removeFile\n }) {\n let actions;\n if (att.progress && att.progress !== 100) {\n actions = [\n {\n id: `Cancel-${att.ID}`,\n text: \"Cancel\",\n icon: \"times\",\n onClick: cancelFile\n }\n ];\n } else if (att.links) {\n const isFile = att.type === \"FILE\";\n const ID = att.ID.replace(/\\s/gi, \"\");\n const actionsMap = new Map([\n [\n \"download\",\n {\n id: `download-${ID}`,\n text: isFile ? \"Download\" : \"Open\",\n icon: isFile ? \"download\" : \"open\",\n onClick: downloadFile\n }\n ],\n [\n \"delete\",\n {\n id: `Delete-${ID}`,\n text: \"Delete\",\n icon: \"trash\",\n onClick: deleteFile\n }\n ]\n ]);\n actions = [];\n actionsMap.forEach((action, actionKey) => {\n if (att.links[actionKey]) {\n actions.push(action);\n }\n });\n } else if (att.error) {\n actions = [\n {\n id: `Remove-${att.ID}`,\n text: \"Remove\",\n icon: \"trash\",\n onClick: removeFile\n }\n ];\n }\n return {\n id: att.ID,\n visual: {\n icon: getIconForAttachment(att),\n progress: att.progress === 100 ? undefined: att.progress,\n },\n primary: {\n type: att.type,\n name: att.error ? att.fileName : att.name,\n icon: \"trash\",\n click: removeFile,\n },\n secondary: {\n text: att.meta,\n error: att.error\n },\n actions\n };\n };\n\n const onFileAdded = (event) => {\n const addedFile = event.target.files[0];\n setFile({\n props: {\n name: addedFile.name,\n icon: getIconFromFileType(addedFile.type),\n },\n inProgress: true\n });\n const arFiles$ = getFiles(event.target.files);\n const myFiles: any = Array.from(arFiles$);\n\n const onUploadProgress = () => {};\n\n const errorHandler = (isFetchCanceled) => {\n return (error) => {\n if (!isFetchCanceled(error)) {\n let uploadFailMsg = pConn.getLocalizedValue('Something went wrong');\n if (error.response && error.response.data && error.response.data.errorDetails) {\n uploadFailMsg = pConn.getLocalizedValue(error.response.data.errorDetails[0].localizedValue);\n }\n myFiles[0].meta = uploadFailMsg;\n myFiles[0].error = true;\n myFiles[0].fileName = pConn.getLocalizedValue('Unable to upload file');\n arFileList$ = myFiles.map((att) => {\n return getNewListUtilityItemProps({\n att,\n downloadFile: null,\n cancelFile: null,\n deleteFile: null,\n removeFile: null\n });\n });\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList$\n },\n inProgress: false,\n attachmentUploaded: true,\n showMenuIcon: false\n };\n });\n }\n throw error;\n };\n };\n\n PCore.getAttachmentUtils()\n .uploadAttachment(\n myFiles[0],\n onUploadProgress,\n errorHandler,\n pConn.getContextName()\n )\n .then((fileRes) => {\n let reqObj;\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n reqObj = {\n type: \"File\",\n attachmentFieldName: valueRef,\n category: categoryName,\n ID: fileRes.ID\n };\n pConn.attachmentsInfo = reqObj;\n } else {\n reqObj = {\n type: \"File\",\n label: valueRef,\n category: categoryName,\n handle: fileRes.ID,\n ID: fileRes.clientFileID\n };\n const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName()).filter(\n (f) => f.label !== valueRef\n );\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, reqObj],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n }\n const fieldName = pConn.getStateProps().value;\n const context = pConn.getContextName();\n\n PCore.getMessageManager().clearMessages({\n type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n myFiles[0].meta = \"Uploaded Successfully\";\n\n arFileList$ = myFiles.map((att) => {\n return getNewListUtilityItemProps({\n att,\n downloadFile: null,\n cancelFile: null,\n deleteFile: null,\n removeFile: null\n });\n });\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList$\n },\n inProgress: false,\n attachmentUploaded: true,\n showMenuIcon: false\n };\n });\n })\n\n .catch(() => {\n // just catching the rethrown error at uploadAttachment\n // to handle Unhandled rejections\n });\n };\n\n function _removeFileFromList(item: any, list) {\n const arFileList = file.props ? file.props.arFileList$ : list;\n const fileIndex = arFileList.findIndex(element => element?.id === item?.id);\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n if (value) {\n pConn.attachmentsInfo = {\n type: \"File\",\n attachmentFieldName: valueRef,\n delete: true\n };\n }\n if (fileIndex > -1) { arFileList.splice(parseInt(fileIndex, 10), 1) };\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList\n },\n };\n });\n } else {\n const attachmentsList = [];\n const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName()).filter(\n (f) => f.label !== valueRef\n );\n if (value && value.pxResults && +value.pyCount > 0) {\n const deletedFile = {\n type: \"File\",\n label: valueRef,\n delete: true,\n responseProps: {\n pzInsKey: arFileList[fileIndex].id\n },\n };\n // updating the redux store to help form-handler in passing the data to delete the file from server\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, deletedFile],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n } else {\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, ...attachmentsList],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n }\n if (fileIndex > -1) { arFileList.splice(parseInt(fileIndex, 10), 1) };\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList\n },\n };\n });\n }\n }\n\n useEffect(() => {\n if (value && value.pxResults && +value.pyCount > 0) {\n fileTemp = buildFilePropsFromResponse(value.pxResults[0]);\n\n if (fileTemp.responseProps) {\n if (!pConn.attachmentsInfo) {\n pConn.attachmentsInfo = {\n type: \"File\",\n attachmentFieldName: valueRef,\n category: categoryName\n };\n }\n\n if (fileTemp.responseProps.pzInsKey && !fileTemp.responseProps.pzInsKey.includes(\"temp\")) {\n\n fileTemp.props.type = fileTemp.responseProps.pyMimeFileExtension;\n fileTemp.props.mimeType = fileTemp.responseProps.pyMimeFileExtension;\n fileTemp.props.ID = fileTemp.responseProps.pzInsKey;\n // create the actions for the \"more\" menu on the attachment\n const arMenuList: Array<any> = [];\n let oMenu: any = {};\n\n oMenu.icon = \"download\";\n oMenu.text = \"Download\";\n oMenu.onClick = () => { _downloadFileFromList(value.pxResults[0])}\n arMenuList.push(oMenu);\n oMenu = {};\n oMenu.icon = \"trash\";\n oMenu.text = \"Delete\";\n oMenu.onClick = () => { _removeFileFromList(arFileList$[0], arFileList$)}\n arMenuList.push(oMenu);\n\n arFileList$.push(getNewListUtilityItemProps({\n att: fileTemp.props,\n downloadFile: null,\n cancelFile: null,\n deleteFile: null,\n removeFile: null\n }));\n arFileList$[0].actions = arMenuList;\n\n setFile((current) => {\n return {\n ...current,\n props: {\n ...current.props,\n arFileList$\n },\n inProgress: false,\n attachmentUploaded: true,\n showMenuIcon: true\n };\n });\n }\n\n if (fileTemp) {\n const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName());\n const index = currentAttachmentList.findIndex(element => element.props.ID === fileTemp.props.ID);\n let tempFiles: any = [];\n if (index < 0) {\n tempFiles = [fileTemp];\n }\n PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [...currentAttachmentList, ...tempFiles],\n {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n }\n );\n }\n }\n }\n PCore.getPubSubUtils().subscribe(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,\n resetAttachmentStoredState,\n caseID\n );\n return () => {\n PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);\n };\n }, []);\n\n let content = (\n <div className='file-div'>\n {file.inProgress && (<div className=\"progress-div\"><CircularProgress /></div>)}\n <div hidden={true} id=\"attachment-ID\">{valueRef}</div>\n <label htmlFor={valueRef}>\n <input\n style={{ display: 'none' }}\n id={valueRef}\n name='upload-photo'\n type='file'\n required={required}\n onChange={onFileAdded}\n />\n <Button variant='outlined' color='primary' component=\"span\">\n Upload file\n </Button>\n </label>\n </div>\n );\n\n if (file && file.attachmentUploaded && file.props.arFileList$ && file.props.arFileList$.length > 0) {\n content = (\n <div>\n {file.showMenuIcon && (<SummaryList arItems$={file.props.arFileList$} menuIconOverrideAction$={_removeFileFromList}></SummaryList>)}\n {!file.showMenuIcon && (<SummaryList menuIconOverride$='trash' arItems$={file.props.arFileList$} menuIconOverrideAction$={_removeFileFromList}></SummaryList>)}\n </div>\n\n );\n }\n\n return (\n <div className='file-upload-container'>\n <span className={`label ${required ? 'file-label' : ''}`}>{label}</span>\n <section>{content}</section>\n </div>\n );\n}\n"]}
@@ -13,6 +13,7 @@ declare namespace ToDo {
13
13
  showTodoList: PropTypes.Requireable<boolean>;
14
14
  type: PropTypes.Requireable<string>;
15
15
  context: PropTypes.Requireable<string>;
16
+ isConfirm: PropTypes.Requireable<boolean>;
16
17
  };
17
18
  var defaultProps: {
18
19
  caseInfoID: string;
@@ -23,6 +24,7 @@ declare namespace ToDo {
23
24
  showTodoList: boolean;
24
25
  type: string;
25
26
  context: string;
27
+ isConfirm: boolean;
26
28
  };
27
29
  }
28
30
  export default ToDo;
@@ -1 +1 @@
1
- {"version":3,"file":"ToDo.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/ToDo/ToDo.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AAyBnC,OAAO,YAAY,CAAC;AAqCpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,eAwPjC;kBAxPuB,IAAI;;;;;;;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
1
+ {"version":3,"file":"ToDo.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/ToDo/ToDo.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AAyBnC,OAAO,YAAY,CAAC;AA2CpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,eA0PjC;kBA1PuB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-shadow */
2
2
  /* eslint-disable @typescript-eslint/no-shadow */
3
- import React, { useState } from 'react';
3
+ import React, { Fragment, useState } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { Utils } from '../../helpers/utils';
6
6
  import { Box, Button, Card, CardContent, CardHeader, Avatar, Typography, Badge, List, ListItem, ListItemText, ListItemSecondaryAction } from '@material-ui/core';
@@ -12,7 +12,7 @@ import { makeStyles } from '@material-ui/core/styles';
12
12
  import { useTheme } from '@material-ui/core/styles';
13
13
  import useMediaQuery from '@material-ui/core/useMediaQuery';
14
14
  import './ToDo.css';
15
- const isChildCase = (assignment) => {
15
+ const isChildCase = assignment => {
16
16
  return assignment.isChild;
17
17
  };
18
18
  function topThreeAssignments(assignmentsSource) {
@@ -40,10 +40,16 @@ const useStyles = makeStyles(theme => ({
40
40
  avatar: {
41
41
  backgroundColor: theme.palette.primary.light,
42
42
  color: theme.palette.getContrastText(theme.palette.primary.light)
43
+ },
44
+ todoWrapper: {
45
+ borderLeft: '6px solid',
46
+ borderLeftColor: theme.palette.primary.light,
47
+ padding: theme.spacing(1),
48
+ margin: theme.spacing(1)
43
49
  }
44
50
  }));
45
51
  export default function ToDo(props) {
46
- const { datasource, getPConnect, headerText, showTodoList, myWorkList, type } = props;
52
+ const { datasource, getPConnect, headerText, showTodoList, myWorkList, type, isConfirm } = props;
47
53
  const CONSTS = PCore.getConstants();
48
54
  const bLogging = true;
49
55
  let assignmentCount = 0;
@@ -153,6 +159,20 @@ export default function ToDo(props) {
153
159
  React.createElement(Button, { size: 'small', color: 'primary' }, `${assignment.name} ${getID(assignment)}`),
154
160
  ` \u2022 Urgency ${getPriority(assignment)}`));
155
161
  };
162
+ const toDoContent = (React.createElement(React.Fragment, null,
163
+ showTodoList && (React.createElement(CardHeader, { title: React.createElement(Badge, { badgeContent: assignmentCount, color: 'primary' },
164
+ React.createElement(Typography, { variant: 'h6' },
165
+ headerText,
166
+ "\u00A0\u00A0\u00A0")) })),
167
+ React.createElement(List, null, assignments.map(assignment => (React.createElement(React.Fragment, null,
168
+ React.createElement("div", { className: 'psdk-todo-avatar-header' },
169
+ React.createElement(Avatar, { className: classes.avatar, style: { marginRight: '16px' } }, currentUserInitials),
170
+ React.createElement("div", { style: { display: 'block' } },
171
+ React.createElement(Typography, { variant: 'h6' }, assignment?.name),
172
+ `Task in ${renderTaskId(type, getPConnect, showTodoList, assignment)} \u2022 Urgency ${getPriority(assignment)}`),
173
+ !isConfirm && (React.createElement("div", { style: { marginLeft: 'auto' } },
174
+ React.createElement(IconButton, { onClick: () => clickGo(assignment) },
175
+ React.createElement(ArrowForwardIosOutlinedIcon, null)))))))))));
156
176
  return (React.createElement(React.Fragment, null,
157
177
  type === CONSTS.WORKLIST && (React.createElement(Card, { className: classes.root },
158
178
  showTodoList && (React.createElement(CardHeader, { title: React.createElement(Badge, { badgeContent: assignmentCount, color: 'primary' },
@@ -162,23 +182,12 @@ export default function ToDo(props) {
162
182
  React.createElement(CardContent, null,
163
183
  React.createElement(List, null, assignments.map(assignment => (React.createElement(ListItem, { key: getAssignmentId(assignment), dense: true, divider: true, onClick: () => clickGo(assignment) },
164
184
  React.createElement(ListItemText, { primary: getAssignmentName(assignment), secondary: getListItemComponent(assignment) }),
165
- type === CONSTS.WORKLIST && (React.createElement(ListItemSecondaryAction, null,
185
+ React.createElement(ListItemSecondaryAction, null,
166
186
  React.createElement(IconButton, { onClick: () => clickGo(assignment) },
167
- React.createElement(ArrowForwardIosOutlinedIcon, null))))))))),
168
- assignmentCount > 3 && (React.createElement(Box, { display: 'flex', justifyContent: 'center' }, bShowMore ? (React.createElement(Button, { color: 'primary', onClick: _showMore }, "Show more")) : (React.createElement(Button, { onClick: _showLess }, "Show less")))))),
169
- type === CONSTS.TODO && (React.createElement(React.Fragment, null,
170
- showTodoList && (React.createElement(React.Fragment, null,
171
- React.createElement(Badge, { badgeContent: assignmentCount, color: 'primary' },
172
- React.createElement(Typography, { variant: 'h6' },
173
- headerText,
174
- "\u00A0\u00A0\u00A0")))),
175
- React.createElement(List, null, assignments.map(assignment => (React.createElement(React.Fragment, null,
176
- React.createElement("div", { className: 'psdk-todo-avatar-header' },
177
- React.createElement(Avatar, { className: classes.avatar, style: { marginRight: '16px' } }, currentUserInitials),
178
- React.createElement("div", { style: { display: 'block' } },
179
- React.createElement(Typography, { variant: 'h6' }, assignment?.name),
180
- `Task in ${renderTaskId(type, getPConnect, showTodoList, assignment)} \u2022 Urgency ${getPriority(assignment)}`)))))),
181
- assignmentCount > 3 && (React.createElement(Box, { display: 'flex', justifyContent: 'center' }, bShowMore ? (React.createElement(Button, { color: 'primary', onClick: _showMore }, "Show more")) : (React.createElement(Button, { onClick: _showLess }, "Show less")))))),
187
+ React.createElement(ArrowForwardIosOutlinedIcon, null)))))))))),
188
+ type === CONSTS.TODO && !isConfirm && (React.createElement(Card, { className: classes.todoWrapper }, toDoContent)),
189
+ type === CONSTS.TODO && isConfirm && React.createElement(Fragment, null, toDoContent),
190
+ assignmentCount > 3 && (React.createElement(Box, { display: 'flex', justifyContent: 'center' }, bShowMore ? (React.createElement(Button, { color: 'primary', onClick: _showMore }, "Show more")) : (React.createElement(Button, { onClick: _showLess }, "Show less")))),
182
191
  React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
183
192
  React.createElement(CloseIcon, { fontSize: 'small' })) })));
184
193
  }
@@ -197,8 +206,9 @@ ToDo.propTypes = {
197
206
  type: PropTypes.string,
198
207
  // pageMessages: PropTypes.arrayOf(PropTypes.any),
199
208
  // eslint-disable-next-line react/no-unused-prop-types
200
- context: PropTypes.string
209
+ context: PropTypes.string,
201
210
  // hideActionButtons: PropTypes.bool
211
+ isConfirm: PropTypes.bool
202
212
  };
203
213
  ToDo.defaultProps = {
204
214
  caseInfoID: '',
@@ -211,7 +221,8 @@ ToDo.defaultProps = {
211
221
  // target: "",
212
222
  type: 'worklist',
213
223
  // pageMessages: null,
214
- context: ''
224
+ context: '',
215
225
  // hideActionButtons: false
226
+ isConfirm: false
216
227
  };
217
228
  //# sourceMappingURL=ToDo.js.map