@pega/react-sdk-components 0.23.4 → 0.23.6
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/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.js +1 -1
- package/lib/components/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/forms/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/forms/AutoComplete/AutoComplete.js +14 -4
- package/lib/components/forms/AutoComplete/AutoComplete.js.map +1 -1
- package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
- package/lib/components/helpers/versionHelpers.js +25 -0
- package/lib/components/helpers/versionHelpers.js.map +1 -1
- package/lib/components/infra/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/infra/Attachment/Attachment.js +2 -1
- package/lib/components/infra/Attachment/Attachment.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +3 -7
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/ToDo/ToDo.d.ts +1 -1
- package/lib/components/infra/ToDo/ToDo.d.ts.map +1 -1
- package/lib/components/infra/ToDo/ToDo.js +83 -110
- package/lib/components/infra/ToDo/ToDo.js.map +1 -1
- package/lib/sdk-pega-component-map.d.ts +6 -2
- package/lib/sdk-pega-component-map.js +9 -5
- package/lib/sdk-pega-component-map.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
4
4
|
import Grid from '@material-ui/core/Grid';
|
|
5
5
|
import TextField from '@material-ui/core/TextField';
|
|
6
|
-
import Operator from '../Operator
|
|
6
|
+
import Operator from '../Operator';
|
|
7
7
|
import './CaseSummaryFields.css';
|
|
8
8
|
import { format } from '../../helpers/formatters';
|
|
9
9
|
export default function CaseSummaryFields(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK;IAC7C,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAEhD,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5D,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAa,EAAE,CAAC,CAAC;IAG9E,SAAS,aAAa,CAAC,KAAU;QAC/B,MAAM,cAAc,GAAG,KAAK,CAA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,CAAC,SAAS,CAAC,MAAM,CAAC;CAC/C,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport isDeepEqual from 'fast-deep-equal/react';\n\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport Operator from '../Operator';\n\nimport './CaseSummaryFields.css';\n\nimport { format } from '../../helpers/formatters';\n\nexport default function CaseSummaryFields(props) {\n const { status, showStatus, theFields } = props;\n\n const [theFieldsToRender, setFieldsToRender] = useState([]);\n const [theFieldsAsGridItems, setFieldsAsGridItems] = useState<Array<any>>([]);\n\n\n function getFieldValue(field: any): any {\n const fieldTypeLower = field.type.toLowerCase();\n\n if (field.config.value === null || field.config.value === \"\") {\n // Special handling for missing value\n // eslint-disable-next-line sonarjs/no-small-switch\n switch(fieldTypeLower) {\n case \"caseoperator\" :\n return <Operator caseOpConfig={field.config} />;\n break;\n\n default:\n return <TextField\n value=\"---\"\n label={field.config.label}\n InputProps={{\n readOnly: true\n }} />;\n }\n }\n\n switch(fieldTypeLower) {\n case \"textinput\" :\n return <TextField\n value={field.config.value}\n label={field.config.label}\n InputProps={{\n readOnly: true\n }} />;\n\n case \"status\" :\n return <TextField\n className=\"psdk-csf-status-style\"\n value={field.config.value}\n label={field.config.label}\n InputProps={{\n readOnly: true\n }} />;\n\n case \"phone\":\n {\n const displayPhone = (field.config.value !== \"\") ? field.config.value : \"---\";\n return <a href={`tel:${displayPhone}`}>\n <TextField\n value={field.config.value}\n label={field.config.label}\n InputProps={{\n readOnly: true,\n inputProps: {style: {cursor: 'pointer'}}\n }}\n />\n </a>;\n }\n\n case \"email\":\n {\n const displayEmail = format(field.config.value, field.type);\n return <a href={`mailto:${displayEmail}`}>\n <TextField\n value={field.config.value}\n label={field.config.label}\n InputProps={{\n readOnly: true,\n inputProps: {style: {cursor: 'pointer'}}\n }}\n />\n </a>;\n\n }\n\n case \"date\":\n return <TextField\n value={format(field.config.value, field.type)}\n label={field.config.label}\n InputProps={{\n readOnly: true\n }} />;\n\n case \"caseoperator\":\n return <Operator caseOpConfig={field.config} />;\n break;\n\n default:\n return (\n <span>{field.type.toLowerCase()} {field.config.value}</span>\n );\n\n }\n\n }\n\n\n // Whenever theFieldsToRender changes, update theFieldsAsGridItems that's used during render\n useEffect(() => {\n const arGridItems = theFieldsToRender.map((field: any) => {\n return ( <Grid item xs={6} key={field.config.label}>{getFieldValue(field)}</Grid> );\n });\n setFieldsAsGridItems(arGridItems);\n },\n [theFieldsToRender]);\n\n\n const theFieldsModifiable = theFields;\n\n // Special Case: if showStatus is true, splice the status value to be 2nd in theFields\n // if it's not already there\n if (showStatus && theFields?.[1].type !== \"status\") {\n const oStatus = { type: \"status\", config: { value: status, label: \"Status\" }};\n\n const count = theFieldsModifiable.length;\n if (count < 2) {\n theFieldsModifiable.push(oStatus);\n }\n else {\n theFieldsModifiable.splice(1, 0, oStatus);\n }\n }\n\n // At this point, we know what fields we want to render...\n // So, update our state if it's changed\n if (!isDeepEqual(theFieldsToRender, theFieldsModifiable)) {\n setFieldsToRender(theFieldsModifiable);\n }\n\n\n return <React.Fragment>\n <Grid container className=\"psdk-case-summary-fields\">\n {theFieldsAsGridItems}\n </Grid>\n </React.Fragment>;\n}\n\nCaseSummaryFields.propTypes = {\n status: PropTypes.string,\n showStatus: PropTypes.bool,\n theFields: PropTypes.arrayOf(PropTypes.object)\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":";AAoCA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,KAAA,eAkJzC"}
|
|
@@ -4,6 +4,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
|
4
4
|
import Utils from '../../helpers/utils';
|
|
5
5
|
import TextInput from '../TextInput';
|
|
6
6
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
7
|
+
import { getDataPage } from '../../helpers/data_page';
|
|
7
8
|
const preProcessColumns = columnList => {
|
|
8
9
|
return columnList.map(col => {
|
|
9
10
|
const tempColObj = { ...col };
|
|
@@ -28,6 +29,8 @@ const getDisplayFieldsMetaData = columnList => {
|
|
|
28
29
|
};
|
|
29
30
|
export default function AutoComplete(props) {
|
|
30
31
|
const { getPConnect, label, required, placeholder, value = '', validatemessage, onChange, readOnly, testId, displayMode, deferDatasource, datasourceMetadata, status, helperText } = props;
|
|
32
|
+
let parameters = datasourceMetadata?.datasource?.parameters;
|
|
33
|
+
const context = getPConnect().getContextName();
|
|
31
34
|
let { listType, datasource = [], columns = [] } = props;
|
|
32
35
|
const [inputValue, setInputValue] = useState('');
|
|
33
36
|
const [options, setOptions] = useState([]);
|
|
@@ -38,11 +41,20 @@ export default function AutoComplete(props) {
|
|
|
38
41
|
// inbound datasource is different, so update theDatasource (to trigger useEffect)
|
|
39
42
|
setDatasource(datasource);
|
|
40
43
|
}
|
|
44
|
+
const flattenParameters = (params = {}) => {
|
|
45
|
+
const flatParams = {};
|
|
46
|
+
Object.keys(params).forEach((key) => {
|
|
47
|
+
const { name, value: theVal } = params[key];
|
|
48
|
+
flatParams[name] = theVal;
|
|
49
|
+
});
|
|
50
|
+
return flatParams;
|
|
51
|
+
};
|
|
41
52
|
// convert associated to datapage listtype and transform props
|
|
42
53
|
// Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList
|
|
43
54
|
if (deferDatasource && datasourceMetadata?.datasource?.name) {
|
|
44
55
|
listType = 'datapage';
|
|
45
56
|
datasource = datasourceMetadata.datasource.name;
|
|
57
|
+
parameters = flattenParameters(parameters);
|
|
46
58
|
const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')
|
|
47
59
|
? datasourceMetadata.datasource.propertyForDisplayText.substring(3)
|
|
48
60
|
: datasourceMetadata.datasource.propertyForDisplayText;
|
|
@@ -71,15 +83,13 @@ export default function AutoComplete(props) {
|
|
|
71
83
|
}, [theDatasource]);
|
|
72
84
|
useEffect(() => {
|
|
73
85
|
if (!displayMode && listType !== 'associated') {
|
|
74
|
-
|
|
75
|
-
workListData.then((workListJSON) => {
|
|
86
|
+
getDataPage(datasource, parameters, context).then((results) => {
|
|
76
87
|
const optionsData = [];
|
|
77
|
-
const results = workListJSON['data'].data;
|
|
78
88
|
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
79
89
|
results?.forEach(element => {
|
|
80
90
|
const val = element[displayColumn.primary]?.toString();
|
|
81
91
|
const obj = {
|
|
82
|
-
key: element.
|
|
92
|
+
key: element[displayColumn.key] || element.pyGUID,
|
|
83
93
|
value: val
|
|
84
94
|
};
|
|
85
95
|
optionsData.push(obj);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../../src/components/forms/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAShD,MAAM,iBAAiB,GAAG,UAAU,CAAC,EAAE;IACrC,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC1B,MAAM,UAAU,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;QAC9B,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,S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C,MAAW,EAAE,EAAE;YACjC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,EACD,SAAS,QACT,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,IAAI,aAAa,EACvC,aAAa,EAAE,gBAAgB,EAC/B,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CACrB,oBAAC,SAAS,OACJ,MAAM,EACV,SAAS,QACT,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,kBACE,MAAM,GACpB,CACH,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport Utils from '../../helpers/utils';\nimport TextInput from '../TextInput';\nimport isDeepEqual from 'fast-deep-equal/react';\n\ndeclare const PCore;\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nconst preProcessColumns = columnList => {\n return columnList.map(col => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = columnList => {\n const displayColumns = columnList.filter(col => col.display === 'true');\n const metaDataObj: any = { key: '', primary: '', secondary: [] };\n const keyCol = columnList.filter(col => col.key === 'true');\n metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';\n for (let index = 0; index < displayColumns.length; index += 1) {\n if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n } else {\n metaDataObj.secondary.push(displayColumns[index].value);\n }\n }\n return metaDataObj;\n};\n\nexport default function AutoComplete(props) {\n const {\n getPConnect,\n label,\n required,\n placeholder,\n value = '',\n validatemessage,\n onChange,\n readOnly,\n testId,\n displayMode,\n deferDatasource,\n datasourceMetadata,\n status,\n helperText\n } = props;\n let { listType, datasource = [], columns = [] } = props;\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<Array<IOption>>([]);\n const [theDatasource, setDatasource] = useState(null);\n let selectedValue: any = '';\n const helperTextToDisplay = validatemessage || helperText;\n\n if (!isDeepEqual(datasource, theDatasource)) {\n // inbound datasource is different, so update theDatasource (to trigger useEffect)\n setDatasource(datasource);\n }\n\n // convert associated to datapage listtype and transform props\n // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList\n if (deferDatasource && datasourceMetadata?.datasource?.name) {\n listType = 'datapage';\n datasource = datasourceMetadata.datasource.name;\n const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)\n : datasourceMetadata.datasource.propertyForDisplayText;\n const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForValue.substring(3)\n : datasourceMetadata.datasource.propertyForValue;\n columns = [\n {\n key: 'true',\n setProperty: 'Associated property',\n value: valueProp\n },\n {\n display: 'true',\n primary: 'true',\n useForSearch: true,\n value: displayProp\n }\n ];\n }\n\n columns = preProcessColumns(columns);\n\n useEffect(() => {\n if (listType === 'associated') {\n setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));\n }\n }, [theDatasource]);\n\n useEffect(() => {\n if (!displayMode && listType !== 'associated') {\n const workListData = PCore.getDataApiUtils().getData(datasource, {});\n\n workListData.then((workListJSON: Object) => {\n const optionsData: Array<IOption> = [];\n const results = workListJSON['data'].data;\n const displayColumn = getDisplayFieldsMetaData(columns);\n results?.forEach(element => {\n const val = element[displayColumn.primary]?.toString();\n const obj = {\n key: element.pyGUID || val,\n value: val\n };\n optionsData.push(obj);\n });\n setOptions(optionsData);\n });\n }\n }, []);\n\n if (value) {\n const index = options?.findIndex(element => element.key === value);\n if (index > -1) {\n selectedValue = options[index].value;\n } else {\n selectedValue = value;\n }\n }\n\n const handleChange = (event: object, newValue) => {\n onChange({ value: newValue ? newValue.key : '' });\n };\n\n const handleInputValue = (event, newInputValue) => {\n setInputValue(newInputValue);\n };\n\n if (readOnly) {\n const theValAsString = options?.find(opt => opt.key === value)?.value;\n return <TextInput {...props} value={theValAsString} />;\n }\n // Need to use both getOptionLabel and getOptionSelected to map our\n // key/value structure to what Autocomplete expects\n return (\n <Autocomplete\n options={options}\n getOptionLabel={(option: IOption) => {\n return option.value ? option.value : '';\n }}\n getOptionSelected={(option: any) => {\n return option.value ? option.value : '';\n }}\n fullWidth\n onChange={handleChange}\n value={selectedValue}\n inputValue={inputValue || selectedValue}\n onInputChange={handleInputValue}\n renderInput={params => (\n <TextField\n {...params}\n fullWidth\n variant='outlined'\n helperText={helperTextToDisplay}\n placeholder={placeholder}\n size='small'\n required={required}\n error={status === 'error'}\n label={label}\n data-test-id={testId}\n />\n )}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../../src/components/forms/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAOtD,MAAM,iBAAiB,GAAG,UAAU,CAAC,EAAE;IACrC,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC1B,MAAM,UAAU,GAAG,EAAE,GAAG,GAAG,EAA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port { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport Utils from '../../helpers/utils';\nimport TextInput from '../TextInput';\nimport isDeepEqual from 'fast-deep-equal/react';\nimport { getDataPage } from '../../helpers/data_page';\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nconst preProcessColumns = columnList => {\n return columnList.map(col => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = columnList => {\n const displayColumns = columnList.filter(col => col.display === 'true');\n const metaDataObj: any = { key: '', primary: '', secondary: [] };\n const keyCol = columnList.filter(col => col.key === 'true');\n metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';\n for (let index = 0; index < displayColumns.length; index += 1) {\n if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n } else {\n metaDataObj.secondary.push(displayColumns[index].value);\n }\n }\n return metaDataObj;\n};\n\nexport default function AutoComplete(props) {\n const {\n getPConnect,\n label,\n required,\n placeholder,\n value = '',\n validatemessage,\n onChange,\n readOnly,\n testId,\n displayMode,\n deferDatasource,\n datasourceMetadata,\n status,\n helperText\n } = props;\n let parameters = datasourceMetadata?.datasource?.parameters;\n const context = getPConnect().getContextName();\n let { listType, datasource = [], columns = [] } = props;\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<Array<IOption>>([]);\n const [theDatasource, setDatasource] = useState(null);\n let selectedValue: any = '';\n const helperTextToDisplay = validatemessage || helperText;\n\n if (!isDeepEqual(datasource, theDatasource)) {\n // inbound datasource is different, so update theDatasource (to trigger useEffect)\n setDatasource(datasource);\n }\n\n const flattenParameters = (params = {}) => {\n const flatParams = {};\n Object.keys(params).forEach((key) => {\n const { name, value: theVal } = params[key];\n flatParams[name] = theVal;\n });\n\n return flatParams;\n };\n\n // convert associated to datapage listtype and transform props\n // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList\n if (deferDatasource && datasourceMetadata?.datasource?.name) {\n listType = 'datapage';\n datasource = datasourceMetadata.datasource.name;\n parameters = flattenParameters(parameters);\n const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)\n : datasourceMetadata.datasource.propertyForDisplayText;\n const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForValue.substring(3)\n : datasourceMetadata.datasource.propertyForValue;\n columns = [\n {\n key: 'true',\n setProperty: 'Associated property',\n value: valueProp\n },\n {\n display: 'true',\n primary: 'true',\n useForSearch: true,\n value: displayProp\n }\n ];\n }\n columns = preProcessColumns(columns);\n\n useEffect(() => {\n if (listType === 'associated') {\n setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));\n }\n }, [theDatasource]);\n\n useEffect(() => {\n if (!displayMode && listType !== 'associated') {\n getDataPage(datasource, parameters, context).then((results: any) => {\n const optionsData: Array<any> = [];\n const displayColumn = getDisplayFieldsMetaData(columns);\n results?.forEach(element => {\n const val = element[displayColumn.primary]?.toString();\n const obj = {\n key: element[displayColumn.key] || element.pyGUID,\n value: val\n };\n optionsData.push(obj);\n });\n setOptions(optionsData);\n });\n }\n }, []);\n\n if (value) {\n const index = options?.findIndex(element => element.key === value);\n if (index > -1) {\n selectedValue = options[index].value;\n } else {\n selectedValue = value;\n }\n }\n\n const handleChange = (event: object, newValue) => {\n onChange({ value: newValue ? newValue.key : '' });\n };\n\n const handleInputValue = (event, newInputValue) => {\n setInputValue(newInputValue);\n };\n\n if (readOnly) {\n const theValAsString = options?.find(opt => opt.key === value)?.value;\n return <TextInput {...props} value={theValAsString} />;\n }\n // Need to use both getOptionLabel and getOptionSelected to map our\n // key/value structure to what Autocomplete expects\n return (\n <Autocomplete\n options={options}\n getOptionLabel={(option: IOption) => {\n return option.value ? option.value : '';\n }}\n getOptionSelected={(option: any) => {\n return option.value ? option.value : '';\n }}\n fullWidth\n onChange={handleChange}\n value={selectedValue}\n inputValue={inputValue || selectedValue}\n onInputChange={handleInputValue}\n renderInput={params => (\n <TextField\n {...params}\n fullWidth\n variant='outlined'\n helperText={helperTextToDisplay}\n placeholder={placeholder}\n size='small'\n required={required}\n error={status === 'error'}\n label={label}\n data-test-id={testId}\n />\n )}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,UAAU,QAAQ,CAAC;AAEhC,wBAAgB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"versionHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,UAAU,QAAQ,CAAC;AAEhC,wBAAgB,uBAAuB,SAsCtC"}
|
|
@@ -9,5 +9,30 @@ export function compareSdkPCoreVersions() {
|
|
|
9
9
|
// const theConstellationVersion = PCore.getPCoreVersion();
|
|
10
10
|
// eslint-disable-next-line no-console
|
|
11
11
|
console.warn(`Using Constellation version ${PCore.getPCoreVersion()}. Ensure this is the same version as your Infinity server.`);
|
|
12
|
+
// JA Testing
|
|
13
|
+
// debugger;
|
|
14
|
+
// const svcParams = [
|
|
15
|
+
// {
|
|
16
|
+
// "field" : "type",
|
|
17
|
+
// "value" : "Field"
|
|
18
|
+
// },
|
|
19
|
+
// {
|
|
20
|
+
// "field" : "subtype",
|
|
21
|
+
// "value" : "Text",
|
|
22
|
+
// }
|
|
23
|
+
// ];
|
|
24
|
+
// const options = {};
|
|
25
|
+
// const AssetLoader = PCore.getAssetLoader();
|
|
26
|
+
// AssetLoader
|
|
27
|
+
// .getSvcComponentsConfig(svcParams, options)
|
|
28
|
+
// .then((response) => {
|
|
29
|
+
// if (response?.data?.components?.[0]) {
|
|
30
|
+
// console.log(response.data.components[0]);
|
|
31
|
+
// }
|
|
32
|
+
// throw new Error('bad response');
|
|
33
|
+
// })
|
|
34
|
+
// .catch(() => {
|
|
35
|
+
// throw new Error('no response:');
|
|
36
|
+
// });
|
|
12
37
|
}
|
|
13
38
|
//# sourceMappingURL=versionHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAEhC,MAAM,UAAU,uBAAuB;IAErC,2DAA2D;IAE3D,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,+BAA+B,KAAK,CAAC,eAAe,EAAE,4DAA4D,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"versionHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/versionHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAEhC,MAAM,UAAU,uBAAuB;IAErC,2DAA2D;IAE3D,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,+BAA+B,KAAK,CAAC,eAAe,EAAE,4DAA4D,CAAC,CAAC;IAEjI,aAAa;IACb,YAAY;IAEZ,sBAAsB;IACtB,MAAM;IACN,wBAAwB;IACxB,wBAAwB;IACxB,OAAO;IACP,MAAM;IACN,2BAA2B;IAC3B,wBAAwB;IACxB,MAAM;IACN,KAAK;IAEL,sBAAsB;IAEtB,8CAA8C;IAE9C,cAAc;IACd,iDAAiD;IACjD,2BAA2B;IAC3B,+CAA+C;IAC/C,oDAAoD;IACpD,UAAU;IACV,yCAAyC;IACzC,QAAQ;IACR,oBAAoB;IACpB,yCAAyC;IACzC,SAAS;AAGX,CAAC","sourcesContent":["/**\n * versionHelpers.ts\n *\n * Container helper functions that can identify which version of\n * PCore/PConnect is being run\n */\n\ndeclare const PCore;\n\nexport const sdkVersion = \"8.7\";\n\nexport function compareSdkPCoreVersions() {\n\n // const theConstellationVersion = PCore.getPCoreVersion();\n\n // eslint-disable-next-line no-console\n console.warn(`Using Constellation version ${PCore.getPCoreVersion()}. Ensure this is the same version as your Infinity server.`);\n\n // JA Testing\n // debugger;\n\n // const svcParams = [\n // {\n // \"field\" : \"type\",\n // \"value\" : \"Field\"\n // },\n // {\n // \"field\" : \"subtype\",\n // \"value\" : \"Text\",\n // }\n // ];\n\n // const options = {};\n\n // const AssetLoader = PCore.getAssetLoader();\n\n // AssetLoader\n // .getSvcComponentsConfig(svcParams, options)\n // .then((response) => {\n // if (response?.data?.components?.[0]) {\n // console.log(response.data.components[0]);\n // }\n // throw new Error('bad response');\n // })\n // .catch(() => {\n // throw new Error('no response:');\n // });\n\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/Attachment/Attachment.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;AAW1B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/Attachment/Attachment.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;AAW1B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,KAAA,eAmYvC"}
|
|
@@ -159,7 +159,8 @@ export default function Attachment(props) {
|
|
|
159
159
|
handle: fileRes.ID,
|
|
160
160
|
ID: fileRes.clientFileID
|
|
161
161
|
};
|
|
162
|
-
|
|
162
|
+
const currentAttachmentList = getCurrentAttachmentsList(pConn.getContextName()).filter((f) => f.label !== valueRef);
|
|
163
|
+
PCore.getStateUtils().updateState(pConn.getContextName(), 'attachmentsList', [...currentAttachmentList, reqObj], {
|
|
163
164
|
pageReference: 'context_data',
|
|
164
165
|
isArrayDeepMerge: false
|
|
165
166
|
});
|
|
@@ -1 +1 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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,EAAC,OAAO,IAAE,KAAK,CAAQ;QACtC,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 './AttachmentUtils';\nimport './Attachment.css';\nimport SummaryList from '../../widgets/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\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 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.name,\n icon: \"trash\",\n click: removeFile,\n },\n secondary: {\n text: att.meta\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 = () => {};\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 PCore.getStateUtils().updateState(\n pConn.getContextName(),\n 'attachmentsList',\n [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 }\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'>{label}</span>\n <section>{content}</section>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../src/components/infra/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,mBAAmB,CAAC;AAC3H,OAAO,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AAW,6BAA2B,mBAAmB,GAAgB,CAAC,CAC3J,CAEP,CAAC;KACH;IAED,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,8BAAM,SAAS,EAAC,OAAO,IAAE,KAAK,CAAQ;QACtC,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 './AttachmentUtils';\nimport './Attachment.css';\nimport SummaryList from '../../widgets/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\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 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.name,\n icon: \"trash\",\n click: removeFile,\n },\n secondary: {\n text: att.meta\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 = () => {};\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 }\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'>{label}</span>\n <section>{content}</section>\n </div>\n );\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,eAwb1C;kBAxbuB,aAAa;;;;;;;;;;;;;;;;;;eAAb,aAAa"}
|
|
@@ -40,6 +40,8 @@ const useStyles = makeStyles((theme) => ({
|
|
|
40
40
|
}));
|
|
41
41
|
export default function FlowContainer(props) {
|
|
42
42
|
const pCoreConstants = PCore.getConstants();
|
|
43
|
+
const { TODO } = pCoreConstants;
|
|
44
|
+
const todo_headerText = "To do";
|
|
43
45
|
const { getPConnect, routingInfo } = props;
|
|
44
46
|
const { displayOnlyFA } = useContext(StoreContext);
|
|
45
47
|
const thePConn = getPConnect();
|
|
@@ -52,10 +54,6 @@ export default function FlowContainer(props) {
|
|
|
52
54
|
const [todo_showTodoList, setShowTodoList] = useState(false);
|
|
53
55
|
const [todo_datasource, setTodoDatasource] = useState({});
|
|
54
56
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
55
|
-
const [todo_headerText, setTodoHeaderText] = useState("To do");
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
57
|
-
const [todo_type, setTodoType] = useState("");
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
59
57
|
const [todo_context, setTodoContext] = useState("");
|
|
60
58
|
const [caseMessages, setCaseMessages] = useState("");
|
|
61
59
|
const [bHasCaseMessages, setHasCaseMessages] = useState(false);
|
|
@@ -207,9 +205,7 @@ export default function FlowContainer(props) {
|
|
|
207
205
|
}
|
|
208
206
|
// From WC SDK updateSelf - so do this in useEffect that's run only when the props change...
|
|
209
207
|
useEffect(() => {
|
|
210
|
-
// debugger;
|
|
211
208
|
const localPConn = arNewChildren[0].getPConnect();
|
|
212
|
-
// debugger;
|
|
213
209
|
setBuildName(getBuildName());
|
|
214
210
|
// routingInfo was added as component prop in populateAdditionalProps
|
|
215
211
|
// let routingInfo = this.getComponentProp("routingInfo");
|
|
@@ -345,7 +341,7 @@ export default function FlowContainer(props) {
|
|
|
345
341
|
React.createElement(Assignment, { getPConnect: getPConnect, itemKey: itemKey }, arNewChildrenAsReact)))
|
|
346
342
|
:
|
|
347
343
|
React.createElement("div", null,
|
|
348
|
-
React.createElement(ToDo, { getPConnect: getPConnect, caseInfoID: todo_caseInfoID, datasource: todo_datasource, showTodoList: todo_showTodoList, headerText: todo_headerText, type:
|
|
344
|
+
React.createElement(ToDo, { getPConnect: getPConnect, caseInfoID: todo_caseInfoID, datasource: todo_datasource, showTodoList: todo_showTodoList, headerText: todo_headerText, type: TODO, context: todo_context, itemKey: itemKey }))
|
|
349
345
|
:
|
|
350
346
|
React.createElement("div", { className: classes.alert },
|
|
351
347
|
React.createElement(Alert, { severity: "success" }, caseMessages))));
|
|
@@ -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,YAAY,CAAC;AAE9B,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,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AAQ,EAAC,SAAS,IAAE,YAAY,CAAS,CAC5C,CAEJ,CACP,CAAA;AACH,CAAC;AAED,aAAa,CAAC,YAAY,GAAG;IAC3B,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,IAAI;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 \"../../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\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_headerText, setTodoHeaderText] = useState(\"To do\");\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [todo_type, setTodoType] = 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\n // debugger;\n\n const localPConn = arNewChildren[0].getPConnect();\n\n // debugger;\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\n // let configProps = this.thePConn.resolveConfigProps(this.thePConn.getConfigProps());\n\n\n if (!loadingInfo) {\n // turn off spinner\n // this.psService.sendMessage(false);\n }\n\n const caseViewMode = thePConn.getValue(\"context_data.caseViewMode\");\n\n const { CASE_INFO: CASE_CONSTS } = pCoreConstants;\n\n\n if (caseViewMode && caseViewMode === \"review\") {\n\n setTimeout(() => {\n\n // updated for 8.7 - 30-Mar-2022\n\n const todoAssignments = getToDoAssignments(thePConn);\n\n if (todoAssignments && todoAssignments.length > 0) {\n setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID));\n setTodoDatasource({ source: todoAssignments });\n }\n\n setShowTodo(true);\n setShowTodoList(false);\n\n\n }, 100);\n\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 }\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_type}\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,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AE,OAAO,EAAE,OAAO,GAAS,CAC9C;QACR,CAAC;YACD,6BAAK,SAAS,EAAE,OAAO,CAAC,KAAK;gBAC3B,oBAAC,KAAK,IAAC,QAAQ,EAAC,SAAS,IAAE,YAAY,CAAS,CAC5C,CAEJ,CACP,CAAA;AACH,CAAC;AAED,aAAa,CAAC,YAAY,GAAG;IAC3B,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,IAAI;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 \"../../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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToDo.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/ToDo/ToDo.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAyBnC,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ToDo.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/ToDo/ToDo.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAyBnC,OAAO,YAAY,CAAC;AAqCpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,eA2LjC;kBA3LuB,IAAI;;;;;;;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import PropTypes from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { Utils } from '../../helpers/utils';
|
|
4
|
-
import { Box, Button, Card, CardContent, CardHeader, Avatar, Typography, Badge, List, ListItem, ListItemText, ListItemSecondaryAction
|
|
4
|
+
import { Box, Button, Card, CardContent, CardHeader, Avatar, Typography, Badge, List, ListItem, ListItemText, ListItemSecondaryAction } from '@material-ui/core';
|
|
5
5
|
import Snackbar from '@material-ui/core/Snackbar';
|
|
6
6
|
import IconButton from '@material-ui/core/IconButton';
|
|
7
7
|
import CloseIcon from '@material-ui/icons/Close';
|
|
@@ -10,79 +10,73 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
10
10
|
import { useTheme } from '@material-ui/core/styles';
|
|
11
11
|
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
12
12
|
import './ToDo.css';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
const isChildCase = (assignment) => {
|
|
14
|
+
return assignment.isChild;
|
|
15
|
+
};
|
|
16
|
+
function topThreeAssignments(assignmentsSource) {
|
|
17
|
+
return Array.isArray(assignmentsSource) ? assignmentsSource.slice(0, 3) : [];
|
|
18
|
+
}
|
|
19
|
+
function getID(assignment) {
|
|
20
|
+
if (assignment.value) {
|
|
21
|
+
const refKey = assignment.value;
|
|
22
|
+
return refKey.substring(refKey.lastIndexOf(' ') + 1);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const refKey = assignment.ID;
|
|
26
|
+
const arKeys = refKey.split('!')[0].split(' ');
|
|
27
|
+
return arKeys[2];
|
|
25
28
|
}
|
|
26
|
-
return result;
|
|
27
29
|
}
|
|
28
|
-
const useStyles = makeStyles(
|
|
30
|
+
const useStyles = makeStyles(theme => ({
|
|
29
31
|
root: {
|
|
30
32
|
marginTop: theme.spacing(1),
|
|
31
33
|
marginBottom: theme.spacing(1),
|
|
32
34
|
paddingBottom: theme.spacing(1),
|
|
33
|
-
borderLeft:
|
|
35
|
+
borderLeft: '6px solid',
|
|
34
36
|
borderLeftColor: theme.palette.primary.light
|
|
35
37
|
},
|
|
36
38
|
avatar: {
|
|
37
39
|
backgroundColor: theme.palette.primary.light,
|
|
38
|
-
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
40
|
+
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
39
41
|
}
|
|
40
42
|
}));
|
|
41
43
|
export default function ToDo(props) {
|
|
42
|
-
const {
|
|
44
|
+
const { datasource, getPConnect, headerText, showTodoList, myWorkList, type } = props;
|
|
45
|
+
const CONSTS = PCore.getConstants();
|
|
43
46
|
const bLogging = true;
|
|
44
|
-
const [bShowMore, setBShowMore] = useState(true);
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
46
|
-
const [currentUser, setCurrentUser] = useState(PCore.getEnvironmentInfo().getOperatorName());
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
48
|
-
const [currentUserInitials, setCurrentUserInitials] = useState(Utils.getInitials(currentUser));
|
|
49
|
-
const [showSnackbar, setShowSnackbar] = useState(false);
|
|
50
|
-
const [snackbarMessage, setSnackbarMessage] = useState("");
|
|
51
|
-
const thePConn = getPConnect();
|
|
52
47
|
let assignmentCount = 0;
|
|
48
|
+
const currentUser = PCore.getEnvironmentInfo().getOperatorName();
|
|
49
|
+
const currentUserInitials = Utils.getInitials(currentUser);
|
|
53
50
|
const assignmentsSource = datasource?.source || myWorkList?.source;
|
|
54
|
-
|
|
51
|
+
const [bShowMore, setBShowMore] = useState(true);
|
|
52
|
+
const [showSnackbar, setShowSnackbar] = useState(false);
|
|
53
|
+
const [snackbarMessage, setSnackbarMessage] = useState('');
|
|
55
54
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
56
|
-
const [
|
|
55
|
+
const [assignments, setAssignments] = useState(initAssignments());
|
|
56
|
+
const thePConn = getPConnect();
|
|
57
57
|
const classes = useStyles();
|
|
58
58
|
const theme = useTheme();
|
|
59
59
|
const isDesktop = useMediaQuery(theme.breakpoints.up('md'));
|
|
60
60
|
// const { setOpen } = useNavBar();
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (len > 3)
|
|
66
|
-
len = 3;
|
|
67
|
-
for (let i = 0; i < len; i += 1) {
|
|
68
|
-
arList3.push(arList[i]);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return arList3;
|
|
72
|
-
}
|
|
73
|
-
function getID(assignment) {
|
|
74
|
-
let sID = "";
|
|
75
|
-
if (assignment.value) {
|
|
76
|
-
const refKey = assignment.value;
|
|
77
|
-
sID = refKey.substring(refKey.lastIndexOf(" ") + 1);
|
|
61
|
+
function initAssignments() {
|
|
62
|
+
if (assignmentsSource) {
|
|
63
|
+
assignmentCount = assignmentsSource.length;
|
|
64
|
+
return topThreeAssignments(assignmentsSource);
|
|
78
65
|
}
|
|
79
66
|
else {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
sID = arKeys[2];
|
|
67
|
+
// turn off todolist
|
|
68
|
+
return [];
|
|
83
69
|
}
|
|
84
|
-
return sID;
|
|
85
70
|
}
|
|
71
|
+
const getAssignmentId = assignment => {
|
|
72
|
+
return type === CONSTS.TODO ? assignment.ID : assignment.id;
|
|
73
|
+
};
|
|
74
|
+
const getPriority = assignment => {
|
|
75
|
+
return type === CONSTS.TODO ? assignment.urgency : assignment.priority;
|
|
76
|
+
};
|
|
77
|
+
const getAssignmentName = assignment => {
|
|
78
|
+
return type === CONSTS.TODO ? assignment.name : assignment.stepName;
|
|
79
|
+
};
|
|
86
80
|
function showToast(message) {
|
|
87
81
|
const theMessage = `Assignment: ${message}`;
|
|
88
82
|
// eslint-disable-next-line no-console
|
|
@@ -96,40 +90,37 @@ export default function ToDo(props) {
|
|
|
96
90
|
}
|
|
97
91
|
setShowSnackbar(false);
|
|
98
92
|
}
|
|
99
|
-
;
|
|
100
93
|
function _showMore() {
|
|
101
94
|
setBShowMore(false);
|
|
102
|
-
|
|
95
|
+
setAssignments(assignmentsSource);
|
|
103
96
|
}
|
|
104
97
|
function _showLess() {
|
|
105
98
|
setBShowMore(true);
|
|
106
|
-
|
|
99
|
+
setAssignments(topThreeAssignments(assignmentsSource));
|
|
107
100
|
}
|
|
108
|
-
function clickGo(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// Disable closing the side bar per standup vote
|
|
112
|
-
//
|
|
113
|
-
// setOpen(false);
|
|
114
|
-
const { id } = inAssignmentArray[0];
|
|
115
|
-
let { classname = "" } = inAssignmentArray[0];
|
|
101
|
+
function clickGo(assignment) {
|
|
102
|
+
const id = getAssignmentId(assignment);
|
|
103
|
+
let { classname = '' } = assignment;
|
|
116
104
|
const sTarget = thePConn.getContainerName();
|
|
117
105
|
const sTargetContainerName = sTarget;
|
|
118
|
-
const options = {
|
|
119
|
-
if (classname === null || classname ===
|
|
106
|
+
const options = { containerName: sTargetContainerName };
|
|
107
|
+
if (classname === null || classname === '') {
|
|
120
108
|
classname = thePConn.getCaseInfo().getClassName();
|
|
121
109
|
}
|
|
122
|
-
if (sTarget ===
|
|
123
|
-
options[
|
|
124
|
-
options[
|
|
125
|
-
options[
|
|
126
|
-
options[
|
|
110
|
+
if (sTarget === 'workarea') {
|
|
111
|
+
options['isActionFromToDoList'] = true;
|
|
112
|
+
options['target'] = '';
|
|
113
|
+
options['context'] = null;
|
|
114
|
+
options['isChild'] = isChildCase(assignment);
|
|
127
115
|
}
|
|
128
116
|
else {
|
|
129
|
-
options[
|
|
130
|
-
options[
|
|
117
|
+
options['isActionFromToDoList'] = false;
|
|
118
|
+
options['target'] = sTarget;
|
|
131
119
|
}
|
|
132
|
-
thePConn
|
|
120
|
+
thePConn
|
|
121
|
+
.getActionsApi()
|
|
122
|
+
.openAssignment(id, classname, options)
|
|
123
|
+
.then(() => {
|
|
133
124
|
if (bLogging) {
|
|
134
125
|
// eslint-disable-next-line no-console
|
|
135
126
|
console.log(`openAssignment completed`);
|
|
@@ -139,56 +130,39 @@ export default function ToDo(props) {
|
|
|
139
130
|
showToast(`Submit failed!`);
|
|
140
131
|
});
|
|
141
132
|
}
|
|
142
|
-
function initAssignments() {
|
|
143
|
-
if (showTodoList) {
|
|
144
|
-
if (assignmentsSource) {
|
|
145
|
-
assignmentCount = (assignmentsSource !== null) ? assignmentsSource.length : 0;
|
|
146
|
-
return topThreeAssignments(assignmentsSource);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
// turn off todolist
|
|
150
|
-
return [];
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
else if (caseInfoID !== undefined) {
|
|
154
|
-
// get caseInfoId assignment.
|
|
155
|
-
return getCaseInfoAssignment(assignmentsSource, caseInfoID);
|
|
156
|
-
}
|
|
157
|
-
return [];
|
|
158
|
-
}
|
|
159
133
|
const getListItemComponent = assignment => {
|
|
160
134
|
if (isDesktop) {
|
|
161
135
|
return (React.createElement(React.Fragment, null,
|
|
162
136
|
"Task in",
|
|
163
|
-
React.createElement(Button, { size:
|
|
137
|
+
React.createElement(Button, { size: 'small', color: 'primary' }, `${assignment.name} ${getID(assignment)}`),
|
|
164
138
|
` \u2022 `,
|
|
165
|
-
React.createElement("span", { className:
|
|
166
|
-
` \u2022
|
|
139
|
+
React.createElement("span", { className: 'psdk-todo-assignment-status' }, assignment.status),
|
|
140
|
+
` \u2022 Urgency ${getPriority(assignment)}`));
|
|
167
141
|
}
|
|
168
142
|
return (React.createElement(React.Fragment, null,
|
|
169
|
-
React.createElement(Button, { size:
|
|
170
|
-
` \u2022
|
|
143
|
+
React.createElement(Button, { size: 'small', color: 'primary' }, `${assignment.name} ${getID(assignment)}`),
|
|
144
|
+
` \u2022 Urgency ${getPriority(assignment)}`));
|
|
171
145
|
};
|
|
172
146
|
return (React.createElement(React.Fragment, null,
|
|
173
147
|
React.createElement(Card, { className: classes.root },
|
|
174
|
-
showTodoList && (React.createElement(CardHeader, { title: React.createElement(Badge, { badgeContent: assignmentCount, color:
|
|
175
|
-
React.createElement(Typography, { variant:
|
|
148
|
+
showTodoList && (React.createElement(CardHeader, { title: React.createElement(Badge, { badgeContent: assignmentCount, color: 'primary' },
|
|
149
|
+
React.createElement(Typography, { variant: 'h6' },
|
|
176
150
|
headerText,
|
|
177
151
|
"\u00A0\u00A0\u00A0")), avatar: React.createElement(Avatar, { className: classes.avatar }, currentUserInitials) })),
|
|
178
152
|
React.createElement(CardContent, null,
|
|
179
|
-
React.createElement(List, null,
|
|
180
|
-
React.createElement(ListItemText, { primary: assignment
|
|
153
|
+
React.createElement(List, null, assignments.map(assignment => (React.createElement(ListItem, { key: getAssignmentId(assignment), dense: true, divider: true, onClick: () => clickGo(assignment) },
|
|
154
|
+
React.createElement(ListItemText, { primary: getAssignmentName(assignment), secondary: getListItemComponent(assignment) }),
|
|
181
155
|
React.createElement(ListItemSecondaryAction, null,
|
|
182
|
-
React.createElement(IconButton, { onClick: () => clickGo(
|
|
156
|
+
React.createElement(IconButton, { onClick: () => clickGo(assignment) },
|
|
183
157
|
React.createElement(ArrowForwardIosOutlinedIcon, null)))))))),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
React.createElement(CloseIcon, { fontSize: "small" })) })));
|
|
158
|
+
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"))))),
|
|
159
|
+
React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
|
|
160
|
+
React.createElement(CloseIcon, { fontSize: 'small' })) })));
|
|
188
161
|
}
|
|
189
162
|
ToDo.propTypes = {
|
|
190
163
|
datasource: PropTypes.instanceOf(Object),
|
|
191
164
|
myWorkList: PropTypes.instanceOf(Object),
|
|
165
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
192
166
|
caseInfoID: PropTypes.string,
|
|
193
167
|
// buildName: PropTypes.string,
|
|
194
168
|
getPConnect: PropTypes.func.isRequired,
|
|
@@ -197,25 +171,24 @@ ToDo.propTypes = {
|
|
|
197
171
|
itemKey: PropTypes.string,
|
|
198
172
|
showTodoList: PropTypes.bool,
|
|
199
173
|
// target: PropTypes.string,
|
|
200
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
201
174
|
type: PropTypes.string,
|
|
202
175
|
// pageMessages: PropTypes.arrayOf(PropTypes.any),
|
|
203
176
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
204
|
-
context: PropTypes.string
|
|
177
|
+
context: PropTypes.string
|
|
205
178
|
// hideActionButtons: PropTypes.bool
|
|
206
179
|
};
|
|
207
180
|
ToDo.defaultProps = {
|
|
208
|
-
caseInfoID:
|
|
181
|
+
caseInfoID: '',
|
|
209
182
|
datasource: [],
|
|
210
183
|
myWorkList: {},
|
|
211
184
|
// buildName: "",
|
|
212
|
-
headerText:
|
|
213
|
-
itemKey:
|
|
185
|
+
headerText: 'To do',
|
|
186
|
+
itemKey: '',
|
|
214
187
|
showTodoList: true,
|
|
215
188
|
// target: "",
|
|
216
|
-
type:
|
|
189
|
+
type: 'worklist',
|
|
217
190
|
// pageMessages: null,
|
|
218
|
-
context:
|
|
191
|
+
context: ''
|
|
219
192
|
// hideActionButtons: false
|
|
220
193
|
};
|
|
221
194
|
//# sourceMappingURL=ToDo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToDo.js","sourceRoot":"","sources":["../../../../src/components/infra/ToDo/ToDo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C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I,EAAE,SAAS,CAAC,MAAM;IACtB,kDAAkD;IAClD,sDAAsD;IACtD,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,oCAAoC;CACrC,CAAC;AAEF,IAAI,CAAC,YAAY,GAAG;IAClB,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,iBAAiB;IACjB,UAAU,EAAE,OAAO;IACnB,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,IAAI;IAClB,cAAc;IACd,IAAI,EAAE,UAAU;IAChB,sBAAsB;IACtB,OAAO,EAAE,EAAE;IACX,2BAA2B;CAC5B,CAAC","sourcesContent":["import React, { useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Utils } from '../../helpers/utils';\nimport {\n Box,\n Button,\n Card,\n CardContent,\n CardHeader,\n Avatar,\n Typography,\n Badge,\n List,\n ListItem,\n ListItemText,\n ListItemSecondaryAction,\n} from \"@material-ui/core\";\nimport Snackbar from '@material-ui/core/Snackbar';\nimport IconButton from '@material-ui/core/IconButton';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport ArrowForwardIosOutlinedIcon from '@material-ui/icons/ArrowForwardIosOutlined';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTheme } from '@material-ui/core/styles';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport './ToDo.css';\n\n// import { useNavBar } from \"../templates/AppShell\";\n\nfunction getCaseInfoAssignment(assignmentsSource: Array<any>, caseInfoID: string) {\n const result: Array<any> = [];\n for (const source of assignmentsSource) {\n if (source.ID.indexOf(caseInfoID) >= 0) {\n const listRow = JSON.parse(JSON.stringify(source));\n // urgency becomes priority\n listRow['priority'] = listRow.urgency || undefined;\n // mimic regular list\n listRow['id'] = listRow['ID'] || undefined;\n result.push(listRow);\n }\n }\n\n return result;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n borderLeft: \"6px solid\",\n borderLeftColor: theme.palette.primary.light\n },\n avatar: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light),\n }\n}));\n\ndeclare const PCore: any;\n\nexport default function ToDo(props) {\n const {\n caseInfoID,\n datasource,\n getPConnect,\n headerText,\n showTodoList,\n myWorkList\n } = props;\n\n const bLogging = true;\n const [bShowMore, setBShowMore] = useState( true );\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const[currentUser, setCurrentUser] = useState(PCore.getEnvironmentInfo().getOperatorName());\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const[currentUserInitials, setCurrentUserInitials] = useState(Utils.getInitials(currentUser));\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage]: any = useState(\"\");\n\n\n const thePConn = getPConnect();\n let assignmentCount = 0;\n const assignmentsSource = datasource?.source || myWorkList?.source;\n // let arAssignments : Array<any> = [];\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const[arAssignments, setArAssignments] = useState<Array<any>>( initAssignments() );\n const classes = useStyles();\n const theme = useTheme();\n const isDesktop = useMediaQuery(theme.breakpoints.up('md'));\n // const { setOpen } = useNavBar();\n\n function topThreeAssignments(arList: Array<any>): Array<any> {\n const arList3: Array<any> = new Array<any>();\n\n if (arList && typeof(arList) === \"object\") {\n let len = arList.length;\n if (len > 3) len = 3;\n\n for (let i =0; i < len; i+=1) {\n arList3.push(arList[i]);\n }\n }\n return arList3;\n }\n\n function getID(assignment: any) {\n let sID = \"\";\n if (assignment.value) {\n const refKey = assignment.value;\n sID = refKey.substring(refKey.lastIndexOf(\" \") + 1);\n }\n else {\n const refKey = assignment.ID;\n const arKeys = refKey.split(\"!\")[0].split(\" \");\n sID = arKeys[2];\n }\n return sID;\n }\n\n\n function showToast(message: string) {\n const theMessage = `Assignment: ${message}`;\n // eslint-disable-next-line no-console\n console.error(theMessage);\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n };\n\n\n function _showMore() {\n setBShowMore(false);\n setArAssignments(assignmentsSource);\n }\n\n\n function _showLess() {\n setBShowMore(true);\n setArAssignments(topThreeAssignments(assignmentsSource));\n }\n\n\n function clickGo(inAssignmentArray: any) {\n //\n // By Sherif\n // Disable closing the side bar per standup vote\n //\n // setOpen(false);\n\n const { id } = inAssignmentArray[0];\n let { classname = \"\" } = inAssignmentArray[0];\n const sTarget = thePConn.getContainerName();\n const sTargetContainerName = sTarget;\n\n const options = { \"containerName\": sTargetContainerName};\n\n if (classname === null || classname === \"\") {\n classname = thePConn.getCaseInfo().getClassName();\n }\n\n if (sTarget === \"workarea\") {\n options[\"isActionFromToDoList\"] = true;\n options[\"target\"] = \"\";\n options[\"context\"] = null;\n options[\"isChild\"] = undefined;\n }\n else {\n options[\"isActionFromToDoList\"] = false;\n options[\"target\"] = sTarget;\n }\n\n thePConn.getActionsApi().openAssignment(id, classname, options).then(() => {\n if (bLogging) {\n // eslint-disable-next-line no-console\n console.log(`openAssignment completed`);\n }\n })\n .catch(() => {\n showToast( `Submit failed!`);\n });\n\n }\n\n\n function initAssignments() : Array<any> {\n if (showTodoList) {\n if (assignmentsSource) {\n assignmentCount = (assignmentsSource !== null) ? assignmentsSource.length : 0;\n return topThreeAssignments(assignmentsSource);\n }else {\n // turn off todolist\n return [];\n }\n }\n else if (caseInfoID !== undefined) {\n // get caseInfoId assignment.\n return getCaseInfoAssignment(assignmentsSource, caseInfoID);\n }\n return [];\n }\n\n const getListItemComponent = assignment => {\n if (isDesktop) {\n return (\n <>\n Task in\n <Button size=\"small\" color=\"primary\">{`${assignment.name} ${getID(assignment)}`}</Button>\n {` \\u2022 `}<span className=\"psdk-todo-assignment-status\">{assignment.status}</span>\n {` \\u2022 Priority ${assignment.priority}`}\n </>\n )\n } return (\n <>\n <Button size=\"small\" color=\"primary\">{`${assignment.name} ${getID(assignment)}`}</Button>\n {` \\u2022 Priority ${assignment.priority}`}\n </>\n )\n }\n\n return (\n <React.Fragment>\n <Card className={classes.root}>\n {\n showTodoList && (\n <CardHeader\n title={\n <Badge badgeContent={assignmentCount} color=\"primary\">\n <Typography variant=\"h6\">{headerText} </Typography>\n </Badge>\n }\n avatar={\n <Avatar className={classes.avatar}>\n {currentUserInitials}\n </Avatar>\n }\n ></CardHeader>\n )\n }\n <CardContent>\n <List>\n {\n arAssignments.map(assignment => (\n <ListItem\n key={assignment.id}\n dense\n divider\n onClick={() => clickGo([assignment])}\n >\n <ListItemText\n primary={assignment.stepName}\n secondary={getListItemComponent(assignment)}\n />\n <ListItemSecondaryAction>\n <IconButton onClick={() => clickGo([assignment])}>\n <ArrowForwardIosOutlinedIcon />\n </IconButton>\n </ListItemSecondaryAction>\n </ListItem>\n ))\n }\n </List>\n </CardContent>\n {\n showTodoList && (\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n >\n {\n bShowMore ? <Button color=\"primary\" onClick={_showMore}>Show more</Button>\n : <Button onClick={_showLess}>Show less</Button>\n }\n </Box>\n )\n }\n </Card>\n\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton size=\"small\" aria-label=\"close\" color=\"inherit\" onClick={handleSnackbarClose}>\n <CloseIcon fontSize=\"small\" />\n </IconButton>\n }\n />\n </React.Fragment>\n );\n}\n\nToDo.propTypes = {\n datasource: PropTypes.instanceOf(Object),\n myWorkList: PropTypes.instanceOf(Object),\n caseInfoID: PropTypes.string,\n // buildName: PropTypes.string,\n getPConnect: PropTypes.func.isRequired,\n headerText: PropTypes.string,\n // eslint-disable-next-line react/no-unused-prop-types\n itemKey: PropTypes.string,\n showTodoList: PropTypes.bool,\n // target: PropTypes.string,\n // eslint-disable-next-line react/no-unused-prop-types\n type: PropTypes.string,\n // pageMessages: PropTypes.arrayOf(PropTypes.any),\n // eslint-disable-next-line react/no-unused-prop-types\n context: PropTypes.string,\n // hideActionButtons: PropTypes.bool\n};\n\nToDo.defaultProps = {\n caseInfoID: \"\",\n datasource: [],\n myWorkList: {},\n // buildName: \"\",\n headerText: \"To do\",\n itemKey: \"\",\n showTodoList: true,\n // target: \"\",\n type: \"worklist\",\n // pageMessages: null,\n context: \"\",\n // hideActionButtons: false\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ToDo.js","sourceRoot":"","sources":["../../../../src/components/infra/ToDo/ToDo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,MAAM,EACN,UAAU,EACV,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,UAAU,MAAM,8BAA8B,CAAC;AACtD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,2BAA2B,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,aAAa,MAAM,iCAAiC,CAAC;AAE5D,OAAO,YAAY,CAAC;AAIpB,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,EAAE;IACjC,OAAO,UAAU,CAAC,OAAO,CAAC;AAC5B,CAAC,CAAC;AAEF,SAAS,mBAAmB,CAAC,iBAA6B;IACxD,OAAO,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,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AAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,iBAAiB;IACjB,UAAU,EAAE,OAAO;IACnB,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,IAAI;IAClB,cAAc;IACd,IAAI,EAAE,UAAU;IAChB,sBAAsB;IACtB,OAAO,EAAE,EAAE;IACX,2BAA2B;CAC5B,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Utils } from '../../helpers/utils';\nimport {\n Box,\n Button,\n Card,\n CardContent,\n CardHeader,\n Avatar,\n Typography,\n Badge,\n List,\n ListItem,\n ListItemText,\n ListItemSecondaryAction\n} from '@material-ui/core';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport IconButton from '@material-ui/core/IconButton';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport ArrowForwardIosOutlinedIcon from '@material-ui/icons/ArrowForwardIosOutlined';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTheme } from '@material-ui/core/styles';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport './ToDo.css';\n\ndeclare const PCore: any;\n\nconst isChildCase = (assignment) => {\n return assignment.isChild;\n};\n\nfunction topThreeAssignments(assignmentsSource: Array<any>): Array<any> {\n return Array.isArray(assignmentsSource) ? assignmentsSource.slice(0, 3) : [];\n}\n\nfunction getID(assignment: any) {\n if (assignment.value) {\n const refKey = assignment.value;\n return refKey.substring(refKey.lastIndexOf(' ') + 1);\n } else {\n const refKey = assignment.ID;\n const arKeys = refKey.split('!')[0].split(' ');\n return arKeys[2];\n }\n}\n\nconst useStyles = makeStyles(theme => ({\n root: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n borderLeft: '6px solid',\n borderLeftColor: theme.palette.primary.light\n },\n avatar: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light)\n }\n}));\n\nexport default function ToDo(props) {\n const { datasource, getPConnect, headerText, showTodoList, myWorkList, type } = props;\n\n const CONSTS = PCore.getConstants();\n\n const bLogging = true;\n let assignmentCount = 0;\n const currentUser = PCore.getEnvironmentInfo().getOperatorName();\n const currentUserInitials = Utils.getInitials(currentUser);\n const assignmentsSource = datasource?.source || myWorkList?.source;\n\n const [bShowMore, setBShowMore] = useState(true);\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage]: any = useState('');\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const [assignments, setAssignments] = useState<Array<any>>(initAssignments());\n\n const thePConn = getPConnect();\n const classes = useStyles();\n const theme = useTheme();\n const isDesktop = useMediaQuery(theme.breakpoints.up('md'));\n // const { setOpen } = useNavBar();\n\n function initAssignments(): Array<any> {\n if (assignmentsSource) {\n assignmentCount = assignmentsSource.length;\n return topThreeAssignments(assignmentsSource);\n } else {\n // turn off todolist\n return [];\n }\n }\n\n const getAssignmentId = assignment => {\n return type === CONSTS.TODO ? assignment.ID : assignment.id;\n };\n\n const getPriority = assignment => {\n return type === CONSTS.TODO ? assignment.urgency : assignment.priority;\n };\n\n const getAssignmentName = assignment => {\n return type === CONSTS.TODO ? assignment.name : assignment.stepName;\n };\n\n function showToast(message: string) {\n const theMessage = `Assignment: ${message}`;\n // eslint-disable-next-line no-console\n console.error(theMessage);\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n function _showMore() {\n setBShowMore(false);\n setAssignments(assignmentsSource);\n }\n\n function _showLess() {\n setBShowMore(true);\n setAssignments(topThreeAssignments(assignmentsSource));\n }\n\n function clickGo(assignment) {\n const id = getAssignmentId(assignment);\n let { classname = '' } = assignment;\n const sTarget = thePConn.getContainerName();\n const sTargetContainerName = sTarget;\n\n const options = { containerName: sTargetContainerName };\n\n if (classname === null || classname === '') {\n classname = thePConn.getCaseInfo().getClassName();\n }\n\n if (sTarget === 'workarea') {\n options['isActionFromToDoList'] = true;\n options['target'] = '';\n options['context'] = null;\n options['isChild'] = isChildCase(assignment);\n } else {\n options['isActionFromToDoList'] = false;\n options['target'] = sTarget;\n }\n\n thePConn\n .getActionsApi()\n .openAssignment(id, classname, options)\n .then(() => {\n if (bLogging) {\n // eslint-disable-next-line no-console\n console.log(`openAssignment completed`);\n }\n })\n .catch(() => {\n showToast(`Submit failed!`);\n });\n }\n\n const getListItemComponent = assignment => {\n if (isDesktop) {\n return (\n <>\n Task in\n <Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>\n {` \\u2022 `}\n <span className='psdk-todo-assignment-status'>{assignment.status}</span>\n {` \\u2022 Urgency ${getPriority(assignment)}`}\n </>\n );\n }\n return (\n <>\n <Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>\n {` \\u2022 Urgency ${getPriority(assignment)}`}\n </>\n );\n };\n\n return (\n <React.Fragment>\n <Card className={classes.root}>\n {showTodoList && (\n <CardHeader\n title={\n <Badge badgeContent={assignmentCount} color='primary'>\n <Typography variant='h6'>{headerText} </Typography>\n </Badge>\n }\n avatar={<Avatar className={classes.avatar}>{currentUserInitials}</Avatar>}\n ></CardHeader>\n )}\n <CardContent>\n <List>\n {assignments.map(assignment => (\n <ListItem\n key={getAssignmentId(assignment)}\n dense\n divider\n onClick={() => clickGo(assignment)}\n >\n <ListItemText\n primary={getAssignmentName(assignment)}\n secondary={getListItemComponent(assignment)}\n />\n <ListItemSecondaryAction>\n <IconButton onClick={() => clickGo(assignment)}>\n <ArrowForwardIosOutlinedIcon />\n </IconButton>\n </ListItemSecondaryAction>\n </ListItem>\n ))}\n </List>\n </CardContent>\n {assignmentCount > 3 && (\n <Box display='flex' justifyContent='center'>\n {bShowMore ? (\n <Button color='primary' onClick={_showMore}>\n Show more\n </Button>\n ) : (\n <Button onClick={_showLess}>Show less</Button>\n )}\n </Box>\n )}\n </Card>\n\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </React.Fragment>\n );\n}\n\nToDo.propTypes = {\n datasource: PropTypes.instanceOf(Object),\n myWorkList: PropTypes.instanceOf(Object),\n // eslint-disable-next-line react/no-unused-prop-types\n caseInfoID: PropTypes.string,\n // buildName: PropTypes.string,\n getPConnect: PropTypes.func.isRequired,\n headerText: PropTypes.string,\n // eslint-disable-next-line react/no-unused-prop-types\n itemKey: PropTypes.string,\n showTodoList: PropTypes.bool,\n // target: PropTypes.string,\n type: PropTypes.string,\n // pageMessages: PropTypes.arrayOf(PropTypes.any),\n // eslint-disable-next-line react/no-unused-prop-types\n context: PropTypes.string\n // hideActionButtons: PropTypes.bool\n};\n\nToDo.defaultProps = {\n caseInfoID: '',\n datasource: [],\n myWorkList: {},\n // buildName: \"\",\n headerText: 'To do',\n itemKey: '',\n showTodoList: true,\n // target: \"\",\n type: 'worklist',\n // pageMessages: null,\n context: ''\n // hideActionButtons: false\n};\n"]}
|
|
@@ -10,6 +10,7 @@ declare namespace pegaSdkComponentMap {
|
|
|
10
10
|
export { CancelAlert };
|
|
11
11
|
export { CaseHistory };
|
|
12
12
|
export { CaseSummary };
|
|
13
|
+
export { CaseSummaryFields };
|
|
13
14
|
export { CaseView };
|
|
14
15
|
export { Checkbox };
|
|
15
16
|
export { Currency };
|
|
@@ -19,11 +20,11 @@ declare namespace pegaSdkComponentMap {
|
|
|
19
20
|
export { DateTime };
|
|
20
21
|
export { Decimal };
|
|
21
22
|
export { DefaultForm };
|
|
23
|
+
export { DeferLoad };
|
|
22
24
|
export { Details };
|
|
23
25
|
export { DetailsSubTabs };
|
|
24
26
|
export { DetailsThreeColumn };
|
|
25
27
|
export { DetailsTwoColumn };
|
|
26
|
-
export { DeferLoad };
|
|
27
28
|
export { Dropdown };
|
|
28
29
|
export { Email };
|
|
29
30
|
export { ErrorBoundary };
|
|
@@ -47,6 +48,7 @@ declare namespace pegaSdkComponentMap {
|
|
|
47
48
|
export { OneColumn };
|
|
48
49
|
export { OneColumnPage };
|
|
49
50
|
export { OneColumnTab };
|
|
51
|
+
export { Operator };
|
|
50
52
|
export { Percentage };
|
|
51
53
|
export { Phone };
|
|
52
54
|
export { PromotedFilters };
|
|
@@ -92,6 +94,7 @@ import AutoComplete from "../lib/components/forms/AutoComplete";
|
|
|
92
94
|
import CancelAlert from "../lib/components/forms/CancelAlert";
|
|
93
95
|
import CaseHistory from "../lib/components/widgets/CaseHistory";
|
|
94
96
|
import CaseSummary from "../lib/components/templates/CaseSummary";
|
|
97
|
+
import CaseSummaryFields from "../lib/components/designSystemExtensions/CaseSummaryFields";
|
|
95
98
|
import CaseView from "../lib/components/templates/CaseView";
|
|
96
99
|
import Checkbox from "../lib/components/forms/Checkbox";
|
|
97
100
|
import Currency from "../lib/components/forms/Currency";
|
|
@@ -101,11 +104,11 @@ import Date from "../lib/components/forms/Date";
|
|
|
101
104
|
import DateTime from "../lib/components/forms/DateTime";
|
|
102
105
|
import Decimal from "../lib/components/forms/Decimal";
|
|
103
106
|
import DefaultForm from "../lib/components/templates/DefaultForm";
|
|
107
|
+
import DeferLoad from "../lib/components/infra/DeferLoad";
|
|
104
108
|
import Details from "../lib/components/templates/Details/Details";
|
|
105
109
|
import DetailsSubTabs from "../lib/components/templates/Details/DetailsSubTabs";
|
|
106
110
|
import DetailsThreeColumn from "./components/templates/Details/DetailsThreeColumn";
|
|
107
111
|
import DetailsTwoColumn from "../lib/components/templates/Details/DetailsTwoColumn/DetailsTwoColumn";
|
|
108
|
-
import DeferLoad from "../lib/components/infra/DeferLoad";
|
|
109
112
|
import Dropdown from "../lib/components/forms/Dropdown";
|
|
110
113
|
import Email from "../lib/components/forms/Email/Email";
|
|
111
114
|
import ErrorBoundary from "../lib/components/infra/ErrorBoundary";
|
|
@@ -129,6 +132,7 @@ import NavBar from "../lib/components/infra/NavBar";
|
|
|
129
132
|
import OneColumn from "../lib/components/templates/OneColumn/OneColumn";
|
|
130
133
|
import OneColumnPage from "../lib/components/templates/OneColumn/OneColumnPage";
|
|
131
134
|
import OneColumnTab from "../lib/components/templates/OneColumn/OneColumnTab";
|
|
135
|
+
import Operator from "../lib/components/designSystemExtensions/Operator";
|
|
132
136
|
import Percentage from "../lib/components/forms/Percentage";
|
|
133
137
|
import Phone from "../lib/components/forms/Phone/Phone";
|
|
134
138
|
import PromotedFilters from "../lib/components/templates/PromotedFilters";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// placed in the npm module's 'lib' directory. So, we expect to import from there.
|
|
3
3
|
// This file should import and expose ALL of the components that may be
|
|
4
4
|
// dynamically rendered at runtime via calls to react_pconnect or the View component
|
|
5
|
-
import ActionButtons from '../lib/components/infra/ActionButtons';
|
|
5
|
+
import ActionButtons from '../lib/components/infra/ActionButtons';
|
|
6
6
|
import AppAnnouncement from '../lib/components/widgets/AppAnnouncement';
|
|
7
7
|
import AppShell from '../lib/components/templates/AppShell/AppShell';
|
|
8
8
|
import Assignment from '../lib/components/infra/Assignment/Assignment';
|
|
@@ -12,6 +12,7 @@ import AutoComplete from '../lib/components/forms/AutoComplete';
|
|
|
12
12
|
import CancelAlert from '../lib/components/forms/CancelAlert';
|
|
13
13
|
import CaseHistory from '../lib/components/widgets/CaseHistory';
|
|
14
14
|
import CaseSummary from '../lib/components/templates/CaseSummary';
|
|
15
|
+
import CaseSummaryFields from '../lib/components/designSystemExtensions/CaseSummaryFields';
|
|
15
16
|
import CaseView from '../lib/components/templates/CaseView';
|
|
16
17
|
import Checkbox from '../lib/components/forms/Checkbox';
|
|
17
18
|
import Currency from '../lib/components/forms/Currency';
|
|
@@ -27,8 +28,8 @@ import DetailsSubTabs from '../lib/components/templates/Details/DetailsSubTabs';
|
|
|
27
28
|
import DetailsThreeColumn from './components/templates/Details/DetailsThreeColumn';
|
|
28
29
|
import DetailsTwoColumn from '../lib/components/templates/Details/DetailsTwoColumn/DetailsTwoColumn';
|
|
29
30
|
import Dropdown from '../lib/components/forms/Dropdown';
|
|
30
|
-
import ErrorBoundary from '../lib/components/infra/ErrorBoundary';
|
|
31
31
|
import Email from '../lib/components/forms/Email/Email';
|
|
32
|
+
import ErrorBoundary from '../lib/components/infra/ErrorBoundary';
|
|
32
33
|
import FieldGroupTemplate from './components/templates/FieldGroupTemplate';
|
|
33
34
|
import FileUtility from '../lib/components/widgets/FileUtility/FileUtility';
|
|
34
35
|
import FlowContainer from '../lib/components/infra/Containers/FlowContainer';
|
|
@@ -49,6 +50,7 @@ import NavBar from '../lib/components/infra/NavBar';
|
|
|
49
50
|
import OneColumn from '../lib/components/templates/OneColumn/OneColumn';
|
|
50
51
|
import OneColumnPage from '../lib/components/templates/OneColumn/OneColumnPage';
|
|
51
52
|
import OneColumnTab from '../lib/components/templates/OneColumn/OneColumnTab';
|
|
53
|
+
import Operator from '../lib/components/designSystemExtensions/Operator';
|
|
52
54
|
import Percentage from '../lib/components/forms/Percentage';
|
|
53
55
|
import Phone from '../lib/components/forms/Phone/Phone';
|
|
54
56
|
import PromotedFilters from '../lib/components/templates/PromotedFilters';
|
|
@@ -58,12 +60,12 @@ import Reference from '../lib/components/infra/Reference/Reference';
|
|
|
58
60
|
import Region from '../lib/components/infra/Region/Region';
|
|
59
61
|
import RootContainer from '../lib/components/infra/RootContainer/RootContainer';
|
|
60
62
|
import SemanticLink from '../lib/components/forms/SemanticLink';
|
|
61
|
-
import Stages from '../lib/components/infra/Stages';
|
|
62
|
-
import SubTabs from '../lib/components/templates/SubTabs';
|
|
63
63
|
import SimpleTable from '../lib/components/templates/SimpleTable/SimpleTable';
|
|
64
64
|
import SimpleTableManual from '../lib/components/templates/SimpleTable/SimpleTableManual';
|
|
65
65
|
import SimpleTableSelect from '../lib/components/templates/SimpleTable/SimpleTableSelect';
|
|
66
66
|
import SingleReferenceReadOnly from './components/templates/SingleReferenceReadOnly';
|
|
67
|
+
import Stages from '../lib/components/infra/Stages';
|
|
68
|
+
import SubTabs from '../lib/components/templates/SubTabs';
|
|
67
69
|
import SummaryItem from '../lib/components/widgets/SummaryItem';
|
|
68
70
|
import SummaryList from '../lib/components/widgets/SummaryList';
|
|
69
71
|
import TextArea from '../lib/components/forms/TextArea';
|
|
@@ -101,6 +103,7 @@ const pegaSdkComponentMap = {
|
|
|
101
103
|
'CancelAlert': CancelAlert,
|
|
102
104
|
'CaseHistory': CaseHistory,
|
|
103
105
|
'CaseSummary': CaseSummary,
|
|
106
|
+
'CaseSummaryFields': CaseSummaryFields,
|
|
104
107
|
'CaseView': CaseView,
|
|
105
108
|
'Checkbox': Checkbox,
|
|
106
109
|
'Currency': Currency,
|
|
@@ -110,11 +113,11 @@ const pegaSdkComponentMap = {
|
|
|
110
113
|
'DateTime': DateTime,
|
|
111
114
|
'Decimal': Decimal,
|
|
112
115
|
'DefaultForm': DefaultForm,
|
|
116
|
+
'DeferLoad': DeferLoad,
|
|
113
117
|
'Details': Details,
|
|
114
118
|
'DetailsSubTabs': DetailsSubTabs,
|
|
115
119
|
'DetailsThreeColumn': DetailsThreeColumn,
|
|
116
120
|
'DetailsTwoColumn': DetailsTwoColumn,
|
|
117
|
-
'DeferLoad': DeferLoad,
|
|
118
121
|
'Dropdown': Dropdown,
|
|
119
122
|
'Email': Email,
|
|
120
123
|
'ErrorBoundary': ErrorBoundary,
|
|
@@ -138,6 +141,7 @@ const pegaSdkComponentMap = {
|
|
|
138
141
|
'OneColumn': OneColumn,
|
|
139
142
|
'OneColumnPage': OneColumnPage,
|
|
140
143
|
'OneColumnTab': OneColumnTab,
|
|
144
|
+
'Operator': Operator,
|
|
141
145
|
'Percentage': Percentage,
|
|
142
146
|
'Phone': Phone,
|
|
143
147
|
'PromotedFilters': PromotedFilters,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-pega-component-map.js","sourceRoot":"","sources":["../lib/sdk-pega-component-map.js"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,mFAA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AAM;IAChB,SAAS,EAAE,OAAO;IAClB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,WAAW;IAC1B,UAAU,EAAE,QAAQ;IACpB,aAAa,EAAE,WAAW;IAC1B,WAAW,EAAE,SAAS;IACtB,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,SAAS;IACtB,eAAe,EAAE,aAAa;IAC9B,cAAc,EAAE,YAAY;IAC5B,KAAK,EAAE,GAAG;IACV,eAAe,EAAE,aAAa;IAC9B,cAAc,EAAE,YAAY;IAC5B,MAAM,EAAE,IAAI;IACZ,eAAe,EAAE,aAAa;IAC9B,YAAY,EAAE,UAAU;IACxB,mBAAmB,EAAE,iBAAiB;IACtC,gBAAgB,EAAE,cAAc;IAChC,gBAAgB,EAAE,cAAc;CACjC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// When this code is run from the generated npm module, the components are\n// placed in the npm module's 'lib' directory. So, we expect to import from there.\n// This file should import and expose ALL of the components that may be\n// dynamically rendered at runtime via calls to react_pconnect or the View component\n\nimport ActionButtons from '../lib/components/infra/ActionButtons'; // '../lib/components/infra/ActionButtons';\nimport AppAnnouncement from '../lib/components/widgets/AppAnnouncement';\nimport AppShell from '../lib/components/templates/AppShell/AppShell';\nimport Assignment from '../lib/components/infra/Assignment/Assignment';\nimport AssignmentCard from '../lib/components/infra/AssignmentCard/AssignmentCard';\nimport Attachment from '../lib/components/infra/Attachment/Attachment';\nimport AutoComplete from '../lib/components/forms/AutoComplete';\nimport CancelAlert from '../lib/components/forms/CancelAlert';\nimport CaseHistory from '../lib/components/widgets/CaseHistory';\nimport CaseSummary from '../lib/components/templates/CaseSummary';\nimport CaseView from '../lib/components/templates/CaseView';\nimport Checkbox from '../lib/components/forms/Checkbox';\nimport Currency from '../lib/components/forms/Currency';\nimport DashboardFilter from '../lib/components/infra/DashboardFilter';\nimport DataReference from '../lib/components/templates/DataReference';\nimport Date from '../lib/components/forms/Date';\nimport DateTime from '../lib/components/forms/DateTime';\nimport Decimal from '../lib/components/forms/Decimal';\nimport DefaultForm from '../lib/components/templates/DefaultForm';\nimport DeferLoad from '../lib/components/infra/DeferLoad';\nimport Details from '../lib/components/templates/Details/Details';\nimport DetailsSubTabs from '../lib/components/templates/Details/DetailsSubTabs';\nimport DetailsThreeColumn from './components/templates/Details/DetailsThreeColumn';\nimport DetailsTwoColumn from '../lib/components/templates/Details/DetailsTwoColumn/DetailsTwoColumn';\nimport Dropdown from '../lib/components/forms/Dropdown';\nimport ErrorBoundary from '../lib/components/infra/ErrorBoundary';\nimport Email from '../lib/components/forms/Email/Email';\nimport FieldGroupTemplate from './components/templates/FieldGroupTemplate';\nimport FileUtility from '../lib/components/widgets/FileUtility/FileUtility';\nimport FlowContainer from '../lib/components/infra/Containers/FlowContainer';\nimport Followers from '../lib/components/widgets/Followers';\nimport InlineDashboard from '../lib/components/templates/InlineDashboard';\nimport InlineDashboardPage from '../lib/components/templates/InlineDashboardPage/InlineDashboardPage';\nimport Integer from '../lib/components/forms/Integer';\nimport ListPage from '../lib/components/templates/ListPage/ListPage';\nimport ListView from '../lib/components/templates/ListView';\nimport ModalViewContainer from '../lib/components/infra/Containers/ModalViewContainer/ModalViewContainer';\nimport MultiReferenceReadOnly from './components/templates/MultiReferenceReadOnly';\nimport MultiStep from '../lib/components/infra/MultiStep';\nimport NarrowWide from '../lib/components/templates/NarrowWide/NarrowWide';\nimport NarrowWideDetails from '../lib/components/templates/NarrowWide/NarrowWideDetails';\nimport NarrowWideForm from '../lib/components/templates/NarrowWide/NarrowWideForm';\nimport NarrowWidePage from '../lib/components/templates/NarrowWide/NarrowWidePage';\nimport NavBar from '../lib/components/infra/NavBar';\nimport OneColumn from '../lib/components/templates/OneColumn/OneColumn';\nimport OneColumnPage from '../lib/components/templates/OneColumn/OneColumnPage';\nimport OneColumnTab from '../lib/components/templates/OneColumn/OneColumnTab';\nimport Percentage from '../lib/components/forms/Percentage';\nimport Phone from '../lib/components/forms/Phone/Phone';\nimport PromotedFilters from '../lib/components/templates/PromotedFilters';\nimport Pulse from '../lib/components/designSystemExtensions/Pulse';\nimport RadioButtons from '../lib/components/forms/RadioButtons';\nimport Reference from '../lib/components/infra/Reference/Reference';\nimport Region from '../lib/components/infra/Region/Region';\nimport RootContainer from '../lib/components/infra/RootContainer/RootContainer';\nimport SemanticLink from '../lib/components/forms/SemanticLink';\nimport Stages from '../lib/components/infra/Stages';\nimport SubTabs from '../lib/components/templates/SubTabs';\nimport SimpleTable from '../lib/components/templates/SimpleTable/SimpleTable';\nimport SimpleTableManual from '../lib/components/templates/SimpleTable/SimpleTableManual';\nimport SimpleTableSelect from '../lib/components/templates/SimpleTable/SimpleTableSelect';\nimport SingleReferenceReadOnly from './components/templates/SingleReferenceReadOnly';\nimport SummaryItem from '../lib/components/widgets/SummaryItem';\nimport SummaryList from '../lib/components/widgets/SummaryList';\nimport TextArea from '../lib/components/forms/TextArea';\nimport TextContent from '../lib/components/forms/TextContent';\nimport TextInput from '../lib/components/forms/TextInput/TextInput';\nimport Time from '../lib/components/forms/Time';\nimport ToDo from '../lib/components/infra/ToDo';\nimport TwoColumn from '../lib/components/templates/TwoColumn/TwoColumn';\nimport TwoColumnPage from '../lib/components/templates/TwoColumn/TwoColumnPage';\nimport TwoColumnTab from './components/templates/TwoColumn/TwoColumnTab';\nimport URL from '../lib/components/forms/URL';\nimport UserReference from '../lib/components/forms/UserReference';\nimport VerticalTabs from '../lib/components/infra/VerticalTabs';\nimport View from '../lib/components/infra/View';\nimport ViewContainer from '../lib/components/infra/Containers/ViewContainer';\nimport WideNarrow from '../lib/components/templates/WideNarrow/WideNarrow';\nimport WideNarrowDetails from '../lib/components/templates/WideNarrow/WideNarrowDetails';\nimport WideNarrowForm from '../lib/components/templates/WideNarrow/WideNarrowForm';\nimport WideNarrowPage from '../lib/components/templates/WideNarrow/WideNarrowPage';\n\n\n// pegaSdkComponentMap is the JSON object where we'll store the components that are\n// the default implementations provided by the SDK. These will be used if there isn't\n// an entry in the localSdkComponentMap\n\n// NOTE: A few components have non-standard capitalization:\n// 'reference' is what's in the metadata, not Reference\n// 'Todo' is what's in the metadata, not ToDo\n// Also, note that \"Checkbox\" component is named/exported as CheckboxComponent\n\nconst pegaSdkComponentMap = {\n 'ActionButtons': ActionButtons,\n 'AppAnnouncement': AppAnnouncement,\n 'AppShell': AppShell,\n 'Assignment': Assignment,\n 'AssignmentCard': AssignmentCard,\n 'Attachment': Attachment,\n 'AutoComplete': AutoComplete,\n 'CancelAlert': CancelAlert,\n 'CaseHistory': CaseHistory,\n 'CaseSummary': CaseSummary,\n 'CaseView': CaseView,\n 'Checkbox': Checkbox,\n 'Currency': Currency,\n 'DashboardFilter': DashboardFilter,\n 'DataReference': DataReference,\n 'Date': Date,\n 'DateTime': DateTime,\n 'Decimal': Decimal,\n 'DefaultForm': DefaultForm,\n 'Details': Details,\n 'DetailsSubTabs': DetailsSubTabs,\n 'DetailsThreeColumn': DetailsThreeColumn,\n 'DetailsTwoColumn': DetailsTwoColumn,\n 'DeferLoad': DeferLoad,\n 'Dropdown': Dropdown,\n 'Email': Email,\n 'ErrorBoundary': ErrorBoundary,\n 'FieldGroupTemplate': FieldGroupTemplate,\n 'FileUtility': FileUtility,\n 'FlowContainer': FlowContainer,\n 'Followers': Followers,\n 'InlineDashboard': InlineDashboard,\n 'InlineDashboardPage': InlineDashboardPage,\n 'Integer': Integer,\n 'ListPage': ListPage,\n 'ListView': ListView,\n 'ModalViewContainer': ModalViewContainer,\n 'MultiReferenceReadOnly': MultiReferenceReadOnly,\n 'MultiStep': MultiStep,\n 'NarrowWide': NarrowWide,\n 'NarrowWideDetails': NarrowWideDetails,\n 'NarrowWideForm': NarrowWideForm,\n 'NarrowWidePage': NarrowWidePage,\n 'NavBar': NavBar,\n 'OneColumn': OneColumn,\n 'OneColumnPage': OneColumnPage,\n 'OneColumnTab': OneColumnTab,\n 'Percentage': Percentage,\n 'Phone': Phone,\n 'PromotedFilters': PromotedFilters,\n 'Pulse': Pulse,\n 'reference': Reference,\n 'RadioButtons': RadioButtons,\n 'Region': Region,\n 'RootContainer': RootContainer,\n 'SemanticLink': SemanticLink,\n 'SimpleTable': SimpleTable,\n 'SimpleTableManual': SimpleTableManual,\n 'SimpleTableSelect': SimpleTableSelect,\n 'SingleReferenceReadOnly': SingleReferenceReadOnly,\n 'Stages': Stages,\n 'SubTabs': SubTabs,\n 'SummaryItem': SummaryItem,\n 'SummaryList': SummaryList,\n 'TextArea': TextArea,\n 'TextContent': TextContent,\n 'TextInput': TextInput,\n 'Time': Time,\n 'Todo': ToDo,\n 'TwoColumn': TwoColumn,\n 'TwoColumnPage': TwoColumnPage,\n 'TwoColumnTab': TwoColumnTab,\n 'URL': URL,\n 'UserReference': UserReference,\n 'VerticalTabs': VerticalTabs,\n 'View': View,\n 'ViewContainer': ViewContainer,\n 'WideNarrow': WideNarrow,\n 'WideNarrowDetails': WideNarrowDetails,\n 'WideNarrowForm': WideNarrowForm,\n 'WideNarrowPage': WideNarrowPage\n};\n\nexport default pegaSdkComponentMap;\n"]}
|
|
1
|
+
{"version":3,"file":"sdk-pega-component-map.js","sourceRoot":"","sources":["../lib/sdk-pega-component-map.js"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,mFAAmF;AACnF,wEAAwE;AACxE,qFAAqF;AAErF,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,eAAe,MAAM,2CAA2C,CAAC;AACxE,OAAO,QAAQ,MAAM,+CAA+C,CAAC;AACrE,OAAO,UAAU,MAAM,+CAA+C,CAAC;AACvE,OAAO,cAAc,MAAM,uDAAuD,CAAC;AACnF,OAAO,UAAU,MAAM,+CAA+C,CAAC;AACvE,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,WAAW,MAAM,yCAAyC,CAAC;AAClE,OAAO,iBAAiB,MAAM,4DAA4D,CA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EAAE,YAAY;IAC5B,MAAM,EAAE,IAAI;IACZ,eAAe,EAAE,aAAa;IAC9B,YAAY,EAAE,UAAU;IACxB,mBAAmB,EAAE,iBAAiB;IACtC,gBAAgB,EAAE,cAAc;IAChC,gBAAgB,EAAE,cAAc;CACjC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// When this code is run from the generated npm module, the components are\n// placed in the npm module's 'lib' directory. So, we expect to import from there.\n// This file should import and expose ALL of the components that may be\n// dynamically rendered at runtime via calls to react_pconnect or the View component\n\nimport ActionButtons from '../lib/components/infra/ActionButtons';\nimport AppAnnouncement from '../lib/components/widgets/AppAnnouncement';\nimport AppShell from '../lib/components/templates/AppShell/AppShell';\nimport Assignment from '../lib/components/infra/Assignment/Assignment';\nimport AssignmentCard from '../lib/components/infra/AssignmentCard/AssignmentCard';\nimport Attachment from '../lib/components/infra/Attachment/Attachment';\nimport AutoComplete from '../lib/components/forms/AutoComplete';\nimport CancelAlert from '../lib/components/forms/CancelAlert';\nimport CaseHistory from '../lib/components/widgets/CaseHistory';\nimport CaseSummary from '../lib/components/templates/CaseSummary';\nimport CaseSummaryFields from '../lib/components/designSystemExtensions/CaseSummaryFields';\nimport CaseView from '../lib/components/templates/CaseView';\nimport Checkbox from '../lib/components/forms/Checkbox';\nimport Currency from '../lib/components/forms/Currency';\nimport DashboardFilter from '../lib/components/infra/DashboardFilter';\nimport DataReference from '../lib/components/templates/DataReference';\nimport Date from '../lib/components/forms/Date';\nimport DateTime from '../lib/components/forms/DateTime';\nimport Decimal from '../lib/components/forms/Decimal';\nimport DefaultForm from '../lib/components/templates/DefaultForm';\nimport DeferLoad from '../lib/components/infra/DeferLoad';\nimport Details from '../lib/components/templates/Details/Details';\nimport DetailsSubTabs from '../lib/components/templates/Details/DetailsSubTabs';\nimport DetailsThreeColumn from './components/templates/Details/DetailsThreeColumn';\nimport DetailsTwoColumn from '../lib/components/templates/Details/DetailsTwoColumn/DetailsTwoColumn';\nimport Dropdown from '../lib/components/forms/Dropdown';\nimport Email from '../lib/components/forms/Email/Email';\nimport ErrorBoundary from '../lib/components/infra/ErrorBoundary';\nimport FieldGroupTemplate from './components/templates/FieldGroupTemplate';\nimport FileUtility from '../lib/components/widgets/FileUtility/FileUtility';\nimport FlowContainer from '../lib/components/infra/Containers/FlowContainer';\nimport Followers from '../lib/components/widgets/Followers';\nimport InlineDashboard from '../lib/components/templates/InlineDashboard';\nimport InlineDashboardPage from '../lib/components/templates/InlineDashboardPage/InlineDashboardPage';\nimport Integer from '../lib/components/forms/Integer';\nimport ListPage from '../lib/components/templates/ListPage/ListPage';\nimport ListView from '../lib/components/templates/ListView';\nimport ModalViewContainer from '../lib/components/infra/Containers/ModalViewContainer/ModalViewContainer';\nimport MultiReferenceReadOnly from './components/templates/MultiReferenceReadOnly';\nimport MultiStep from '../lib/components/infra/MultiStep';\nimport NarrowWide from '../lib/components/templates/NarrowWide/NarrowWide';\nimport NarrowWideDetails from '../lib/components/templates/NarrowWide/NarrowWideDetails';\nimport NarrowWideForm from '../lib/components/templates/NarrowWide/NarrowWideForm';\nimport NarrowWidePage from '../lib/components/templates/NarrowWide/NarrowWidePage';\nimport NavBar from '../lib/components/infra/NavBar';\nimport OneColumn from '../lib/components/templates/OneColumn/OneColumn';\nimport OneColumnPage from '../lib/components/templates/OneColumn/OneColumnPage';\nimport OneColumnTab from '../lib/components/templates/OneColumn/OneColumnTab';\nimport Operator from '../lib/components/designSystemExtensions/Operator';\nimport Percentage from '../lib/components/forms/Percentage';\nimport Phone from '../lib/components/forms/Phone/Phone';\nimport PromotedFilters from '../lib/components/templates/PromotedFilters';\nimport Pulse from '../lib/components/designSystemExtensions/Pulse';\nimport RadioButtons from '../lib/components/forms/RadioButtons';\nimport Reference from '../lib/components/infra/Reference/Reference';\nimport Region from '../lib/components/infra/Region/Region';\nimport RootContainer from '../lib/components/infra/RootContainer/RootContainer';\nimport SemanticLink from '../lib/components/forms/SemanticLink';\nimport SimpleTable from '../lib/components/templates/SimpleTable/SimpleTable';\nimport SimpleTableManual from '../lib/components/templates/SimpleTable/SimpleTableManual';\nimport SimpleTableSelect from '../lib/components/templates/SimpleTable/SimpleTableSelect';\nimport SingleReferenceReadOnly from './components/templates/SingleReferenceReadOnly';\nimport Stages from '../lib/components/infra/Stages';\nimport SubTabs from '../lib/components/templates/SubTabs';\nimport SummaryItem from '../lib/components/widgets/SummaryItem';\nimport SummaryList from '../lib/components/widgets/SummaryList';\nimport TextArea from '../lib/components/forms/TextArea';\nimport TextContent from '../lib/components/forms/TextContent';\nimport TextInput from '../lib/components/forms/TextInput/TextInput';\nimport Time from '../lib/components/forms/Time';\nimport ToDo from '../lib/components/infra/ToDo';\nimport TwoColumn from '../lib/components/templates/TwoColumn/TwoColumn';\nimport TwoColumnPage from '../lib/components/templates/TwoColumn/TwoColumnPage';\nimport TwoColumnTab from './components/templates/TwoColumn/TwoColumnTab';\nimport URL from '../lib/components/forms/URL';\nimport UserReference from '../lib/components/forms/UserReference';\nimport VerticalTabs from '../lib/components/infra/VerticalTabs';\nimport View from '../lib/components/infra/View';\nimport ViewContainer from '../lib/components/infra/Containers/ViewContainer';\nimport WideNarrow from '../lib/components/templates/WideNarrow/WideNarrow';\nimport WideNarrowDetails from '../lib/components/templates/WideNarrow/WideNarrowDetails';\nimport WideNarrowForm from '../lib/components/templates/WideNarrow/WideNarrowForm';\nimport WideNarrowPage from '../lib/components/templates/WideNarrow/WideNarrowPage';\n\n\n// pegaSdkComponentMap is the JSON object where we'll store the components that are\n// the default implementations provided by the SDK. These will be used if there isn't\n// an entry in the localSdkComponentMap\n\n// NOTE: A few components have non-standard capitalization:\n// 'reference' is what's in the metadata, not Reference\n// 'Todo' is what's in the metadata, not ToDo\n// Also, note that \"Checkbox\" component is named/exported as CheckboxComponent\n\nconst pegaSdkComponentMap = {\n 'ActionButtons': ActionButtons,\n 'AppAnnouncement': AppAnnouncement,\n 'AppShell': AppShell,\n 'Assignment': Assignment,\n 'AssignmentCard': AssignmentCard,\n 'Attachment': Attachment,\n 'AutoComplete': AutoComplete,\n 'CancelAlert': CancelAlert,\n 'CaseHistory': CaseHistory,\n 'CaseSummary': CaseSummary,\n 'CaseSummaryFields': CaseSummaryFields,\n 'CaseView': CaseView,\n 'Checkbox': Checkbox,\n 'Currency': Currency,\n 'DashboardFilter': DashboardFilter,\n 'DataReference': DataReference,\n 'Date': Date,\n 'DateTime': DateTime,\n 'Decimal': Decimal,\n 'DefaultForm': DefaultForm,\n 'DeferLoad': DeferLoad,\n 'Details': Details,\n 'DetailsSubTabs': DetailsSubTabs,\n 'DetailsThreeColumn': DetailsThreeColumn,\n 'DetailsTwoColumn': DetailsTwoColumn,\n 'Dropdown': Dropdown,\n 'Email': Email,\n 'ErrorBoundary': ErrorBoundary,\n 'FieldGroupTemplate': FieldGroupTemplate,\n 'FileUtility': FileUtility,\n 'FlowContainer': FlowContainer,\n 'Followers': Followers,\n 'InlineDashboard': InlineDashboard,\n 'InlineDashboardPage': InlineDashboardPage,\n 'Integer': Integer,\n 'ListPage': ListPage,\n 'ListView': ListView,\n 'ModalViewContainer': ModalViewContainer,\n 'MultiReferenceReadOnly': MultiReferenceReadOnly,\n 'MultiStep': MultiStep,\n 'NarrowWide': NarrowWide,\n 'NarrowWideDetails': NarrowWideDetails,\n 'NarrowWideForm': NarrowWideForm,\n 'NarrowWidePage': NarrowWidePage,\n 'NavBar': NavBar,\n 'OneColumn': OneColumn,\n 'OneColumnPage': OneColumnPage,\n 'OneColumnTab': OneColumnTab,\n 'Operator': Operator,\n 'Percentage': Percentage,\n 'Phone': Phone,\n 'PromotedFilters': PromotedFilters,\n 'Pulse': Pulse,\n 'reference': Reference,\n 'RadioButtons': RadioButtons,\n 'Region': Region,\n 'RootContainer': RootContainer,\n 'SemanticLink': SemanticLink,\n 'SimpleTable': SimpleTable,\n 'SimpleTableManual': SimpleTableManual,\n 'SimpleTableSelect': SimpleTableSelect,\n 'SingleReferenceReadOnly': SingleReferenceReadOnly,\n 'Stages': Stages,\n 'SubTabs': SubTabs,\n 'SummaryItem': SummaryItem,\n 'SummaryList': SummaryList,\n 'TextArea': TextArea,\n 'TextContent': TextContent,\n 'TextInput': TextInput,\n 'Time': Time,\n 'Todo': ToDo,\n 'TwoColumn': TwoColumn,\n 'TwoColumnPage': TwoColumnPage,\n 'TwoColumnTab': TwoColumnTab,\n 'URL': URL,\n 'UserReference': UserReference,\n 'VerticalTabs': VerticalTabs,\n 'View': View,\n 'ViewContainer': ViewContainer,\n 'WideNarrow': WideNarrow,\n 'WideNarrowDetails': WideNarrowDetails,\n 'WideNarrowForm': WideNarrowForm,\n 'WideNarrowPage': WideNarrowPage\n};\n\nexport default pegaSdkComponentMap;\n"]}
|
package/package.json
CHANGED