@pega/react-sdk-overrides 0.23.26 → 8.8.21
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 +47 -0
- package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/lib/designSystemExtension/Banner/Banner.tsx +12 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +15 -10
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +10 -11
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +10 -3
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +11 -5
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +11 -3
- package/lib/designSystemExtension/Operator/Operator.tsx +30 -21
- package/lib/designSystemExtension/Pulse/Pulse.tsx +11 -7
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
- package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +12 -3
- package/lib/field/AutoComplete/AutoComplete.tsx +37 -18
- package/lib/field/CancelAlert/CancelAlert.tsx +21 -12
- package/lib/field/Checkbox/Checkbox.tsx +41 -17
- package/lib/field/Currency/Currency.tsx +23 -15
- package/lib/field/Currency/currency-utils.ts +1 -2
- package/lib/field/Date/Date.tsx +31 -17
- package/lib/field/DateTime/DateTime.tsx +26 -15
- package/lib/field/Decimal/Decimal.tsx +82 -19
- package/lib/field/Dropdown/Dropdown.tsx +57 -14
- package/lib/field/Email/Email.tsx +17 -9
- package/lib/field/Integer/Integer.tsx +15 -7
- package/lib/field/Percentage/Percentage.tsx +15 -7
- package/lib/field/Phone/Phone.tsx +21 -12
- package/lib/field/RadioButtons/RadioButtons.tsx +54 -27
- package/lib/field/RichText/RichText.tsx +93 -0
- package/lib/field/RichText/index.tsx +1 -0
- package/lib/field/ScalarList/ScalarList.tsx +64 -0
- package/lib/field/ScalarList/config-ext.json +8 -0
- package/lib/field/ScalarList/index.tsx +1 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
- package/lib/field/SemanticLink/utils.ts +2 -1
- package/lib/field/TextArea/TextArea.tsx +14 -5
- package/lib/field/TextContent/TextContent.tsx +10 -1
- package/lib/field/TextInput/TextInput.tsx +40 -11
- package/lib/field/Time/Time.tsx +29 -26
- package/lib/field/URL/URL.tsx +24 -8
- package/lib/field/UserReference/UserReference.tsx +52 -60
- package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +5 -5
- package/lib/helpers/auth.js +741 -390
- package/lib/helpers/authManager.ts +933 -0
- package/lib/helpers/case-utils.tsx +103 -0
- package/lib/helpers/common-utils.ts +4 -0
- package/lib/helpers/config_access.js +63 -145
- package/lib/helpers/data_page.ts +2 -1
- package/lib/helpers/date-format-utils.ts +29 -19
- package/lib/helpers/{event-utils.js → event-utils.ts} +1 -1
- package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +4 -3
- package/lib/helpers/formatters/{Currency.js → Currency.ts} +13 -12
- package/lib/helpers/formatters/{CurrencyMap.js → CurrencyMap.ts} +8 -5
- package/lib/helpers/formatters/{Date.js → Date.ts} +2 -2
- package/lib/helpers/formatters/{common.js → common.ts} +4 -4
- package/lib/helpers/formatters/{index.js → index.ts} +3 -3
- package/lib/helpers/simpleTableHelpers.ts +10 -6
- package/lib/helpers/state-utils.tsx +47 -0
- package/lib/helpers/template-utils.ts +3 -4
- package/lib/helpers/utils.ts +12 -4
- package/lib/helpers/versionHelpers.ts +0 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +13 -18
- package/lib/infra/Assignment/Assignment.tsx +38 -32
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +15 -19
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +76 -64
- package/lib/infra/Containers/FlowContainer/{helpers.js → helpers.ts} +18 -16
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +41 -27
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +19 -28
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +16 -20
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +16 -19
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +20 -19
- package/lib/infra/MultiStep/MultiStep.tsx +24 -24
- package/lib/infra/NavBar/NavBar.tsx +23 -24
- package/lib/infra/Reference/Reference.tsx +13 -18
- package/lib/infra/Region/Region.tsx +8 -6
- package/lib/infra/RootContainer/RootContainer.tsx +32 -39
- package/lib/infra/Stages/Stages.tsx +15 -9
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +8 -1
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
- package/lib/infra/View/View.tsx +28 -56
- package/lib/template/AppShell/AppShell.tsx +51 -34
- package/lib/template/BannerPage/BannerPage.tsx +26 -31
- package/lib/template/CaseSummary/CaseSummary.tsx +15 -8
- package/lib/template/CaseView/CaseView.tsx +137 -100
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +27 -27
- package/lib/template/Confirmation/Confirmation.tsx +29 -52
- package/lib/template/DataReference/DataReference.tsx +50 -52
- package/lib/template/DefaultForm/DefaultForm.tsx +29 -20
- package/lib/template/DefaultForm/utils/index.ts +33 -0
- package/lib/template/Details/Details/Details.tsx +16 -17
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +13 -16
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -18
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +20 -18
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -27
- package/lib/template/InlineDashboard/InlineDashboard.tsx +11 -7
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -17
- package/lib/template/ListPage/ListPage.tsx +14 -13
- package/lib/template/ListView/ListView.tsx +191 -186
- package/lib/template/ListView/{hooks.js → hooks.ts} +3 -1
- package/lib/template/ListView/{utils.js → utils.ts} +172 -23
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +12 -17
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +16 -1
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +19 -18
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +9 -1
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +8 -7
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +5 -7
- package/lib/template/PromotedFilters/PromotedFilters.tsx +23 -17
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +103 -6
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +28 -7
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +26 -31
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +34 -36
- package/lib/template/SubTabs/SubTabs.tsx +10 -11
- package/lib/template/SubTabs/tabUtils.ts +0 -2
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +10 -15
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +10 -12
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +17 -3
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +35 -25
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +7 -1
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -17
- package/lib/template/WssNavBar/WssNavBar.tsx +20 -3
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +13 -21
- package/lib/widget/Attachment/Attachment.css +15 -3
- package/lib/widget/Attachment/Attachment.tsx +51 -32
- package/lib/widget/CaseHistory/CaseHistory.tsx +13 -11
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +13 -1
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +40 -26
- package/lib/widget/Followers/Followers.tsx +10 -11
- package/lib/widget/QuickCreate/QuickCreate.tsx +15 -6
- package/lib/widget/SummaryItem/SummaryItem.tsx +12 -4
- package/lib/widget/SummaryList/SummaryList.tsx +17 -3
- package/lib/widget/ToDo/ToDo.tsx +69 -104
- package/package.json +1 -1
- package/lib/helpers/authManager.js +0 -631
- /package/lib/helpers/formatters/{Boolean.js → Boolean.ts} +0 -0
- /package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +0 -0
- /package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +0 -0
|
@@ -5,6 +5,13 @@ import {
|
|
|
5
5
|
Divider,
|
|
6
6
|
} from '@material-ui/core';
|
|
7
7
|
|
|
8
|
+
// LeftAlignVerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
|
|
9
|
+
|
|
10
|
+
interface LeftAlignVerticalTabsProps {
|
|
11
|
+
// If any, enter additional props that only exist on this component
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
8
15
|
// LeftAlignVerticalTab is a specialized Tab that has styles to make it
|
|
9
16
|
// left aligned and full width of the container Tabs
|
|
10
17
|
|
|
@@ -22,6 +29,6 @@ const LeftAlignVerticalTabs: any = withStyles((/* theme */) => ({
|
|
|
22
29
|
display: 'block',
|
|
23
30
|
textAlign: 'left',
|
|
24
31
|
},
|
|
25
|
-
}))((props) => <div><Tab {...props} /><Divider /></div>);
|
|
32
|
+
}))((props: LeftAlignVerticalTabsProps) => <div><Tab {...props} /><Divider /></div>);
|
|
26
33
|
|
|
27
34
|
export default LeftAlignVerticalTabs;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import { makeStyles } from '@material-ui/core/styles'
|
|
4
3
|
|
|
5
4
|
import Tabs from '@material-ui/core/Tabs';
|
|
6
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
7
|
+
// VerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
|
|
8
|
+
interface VerticalTabsProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
tabconfig: Array<any>
|
|
11
|
+
}
|
|
7
12
|
|
|
8
13
|
|
|
9
14
|
// The MuiTabs-indicator class is in a span whose parent is div (under the Tabs root component)
|
|
@@ -31,9 +36,12 @@ const createCustomEvent = (eventName: string, additionalData: {[key: string]: st
|
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
|
|
34
|
-
export default function VerticalTabs(props) {
|
|
39
|
+
export default function VerticalTabs(props: VerticalTabsProps) {
|
|
40
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
41
|
+
const LeftAlignVerticalTab = getComponentFromMap("LeftAlignVerticalTabs");
|
|
42
|
+
|
|
35
43
|
// Get a React warning when we use tabConfig as mixed case. So all lowercase tabconfig
|
|
36
|
-
const { tabconfig } = props;
|
|
44
|
+
const { tabconfig = [] } = props;
|
|
37
45
|
const classes = useStyles();
|
|
38
46
|
const [value, setValue] = useState(0);
|
|
39
47
|
|
|
@@ -65,11 +73,3 @@ export default function VerticalTabs(props) {
|
|
|
65
73
|
</div>
|
|
66
74
|
)
|
|
67
75
|
}
|
|
68
|
-
|
|
69
|
-
VerticalTabs.defaultProps = {
|
|
70
|
-
tabconfig: []
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
VerticalTabs.propTypes = {
|
|
74
|
-
tabconfig: PropTypes.arrayOf(PropTypes.object)
|
|
75
|
-
};
|
package/lib/infra/View/View.tsx
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
// import { FieldGroup } from "@pega/cosmos-react-core";
|
|
4
3
|
// import { LazyMap as LazyComponentMap } from "../../components_map";
|
|
5
4
|
|
|
6
|
-
import {
|
|
7
|
-
import ErrorBoundary from '@pega/react-sdk-components/lib/components/infra/ErrorBoundary';
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
6
|
|
|
9
7
|
import { getAllFields } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
|
|
10
8
|
|
|
11
9
|
// Need to import any templates that we might render
|
|
12
10
|
|
|
13
11
|
import './View.css';
|
|
12
|
+
|
|
13
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
interface ViewProps extends PConnProps {
|
|
17
|
+
// If any, enter additional props that only exist on this component
|
|
18
|
+
children: Array<any>,
|
|
19
|
+
template?: string,
|
|
20
|
+
label?: string,
|
|
21
|
+
showLabel: boolean,
|
|
22
|
+
mode?: string,
|
|
23
|
+
title?: string,
|
|
24
|
+
visibility?: boolean,
|
|
25
|
+
name?: string,
|
|
26
|
+
bInForm?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
14
30
|
//
|
|
15
31
|
// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
16
32
|
// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
|
|
@@ -29,14 +45,14 @@ const NO_HEADER_TEMPLATES = [
|
|
|
29
45
|
'Confirmation'
|
|
30
46
|
];
|
|
31
47
|
|
|
32
|
-
export default function View(props) {
|
|
48
|
+
export default function View(props: ViewProps) {
|
|
33
49
|
const { children, template, getPConnect, mode, visibility, name: pageName } = props;
|
|
34
|
-
let { label, showLabel = false } = props;
|
|
50
|
+
let { label = '', showLabel = false } = props;
|
|
35
51
|
|
|
36
52
|
// Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
|
|
37
53
|
// Putting this logic here instead of copy/paste in every Form template index.js
|
|
38
54
|
|
|
39
|
-
const inheritedProps = getPConnect().getInheritedProps();
|
|
55
|
+
const inheritedProps: any = getPConnect().getInheritedProps(); // try to remove any when getInheritedProps typedefs are fixed
|
|
40
56
|
label = inheritedProps.label || label;
|
|
41
57
|
showLabel = inheritedProps.showLabel || showLabel;
|
|
42
58
|
|
|
@@ -57,38 +73,12 @@ export default function View(props) {
|
|
|
57
73
|
// JA - React SDK not using LazyComponentMap yet
|
|
58
74
|
if (template /* && LazyComponentMap[template] */) {
|
|
59
75
|
// 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}`);
|
|
76
|
+
const ViewTemplate: any = getComponentFromMap(template);
|
|
77
|
+
|
|
78
|
+
if (template === 'ListView') {
|
|
79
|
+
// special case for ListView - add in a prop
|
|
80
|
+
const bInForm = true;
|
|
81
|
+
props = { ...props, bInForm };
|
|
92
82
|
}
|
|
93
83
|
|
|
94
84
|
// for debugging/investigation
|
|
@@ -139,24 +129,6 @@ export default function View(props) {
|
|
|
139
129
|
return null;
|
|
140
130
|
}
|
|
141
131
|
|
|
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
132
|
|
|
161
133
|
// Adapted from Constellation DX Component to add in additional props for some templates
|
|
162
134
|
View.additionalProps = (state, getPConnect) => {
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
3
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
4
|
import Avatar from '@material-ui/core/Avatar';
|
|
6
5
|
import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
7
6
|
import './AppShell.css';
|
|
7
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
|
+
|
|
9
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
|
+
|
|
11
|
+
interface AppShellProps extends PConnProps {
|
|
12
|
+
// If any, enter additional props that only exist on this component
|
|
13
|
+
showAppName: boolean,
|
|
14
|
+
pages: Array<{
|
|
15
|
+
pxPageViewIcon: string,
|
|
16
|
+
pyClassName: string,
|
|
17
|
+
pyLabel: string,
|
|
18
|
+
pyRuleName: string,
|
|
19
|
+
pyURLContent: string,
|
|
20
|
+
|
|
21
|
+
}>,
|
|
22
|
+
caseTypes?:Array<object>,
|
|
23
|
+
children?: Array<any>,
|
|
24
|
+
portalTemplate: string,
|
|
25
|
+
portalName: string,
|
|
26
|
+
portalLogo : string,
|
|
27
|
+
navDisplayOptions: { alignment: string, position: string }
|
|
28
|
+
}
|
|
8
29
|
|
|
9
|
-
// AppShell can emit NavBar or WssNavBar
|
|
10
|
-
import NavBar from '@pega/react-sdk-components/lib/components/infra/NavBar';
|
|
11
|
-
import WssNavBar from '@pega/react-sdk-components/lib/components/template/WssNavBar';
|
|
12
30
|
|
|
13
31
|
const useStyles = makeStyles(theme => ({
|
|
14
32
|
root: {
|
|
@@ -29,21 +47,27 @@ const useStyles = makeStyles(theme => ({
|
|
|
29
47
|
}
|
|
30
48
|
}));
|
|
31
49
|
|
|
32
|
-
|
|
50
|
+
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
|
|
51
|
+
declare const PCore: any;
|
|
52
|
+
|
|
33
53
|
|
|
54
|
+
export default function AppShell(props:AppShellProps) {
|
|
55
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
56
|
+
const NavBar = getComponentFromMap("NavBar");
|
|
57
|
+
const WssNavBar = getComponentFromMap("WssNavBar");
|
|
34
58
|
|
|
35
|
-
export default function AppShell(props) {
|
|
36
59
|
const {
|
|
37
|
-
pages,
|
|
38
|
-
caseTypes,
|
|
60
|
+
pages = [],
|
|
61
|
+
caseTypes = [],
|
|
39
62
|
showAppName,
|
|
40
|
-
children,
|
|
63
|
+
children = [],
|
|
41
64
|
getPConnect,
|
|
42
65
|
portalTemplate,
|
|
43
66
|
portalName,
|
|
44
67
|
portalLogo,
|
|
45
68
|
navDisplayOptions
|
|
46
69
|
} = props;
|
|
70
|
+
|
|
47
71
|
const [open, setOpen] = useState(true);
|
|
48
72
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
49
73
|
const [activeTab, setActiveTab] = useState(!pages ? null : pages[0]?.pyRuleName);
|
|
@@ -53,12 +77,13 @@ export default function AppShell(props) {
|
|
|
53
77
|
const userName = envInfo.getOperatorName();
|
|
54
78
|
const currentUserInitials = Utils.getInitials(userName);
|
|
55
79
|
const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
|
|
56
|
-
const portalClass = pConn.getValue('.classID');
|
|
80
|
+
const portalClass = pConn.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
|
|
57
81
|
const envPortalName = envInfo.getPortalName();
|
|
58
|
-
const
|
|
82
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
83
|
+
|
|
59
84
|
const classes = useStyles();
|
|
60
85
|
const actionsAPI = pConn.getActionsApi();
|
|
61
|
-
const localeReference = pConn.getValue('.pyLocaleReference');
|
|
86
|
+
const localeReference = pConn.getValue('.pyLocaleReference', ''); // 2nd arg empty string until typedef marked correctly
|
|
62
87
|
const [imageBlobUrl, setImageBlobUrl] = useState(null);
|
|
63
88
|
// useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
|
|
64
89
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
@@ -70,7 +95,7 @@ export default function AppShell(props) {
|
|
|
70
95
|
useEffect(() => {
|
|
71
96
|
setAppName(PCore.getEnvironmentInfo().getApplicationName());
|
|
72
97
|
|
|
73
|
-
const tempMap = pConn.getChildren()
|
|
98
|
+
const tempMap: any = pConn.getChildren()?.map((child: any, index) => {
|
|
74
99
|
const theChildComp = child.getPConnect().getComponentName();
|
|
75
100
|
const theKey = `.${index}`;
|
|
76
101
|
return (
|
|
@@ -93,11 +118,11 @@ export default function AppShell(props) {
|
|
|
93
118
|
portalLogo.toLowerCase().includes('py-logo') ||
|
|
94
119
|
portalLogo.toLowerCase().includes('py-full-logo')
|
|
95
120
|
) {
|
|
96
|
-
const portalLogoImage = Utils.getIconPath(
|
|
121
|
+
const portalLogoImage = Utils.getIconPath(Utils.getSDKStaticConentUrl()).concat(
|
|
97
122
|
'pzpega-logo-mark.svg'
|
|
98
123
|
);
|
|
99
124
|
setIconURL(portalLogoImage);
|
|
100
|
-
setFullIconURL(`${
|
|
125
|
+
setFullIconURL(`${Utils.getSDKStaticConentUrl()}static/py-full-logo.svg`);
|
|
101
126
|
}
|
|
102
127
|
// not using default icon to fetch it using the way which uses authentication
|
|
103
128
|
else {
|
|
@@ -111,7 +136,7 @@ export default function AppShell(props) {
|
|
|
111
136
|
.catch(() => {
|
|
112
137
|
// eslint-disable-next-line no-console
|
|
113
138
|
console.error(
|
|
114
|
-
|
|
139
|
+
`${localizedVal('Unable to load the image for the portal logo/icon with the insName', 'AppShell')}:${portalLogo}`
|
|
115
140
|
);
|
|
116
141
|
});
|
|
117
142
|
}
|
|
@@ -145,7 +170,7 @@ export default function AppShell(props) {
|
|
|
145
170
|
const links = !pages
|
|
146
171
|
? []
|
|
147
172
|
: pages.map(page => {
|
|
148
|
-
const name =
|
|
173
|
+
const name = localizedVal(page.pyLabel, '', localeReference);
|
|
149
174
|
return {
|
|
150
175
|
text: name,
|
|
151
176
|
name,
|
|
@@ -173,19 +198,19 @@ export default function AppShell(props) {
|
|
|
173
198
|
portalName={portalName}
|
|
174
199
|
imageSrc={iconURL}
|
|
175
200
|
fullImageSrc={fullIconURL}
|
|
176
|
-
appName={
|
|
201
|
+
appName={localizedVal(
|
|
177
202
|
appNameToDisplay,
|
|
178
203
|
'',
|
|
179
204
|
`${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
|
|
180
205
|
)}
|
|
181
206
|
appInfo={{
|
|
182
207
|
imageSrc: iconURL,
|
|
183
|
-
appName:
|
|
208
|
+
appName: localizedVal(
|
|
184
209
|
appNameToDisplay,
|
|
185
210
|
'',
|
|
186
211
|
`${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
|
|
187
212
|
),
|
|
188
|
-
onClick: links[0] && links[0].onClick ? links[0].onClick : undefined
|
|
213
|
+
onClick: links[0] && /* links[0].onClick ? */ links[0].onClick /* : undefined */
|
|
189
214
|
}}
|
|
190
215
|
navLinks={links.filter((link, index) => {
|
|
191
216
|
return index !== 0;
|
|
@@ -203,8 +228,13 @@ export default function AppShell(props) {
|
|
|
203
228
|
<NavContext.Provider value={{ open, setOpen }}>
|
|
204
229
|
<div id='AppShell' className={classes.root}>
|
|
205
230
|
<NavBar
|
|
231
|
+
getPConnect={getPConnect}
|
|
206
232
|
pConn={getPConnect()}
|
|
207
|
-
appName={
|
|
233
|
+
appName={localizedVal(
|
|
234
|
+
appNameToDisplay,
|
|
235
|
+
'',
|
|
236
|
+
`${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
|
|
237
|
+
)}
|
|
208
238
|
pages={pages}
|
|
209
239
|
caseTypes={caseTypes}
|
|
210
240
|
></NavBar>
|
|
@@ -213,16 +243,3 @@ export default function AppShell(props) {
|
|
|
213
243
|
</NavContext.Provider>
|
|
214
244
|
);
|
|
215
245
|
}
|
|
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,37 @@
|
|
|
1
1
|
import { useMemo, Children } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Banner from '@pega/react-sdk-components/lib/components/designSystemExtension/Banner';
|
|
4
2
|
import React from 'react';
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
+
|
|
5
|
+
// BannerPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
|
+
|
|
7
|
+
interface BannerPageProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
children: Array<any>,
|
|
10
|
+
layout?: string,
|
|
11
|
+
heading?: string,
|
|
12
|
+
message?: string,
|
|
13
|
+
imageTheme?: string,
|
|
14
|
+
backgroundImage?: string,
|
|
15
|
+
backgroundColor?: string,
|
|
16
|
+
tintImage?: boolean
|
|
17
|
+
}
|
|
5
18
|
|
|
6
19
|
/*
|
|
7
20
|
* BannerPage template.
|
|
8
21
|
*/
|
|
9
|
-
export default function BannerPage(props) {
|
|
22
|
+
export default function BannerPage(props: BannerPageProps) {
|
|
23
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
24
|
+
const Banner = getComponentFromMap('Banner');
|
|
25
|
+
|
|
10
26
|
const {
|
|
11
27
|
children,
|
|
12
|
-
layout,
|
|
13
|
-
heading,
|
|
14
|
-
message,
|
|
15
|
-
imageTheme,
|
|
16
|
-
backgroundImage,
|
|
17
|
-
backgroundColor,
|
|
18
|
-
tintImage
|
|
28
|
+
layout = 'two-column',
|
|
29
|
+
heading = '',
|
|
30
|
+
message = '',
|
|
31
|
+
imageTheme = 'light',
|
|
32
|
+
backgroundImage = '',
|
|
33
|
+
backgroundColor = '',
|
|
34
|
+
tintImage = false
|
|
19
35
|
} = props;
|
|
20
36
|
|
|
21
37
|
const childArray = useMemo(() => {
|
|
@@ -38,24 +54,3 @@ export default function BannerPage(props) {
|
|
|
38
54
|
/>
|
|
39
55
|
);
|
|
40
56
|
}
|
|
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,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
6
|
+
interface CaseSummaryProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
children: Array<any>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export default function CaseSummary(props: CaseSummaryProps) {
|
|
13
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
14
|
+
const CaseSummaryFields = getComponentFromMap('CaseSummaryFields');
|
|
5
15
|
|
|
6
|
-
export default function CaseSummary(props) {
|
|
7
16
|
const { getPConnect, children } = props;
|
|
8
17
|
const thePConn = getPConnect();
|
|
9
18
|
const theConfigProps = thePConn.getConfigProps();
|
|
10
|
-
const { status, showStatus } = theConfigProps;
|
|
19
|
+
// const { status, showStatus } = theConfigProps;
|
|
20
|
+
const status = theConfigProps["status"];
|
|
21
|
+
const showStatus = theConfigProps["showStatus"];
|
|
11
22
|
|
|
12
23
|
// from Constellation DX Components
|
|
13
24
|
// get the primary and secondary fields with the raw data (which has the non-resolved property values)
|
|
@@ -44,7 +55,3 @@ export default function CaseSummary(props) {
|
|
|
44
55
|
</div>
|
|
45
56
|
)
|
|
46
57
|
}
|
|
47
|
-
|
|
48
|
-
CaseSummary.propTypes = {
|
|
49
|
-
getPConnect: PropTypes.func.isRequired
|
|
50
|
-
};
|