@pega/react-sdk-overrides 8.8.21 → 8.23.11-debug
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/designSystemExtension/AlertBanner/AlertBanner.tsx +9 -13
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -12
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +10 -15
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -10
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +3 -10
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +3 -11
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +3 -11
- package/lib/designSystemExtension/Operator/Operator.tsx +12 -16
- package/lib/designSystemExtension/Pulse/Pulse.tsx +7 -11
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -10
- package/lib/field/AutoComplete/AutoComplete.tsx +18 -37
- package/lib/field/CancelAlert/CancelAlert.tsx +4 -9
- package/lib/field/Checkbox/Checkbox.tsx +16 -39
- package/lib/field/Currency/Currency.tsx +15 -23
- package/lib/field/Currency/currency-utils.ts +5 -1
- package/lib/field/Date/Date.tsx +15 -22
- package/lib/field/DateTime/DateTime.tsx +14 -25
- package/lib/field/Decimal/Decimal.tsx +14 -25
- package/lib/field/Dropdown/Dropdown.tsx +26 -30
- package/lib/field/Email/Email.tsx +9 -17
- package/lib/field/Integer/Integer.tsx +7 -15
- package/lib/field/Percentage/Percentage.tsx +7 -15
- package/lib/field/Phone/Phone.tsx +11 -19
- package/lib/field/RadioButtons/RadioButtons.tsx +37 -25
- package/lib/field/SemanticLink/SemanticLink.tsx +25 -26
- package/lib/field/TextArea/TextArea.tsx +5 -14
- package/lib/field/TextContent/TextContent.tsx +1 -10
- package/lib/field/TextInput/TextInput.tsx +6 -15
- package/lib/field/Time/Time.tsx +27 -22
- package/lib/field/URL/URL.tsx +8 -16
- package/lib/field/UserReference/UserReference.tsx +60 -50
- package/lib/helpers/attachmentHelpers.ts +4 -4
- package/lib/helpers/auth.js +397 -741
- package/lib/helpers/authManager.js +634 -0
- package/lib/helpers/case-utils.tsx +9 -8
- package/lib/helpers/common-utils.ts +1 -1
- package/lib/helpers/config_access.js +73 -0
- package/lib/helpers/date-format-utils.ts +1 -1
- package/lib/helpers/event-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +11 -11
- package/lib/helpers/formatters/CurrencyMap.ts +5 -8
- package/lib/helpers/formatters/Date.ts +1 -1
- package/lib/helpers/formatters/common.ts +6 -2
- package/lib/helpers/formatters/index.ts +3 -3
- package/lib/helpers/simpleTableHelpers.ts +7 -7
- package/lib/helpers/state-utils.tsx +3 -0
- package/lib/helpers/template-utils.ts +6 -3
- package/lib/helpers/versionHelpers.ts +3 -0
- package/lib/infra/ActionButtons/ActionButtons.tsx +19 -9
- package/lib/infra/Assignment/Assignment.tsx +28 -21
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -15
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +58 -57
- package/lib/infra/Containers/FlowContainer/helpers.ts +3 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +19 -14
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -14
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -13
- package/lib/infra/DashboardFilter/filterUtils.tsx +1 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +20 -14
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +14 -10
- package/lib/infra/MultiStep/MultiStep.tsx +22 -22
- package/lib/infra/NavBar/NavBar.tsx +21 -14
- package/lib/infra/Reference/Reference.tsx +18 -13
- package/lib/infra/Region/Region.tsx +6 -8
- package/lib/infra/RootContainer/RootContainer.tsx +25 -16
- package/lib/infra/Stages/Stages.tsx +8 -10
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -8
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
- package/lib/infra/View/View.tsx +22 -21
- package/lib/template/AppShell/AppShell.tsx +25 -36
- package/lib/template/BannerPage/BannerPage.tsx +31 -26
- package/lib/template/CaseSummary/CaseSummary.tsx +8 -15
- package/lib/template/CaseView/CaseView.tsx +25 -24
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +19 -10
- package/lib/template/Confirmation/Confirmation.tsx +53 -27
- package/lib/template/DataReference/DataReference.tsx +52 -48
- package/lib/template/DefaultForm/DefaultForm.tsx +12 -14
- package/lib/template/Details/Details/Details.tsx +17 -16
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +16 -13
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +18 -19
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +18 -20
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +28 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +7 -11
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +17 -19
- package/lib/template/ListPage/ListPage.tsx +13 -14
- package/lib/template/ListView/ListView.tsx +186 -189
- package/lib/template/ListView/utils.ts +23 -170
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +19 -10
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +1 -16
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +18 -19
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +1 -9
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -8
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +7 -5
- package/lib/template/PromotedFilters/PromotedFilters.tsx +14 -16
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -102
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +7 -24
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -23
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +36 -34
- package/lib/template/SubTabs/SubTabs.tsx +11 -10
- package/lib/template/SubTabs/tabUtils.ts +4 -0
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +15 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +12 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +3 -17
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +25 -35
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +1 -7
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +17 -15
- package/lib/template/WssNavBar/WssNavBar.tsx +1 -18
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +21 -13
- package/lib/widget/Attachment/Attachment.tsx +16 -28
- package/lib/widget/CaseHistory/CaseHistory.tsx +10 -12
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -13
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +22 -35
- package/lib/widget/Followers/Followers.tsx +11 -10
- package/lib/widget/QuickCreate/QuickCreate.tsx +5 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +1 -11
- package/lib/widget/SummaryList/SummaryList.tsx +3 -17
- package/lib/widget/ToDo/ToDo.tsx +105 -62
- package/package.json +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +0 -121
- package/lib/designSystemExtension/RichTextEditor/index.tsx +0 -1
- package/lib/field/RichText/RichText.tsx +0 -93
- package/lib/field/RichText/index.tsx +0 -1
- package/lib/field/ScalarList/ScalarList.tsx +0 -64
- package/lib/field/ScalarList/config-ext.json +0 -8
- package/lib/field/ScalarList/index.tsx +0 -1
- package/lib/helpers/authManager.ts +0 -933
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { Fragment, memo, useEffect, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { Typography } from '@material-ui/core';
|
|
4
|
+
import AutoComplete from '@pega/react-sdk-components/lib/components/field/AutoComplete';
|
|
5
|
+
import Dropdown from '@pega/react-sdk-components/lib/components/field/Dropdown';
|
|
3
6
|
import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
|
|
4
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
7
|
|
|
7
8
|
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 errors)
|
|
8
9
|
declare const PCore: any;
|
|
@@ -10,48 +11,23 @@ declare const PCore: any;
|
|
|
10
11
|
const DROPDOWN_LIST = 'Drop-down list';
|
|
11
12
|
const SEARCH_BOX = 'Search box';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
// If any, enter additional props that only exist on URLComponent here
|
|
15
|
-
displayAs?: string;
|
|
16
|
-
label?: string;
|
|
17
|
-
value?: any;
|
|
18
|
-
testId?: string;
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
helperText?: string;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
readOnly?: boolean;
|
|
23
|
-
required?: boolean;
|
|
24
|
-
validatemessage?: string;
|
|
25
|
-
showAsFormattedText?: boolean;
|
|
26
|
-
additionalProps?: object;
|
|
27
|
-
hideLabel?: boolean;
|
|
28
|
-
variant?: string;
|
|
29
|
-
onChange?: any;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const UserReference = (props: UserReferenceProps) => {
|
|
33
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
34
|
-
const AutoComplete = getComponentFromMap('AutoComplete');
|
|
35
|
-
const Dropdown = getComponentFromMap('Dropdown');
|
|
36
|
-
|
|
14
|
+
const UserReference = props => {
|
|
37
15
|
const {
|
|
38
|
-
label
|
|
39
|
-
displayAs
|
|
16
|
+
label,
|
|
17
|
+
displayAs,
|
|
40
18
|
getPConnect,
|
|
41
|
-
value
|
|
42
|
-
testId
|
|
43
|
-
helperText
|
|
44
|
-
validatemessage
|
|
45
|
-
placeholder
|
|
46
|
-
showAsFormattedText
|
|
47
|
-
additionalProps
|
|
48
|
-
hideLabel
|
|
49
|
-
readOnly
|
|
50
|
-
required
|
|
51
|
-
disabled
|
|
52
|
-
onChange
|
|
53
|
-
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
54
|
-
variant = 'inline'
|
|
19
|
+
value,
|
|
20
|
+
testId,
|
|
21
|
+
helperText,
|
|
22
|
+
validatemessage,
|
|
23
|
+
placeholder,
|
|
24
|
+
showAsFormattedText,
|
|
25
|
+
additionalProps,
|
|
26
|
+
hideLabel,
|
|
27
|
+
readOnly,
|
|
28
|
+
required,
|
|
29
|
+
disabled,
|
|
30
|
+
onChange
|
|
55
31
|
} = props;
|
|
56
32
|
const [dropDownDataSource, setDropDownDataSource] = useState([]);
|
|
57
33
|
const [userName, setUserName] = useState('');
|
|
@@ -66,7 +42,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
66
42
|
// if same user ref field is referred in view as editable & readonly formatted text
|
|
67
43
|
// referenced users won't be available, so get user details from dx api
|
|
68
44
|
const { getOperatorDetails } = PCore.getUserApi();
|
|
69
|
-
getOperatorDetails(userId).then(
|
|
45
|
+
getOperatorDetails(userId).then(res => {
|
|
70
46
|
if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
|
|
71
47
|
setUserName(res.data.pyOperatorInfo.pyUserName);
|
|
72
48
|
}
|
|
@@ -78,14 +54,14 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
78
54
|
};
|
|
79
55
|
PCore.getRestClient()
|
|
80
56
|
.invokeRestApi('getListData', { queryPayload })
|
|
81
|
-
.then(
|
|
82
|
-
const ddDataSource = res.data.data.map(
|
|
57
|
+
.then(res => {
|
|
58
|
+
const ddDataSource = res.data.data.map(listItem => ({
|
|
83
59
|
key: listItem.pyUserIdentifier,
|
|
84
60
|
value: listItem.pyUserName
|
|
85
61
|
}));
|
|
86
62
|
setDropDownDataSource(ddDataSource);
|
|
87
63
|
})
|
|
88
|
-
.catch(
|
|
64
|
+
.catch(err => {
|
|
89
65
|
// eslint-disable-next-line no-console
|
|
90
66
|
console.error(err);
|
|
91
67
|
});
|
|
@@ -102,8 +78,8 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
102
78
|
TODO: This has to be replaced with Operator Component
|
|
103
79
|
*/}
|
|
104
80
|
<div>
|
|
105
|
-
<Typography variant=
|
|
106
|
-
<Typography variant=
|
|
81
|
+
<Typography variant='caption'>{label}</Typography>
|
|
82
|
+
<Typography variant='body1'>{userName}</Typography>
|
|
107
83
|
</div>
|
|
108
84
|
</Fragment>
|
|
109
85
|
);
|
|
@@ -133,7 +109,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
133
109
|
label={label}
|
|
134
110
|
getPConnect={getPConnect}
|
|
135
111
|
datasource={OPERATORS_DP}
|
|
136
|
-
listType=
|
|
112
|
+
listType='datapage'
|
|
137
113
|
columns={columns}
|
|
138
114
|
testId={testId}
|
|
139
115
|
placeholder={placeholder}
|
|
@@ -153,7 +129,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
153
129
|
<Dropdown
|
|
154
130
|
additionalProps={additionalProps}
|
|
155
131
|
datasource={dropDownDataSource}
|
|
156
|
-
listType=
|
|
132
|
+
listType='associated'
|
|
157
133
|
getPConnect={getPConnect}
|
|
158
134
|
label={label}
|
|
159
135
|
value={userId}
|
|
@@ -174,6 +150,40 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
174
150
|
return userReferenceComponent;
|
|
175
151
|
};
|
|
176
152
|
|
|
153
|
+
UserReference.propTypes = {
|
|
154
|
+
getPConnect: PropTypes.func.isRequired,
|
|
155
|
+
displayAs: PropTypes.string,
|
|
156
|
+
label: PropTypes.string,
|
|
157
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.objectOf(PropTypes.any)]),
|
|
158
|
+
testId: PropTypes.string,
|
|
159
|
+
placeholder: PropTypes.string,
|
|
160
|
+
helperText: PropTypes.string,
|
|
161
|
+
disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
162
|
+
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
163
|
+
required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
164
|
+
validatemessage: PropTypes.string,
|
|
165
|
+
showAsFormattedText: PropTypes.bool,
|
|
166
|
+
additionalProps: PropTypes.objectOf(PropTypes.any),
|
|
167
|
+
hideLabel: PropTypes.bool
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
UserReference.defaultProps = {
|
|
171
|
+
displayAs: null,
|
|
172
|
+
label: null,
|
|
173
|
+
value: null,
|
|
174
|
+
readOnly: false,
|
|
175
|
+
testId: null,
|
|
176
|
+
placeholder: null,
|
|
177
|
+
helperText: null,
|
|
178
|
+
disabled: false,
|
|
179
|
+
required: false,
|
|
180
|
+
validatemessage: null,
|
|
181
|
+
showAsFormattedText: false,
|
|
182
|
+
additionalProps: {},
|
|
183
|
+
variant: 'inline',
|
|
184
|
+
hideLabel: false
|
|
185
|
+
};
|
|
186
|
+
|
|
177
187
|
// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with
|
|
178
188
|
// same key value pairs in obj. hence using custom comparison function on when to re-render
|
|
179
189
|
const comparisonFn = (prevProps, nextProps) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import download from 'downloadjs';
|
|
2
2
|
|
|
3
|
-
export const validateMaxSize = (fileObj
|
|
3
|
+
export const validateMaxSize = (fileObj, maxSizeInMB) => {
|
|
4
4
|
const fileSize = (fileObj.size / 1048576).toFixed(2);
|
|
5
5
|
return parseFloat(fileSize) < parseFloat(maxSizeInMB);
|
|
6
6
|
};
|
|
@@ -15,7 +15,7 @@ export const fileDownload = (data, fileName, ext) => {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
export const getIconFromFileType = (fileType)
|
|
18
|
+
export const getIconFromFileType = (fileType) => {
|
|
19
19
|
let icon = 'document-doc';
|
|
20
20
|
if (!fileType) return icon;
|
|
21
21
|
if (fileType.startsWith('audio')) {
|
|
@@ -42,7 +42,7 @@ export const getIconFromFileType = (fileType): string => {
|
|
|
42
42
|
return icon;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
export const getIconForAttachment = (inThis:any , attachment:any)
|
|
45
|
+
export const getIconForAttachment = (inThis:any , attachment:any) => {
|
|
46
46
|
let icon;
|
|
47
47
|
switch (attachment.type) {
|
|
48
48
|
case "FILE":
|
|
@@ -57,7 +57,7 @@ export const getIconForAttachment = (inThis:any , attachment:any): string => {
|
|
|
57
57
|
return icon;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
export const buildFilePropsFromResponse = (respObj)
|
|
60
|
+
export const buildFilePropsFromResponse = (respObj) => {
|
|
61
61
|
return {
|
|
62
62
|
props: {
|
|
63
63
|
meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,
|