@pega/react-sdk-overrides 0.23.26 → 0.23.27
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/LICENSE +201 -0
- package/README.md +17 -0
- package/SECURITY.md +10 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +39 -0
- package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/lib/designSystemExtension/Banner/Banner.tsx +21 -7
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +13 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
- package/lib/designSystemExtension/Operator/Operator.tsx +106 -87
- package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
- package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
- package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +21 -15
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +29 -19
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +27 -38
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +10 -18
- package/lib/field/Date/Date.tsx +33 -15
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +22 -11
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +64 -17
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +154 -18
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +16 -7
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +37 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +15 -6
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/Percentage/Percentage.tsx +14 -6
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +17 -7
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +55 -24
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +96 -0
- package/lib/field/RichText/index.tsx +1 -0
- package/lib/field/ScalarList/ScalarList.tsx +63 -0
- package/lib/field/ScalarList/config-ext.json +7 -0
- package/lib/field/ScalarList/index.tsx +1 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -10
- package/lib/field/TextArea/TextArea.tsx +15 -5
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +9 -2
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +41 -10
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +21 -18
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +23 -6
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +52 -58
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +16 -11
- package/lib/helpers/case-utils.tsx +99 -0
- package/lib/helpers/common-utils.ts +8 -0
- package/lib/helpers/data_page.ts +3 -6
- package/lib/helpers/date-format-utils.ts +29 -19
- package/lib/helpers/{event-utils.js → event-utils.ts} +4 -4
- package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +9 -10
- package/lib/helpers/formatters/Boolean.ts +21 -0
- package/lib/helpers/formatters/{Currency.js → Currency.ts} +22 -27
- package/lib/helpers/formatters/CurrencyMap.ts +915 -0
- package/lib/helpers/formatters/{Date.js → Date.ts} +20 -26
- package/lib/helpers/formatters/{common.js → common.ts} +3 -4
- package/lib/helpers/formatters/{index.js → index.ts} +22 -22
- package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +2 -2
- package/lib/helpers/simpleTableHelpers.ts +65 -85
- package/lib/helpers/state-utils.tsx +43 -0
- package/lib/helpers/template-utils.ts +4 -8
- package/lib/helpers/utils.ts +16 -8
- package/lib/helpers/versionHelpers.ts +1 -5
- package/lib/infra/ActionButtons/ActionButtons.tsx +46 -42
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -84
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +98 -232
- package/lib/infra/Containers/FlowContainer/helpers.ts +138 -0
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +66 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +105 -70
- package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
- package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
- package/lib/infra/Containers/SimpleView/helper.ts +125 -0
- package/lib/infra/Containers/SimpleView/index.tsx +1 -0
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +49 -64
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +26 -51
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -40
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -31
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +25 -38
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +180 -216
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +28 -43
- package/lib/infra/Reference/Reference.tsx +16 -22
- package/lib/infra/Region/Region.tsx +9 -9
- package/lib/infra/RootContainer/RootContainer.tsx +82 -125
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +38 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
- package/lib/infra/View/View.tsx +32 -63
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +51 -69
- package/lib/template/BannerPage/BannerPage.tsx +26 -33
- package/lib/template/CaseSummary/CaseSummary.tsx +23 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +122 -114
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +46 -35
- package/lib/template/Confirmation/Confirmation.tsx +25 -53
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +112 -140
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +26 -20
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/DefaultForm/utils/index.ts +33 -0
- package/lib/template/Details/Details/Details.tsx +24 -28
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
- package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/lib/template/Details/DynamicTabs/config.json +36 -0
- package/lib/template/Details/DynamicTabs/index.tsx +1 -0
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -34
- package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
- package/lib/template/ListPage/ListPage.tsx +12 -16
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +1 -3
- package/lib/template/ListView/ListView.tsx +245 -306
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/{hooks.js → hooks.ts} +24 -24
- package/lib/template/ListView/{utils.js → utils.ts} +202 -91
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -30
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
- package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +17 -19
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +44 -34
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +115 -14
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +171 -100
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +34 -40
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
- package/lib/template/SubTabs/SubTabs.tsx +26 -45
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -7
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
- package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +29 -27
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
- package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +16 -18
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
- package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +20 -9
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +75 -4
- package/lib/widget/Attachment/Attachment.tsx +370 -388
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +324 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +27 -25
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +24 -16
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +62 -54
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +15 -4
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +80 -116
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -483
- package/lib/helpers/authManager.js +0 -631
- package/lib/helpers/config_access.js +0 -268
- package/lib/helpers/formatters/Boolean.js +0 -38
- package/lib/helpers/formatters/CurrencyMap.js +0 -908
- package/lib/infra/Containers/FlowContainer/helpers.js +0 -147
package/lib/infra/View/View.tsx
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
// import { FieldGroup } from "@pega/cosmos-react-core";
|
|
4
|
-
// import { LazyMap as LazyComponentMap } from "../../components_map";
|
|
5
|
-
|
|
6
|
-
import { SdkComponentMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
|
-
import ErrorBoundary from '@pega/react-sdk-components/lib/components/infra/ErrorBoundary';
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
8
2
|
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
4
|
import { getAllFields } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
|
|
5
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
6
|
|
|
11
7
|
// Need to import any templates that we might render
|
|
12
8
|
|
|
13
9
|
import './View.css';
|
|
10
|
+
|
|
11
|
+
interface ViewProps extends PConnProps {
|
|
12
|
+
// If any, enter additional props that only exist on this component
|
|
13
|
+
template?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
showLabel: boolean;
|
|
16
|
+
mode?: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
visibility?: boolean;
|
|
19
|
+
name?: string;
|
|
20
|
+
bInForm?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
//
|
|
15
24
|
// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
16
25
|
// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
|
|
@@ -26,17 +35,18 @@ const NO_HEADER_TEMPLATES = [
|
|
|
26
35
|
'DetailsThreeColumn',
|
|
27
36
|
'NarrowWideDetails',
|
|
28
37
|
'WideNarrowDetails',
|
|
29
|
-
'Confirmation'
|
|
38
|
+
'Confirmation',
|
|
39
|
+
'DynamicTabs'
|
|
30
40
|
];
|
|
31
41
|
|
|
32
|
-
export default function View(props) {
|
|
42
|
+
export default function View(props: PropsWithChildren<ViewProps>) {
|
|
33
43
|
const { children, template, getPConnect, mode, visibility, name: pageName } = props;
|
|
34
|
-
let { label, showLabel = false } = props;
|
|
44
|
+
let { label = '', showLabel = false } = props;
|
|
35
45
|
|
|
36
46
|
// Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
|
|
37
47
|
// Putting this logic here instead of copy/paste in every Form template index.js
|
|
38
48
|
|
|
39
|
-
const inheritedProps = getPConnect().getInheritedProps();
|
|
49
|
+
const inheritedProps: any = getPConnect().getInheritedProps(); // try to remove any when getInheritedProps typedefs are fixed
|
|
40
50
|
label = inheritedProps.label || label;
|
|
41
51
|
showLabel = inheritedProps.showLabel || showLabel;
|
|
42
52
|
|
|
@@ -57,45 +67,23 @@ export default function View(props) {
|
|
|
57
67
|
// JA - React SDK not using LazyComponentMap yet
|
|
58
68
|
if (template /* && LazyComponentMap[template] */) {
|
|
59
69
|
// const ViewTemplate = LazyComponentMap[template];
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
//
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
// eslint-disable-next-line no-console
|
|
67
|
-
console.log(`View component found ${template}: Local`);
|
|
68
|
-
ViewTemplate = theLocalComponent;
|
|
69
|
-
} else {
|
|
70
|
-
const thePegaProvidedComponent = SdkComponentMap.getPegaProvidedComponentMap()[template];
|
|
71
|
-
if (thePegaProvidedComponent !== undefined) {
|
|
72
|
-
// console.log(`View component found ${template}: Pega-provided`);
|
|
73
|
-
ViewTemplate = thePegaProvidedComponent;
|
|
74
|
-
} else {
|
|
75
|
-
// eslint-disable-next-line no-console
|
|
76
|
-
console.error(`View component can't find template type ${template}`);
|
|
77
|
-
ViewTemplate = ErrorBoundary;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (template === 'ListView') {
|
|
82
|
-
// special case for ListView - add in a prop
|
|
83
|
-
const bInForm = true;
|
|
84
|
-
props = { ...props, bInForm };
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
// eslint-disable-next-line no-console
|
|
88
|
-
console.warn(`View: SdkComponentMap expected but not found.`);
|
|
89
|
-
|
|
90
|
-
// eslint-disable-next-line no-console
|
|
91
|
-
console.error(`View: Trying to render an unknown template: ${template}`);
|
|
70
|
+
const ViewTemplate: any = getComponentFromMap(template);
|
|
71
|
+
|
|
72
|
+
if (template === 'ListView') {
|
|
73
|
+
// special case for ListView - add in a prop
|
|
74
|
+
const bInForm = true;
|
|
75
|
+
props = { ...props, bInForm };
|
|
92
76
|
}
|
|
93
77
|
|
|
94
78
|
// for debugging/investigation
|
|
95
79
|
// console.log(`View rendering template: ${template}`);
|
|
96
80
|
|
|
97
81
|
// spreading because all props should go to the template
|
|
98
|
-
let RenderedTemplate =
|
|
82
|
+
let RenderedTemplate = (
|
|
83
|
+
<ViewTemplate key={key} {...props}>
|
|
84
|
+
{children}
|
|
85
|
+
</ViewTemplate>
|
|
86
|
+
);
|
|
99
87
|
|
|
100
88
|
if (FORMTEMPLATES.includes(template) && showLabel) {
|
|
101
89
|
// Original:
|
|
@@ -139,25 +127,6 @@ export default function View(props) {
|
|
|
139
127
|
return null;
|
|
140
128
|
}
|
|
141
129
|
|
|
142
|
-
View.defaultProps = {
|
|
143
|
-
label: undefined,
|
|
144
|
-
showLabel: undefined,
|
|
145
|
-
mode: undefined
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
View.propTypes = {
|
|
149
|
-
children: PropTypes.oneOfType([
|
|
150
|
-
PropTypes.arrayOf(PropTypes.node),
|
|
151
|
-
PropTypes.array
|
|
152
|
-
]) /* array might be empty */,
|
|
153
|
-
template: PropTypes.string /* .isRequired */,
|
|
154
|
-
getPConnect: PropTypes.func.isRequired,
|
|
155
|
-
label: PropTypes.string,
|
|
156
|
-
showLabel: PropTypes.bool,
|
|
157
|
-
mode: PropTypes.string,
|
|
158
|
-
title: PropTypes.string
|
|
159
|
-
};
|
|
160
|
-
|
|
161
130
|
// Adapted from Constellation DX Component to add in additional props for some templates
|
|
162
131
|
View.additionalProps = (state, getPConnect) => {
|
|
163
132
|
const thePConn = getPConnect();
|
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
.appshell-top {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
background-color: var(--app-background-color);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
.appshell-main {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
position: relative;
|
|
8
|
+
min-height: 100vh;
|
|
9
|
+
display: block;
|
|
10
|
+
width: 100%;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.psdk-icon {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
padding: 0rem 0.125rem;
|
|
15
|
+
min-width: unset;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.progress-box {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
height: 100%;
|
|
24
|
+
width: 100%;
|
|
25
|
+
background-color: whitesmoke;
|
|
26
|
+
position: fixed;
|
|
27
|
+
z-index: 999;
|
|
28
|
+
top: 0rem;
|
|
29
|
+
left: 0rem;
|
|
30
|
+
opacity: 0.5;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
.progress-spinner {
|
|
35
|
-
|
|
34
|
+
text-align: center;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
::ng-deep snack-bar-container.snackbar-newline {
|
|
39
|
-
|
|
38
|
+
white-space: pre-line;
|
|
40
39
|
}
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { PropsWithChildren, useEffect, useState } from 'react';
|
|
3
2
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
-
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
3
|
import Avatar from '@material-ui/core/Avatar';
|
|
4
|
+
|
|
5
|
+
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
6
6
|
import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
7
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
|
|
7
10
|
import './AppShell.css';
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
interface AppShellProps extends PConnProps {
|
|
13
|
+
// If any, enter additional props that only exist on this component
|
|
14
|
+
showAppName: boolean;
|
|
15
|
+
pages: {
|
|
16
|
+
pxPageViewIcon: string;
|
|
17
|
+
pyClassName: string;
|
|
18
|
+
pyLabel: string;
|
|
19
|
+
pyRuleName: string;
|
|
20
|
+
pyURLContent: string;
|
|
21
|
+
}[];
|
|
22
|
+
caseTypes?: object[];
|
|
23
|
+
portalTemplate: string;
|
|
24
|
+
portalName: string;
|
|
25
|
+
portalLogo: string;
|
|
26
|
+
navDisplayOptions: { alignment: string; position: string };
|
|
27
|
+
}
|
|
12
28
|
|
|
13
29
|
const useStyles = makeStyles(theme => ({
|
|
14
30
|
root: {
|
|
@@ -29,23 +45,15 @@ const useStyles = makeStyles(theme => ({
|
|
|
29
45
|
}
|
|
30
46
|
}));
|
|
31
47
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
showAppName,
|
|
40
|
-
children,
|
|
41
|
-
getPConnect,
|
|
42
|
-
portalTemplate,
|
|
43
|
-
portalName,
|
|
44
|
-
portalLogo,
|
|
45
|
-
navDisplayOptions
|
|
46
|
-
} = props;
|
|
48
|
+
export default function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
49
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
50
|
+
const NavBar = getComponentFromMap('NavBar');
|
|
51
|
+
const WssNavBar = getComponentFromMap('WssNavBar');
|
|
52
|
+
|
|
53
|
+
const { pages = [], caseTypes = [], showAppName, children = [], getPConnect, portalTemplate, portalName, portalLogo, navDisplayOptions } = props;
|
|
54
|
+
|
|
47
55
|
const [open, setOpen] = useState(true);
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
57
|
const [activeTab, setActiveTab] = useState(!pages ? null : pages[0]?.pyRuleName);
|
|
50
58
|
const pConn = getPConnect();
|
|
51
59
|
const envInfo = PCore.getEnvironmentInfo();
|
|
@@ -53,24 +61,25 @@ export default function AppShell(props) {
|
|
|
53
61
|
const userName = envInfo.getOperatorName();
|
|
54
62
|
const currentUserInitials = Utils.getInitials(userName);
|
|
55
63
|
const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
|
|
56
|
-
const portalClass = pConn.getValue('.classID');
|
|
64
|
+
const portalClass = pConn.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
|
|
57
65
|
const envPortalName = envInfo.getPortalName();
|
|
58
|
-
const
|
|
66
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
67
|
+
|
|
59
68
|
const classes = useStyles();
|
|
60
69
|
const actionsAPI = pConn.getActionsApi();
|
|
61
|
-
const localeReference = pConn.getValue('.pyLocaleReference');
|
|
62
|
-
const [imageBlobUrl, setImageBlobUrl] = useState(null);
|
|
70
|
+
const localeReference = pConn.getValue('.pyLocaleReference', ''); // 2nd arg empty string until typedef marked correctly
|
|
71
|
+
const [imageBlobUrl, setImageBlobUrl] = useState<string | null>(null);
|
|
63
72
|
// useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
65
74
|
const [appName, setAppName] = useState('');
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
76
|
const [mapChildren, setMapChildren] = useState([]);
|
|
68
77
|
|
|
69
78
|
// Initial setting of appName and mapChildren
|
|
70
79
|
useEffect(() => {
|
|
71
80
|
setAppName(PCore.getEnvironmentInfo().getApplicationName());
|
|
72
81
|
|
|
73
|
-
const tempMap = pConn.getChildren()
|
|
82
|
+
const tempMap: any = (pConn.getChildren() as any)?.map((child: any, index) => {
|
|
74
83
|
const theChildComp = child.getPConnect().getComponentName();
|
|
75
84
|
const theKey = `.${index}`;
|
|
76
85
|
return (
|
|
@@ -93,11 +102,9 @@ export default function AppShell(props) {
|
|
|
93
102
|
portalLogo.toLowerCase().includes('py-logo') ||
|
|
94
103
|
portalLogo.toLowerCase().includes('py-full-logo')
|
|
95
104
|
) {
|
|
96
|
-
const portalLogoImage = Utils.getIconPath(
|
|
97
|
-
'pzpega-logo-mark.svg'
|
|
98
|
-
);
|
|
105
|
+
const portalLogoImage = Utils.getIconPath(Utils.getSDKStaticConentUrl()).concat('pzpega-logo-mark.svg');
|
|
99
106
|
setIconURL(portalLogoImage);
|
|
100
|
-
setFullIconURL(`${
|
|
107
|
+
setFullIconURL(`${Utils.getSDKStaticConentUrl()}static/py-full-logo.svg`);
|
|
101
108
|
}
|
|
102
109
|
// not using default icon to fetch it using the way which uses authentication
|
|
103
110
|
else {
|
|
@@ -109,10 +116,8 @@ export default function AppShell(props) {
|
|
|
109
116
|
setFullIconURL(data);
|
|
110
117
|
})
|
|
111
118
|
.catch(() => {
|
|
112
|
-
|
|
113
|
-
console.error(
|
|
114
|
-
`Unable to load the image for the portal logo/icon with the insName:${portalLogo}`
|
|
115
|
-
);
|
|
119
|
+
// eslint-disable-next-line no-console
|
|
120
|
+
console.error(`${localizedVal('Unable to load the image for the portal logo/icon with the insName', 'AppShell')}:${portalLogo}`);
|
|
116
121
|
});
|
|
117
122
|
}
|
|
118
123
|
}, [portalLogo]);
|
|
@@ -145,16 +150,13 @@ export default function AppShell(props) {
|
|
|
145
150
|
const links = !pages
|
|
146
151
|
? []
|
|
147
152
|
: pages.map(page => {
|
|
148
|
-
const name =
|
|
153
|
+
const name = localizedVal(page.pyLabel, '', localeReference);
|
|
149
154
|
return {
|
|
150
155
|
text: name,
|
|
151
156
|
name,
|
|
152
157
|
icon: page.pxPageViewIcon.replace('pi pi-', ''),
|
|
153
158
|
active: page.pyRuleName === activeTab,
|
|
154
|
-
onClick: () =>
|
|
155
|
-
!page.pyURLContent || page.pyURLContent === ''
|
|
156
|
-
? showPage(page.pyRuleName, page.pyClassName)
|
|
157
|
-
: openURL(page.pyURLContent)
|
|
159
|
+
onClick: () => (!page.pyURLContent || page.pyURLContent === '' ? showPage(page.pyRuleName, page.pyClassName) : openURL(page.pyURLContent))
|
|
158
160
|
};
|
|
159
161
|
});
|
|
160
162
|
|
|
@@ -173,19 +175,11 @@ export default function AppShell(props) {
|
|
|
173
175
|
portalName={portalName}
|
|
174
176
|
imageSrc={iconURL}
|
|
175
177
|
fullImageSrc={fullIconURL}
|
|
176
|
-
appName={
|
|
177
|
-
appNameToDisplay,
|
|
178
|
-
'',
|
|
179
|
-
`${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
|
|
180
|
-
)}
|
|
178
|
+
appName={localizedVal(appNameToDisplay, '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
|
|
181
179
|
appInfo={{
|
|
182
180
|
imageSrc: iconURL,
|
|
183
|
-
appName:
|
|
184
|
-
|
|
185
|
-
'',
|
|
186
|
-
`${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
|
|
187
|
-
),
|
|
188
|
-
onClick: links[0] && links[0].onClick ? links[0].onClick : undefined
|
|
181
|
+
appName: localizedVal(appNameToDisplay, '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase()),
|
|
182
|
+
onClick: links[0] && /* links[0].onClick ? */ links[0].onClick /* : undefined */
|
|
189
183
|
}}
|
|
190
184
|
navLinks={links.filter((link, index) => {
|
|
191
185
|
return index !== 0;
|
|
@@ -195,34 +189,22 @@ export default function AppShell(props) {
|
|
|
195
189
|
/>
|
|
196
190
|
<div className={classes.wsscontent}>{children}</div>
|
|
197
191
|
</div>
|
|
198
|
-
|
|
199
192
|
);
|
|
200
193
|
}
|
|
201
194
|
|
|
202
195
|
return (
|
|
196
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
203
197
|
<NavContext.Provider value={{ open, setOpen }}>
|
|
204
198
|
<div id='AppShell' className={classes.root}>
|
|
205
199
|
<NavBar
|
|
200
|
+
getPConnect={getPConnect}
|
|
206
201
|
pConn={getPConnect()}
|
|
207
|
-
appName={appNameToDisplay}
|
|
202
|
+
appName={localizedVal(appNameToDisplay, '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
|
|
208
203
|
pages={pages}
|
|
209
204
|
caseTypes={caseTypes}
|
|
210
|
-
|
|
205
|
+
/>
|
|
211
206
|
<div className={classes.content}>{children}</div>
|
|
212
207
|
</div>
|
|
213
208
|
</NavContext.Provider>
|
|
214
209
|
);
|
|
215
210
|
}
|
|
216
|
-
|
|
217
|
-
AppShell.defaultProps = {
|
|
218
|
-
pages: [],
|
|
219
|
-
caseTypes: [],
|
|
220
|
-
children: []
|
|
221
|
-
};
|
|
222
|
-
AppShell.propTypes = {
|
|
223
|
-
showAppName: PropTypes.bool /* .isRequired */,
|
|
224
|
-
pages: PropTypes.arrayOf(PropTypes.object),
|
|
225
|
-
caseTypes: PropTypes.arrayOf(PropTypes.object),
|
|
226
|
-
children: PropTypes.arrayOf(PropTypes.node),
|
|
227
|
-
getPConnect: PropTypes.func.isRequired
|
|
228
|
-
};
|
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Children, PropsWithChildren, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
6
|
+
interface BannerPageProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
layout?: string;
|
|
9
|
+
heading?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
imageTheme?: string;
|
|
12
|
+
backgroundImage?: string;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
tintImage?: boolean;
|
|
15
|
+
}
|
|
5
16
|
|
|
6
17
|
/*
|
|
7
18
|
* BannerPage template.
|
|
8
19
|
*/
|
|
9
|
-
export default function BannerPage(props) {
|
|
20
|
+
export default function BannerPage(props: PropsWithChildren<BannerPageProps>) {
|
|
21
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
22
|
+
const Banner = getComponentFromMap('Banner');
|
|
23
|
+
|
|
10
24
|
const {
|
|
11
25
|
children,
|
|
12
|
-
layout,
|
|
13
|
-
heading,
|
|
14
|
-
message,
|
|
15
|
-
imageTheme,
|
|
16
|
-
backgroundImage,
|
|
17
|
-
backgroundColor,
|
|
18
|
-
tintImage
|
|
26
|
+
layout = 'two-column',
|
|
27
|
+
heading = '',
|
|
28
|
+
message = '',
|
|
29
|
+
imageTheme = 'light',
|
|
30
|
+
backgroundImage = '',
|
|
31
|
+
backgroundColor = '',
|
|
32
|
+
tintImage = false
|
|
19
33
|
} = props;
|
|
20
34
|
|
|
21
35
|
const childArray = useMemo(() => {
|
|
@@ -38,24 +52,3 @@ export default function BannerPage(props) {
|
|
|
38
52
|
/>
|
|
39
53
|
);
|
|
40
54
|
}
|
|
41
|
-
|
|
42
|
-
BannerPage.propTypes = {
|
|
43
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
44
|
-
layout: PropTypes.string,
|
|
45
|
-
heading: PropTypes.string,
|
|
46
|
-
message: PropTypes.string,
|
|
47
|
-
imageTheme: PropTypes.string,
|
|
48
|
-
backgroundImage: PropTypes.string,
|
|
49
|
-
backgroundColor: PropTypes.string,
|
|
50
|
-
tintImage: PropTypes.bool
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
BannerPage.defaultProps = {
|
|
54
|
-
layout: 'two-column',
|
|
55
|
-
heading: '',
|
|
56
|
-
message: '',
|
|
57
|
-
imageTheme: 'light',
|
|
58
|
-
backgroundImage: '',
|
|
59
|
-
backgroundColor: '',
|
|
60
|
-
tintImage: false
|
|
61
|
-
};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
interface CaseSummaryProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function CaseSummary(props: PropsWithChildren<CaseSummaryProps>) {
|
|
10
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
11
|
+
const CaseSummaryFields = getComponentFromMap('CaseSummaryFields');
|
|
5
12
|
|
|
6
|
-
export default function CaseSummary(props) {
|
|
7
13
|
const { getPConnect, children } = props;
|
|
14
|
+
|
|
8
15
|
const thePConn = getPConnect();
|
|
9
|
-
const theConfigProps = thePConn.getConfigProps();
|
|
10
|
-
const { status, showStatus } = theConfigProps;
|
|
16
|
+
const theConfigProps: any = thePConn.getConfigProps();
|
|
17
|
+
// const { status, showStatus } = theConfigProps;
|
|
18
|
+
const status = theConfigProps.status;
|
|
19
|
+
const showStatus = theConfigProps.showStatus;
|
|
11
20
|
|
|
12
21
|
// from Constellation DX Components
|
|
13
22
|
// get the primary and secondary fields with the raw data (which has the non-resolved property values)
|
|
@@ -17,15 +26,15 @@ export default function CaseSummary(props) {
|
|
|
17
26
|
|
|
18
27
|
// From other SDKs
|
|
19
28
|
// may want to move these into useEffect/useState combo
|
|
20
|
-
let arPrimaryFields:
|
|
21
|
-
let arSecondaryFields:
|
|
29
|
+
let arPrimaryFields: any[] = [];
|
|
30
|
+
let arSecondaryFields: any[] = [];
|
|
22
31
|
|
|
23
|
-
for (const child of children) {
|
|
24
|
-
const childPConn = child.props.getPConnect();
|
|
32
|
+
for (const child of children as ReactElement[]) {
|
|
33
|
+
const childPConn = (child as ReactElement).props.getPConnect();
|
|
25
34
|
const childPConnData = childPConn.resolveConfigProps(childPConn.getRawMetadata());
|
|
26
|
-
if (childPConnData.name.toLowerCase() ===
|
|
35
|
+
if (childPConnData.name.toLowerCase() === 'primary fields') {
|
|
27
36
|
arPrimaryFields = childPConnData.children;
|
|
28
|
-
} else if (childPConnData.name.toLowerCase() ===
|
|
37
|
+
} else if (childPConnData.name.toLowerCase() === 'secondary fields') {
|
|
29
38
|
arSecondaryFields = childPConnData.children;
|
|
30
39
|
}
|
|
31
40
|
}
|
|
@@ -38,13 +47,9 @@ export default function CaseSummary(props) {
|
|
|
38
47
|
// console.log(`CaseSummary: arSecondaryFields: ${JSON.stringify(arSecondaryFields)}`);
|
|
39
48
|
|
|
40
49
|
return (
|
|
41
|
-
<div id=
|
|
50
|
+
<div id='CaseSummary'>
|
|
42
51
|
<CaseSummaryFields status={status} showStatus={showStatus} theFields={arPrimaryFields} />
|
|
43
52
|
<CaseSummaryFields theFields={arSecondaryFields} />
|
|
44
53
|
</div>
|
|
45
|
-
)
|
|
54
|
+
);
|
|
46
55
|
}
|
|
47
|
-
|
|
48
|
-
CaseSummary.propTypes = {
|
|
49
|
-
getPConnect: PropTypes.func.isRequired
|
|
50
|
-
};
|