@pega/react-sdk-components 0.23.17 → 0.23.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +20 -3
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +1 -2
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +23 -40
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.js +5 -5
- package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +5 -5
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/Currency.d.ts.map +1 -1
- package/lib/components/field/Currency/Currency.js +21 -6
- package/lib/components/field/Currency/Currency.js.map +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts +11 -0
- package/lib/components/field/Currency/currency-utils.d.ts.map +1 -0
- package/lib/components/field/Currency/currency-utils.js +60 -0
- package/lib/components/field/Currency/currency-utils.js.map +1 -0
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +17 -6
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +16 -7
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +5 -5
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +5 -5
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Email/Email.js +5 -5
- package/lib/components/field/Email/Email.js.map +1 -1
- package/lib/components/field/Integer/Integer.d.ts.map +1 -1
- package/lib/components/field/Integer/Integer.js +5 -5
- package/lib/components/field/Integer/Integer.js.map +1 -1
- package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
- package/lib/components/field/Percentage/Percentage.js +5 -5
- package/lib/components/field/Percentage/Percentage.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +5 -5
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +5 -5
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.js +5 -1
- package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/field/TextArea/TextArea.js +5 -5
- package/lib/components/field/TextArea/TextArea.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +5 -5
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +5 -5
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +5 -5
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/helpers/authManager.d.ts.map +1 -1
- package/lib/components/helpers/authManager.js +1 -0
- package/lib/components/helpers/authManager.js.map +1 -1
- package/lib/components/helpers/date-format-utils.d.ts +13 -0
- package/lib/components/helpers/date-format-utils.d.ts.map +1 -0
- package/lib/components/helpers/date-format-utils.js +59 -0
- package/lib/components/helpers/date-format-utils.js.map +1 -0
- package/lib/components/helpers/event-utils.js +1 -1
- package/lib/components/helpers/event-utils.js.map +1 -1
- package/lib/components/helpers/formatters/Currency.js +11 -5
- package/lib/components/helpers/formatters/Currency.js.map +1 -1
- package/lib/components/helpers/formatters/common.d.ts.map +1 -1
- package/lib/components/helpers/formatters/common.js +6 -1
- package/lib/components/helpers/formatters/common.js.map +1 -1
- package/lib/components/helpers/formatters/index.d.ts.map +1 -1
- package/lib/components/helpers/formatters/index.js +4 -0
- package/lib/components/helpers/formatters/index.js.map +1 -1
- package/lib/components/helpers/template-utils.d.ts +14 -0
- package/lib/components/helpers/template-utils.d.ts.map +1 -0
- package/lib/components/helpers/template-utils.js +65 -0
- package/lib/components/helpers/template-utils.js.map +1 -0
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +53 -54
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +3 -49
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.css +4 -18
- package/lib/components/infra/NavBar/NavBar.d.ts +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +57 -121
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +0 -50
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +1 -2
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +13 -4
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +2 -323
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.js +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +2 -3
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js +6 -1
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/Details/Details/Details.d.ts +2 -0
- package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
- package/lib/components/template/Details/Details/Details.js +35 -18
- package/lib/components/template/Details/Details/Details.js.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +12 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +43 -27
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +12 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +43 -25
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.d.ts +91 -0
- package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -0
- package/lib/components/template/ListView/DefaultViewMeta.js +208 -0
- package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -0
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +147 -83
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/ListView/hooks.d.ts +2 -0
- package/lib/components/template/ListView/hooks.d.ts.map +1 -0
- package/lib/components/template/ListView/hooks.js +73 -0
- package/lib/components/template/ListView/hooks.js.map +1 -0
- package/lib/components/template/ListView/utils.d.ts +63 -0
- package/lib/components/template/ListView/utils.d.ts.map +1 -0
- package/lib/components/template/ListView/utils.js +537 -0
- package/lib/components/template/ListView/utils.js.map +1 -0
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +12 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +45 -29
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -20
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +12 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +45 -29
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.css +7 -0
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +25 -2
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +33 -0
- package/package.json +1 -1
- package/lib/components/template/utils.d.ts +0 -3
- package/lib/components/template/utils.d.ts.map +0 -1
- package/lib/components/template/utils.js +0 -22
- package/lib/components/template/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.js"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.js"],"names":[],"mappings":"AAAA,4CAOC;AAED,uDAIC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export function getLocale(locale) {
|
|
2
|
+
// use locale if specified
|
|
2
3
|
if (locale)
|
|
3
4
|
return locale;
|
|
4
|
-
|
|
5
|
+
// otherwise, use operator locale if it's defined
|
|
6
|
+
if (window.PCore.getEnvironmentInfo().getUseLocale())
|
|
7
|
+
return window.PCore.getEnvironmentInfo().getUseLocale();
|
|
8
|
+
// fallback
|
|
9
|
+
return Intl.DateTimeFormat().resolvedOptions().locale;
|
|
5
10
|
}
|
|
6
11
|
export function getCurrentTimezone(timezone) {
|
|
7
12
|
if (timezone)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.js"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,MAAM;IAC9B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/common.js"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,MAAM;IAC9B,0BAA0B;IAC1B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,iDAAiD;IACjD,IAAI,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC,YAAY,EAAE;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC,YAAY,EAAE,CAAC;IAC9G,WAAW;IACX,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAQ;IACzC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,oCAAoC;IACpC,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,gBAAgB,EAAE,EAAE,CAAC;AACxD,CAAC","sourcesContent":["export function getLocale(locale) {\n // use locale if specified\n if (locale) return locale;\n // otherwise, use operator locale if it's defined\n if (window.PCore.getEnvironmentInfo().getUseLocale()) return window.PCore.getEnvironmentInfo().getUseLocale();\n // fallback\n return Intl.DateTimeFormat().resolvedOptions().locale;\n}\n\nexport function getCurrentTimezone(timezone) {\n if (timezone) return timezone;\n // eslint-disable-next-line no-undef\n return PCore?.getLocaleUtils?.().getTimeZoneInUse?.();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/index.js"],"names":[],"mappings":"AA4DA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/index.js"],"names":[],"mappings":"AA4DA,iEAgEC"}
|
|
@@ -96,6 +96,10 @@ export function format(value, type, options = {}) {
|
|
|
96
96
|
formattedValue = Boolean.TrueFalse(value, { allowEmpty: false });
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
|
+
case "userreference": {
|
|
100
|
+
formattedValue = value.userName;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
99
103
|
default:
|
|
100
104
|
formattedValue = value;
|
|
101
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources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,OAAO,EAAE,CAAC;YACjD,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM;SACP;QAED,KAAK,UAAU,CAAC,CAAC;YACf,MAAM,cAAc,GAAG;gBACrB,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,kBAAkB,EAAE;aAC/B,CAAC;YACF,MAAM,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;YACjD,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM;SACP;QAED,KAAK,SAAS,CAAC;QACf,KAAK,UAAU,CAAC,CAAC;YACf,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;YACjE,MAAM;SACP;QAED;YACE,cAAc,GAAG,KAAK,CAAC;KAC1B;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import Boolean from \"./Boolean\";\nimport Currency from \"./Currency\";\nimport DateFormatter from \"./Date\";\nimport { getCurrentTimezone, getLocale } from \"./common\";\n\nexport default {\n ...Boolean,\n ...Currency,\n ...DateFormatter\n};\n\nfunction getDateObject(text) {\n // TODO - cleanup formatters util functions as DX APIs are returning values per ISO std now.\n const timeStamp = text.replace(/-/g, \"\");\n const isDateTime = timeStamp.indexOf(\"GMT\") !== -1;\n const year = parseInt(timeStamp.substr(0, 4), 10);\n const month = parseInt(timeStamp.substr(4, 2), 10) - 1;\n const day = parseInt(timeStamp.substr(6, 2), 10);\n\n const date = new Date();\n\n date.setDate(day);\n date.setMonth(month);\n date.setFullYear(year);\n\n if (isDateTime) {\n const hours = parseInt(timeStamp.substr(9, 2), 10);\n const minutes = parseInt(timeStamp.substr(11, 2), 10);\n const seconds = parseInt(timeStamp.substr(13, 2), 10);\n const ms = parseInt(timeStamp.substr(16, 3), 10);\n date.setHours(hours);\n date.setMinutes(minutes);\n date.setSeconds(seconds);\n date.setMilliseconds(ms);\n }\n\n return date;\n}\n\nfunction isIsoDate(str) {\n if (!/\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/.test(str)) return false;\n const d = new Date(str);\n return d.toISOString() === str;\n}\n\nfunction parseDateInISO(value) {\n const isMilliSeconds = new RegExp(\"^[0-9]+$\").exec(value);\n if (isMilliSeconds) {\n const date = new Date(parseInt(value, 10));\n return date.toISOString();\n }\n\n if (isIsoDate(value)) {\n const date = new Date(value);\n return date.toISOString();\n }\n\n return value ? getDateObject(value).toISOString() : value;\n}\n\nexport function format(value, type, options = {}) {\n let formattedValue;\n\n switch (type?.toLowerCase()) {\n case \"currency\": {\n const defaultOptions = {\n locale: getLocale(),\n position: \"before\",\n decPlaces: 2\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Currency(value, params);\n break;\n }\n\n case \"decimal\": {\n const defaultOptions = { locale: getLocale(), decPlaces: 2 };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Decimal(value, params);\n break;\n }\n\n case \"integer\": {\n const defaultOptions = { locale: getLocale() };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Integer(value, params);\n break;\n }\n\n case \"date\": {\n const defaultOptions = {\n format: \"MMM DD, YYYY\",\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case \"datetime\": {\n const defaultOptions = {\n format: \"MMM DD, YYYY h:mm A\",\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case \"boolean\":\n case \"checkbox\": {\n formattedValue = Boolean.TrueFalse(value, { allowEmpty: false });\n break;\n }\n\n default:\n formattedValue = value;\n }\n return formattedValue;\n}\n"]}
|
|
1
|
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AG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;YACjD,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM;SACP;QAED,KAAK,UAAU,CAAC,CAAC;YACf,MAAM,cAAc,GAAG;gBACrB,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,kBAAkB,EAAE;aAC/B,CAAC;YACF,MAAM,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;YACjD,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM;SACP;QAED,KAAK,SAAS,CAAC;QACf,KAAK,UAAU,CAAC,CAAC;YACf,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;YACjE,MAAM;SACP;QAED,KAAK,eAAe,CAAC,CAAC;YACpB,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC;YAChC,MAAM;SACP;QAED;YACE,cAAc,GAAG,KAAK,CAAC;KAC1B;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import Boolean from \"./Boolean\";\nimport Currency from \"./Currency\";\nimport DateFormatter from \"./Date\";\nimport { getCurrentTimezone, getLocale } from \"./common\";\n\nexport default {\n ...Boolean,\n ...Currency,\n ...DateFormatter\n};\n\nfunction getDateObject(text) {\n // TODO - cleanup formatters util functions as DX APIs are returning values per ISO std now.\n const timeStamp = text.replace(/-/g, \"\");\n const isDateTime = timeStamp.indexOf(\"GMT\") !== -1;\n const year = parseInt(timeStamp.substr(0, 4), 10);\n const month = parseInt(timeStamp.substr(4, 2), 10) - 1;\n const day = parseInt(timeStamp.substr(6, 2), 10);\n\n const date = new Date();\n\n date.setDate(day);\n date.setMonth(month);\n date.setFullYear(year);\n\n if (isDateTime) {\n const hours = parseInt(timeStamp.substr(9, 2), 10);\n const minutes = parseInt(timeStamp.substr(11, 2), 10);\n const seconds = parseInt(timeStamp.substr(13, 2), 10);\n const ms = parseInt(timeStamp.substr(16, 3), 10);\n date.setHours(hours);\n date.setMinutes(minutes);\n date.setSeconds(seconds);\n date.setMilliseconds(ms);\n }\n\n return date;\n}\n\nfunction isIsoDate(str) {\n if (!/\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/.test(str)) return false;\n const d = new Date(str);\n return d.toISOString() === str;\n}\n\nfunction parseDateInISO(value) {\n const isMilliSeconds = new RegExp(\"^[0-9]+$\").exec(value);\n if (isMilliSeconds) {\n const date = new Date(parseInt(value, 10));\n return date.toISOString();\n }\n\n if (isIsoDate(value)) {\n const date = new Date(value);\n return date.toISOString();\n }\n\n return value ? getDateObject(value).toISOString() : value;\n}\n\nexport function format(value, type, options = {}) {\n let formattedValue;\n\n switch (type?.toLowerCase()) {\n case \"currency\": {\n const defaultOptions = {\n locale: getLocale(),\n position: \"before\",\n decPlaces: 2\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Currency(value, params);\n break;\n }\n\n case \"decimal\": {\n const defaultOptions = { locale: getLocale(), decPlaces: 2 };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Decimal(value, params);\n break;\n }\n\n case \"integer\": {\n const defaultOptions = { locale: getLocale() };\n const params = { ...defaultOptions, ...options };\n formattedValue = Currency.Integer(value, params);\n break;\n }\n\n case \"date\": {\n const defaultOptions = {\n format: \"MMM DD, YYYY\",\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case \"datetime\": {\n const defaultOptions = {\n format: \"MMM DD, YYYY h:mm A\",\n timezone: getCurrentTimezone()\n };\n const params = { ...defaultOptions, ...options };\n formattedValue = DateFormatter.Date(parseDateInISO(value), params);\n break;\n }\n\n case \"boolean\":\n case \"checkbox\": {\n formattedValue = Boolean.TrueFalse(value, { allowEmpty: false });\n break;\n }\n\n case \"userreference\": {\n formattedValue = value.userName;\n break;\n }\n\n default:\n formattedValue = value;\n }\n return formattedValue;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function getAllFields(pConnect: any): never[];
|
|
2
|
+
export declare function filterForFieldValueList(fields: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* Determine if the current view is the view of the case step/assignment.
|
|
5
|
+
* @param {Function} pConnect PConnect object for the component
|
|
6
|
+
*/
|
|
7
|
+
export declare function getIsAssignmentView(pConnect: any): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* A hook that gets the instructions content for a view.
|
|
10
|
+
* @param {Function} pConnect PConnect object for the component
|
|
11
|
+
* @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
|
|
12
|
+
*/
|
|
13
|
+
export declare function getInstructions(pConnect: any, instructions?: string): any;
|
|
14
|
+
//# sourceMappingURL=template-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/template-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,WAUzC;AAGD,wBAAgB,uBAAuB,CAAC,MAAM,EAAG,GAAG,OAQnD;AAGD;;;GAGG;AACF,wBAAgB,mBAAmB,CAAC,QAAQ,KAAA,WAY5C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,KAAA,EAAE,YAAY,SAAa,OA4BlE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// This file is adapted from React DX components/template/utils.js
|
|
2
|
+
export function getAllFields(pConnect) {
|
|
3
|
+
const metadata = pConnect.getRawMetadata();
|
|
4
|
+
let allFields = [];
|
|
5
|
+
if (metadata.children && metadata.children.map) {
|
|
6
|
+
allFields = metadata.children.map((fields) => {
|
|
7
|
+
const children = fields.children instanceof Array ? fields.children : [];
|
|
8
|
+
return children.map((field) => field.config);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return allFields;
|
|
12
|
+
}
|
|
13
|
+
export function filterForFieldValueList(fields) {
|
|
14
|
+
return fields
|
|
15
|
+
.filter(({ visibility }) => visibility !== false)
|
|
16
|
+
.map(({ value, label }) => ({
|
|
17
|
+
id: label.toLowerCase(),
|
|
18
|
+
name: label,
|
|
19
|
+
value
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Determine if the current view is the view of the case step/assignment.
|
|
24
|
+
* @param {Function} pConnect PConnect object for the component
|
|
25
|
+
*/
|
|
26
|
+
export function getIsAssignmentView(pConnect) {
|
|
27
|
+
// Get caseInfo content from the store which contains the view info about the current assignment/step
|
|
28
|
+
// TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
|
|
29
|
+
const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
|
|
30
|
+
const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
|
|
31
|
+
const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
|
|
32
|
+
// Get the info about the current view from pConnect
|
|
33
|
+
const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
|
|
34
|
+
return assignmentViewId === currentViewId;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A hook that gets the instructions content for a view.
|
|
38
|
+
* @param {Function} pConnect PConnect object for the component
|
|
39
|
+
* @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
|
|
40
|
+
*/
|
|
41
|
+
export function getInstructions(pConnect, instructions = 'casestep') {
|
|
42
|
+
const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
|
|
43
|
+
// Determine if this view is the current assignment/step view
|
|
44
|
+
const isCurrentAssignmentView = getIsAssignmentView(pConnect);
|
|
45
|
+
// Case step instructions
|
|
46
|
+
if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {
|
|
47
|
+
return caseStepInstructions;
|
|
48
|
+
}
|
|
49
|
+
// No instructions
|
|
50
|
+
if (instructions === 'none') {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
// If the annotation wasn't processed correctly, don't return any instruction text
|
|
54
|
+
if (instructions?.startsWith('@PARAGRAPH')) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
// Custom instructions from the view
|
|
58
|
+
// The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but
|
|
59
|
+
// it is evaluated by core logic to the content
|
|
60
|
+
if (instructions !== 'casestep' && instructions !== 'none') {
|
|
61
|
+
return instructions;
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=template-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/template-utils.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAInE,MAAM,UAAU,YAAY,CAAC,QAAa;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC3C,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC9C,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,OAAO,QAAQ,CAAC,GAAG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BAAuB,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE9D,yBAAyB;IACzB,IAAI,YAAY,KAAK,UAAU,IAAI,uBAAuB,IAAI,oBAAoB,EAAE,MAAM,EAAE;QAC1F,OAAO,oBAAoB,CAAC;KAC7B;IAED,kBAAkB;IAClB,IAAI,YAAY,KAAK,MAAM,EAAE;QAC3B,OAAO,SAAS,CAAC;KAClB;IAED,kFAAkF;IAClF,IAAI,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE;QAC1C,OAAO,SAAS,CAAC;KAClB;IAED,oCAAoC;IACpC,iGAAiG;IACjG,+CAA+C;IAC/C,IAAI,YAAY,KAAK,UAAU,IAAI,YAAY,KAAK,MAAM,EAAE;QAC1D,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// This file is adapted from React DX components/template/utils.js\n\ndeclare const PCore: any;\n\nexport function getAllFields(pConnect: any) {\n const metadata = pConnect.getRawMetadata();\n let allFields = [];\n if (metadata.children && metadata.children.map) {\n allFields = metadata.children.map((fields) => {\n const children = fields.children instanceof Array ? fields.children : [];\n return children.map((field) => field.config);\n });\n }\n return allFields;\n}\n\n\nexport function filterForFieldValueList(fields : any) {\n return fields\n .filter(({ visibility }) => visibility !== false)\n .map(({ value, label }) => ({\n id: label.toLowerCase(),\n name: label,\n value\n }));\n}\n\n\n/**\n * Determine if the current view is the view of the case step/assignment.\n * @param {Function} pConnect PConnect object for the component\n */\n export function getIsAssignmentView(pConnect) {\n // Get caseInfo content from the store which contains the view info about the current assignment/step\n // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available\n const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);\n const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);\n\n const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;\n\n // Get the info about the current view from pConnect\n const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;\n\n return assignmentViewId === currentViewId;\n}\n\n/**\n * A hook that gets the instructions content for a view.\n * @param {Function} pConnect PConnect object for the component\n * @param {string} [instructions=\"casestep\"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)\n */\nexport function getInstructions(pConnect, instructions = 'casestep') {\n const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);\n\n // Determine if this view is the current assignment/step view\n const isCurrentAssignmentView = getIsAssignmentView(pConnect);\n\n // Case step instructions\n if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {\n return caseStepInstructions;\n }\n\n // No instructions\n if (instructions === 'none') {\n return undefined;\n }\n\n // If the annotation wasn't processed correctly, don't return any instruction text\n if (instructions?.startsWith('@PARAGRAPH')) {\n return undefined;\n }\n\n // Custom instructions from the view\n // The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but\n // it is evaluated by core logic to the content\n if (instructions !== 'casestep' && instructions !== 'none') {\n return instructions;\n }\n return undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/infra/Containers/FlowContainer/FlowContainer.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AAgDnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"FlowContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/infra/Containers/FlowContainer/FlowContainer.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AAgDnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,eAmb1C;kBAnbuB,aAAa;;;;;;;;;;;;;;;;;;eAAb,aAAa"}
|
|
@@ -203,7 +203,7 @@ export default function FlowContainer(props) {
|
|
|
203
203
|
}
|
|
204
204
|
return activeActionLabel;
|
|
205
205
|
}
|
|
206
|
-
// From WC
|
|
206
|
+
// From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...
|
|
207
207
|
useEffect(() => {
|
|
208
208
|
const localPConn = arNewChildren[0].getPConnect();
|
|
209
209
|
setBuildName(getBuildName());
|
|
@@ -247,6 +247,58 @@ export default function FlowContainer(props) {
|
|
|
247
247
|
if (window.sessionStorage.getItem("okToInitFlowContainer") === "true") {
|
|
248
248
|
initContainer();
|
|
249
249
|
}
|
|
250
|
+
// this check in routingInfo, mimic React to check and get the internals of the
|
|
251
|
+
// flowContainer and force updates to pConnect/redux
|
|
252
|
+
if (routingInfo && loadingInfo !== undefined) {
|
|
253
|
+
// debugging/investigation help
|
|
254
|
+
// console.log(`${thePConn.getComponentName()}: >>routingInfo: ${JSON.stringify(routingInfo)}`);
|
|
255
|
+
const currentOrder = routingInfo.accessedOrder;
|
|
256
|
+
const currentItems = routingInfo.items;
|
|
257
|
+
const type = routingInfo.type;
|
|
258
|
+
if (currentOrder && currentItems) { // JA - making more similar to React version
|
|
259
|
+
const key = currentOrder[currentOrder.length - 1];
|
|
260
|
+
// save off itemKey to be used for finishAssignment, etc.
|
|
261
|
+
// debugger;
|
|
262
|
+
setItemKey(key);
|
|
263
|
+
if (currentOrder.length > 0 &&
|
|
264
|
+
currentItems[key] &&
|
|
265
|
+
currentItems[key].view &&
|
|
266
|
+
type === "single" &&
|
|
267
|
+
!Utils.isEmptyObject(currentItems[key].view)) {
|
|
268
|
+
const currentItem = currentItems[key];
|
|
269
|
+
const rootView = currentItem.view;
|
|
270
|
+
const { context } = rootView.config;
|
|
271
|
+
const config = { meta: rootView };
|
|
272
|
+
config["options"] = {
|
|
273
|
+
context: currentItem.context,
|
|
274
|
+
pageReference: context || localPConn.getPageReference(),
|
|
275
|
+
hasForm: true,
|
|
276
|
+
isFlowContainer: true,
|
|
277
|
+
containerName: localPConn.getContainerName(),
|
|
278
|
+
containerItemName: key,
|
|
279
|
+
parentPageReference: localPConn.getPageReference()
|
|
280
|
+
};
|
|
281
|
+
const configObject = PCore.createPConnect(config);
|
|
282
|
+
// Since we're setting an array, need to add in an appropriate key
|
|
283
|
+
// to remove React warning.
|
|
284
|
+
configObject["key"] = config["options"].parentPageReference;
|
|
285
|
+
// keep track of these changes
|
|
286
|
+
const theNewChildren = [];
|
|
287
|
+
theNewChildren.push(configObject);
|
|
288
|
+
setArNewChildren(theNewChildren);
|
|
289
|
+
// JEA - adapted from Constellation DX Components FlowContainer since we want to render children that are React components
|
|
290
|
+
const root = createElement(createPConnectComponent(), configObject);
|
|
291
|
+
setArNewChildrenAsReact([root]);
|
|
292
|
+
const oWorkItem = configObject.getPConnect(); // was theNewChildren[0].getPConnect()
|
|
293
|
+
const oWorkData = oWorkItem.getDataObject();
|
|
294
|
+
// check if have oWorkData, there are times due to timing of state change, when this
|
|
295
|
+
// may not be available
|
|
296
|
+
if (oWorkData) {
|
|
297
|
+
setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments[0].name);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
250
302
|
}
|
|
251
303
|
// if have caseMessage show message and end
|
|
252
304
|
const theCaseMessages = thePConn.getValue("caseMessages");
|
|
@@ -259,64 +311,11 @@ export default function FlowContainer(props) {
|
|
|
259
311
|
PCore.getPubSubUtils().publish("assignmentFinished");
|
|
260
312
|
// debugger;
|
|
261
313
|
setCheckSvg(Utils.getImageSrc("check", PCore.getAssetLoader().getStaticServerUrl()));
|
|
262
|
-
return;
|
|
263
314
|
}
|
|
264
315
|
else {
|
|
265
316
|
// debugger;
|
|
266
317
|
setHasCaseMessages(false);
|
|
267
318
|
}
|
|
268
|
-
// this check in routingInfo, mimic React to check and get the internals of the
|
|
269
|
-
// flowContainer and force updates to pConnect/redux
|
|
270
|
-
if (routingInfo && loadingInfo !== undefined) {
|
|
271
|
-
// debugging/investigation help
|
|
272
|
-
// console.log(`${thePConn.getComponentName()}: >>routingInfo: ${JSON.stringify(routingInfo)}`);
|
|
273
|
-
const currentOrder = routingInfo.accessedOrder;
|
|
274
|
-
const currentItems = routingInfo.items;
|
|
275
|
-
const type = routingInfo.type;
|
|
276
|
-
if (currentOrder && currentItems) { // JA - making more similar to React version
|
|
277
|
-
const key = currentOrder[currentOrder.length - 1];
|
|
278
|
-
// save off itemKey to be used for finishAssignment, etc.
|
|
279
|
-
// debugger;
|
|
280
|
-
setItemKey(key);
|
|
281
|
-
if (currentOrder.length > 0 &&
|
|
282
|
-
currentItems[key] &&
|
|
283
|
-
currentItems[key].view &&
|
|
284
|
-
type === "single" &&
|
|
285
|
-
!Utils.isEmptyObject(currentItems[key].view)) {
|
|
286
|
-
const currentItem = currentItems[key];
|
|
287
|
-
const rootView = currentItem.view;
|
|
288
|
-
const { context } = rootView.config;
|
|
289
|
-
const config = { meta: rootView };
|
|
290
|
-
config["options"] = {
|
|
291
|
-
context: currentItem.context,
|
|
292
|
-
pageReference: context || localPConn.getPageReference(),
|
|
293
|
-
hasForm: true,
|
|
294
|
-
isFlowContainer: true,
|
|
295
|
-
containerName: localPConn.getContainerName(),
|
|
296
|
-
containerItemName: key,
|
|
297
|
-
parentPageReference: localPConn.getPageReference()
|
|
298
|
-
};
|
|
299
|
-
const configObject = PCore.createPConnect(config);
|
|
300
|
-
// Since we're setting an array, need to add in an appropriate key
|
|
301
|
-
// to remove React warning.
|
|
302
|
-
configObject["key"] = config["options"].parentPageReference;
|
|
303
|
-
// keep track of these changes
|
|
304
|
-
const theNewChildren = [];
|
|
305
|
-
theNewChildren.push(configObject);
|
|
306
|
-
setArNewChildren(theNewChildren);
|
|
307
|
-
// JEA - adapted from Nebula FlowContainer since we want to render children that are React components
|
|
308
|
-
const root = createElement(createPConnectComponent(), configObject);
|
|
309
|
-
setArNewChildrenAsReact([root]);
|
|
310
|
-
const oWorkItem = configObject.getPConnect(); // was theNewChildren[0].getPConnect()
|
|
311
|
-
const oWorkData = oWorkItem.getDataObject();
|
|
312
|
-
// check if have oWorkData, there are times due to timing of state change, when this
|
|
313
|
-
// may not be available
|
|
314
|
-
if (oWorkData) {
|
|
315
|
-
setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments[0].name);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
319
|
}, [props]);
|
|
321
320
|
const caseId = thePConn.getCaseSummary().content.pyID;
|
|
322
321
|
const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments[0].urgency : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowContainer.js","sourceRoot":"","sources":["../../../../../src/components/infra/Containers/FlowContainer/FlowContainer.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8BAA8B;AAC9B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,uBAAuB,MAAM,mCAAmC,CAAC;AACxE,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,UAAU,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAIjE,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAA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AI;CACnB,CAAC;AAEF,aAAa,CAAC,SAAS,GAAG;IACxB,sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,sDAAsD;IACtD,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,WAAW,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC9C,sDAAsD;IACtD,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;CAC/C,CAAC","sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable camelcase */\nimport React, { useState, useEffect, useContext, createElement } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Card, CardHeader, Avatar, Typography } from \"@material-ui/core\";\nimport { Utils } from '../../../helpers/utils';\nimport { Alert } from '@material-ui/lab';\n\nimport Assignment from '../../Assignment';\nimport ToDo from \"../../../widget/ToDo\";\n\nimport createPConnectComponent from '../../../../bridge/react_pconnect';\nimport StoreContext from \"../../../../bridge/Context/StoreContext\";\nimport DayjsUtils from \"@date-io/dayjs\";\nimport { MuiPickersUtilsProvider } from \"@material-ui/pickers\";\n\nimport { addContainerItem, getToDoAssignments } from './helpers';\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 useStyles = makeStyles((theme) => ({\n root: {\n paddingRight: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingTop: theme.spacing(1.5),\n paddingBottom: theme.spacing(1.5),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n alert: {\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n },\n avatar: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light),\n }\n}));\n\n\n\nexport default function FlowContainer(props) {\n const pCoreConstants = PCore.getConstants();\n const { TODO } = pCoreConstants;\n const todo_headerText = \"To do\";\n\n const { getPConnect, routingInfo } = props;\n\n const {displayOnlyFA} = useContext(StoreContext);\n\n const thePConn = getPConnect();\n\n // const [init, setInit] = useState(true);\n // const [fcState, setFCState] = useState({ hasError: false });\n const [arNewChildren, setArNewChildren] = useState<Array<any>>(thePConn.getChildren());\n const [arNewChildrenAsReact, setArNewChildrenAsReact] = useState<Array<any>>([]);\n\n const [todo_showTodo, setShowTodo] = useState(false);\n const [todo_caseInfoID, setCaseInfoID] = useState(\"\");\n const [todo_showTodoList, setShowTodoList] = useState(false);\n const [todo_datasource, setTodoDatasource] = useState({});\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [todo_context, setTodoContext] = useState(\"\");\n\n\n const [caseMessages, setCaseMessages] = useState(\"\");\n const [bHasCaseMessages, setHasCaseMessages] = useState(false);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [checkSvg, setCheckSvg] = useState(\"\");\n\n\n const [itemKey, setItemKey] = useState(\"\");\n const [containerName, setContainerName] = useState(\"\");\n const [buildName, setBuildName] = useState(\"\");\n\n const classes = useStyles();\n\n function initContainer() {\n\n const ourPConn = getPConnect();\n const containerMgr = ourPConn.getContainerManager();\n const baseContext = ourPConn.getContextName();\n const theContainerName = ourPConn.getContainerName();\n const containerType = \"single\";\n\n const flowContainerTarget = `${baseContext}/${theContainerName}`;\n const isContainerItemAvailable = PCore.getContainerUtils().getActiveContainerItemName(\n flowContainerTarget\n );\n\n window.sessionStorage.setItem(\"okToInitFlowContainer\", \"false\");\n\n if (!isContainerItemAvailable) {\n containerMgr.initializeContainers({\n type: containerType\n });\n\n // updated for 8.7 - 30-Mar-2022\n addContainerItem(ourPConn);\n }\n }\n\n\n function getBuildName(): string {\n const ourPConn = getPConnect();\n\n // let { getPConnect, name } = this.pConn$.pConn;\n const context = ourPConn.getContextName();\n let viewContainerName = ourPConn.getContainerName();\n\n if (!viewContainerName) viewContainerName = \"\";\n return `${context.toUpperCase()}/${viewContainerName.toUpperCase()}`;\n }\n\n\n function getTodoVisibility() {\n const caseViewMode = getPConnect().getValue(\"context_data.caseViewMode\");\n if (caseViewMode && caseViewMode === \"review\") {\n return true;\n }\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (caseViewMode && caseViewMode === \"perform\") {\n return false;\n }\n\n return true;\n }\n\n\n function initComponent(bLoadChildren: boolean) {\n\n const ourPConn = getPConnect();\n\n // when true, update arChildren from pConn, otherwise, arChilren will be updated in updateSelf()\n if (bLoadChildren) {\n setArNewChildren(ourPConn.getChildren());\n }\n\n // debugging/investigation help\n // console.log(`${ourPConn.getComponentName()}: children update for main draw`);\n\n // const oData = ourPConn.getDataObject();\n\n // const activeActionLabel = \"\";\n // const child0_getPConnect = arNewChildren[0].getPConnect();\n\n // this.templateName$ = this.configProps$[\"template\"];\n\n // debugger;\n setShowTodo(getTodoVisibility());\n\n // create pointers to functions\n // const containerMgr = ourPConn.getContainerManager();\n // const actionsAPI = thePConn.getActionsApi();\n const baseContext = ourPConn.getContextName();\n const acName = ourPConn.getContainerName();\n\n // for now, in general this should be overridden by updateSelf(), and not be blank\n if (itemKey === \"\") {\n // debugger;\n setItemKey(baseContext.concat(\"/\").concat(acName));\n }\n\n\n ourPConn.isBoundToState();\n\n\n // inside\n // get fist kid, get the name and displa\n // pass first kid to a view container, which will disperse it to a view which will use one column, two column, etc.\n const oWorkItem = arNewChildren[0].getPConnect(); // child0_getPConnect;\n const oWorkData = oWorkItem.getDataObject();\n\n if (bLoadChildren && oWorkData) {\n // debugger;\n setContainerName(oWorkData.caseInfo.assignments[0].name);\n }\n\n // debugger;\n setBuildName(getBuildName());\n\n }\n\n\n useEffect(() => {\n // from WC SDK connectedCallback (mount)\n initComponent(true);\n initContainer();\n }, []);\n\n\n function isCaseWideLocalAction() {\n const ourPConn = getPConnect();\n\n const actionID = ourPConn.getValue(pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);\n const caseActions = ourPConn.getValue(pCoreConstants.CASE_INFO.AVAILABLEACTIONS);\n let bCaseWideAction = false;\n if (caseActions && actionID) {\n const actionObj = caseActions.find(\n (caseAction) => caseAction.ID === actionID\n );\n if (actionObj) {\n bCaseWideAction = actionObj.type === \"Case\";\n }\n }\n return bCaseWideAction;\n }\n\n\n function hasChildCaseAssignments() {\n const ourPConn = getPConnect();\n\n const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS);\n // const allAssignments = [];\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (childCases && childCases.length > 0) {\n return true;\n }\n return false;\n }\n\n\n function hasAssignments() {\n const ourPConn = getPConnect();\n\n let bHasAssignments = false;\n const assignmentsList: Array<any> = ourPConn.getValue(pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);\n const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();\n // 8.7 includes assignments in Assignments List that may be assigned to\n // a different operator. So, see if there are any assignments for\n // the current operator\n let bAssignmentsForThisOperator = false;\n\n // Bail out if there isn't an assignmentsList\n if (!assignmentsList) {\n return bHasAssignments;\n }\n\n for (const assignment of assignmentsList) {\n if (assignment[\"assigneeInfo\"][\"ID\"] === thisOperator) {\n bAssignmentsForThisOperator = true;\n }\n }\n\n const bHasChildCaseAssignments = hasChildCaseAssignments();\n\n if (\n bAssignmentsForThisOperator ||\n bHasChildCaseAssignments ||\n isCaseWideLocalAction()\n ) {\n bHasAssignments = true;\n }\n\n return bHasAssignments;\n }\n\n\n\n function getActiveViewLabel() {\n const ourPConn = getPConnect();\n\n let activeActionLabel = \"\";\n\n const { CASE_INFO: CASE_CONSTS } = pCoreConstants;\n\n const caseActions = ourPConn.getValue(CASE_CONSTS.CASE_INFO_ACTIONS);\n const activeActionID = ourPConn.getValue(CASE_CONSTS.ACTIVE_ACTION_ID);\n const activeAction = caseActions.find(\n (action) => action.ID === activeActionID\n );\n if (activeAction) {\n activeActionLabel = activeAction.name;\n }\n return activeActionLabel;\n }\n\n\n // From WC SDK updateSelf - so do this in useEffect that's run only when the props change...\n\n useEffect(() => {\n const localPConn = arNewChildren[0].getPConnect();\n\n setBuildName(getBuildName());\n\n // routingInfo was added as component prop in populateAdditionalProps\n // let routingInfo = this.getComponentProp(\"routingInfo\");\n\n let loadingInfo: any;\n try {\n loadingInfo = thePConn.getLoadingStatus();\n }\n catch (ex) {\n // eslint-disable-next-line no-console\n console.error(`${thePConn.getComponentName()}: loadingInfo catch block`);\n }\n\n // let configProps = this.thePConn.resolveConfigProps(this.thePConn.getConfigProps());\n\n if (!loadingInfo) {\n // turn off spinner\n // this.psService.sendMessage(false);\n }\n\n const caseViewMode = thePConn.getValue(\"context_data.caseViewMode\");\n const { CASE_INFO: CASE_CONSTS } = pCoreConstants;\n if (caseViewMode && caseViewMode === \"review\") {\n setTimeout(() => {\n // updated for 8.7 - 30-Mar-2022\n const todoAssignments = getToDoAssignments(thePConn);\n if (todoAssignments && todoAssignments.length > 0) {\n setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID));\n setTodoDatasource({ source: todoAssignments });\n }\n setShowTodo(true);\n setShowTodoList(false);\n }, 100);\n\n // in React, when cancel is called, somehow the constructor for flowContainer is called which\n // does init/add of containers. This mimics that\n initContainer();\n }\n else if (caseViewMode && caseViewMode === \"perform\") {\n // perform\n // debugger;\n setShowTodo(false);\n\n // this is different than Angular SDK, as we need to initContainer if root container reloaded\n if (window.sessionStorage.getItem(\"okToInitFlowContainer\") === \"true\") {\n initContainer();\n }\n }\n\n // if have caseMessage show message and end\n const theCaseMessages = thePConn.getValue(\"caseMessages\");\n\n if (theCaseMessages || !hasAssignments()) {\n\n // Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.\n // So, if we get here and caseMessages$ is empty, use default value in DX API response\n setCaseMessages(theCaseMessages || \"Thank you! The next step in this case has been routed appropriately.\");\n setHasCaseMessages(true);\n\n\n // publish this \"assignmentFinished\" for mashup, need to get approved as a standard\n PCore.getPubSubUtils().publish(\n \"assignmentFinished\");\n\n\n // debugger;\n setCheckSvg(Utils.getImageSrc(\"check\", PCore.getAssetLoader().getStaticServerUrl()));\n return;\n }\n else {\n // debugger;\n setHasCaseMessages(false);\n }\n\n\n // this check in routingInfo, mimic React to check and get the internals of the\n // flowContainer and force updates to pConnect/redux\n if (routingInfo && loadingInfo !== undefined) {\n\n // debugging/investigation help\n // console.log(`${thePConn.getComponentName()}: >>routingInfo: ${JSON.stringify(routingInfo)}`);\n\n const currentOrder = routingInfo.accessedOrder;\n const currentItems = routingInfo.items;\n const type = routingInfo.type;\n if (currentOrder && currentItems) { // JA - making more similar to React version\n const key = currentOrder[currentOrder.length - 1];\n\n // save off itemKey to be used for finishAssignment, etc.\n // debugger;\n setItemKey(key);\n\n if (currentOrder.length > 0 &&\n currentItems[key] &&\n currentItems[key].view &&\n type === \"single\" &&\n !Utils.isEmptyObject(currentItems[key].view)) {\n const currentItem = currentItems[key];\n const rootView = currentItem.view;\n const { context } = rootView.config;\n const config = { meta: rootView };\n\n config[\"options\"] = {\n context: currentItem.context,\n pageReference: context || localPConn.getPageReference(),\n hasForm: true,\n isFlowContainer: true,\n containerName: localPConn.getContainerName(),\n containerItemName: key,\n parentPageReference: localPConn.getPageReference()\n };\n\n const configObject = PCore.createPConnect(config);\n\n // Since we're setting an array, need to add in an appropriate key\n // to remove React warning.\n configObject[\"key\"] = config[\"options\"].parentPageReference;\n\n // keep track of these changes\n const theNewChildren: Array<Object> = [];\n theNewChildren.push(configObject);\n setArNewChildren(theNewChildren);\n\n // JEA - adapted from Nebula FlowContainer since we want to render children that are React components\n const root = createElement(createPConnectComponent(), configObject);\n setArNewChildrenAsReact([root]);\n\n const oWorkItem = configObject.getPConnect(); // was theNewChildren[0].getPConnect()\n const oWorkData = oWorkItem.getDataObject();\n\n\n // check if have oWorkData, there are times due to timing of state change, when this\n // may not be available\n if (oWorkData) {\n setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments[0].name);\n }\n }\n }\n\n }\n\n\n }, [props]);\n\n const caseId = thePConn.getCaseSummary().content.pyID;\n const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments[0].urgency : \"\";\n const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName());\n let instructionText = thePConn.getCaseSummary()?.assignments?.[0]?.instructions;\n if (instructionText === undefined) {\n instructionText = \"\";\n }\n\n return (\n <div style={{ textAlign: \"left\" }} id={buildName} className=\"psdk-flow-container-top\">\n {!bHasCaseMessages ?\n (!todo_showTodo) ?\n (!displayOnlyFA) ?\n <Card className={classes.root}>\n <CardHeader\n title={<Typography variant=\"h6\">{containerName}</Typography>}\n subheader={`Task in ${caseId} \\u2022 Priority ${urgency}`}\n avatar={\n <Avatar className={classes.avatar}>\n {operatorInitials}\n </Avatar>\n }\n ></CardHeader>\n { instructionText !== '' ? <Typography variant=\"caption\">{instructionText}</Typography> : null }\n <MuiPickersUtilsProvider utils={DayjsUtils}>\n <Assignment getPConnect={getPConnect} itemKey={itemKey}>\n {arNewChildrenAsReact}\n </Assignment>\n </MuiPickersUtilsProvider>\n </Card>\n :\n <Card className={classes.root}>\n <Typography variant=\"h6\">{containerName}</Typography>\n { instructionText !== '' ? <Typography variant=\"caption\">{instructionText}</Typography> : null }\n <MuiPickersUtilsProvider utils={DayjsUtils}>\n <Assignment getPConnect={getPConnect} itemKey={itemKey}>\n {arNewChildrenAsReact}\n </Assignment>\n </MuiPickersUtilsProvider>\n </Card>\n :\n <div>\n <ToDo getPConnect={getPConnect} caseInfoID={todo_caseInfoID} datasource={todo_datasource}\n showTodoList={todo_showTodoList} headerText={todo_headerText} type={TODO}\n context={todo_context} itemKey={itemKey}></ToDo>\n </div>\n :\n <div className={classes.alert}>\n <Alert severity=\"success\">{caseMessages}</Alert>\n </div>\n }\n </div>\n )\n}\n\nFlowContainer.defaultProps = {\n children: null,\n getPConnect: null,\n name: \"\",\n routingInfo: null,\n pageMessages: null\n};\n\nFlowContainer.propTypes = {\n // eslint-disable-next-line react/no-unused-prop-types\n children: PropTypes.node,\n getPConnect: PropTypes.func,\n // eslint-disable-next-line react/no-unused-prop-types\n name: PropTypes.string,\n routingInfo: PropTypes.objectOf(PropTypes.any),\n // eslint-disable-next-line react/no-unused-prop-types\n pageMessages: PropTypes.arrayOf(PropTypes.any)\n};\n"]}
|
|
1
|
+
{"version":3,"file":"FlowContainer.js","sourceRoot":"","sources":["../../../../../src/components/infra/Containers/FlowContainer/FlowContainer.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8BAA8B;AAC9B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,uBAAuB,MAAM,mCAAmC,CAAC;AACxE,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,UAAU,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAIjE,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAAE;AAGF,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAA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sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,sDAAsD;IACtD,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,WAAW,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC9C,sDAAsD;IACtD,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;CAC/C,CAAC","sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable camelcase */\nimport React, { useState, useEffect, useContext, createElement } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Card, CardHeader, Avatar, Typography } from \"@material-ui/core\";\nimport { Utils } from '../../../helpers/utils';\nimport { Alert } from '@material-ui/lab';\n\nimport Assignment from '../../Assignment';\nimport ToDo from \"../../../widget/ToDo\";\n\nimport createPConnectComponent from '../../../../bridge/react_pconnect';\nimport StoreContext from \"../../../../bridge/Context/StoreContext\";\nimport DayjsUtils from \"@date-io/dayjs\";\nimport { MuiPickersUtilsProvider } from \"@material-ui/pickers\";\n\nimport { addContainerItem, getToDoAssignments } from './helpers';\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 useStyles = makeStyles((theme) => ({\n root: {\n paddingRight: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingTop: theme.spacing(1.5),\n paddingBottom: theme.spacing(1.5),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n alert: {\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n },\n avatar: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light),\n }\n}));\n\n\n\nexport default function FlowContainer(props) {\n const pCoreConstants = PCore.getConstants();\n const { TODO } = pCoreConstants;\n const todo_headerText = \"To do\";\n\n const { getPConnect, routingInfo } = props;\n\n const {displayOnlyFA} = useContext(StoreContext);\n\n const thePConn = getPConnect();\n\n // const [init, setInit] = useState(true);\n // const [fcState, setFCState] = useState({ hasError: false });\n const [arNewChildren, setArNewChildren] = useState<Array<any>>(thePConn.getChildren());\n const [arNewChildrenAsReact, setArNewChildrenAsReact] = useState<Array<any>>([]);\n\n const [todo_showTodo, setShowTodo] = useState(false);\n const [todo_caseInfoID, setCaseInfoID] = useState(\"\");\n const [todo_showTodoList, setShowTodoList] = useState(false);\n const [todo_datasource, setTodoDatasource] = useState({});\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [todo_context, setTodoContext] = useState(\"\");\n\n\n const [caseMessages, setCaseMessages] = useState(\"\");\n const [bHasCaseMessages, setHasCaseMessages] = useState(false);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [checkSvg, setCheckSvg] = useState(\"\");\n\n\n const [itemKey, setItemKey] = useState(\"\");\n const [containerName, setContainerName] = useState(\"\");\n const [buildName, setBuildName] = useState(\"\");\n\n const classes = useStyles();\n\n function initContainer() {\n\n const ourPConn = getPConnect();\n const containerMgr = ourPConn.getContainerManager();\n const baseContext = ourPConn.getContextName();\n const theContainerName = ourPConn.getContainerName();\n const containerType = \"single\";\n\n const flowContainerTarget = `${baseContext}/${theContainerName}`;\n const isContainerItemAvailable = PCore.getContainerUtils().getActiveContainerItemName(\n flowContainerTarget\n );\n\n window.sessionStorage.setItem(\"okToInitFlowContainer\", \"false\");\n\n if (!isContainerItemAvailable) {\n containerMgr.initializeContainers({\n type: containerType\n });\n\n // updated for 8.7 - 30-Mar-2022\n addContainerItem(ourPConn);\n }\n }\n\n\n function getBuildName(): string {\n const ourPConn = getPConnect();\n\n // let { getPConnect, name } = this.pConn$.pConn;\n const context = ourPConn.getContextName();\n let viewContainerName = ourPConn.getContainerName();\n\n if (!viewContainerName) viewContainerName = \"\";\n return `${context.toUpperCase()}/${viewContainerName.toUpperCase()}`;\n }\n\n\n function getTodoVisibility() {\n const caseViewMode = getPConnect().getValue(\"context_data.caseViewMode\");\n if (caseViewMode && caseViewMode === \"review\") {\n return true;\n }\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (caseViewMode && caseViewMode === \"perform\") {\n return false;\n }\n\n return true;\n }\n\n\n function initComponent(bLoadChildren: boolean) {\n\n const ourPConn = getPConnect();\n\n // when true, update arChildren from pConn, otherwise, arChilren will be updated in updateSelf()\n if (bLoadChildren) {\n setArNewChildren(ourPConn.getChildren());\n }\n\n // debugging/investigation help\n // console.log(`${ourPConn.getComponentName()}: children update for main draw`);\n\n // const oData = ourPConn.getDataObject();\n\n // const activeActionLabel = \"\";\n // const child0_getPConnect = arNewChildren[0].getPConnect();\n\n // this.templateName$ = this.configProps$[\"template\"];\n\n // debugger;\n setShowTodo(getTodoVisibility());\n\n // create pointers to functions\n // const containerMgr = ourPConn.getContainerManager();\n // const actionsAPI = thePConn.getActionsApi();\n const baseContext = ourPConn.getContextName();\n const acName = ourPConn.getContainerName();\n\n // for now, in general this should be overridden by updateSelf(), and not be blank\n if (itemKey === \"\") {\n // debugger;\n setItemKey(baseContext.concat(\"/\").concat(acName));\n }\n\n\n ourPConn.isBoundToState();\n\n\n // inside\n // get fist kid, get the name and displa\n // pass first kid to a view container, which will disperse it to a view which will use one column, two column, etc.\n const oWorkItem = arNewChildren[0].getPConnect(); // child0_getPConnect;\n const oWorkData = oWorkItem.getDataObject();\n\n if (bLoadChildren && oWorkData) {\n // debugger;\n setContainerName(oWorkData.caseInfo.assignments[0].name);\n }\n\n // debugger;\n setBuildName(getBuildName());\n\n }\n\n\n useEffect(() => {\n // from WC SDK connectedCallback (mount)\n initComponent(true);\n initContainer();\n }, []);\n\n\n function isCaseWideLocalAction() {\n const ourPConn = getPConnect();\n\n const actionID = ourPConn.getValue(pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);\n const caseActions = ourPConn.getValue(pCoreConstants.CASE_INFO.AVAILABLEACTIONS);\n let bCaseWideAction = false;\n if (caseActions && actionID) {\n const actionObj = caseActions.find(\n (caseAction) => caseAction.ID === actionID\n );\n if (actionObj) {\n bCaseWideAction = actionObj.type === \"Case\";\n }\n }\n return bCaseWideAction;\n }\n\n\n function hasChildCaseAssignments() {\n const ourPConn = getPConnect();\n\n const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS);\n // const allAssignments = [];\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (childCases && childCases.length > 0) {\n return true;\n }\n return false;\n }\n\n\n function hasAssignments() {\n const ourPConn = getPConnect();\n\n let bHasAssignments = false;\n const assignmentsList: Array<any> = ourPConn.getValue(pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);\n const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();\n // 8.7 includes assignments in Assignments List that may be assigned to\n // a different operator. So, see if there are any assignments for\n // the current operator\n let bAssignmentsForThisOperator = false;\n\n // Bail out if there isn't an assignmentsList\n if (!assignmentsList) {\n return bHasAssignments;\n }\n\n for (const assignment of assignmentsList) {\n if (assignment[\"assigneeInfo\"][\"ID\"] === thisOperator) {\n bAssignmentsForThisOperator = true;\n }\n }\n\n const bHasChildCaseAssignments = hasChildCaseAssignments();\n\n if (\n bAssignmentsForThisOperator ||\n bHasChildCaseAssignments ||\n isCaseWideLocalAction()\n ) {\n bHasAssignments = true;\n }\n\n return bHasAssignments;\n }\n\n\n\n function getActiveViewLabel() {\n const ourPConn = getPConnect();\n\n let activeActionLabel = \"\";\n\n const { CASE_INFO: CASE_CONSTS } = pCoreConstants;\n\n const caseActions = ourPConn.getValue(CASE_CONSTS.CASE_INFO_ACTIONS);\n const activeActionID = ourPConn.getValue(CASE_CONSTS.ACTIVE_ACTION_ID);\n const activeAction = caseActions.find(\n (action) => action.ID === activeActionID\n );\n if (activeAction) {\n activeActionLabel = activeAction.name;\n }\n return activeActionLabel;\n }\n\n\n // From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...\n useEffect(() => {\n const localPConn = arNewChildren[0].getPConnect();\n\n setBuildName(getBuildName());\n\n // routingInfo was added as component prop in populateAdditionalProps\n // let routingInfo = this.getComponentProp(\"routingInfo\");\n\n let loadingInfo: any;\n try {\n loadingInfo = thePConn.getLoadingStatus();\n }\n catch (ex) {\n // eslint-disable-next-line no-console\n console.error(`${thePConn.getComponentName()}: loadingInfo catch block`);\n }\n\n // let configProps = this.thePConn.resolveConfigProps(this.thePConn.getConfigProps());\n\n if (!loadingInfo) {\n // turn off spinner\n // this.psService.sendMessage(false);\n }\n\n const caseViewMode = thePConn.getValue(\"context_data.caseViewMode\");\n const { CASE_INFO: CASE_CONSTS } = pCoreConstants;\n if (caseViewMode && caseViewMode === \"review\") {\n setTimeout(() => {\n // updated for 8.7 - 30-Mar-2022\n const todoAssignments = getToDoAssignments(thePConn);\n if (todoAssignments && todoAssignments.length > 0) {\n setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID));\n setTodoDatasource({ source: todoAssignments });\n }\n setShowTodo(true);\n setShowTodoList(false);\n }, 100);\n\n // in React, when cancel is called, somehow the constructor for flowContainer is called which\n // does init/add of containers. This mimics that\n initContainer();\n }\n else if (caseViewMode && caseViewMode === \"perform\") {\n // perform\n // debugger;\n setShowTodo(false);\n\n // this is different than Angular SDK, as we need to initContainer if root container reloaded\n if (window.sessionStorage.getItem(\"okToInitFlowContainer\") === \"true\") {\n initContainer();\n }\n\n // this check in routingInfo, mimic React to check and get the internals of the\n // flowContainer and force updates to pConnect/redux\n if (routingInfo && loadingInfo !== undefined) {\n\n // debugging/investigation help\n // console.log(`${thePConn.getComponentName()}: >>routingInfo: ${JSON.stringify(routingInfo)}`);\n\n const currentOrder = routingInfo.accessedOrder;\n const currentItems = routingInfo.items;\n const type = routingInfo.type;\n if (currentOrder && currentItems) { // JA - making more similar to React version\n const key = currentOrder[currentOrder.length - 1];\n\n // save off itemKey to be used for finishAssignment, etc.\n // debugger;\n setItemKey(key);\n\n if (currentOrder.length > 0 &&\n currentItems[key] &&\n currentItems[key].view &&\n type === \"single\" &&\n !Utils.isEmptyObject(currentItems[key].view)) {\n const currentItem = currentItems[key];\n const rootView = currentItem.view;\n const { context } = rootView.config;\n const config = { meta: rootView };\n\n config[\"options\"] = {\n context: currentItem.context,\n pageReference: context || localPConn.getPageReference(),\n hasForm: true,\n isFlowContainer: true,\n containerName: localPConn.getContainerName(),\n containerItemName: key,\n parentPageReference: localPConn.getPageReference()\n };\n\n const configObject = PCore.createPConnect(config);\n\n // Since we're setting an array, need to add in an appropriate key\n // to remove React warning.\n configObject[\"key\"] = config[\"options\"].parentPageReference;\n\n // keep track of these changes\n const theNewChildren: Array<Object> = [];\n theNewChildren.push(configObject);\n setArNewChildren(theNewChildren);\n\n // JEA - adapted from Constellation DX Components FlowContainer since we want to render children that are React components\n const root = createElement(createPConnectComponent(), configObject);\n setArNewChildrenAsReact([root]);\n\n const oWorkItem = configObject.getPConnect(); // was theNewChildren[0].getPConnect()\n const oWorkData = oWorkItem.getDataObject();\n\n\n // check if have oWorkData, there are times due to timing of state change, when this\n // may not be available\n if (oWorkData) {\n setContainerName(getActiveViewLabel() || oWorkData.caseInfo.assignments[0].name);\n }\n }\n }\n\n }\n }\n\n // if have caseMessage show message and end\n const theCaseMessages = thePConn.getValue(\"caseMessages\");\n\n if (theCaseMessages || !hasAssignments()) {\n\n // Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.\n // So, if we get here and caseMessages$ is empty, use default value in DX API response\n setCaseMessages(theCaseMessages || \"Thank you! The next step in this case has been routed appropriately.\");\n setHasCaseMessages(true);\n\n\n // publish this \"assignmentFinished\" for mashup, need to get approved as a standard\n PCore.getPubSubUtils().publish(\n \"assignmentFinished\");\n\n\n // debugger;\n setCheckSvg(Utils.getImageSrc(\"check\", PCore.getAssetLoader().getStaticServerUrl()));\n }\n else {\n // debugger;\n setHasCaseMessages(false);\n }\n }, [props]);\n\n const caseId = thePConn.getCaseSummary().content.pyID;\n const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments[0].urgency : \"\";\n const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName());\n let instructionText = thePConn.getCaseSummary()?.assignments?.[0]?.instructions;\n if (instructionText === undefined) {\n instructionText = \"\";\n }\n\n return (\n <div style={{ textAlign: \"left\" }} id={buildName} className=\"psdk-flow-container-top\">\n {!bHasCaseMessages ?\n (!todo_showTodo) ?\n (!displayOnlyFA) ?\n <Card className={classes.root}>\n <CardHeader\n title={<Typography variant=\"h6\">{containerName}</Typography>}\n subheader={`Task in ${caseId} \\u2022 Priority ${urgency}`}\n avatar={\n <Avatar className={classes.avatar}>\n {operatorInitials}\n </Avatar>\n }\n ></CardHeader>\n { instructionText !== '' ? <Typography variant=\"caption\">{instructionText}</Typography> : null }\n <MuiPickersUtilsProvider utils={DayjsUtils}>\n <Assignment getPConnect={getPConnect} itemKey={itemKey}>\n {arNewChildrenAsReact}\n </Assignment>\n </MuiPickersUtilsProvider>\n </Card>\n :\n <Card className={classes.root}>\n <Typography variant=\"h6\">{containerName}</Typography>\n { instructionText !== '' ? <Typography variant=\"caption\">{instructionText}</Typography> : null }\n <MuiPickersUtilsProvider utils={DayjsUtils}>\n <Assignment getPConnect={getPConnect} itemKey={itemKey}>\n {arNewChildrenAsReact}\n </Assignment>\n </MuiPickersUtilsProvider>\n </Card>\n :\n <div>\n <ToDo getPConnect={getPConnect} caseInfoID={todo_caseInfoID} datasource={todo_datasource}\n showTodoList={todo_showTodoList} headerText={todo_headerText} type={TODO}\n context={todo_context} itemKey={itemKey}></ToDo>\n </div>\n :\n <div className={classes.alert}>\n <Alert severity=\"success\">{caseMessages}</Alert>\n </div>\n }\n </div>\n )\n}\n\nFlowContainer.defaultProps = {\n children: null,\n getPConnect: null,\n name: \"\",\n routingInfo: null,\n pageMessages: null\n};\n\nFlowContainer.propTypes = {\n // eslint-disable-next-line react/no-unused-prop-types\n children: PropTypes.node,\n getPConnect: PropTypes.func,\n // eslint-disable-next-line react/no-unused-prop-types\n name: PropTypes.string,\n routingInfo: PropTypes.objectOf(PropTypes.any),\n // eslint-disable-next-line react/no-unused-prop-types\n pageMessages: PropTypes.arrayOf(PropTypes.any)\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,iBAAS,aAAa,CAAC,KAAK,KAAA,sBA0C3B;kBA1CQ,aAAa;;;;;;;;;;AAqDtB,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Adapted from nebula ErrorBoundary (remove Cosmos dependencies)
|
|
2
1
|
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
function ErrorBoundary(props) {
|
|
@@ -8,20 +7,7 @@ function ErrorBoundary(props) {
|
|
|
8
7
|
const { getPConnect, isInternalError } = props;
|
|
9
8
|
const theErrorDiv = React.createElement("div", null, ERROR_TEXT);
|
|
10
9
|
if (!getPConnect) {
|
|
11
|
-
return (theErrorDiv
|
|
12
|
-
// <Flex
|
|
13
|
-
// container={{
|
|
14
|
-
// alignItems: "center",
|
|
15
|
-
// justify: "center",
|
|
16
|
-
// itemGap: 1
|
|
17
|
-
// }}
|
|
18
|
-
// >
|
|
19
|
-
// <Text status="error">
|
|
20
|
-
// <Icon name="warn-solid" />
|
|
21
|
-
// </Text>
|
|
22
|
-
// <Text data-testid="errorText">{ERROR_TEXT}</Text>
|
|
23
|
-
// </Flex>
|
|
24
|
-
);
|
|
10
|
+
return (theErrorDiv);
|
|
25
11
|
}
|
|
26
12
|
const pConn = getPConnect();
|
|
27
13
|
if (!isInternalError) {
|
|
@@ -31,14 +17,7 @@ function ErrorBoundary(props) {
|
|
|
31
17
|
Raw meta data for the component: ${JSON.stringify(pConn.getRawMetadata())}`);
|
|
32
18
|
}
|
|
33
19
|
if (pConn.getConfigProps().type === "page") {
|
|
34
|
-
return (theErrorDiv
|
|
35
|
-
// <Banner
|
|
36
|
-
// data-testid="errorBanner"
|
|
37
|
-
// variant="urgent"
|
|
38
|
-
// heading="Error"
|
|
39
|
-
// messages={[ERROR_TEXT]}
|
|
40
|
-
// />
|
|
41
|
-
);
|
|
20
|
+
return (theErrorDiv);
|
|
42
21
|
}
|
|
43
22
|
if (pConn.getContainerName() === WORK_AREA ||
|
|
44
23
|
pConn.isInsideList() === true ||
|
|
@@ -47,32 +26,7 @@ function ErrorBoundary(props) {
|
|
|
47
26
|
publish(ERROR_WHILE_RENDERING);
|
|
48
27
|
return null;
|
|
49
28
|
}
|
|
50
|
-
return (theErrorDiv
|
|
51
|
-
// <Card>
|
|
52
|
-
// <CardHeader>
|
|
53
|
-
// <Text variant="h3">
|
|
54
|
-
// {pConn.getConfigProps().label || pConn.getComponentName()}
|
|
55
|
-
// </Text>
|
|
56
|
-
// </CardHeader>
|
|
57
|
-
// <CardContent
|
|
58
|
-
// direction="row"
|
|
59
|
-
// style={{ minHeight: "5rem", justifyContent: "center" }}
|
|
60
|
-
// >
|
|
61
|
-
// <Flex
|
|
62
|
-
// container={{
|
|
63
|
-
// alignItems: "center",
|
|
64
|
-
// justify: "center",
|
|
65
|
-
// itemGap: 1
|
|
66
|
-
// }}
|
|
67
|
-
// >
|
|
68
|
-
// <Text status="error">
|
|
69
|
-
// <Icon name="warn-solid" />
|
|
70
|
-
// </Text>
|
|
71
|
-
// <Text>{ERROR_TEXT}</Text>
|
|
72
|
-
// </Flex>
|
|
73
|
-
// </CardContent>
|
|
74
|
-
// </Card>
|
|
75
|
-
);
|
|
29
|
+
return (theErrorDiv);
|
|
76
30
|
}
|
|
77
31
|
ErrorBoundary.propTypes = {
|
|
78
32
|
getPConnect: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../src/components/infra/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../src/components/infra/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,SAAS,aAAa,CAAC,KAAK;IAC1B,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC,uBAAuB,EAAE,CAAC;IACrE,MAAM,SAAS,GAAG,UAAU,CAAC;IAC7B,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;IACtD,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE/C,MAAM,WAAW,GAAG,iCAAM,UAAU,CAAO,CAAA;IAE3C,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,CACL,WAAW,CACZ,CAAC;KACH;IAED,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAE5B,IAAI,CAAC,eAAe,EAAE;QACpB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,gCAAgC,KAAK,CAAC,gBAAgB,EAAE;;uCAEnC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC,CAAC;KAC9E;IAED,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,KAAK,MAAM,EAAE;QAC1C,OAAO,CACL,WAAW,CACZ,CAAC;KACH;IAED,IACE,KAAK,CAAC,gBAAgB,EAAE,KAAK,SAAS;QACtC,KAAK,CAAC,YAAY,EAAE,KAAK,IAAI;QAC7B,KAAK,CAAC,gBAAgB,EAAE,KAAK,OAAO,EACpC;QACA,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QAC3C,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,WAAW,CACZ,CAAC;AACJ,CAAC;AACD,aAAa,CAAC,SAAS,GAAG;IACxB,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,eAAe,EAAE,SAAS,CAAC,IAAI;CAChC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\ndeclare const PCore;\n\nfunction ErrorBoundary(props) {\n const ERROR_TEXT = PCore.getErrorHandler().getGenericFailedMessage();\n const WORK_AREA = \"workarea\";\n const ERROR_WHILE_RENDERING = \"ERROR_WHILE_RENDERING\";\n const { getPConnect, isInternalError } = props;\n\n const theErrorDiv = <div>{ERROR_TEXT}</div>\n\n if (!getPConnect) {\n return (\n theErrorDiv\n );\n }\n\n const pConn = getPConnect();\n\n if (!isInternalError) {\n // eslint-disable-next-line no-console\n console.error(`Unable to load the component ${pConn.getComponentName()}\n This might be due to the view meta data getting corrupted or the component file missing.\n Raw meta data for the component: ${JSON.stringify(pConn.getRawMetadata())}`);\n }\n\n if (pConn.getConfigProps().type === \"page\") {\n return (\n theErrorDiv\n );\n }\n\n if (\n pConn.getContainerName() === WORK_AREA ||\n pConn.isInsideList() === true ||\n pConn.getContainerName() === \"modal\"\n ) {\n const { publish } = PCore.getPubSubUtils();\n publish(ERROR_WHILE_RENDERING);\n return null;\n }\n\n return (\n theErrorDiv\n );\n}\nErrorBoundary.propTypes = {\n getPConnect: PropTypes.func,\n isInternalError: PropTypes.bool\n};\n\nErrorBoundary.defaultProps = {\n getPConnect: null,\n isInternalError: false\n};\n\nexport default ErrorBoundary;\n"]}
|