@pega/react-sdk-overrides 24.2.11 → 25.1.11

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.
Files changed (173) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  2. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  3. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  4. package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
  5. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
  7. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  8. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  9. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  10. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
  11. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  12. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  13. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
  14. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
  15. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
  16. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  17. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  18. package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
  19. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  20. package/lib/field/Currency/Currency.tsx +3 -3
  21. package/lib/field/Currency/currency-utils.ts +1 -2
  22. package/lib/field/Date/Date.tsx +3 -7
  23. package/lib/field/DateTime/DateTime.tsx +3 -8
  24. package/lib/field/Decimal/Decimal.tsx +3 -5
  25. package/lib/field/Dropdown/Dropdown.tsx +5 -7
  26. package/lib/field/Email/Email.tsx +11 -13
  27. package/lib/field/Group/Group.tsx +10 -8
  28. package/lib/field/Integer/Integer.tsx +5 -7
  29. package/lib/field/Location/Location.css +4 -0
  30. package/lib/field/Location/Location.tsx +258 -0
  31. package/lib/field/Location/config-ext.json +8 -0
  32. package/lib/field/Location/index.tsx +1 -0
  33. package/lib/field/Multiselect/utils.ts +1 -1
  34. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  35. package/lib/field/ObjectReference/index.tsx +1 -0
  36. package/lib/field/ObjectReference/utils.ts +111 -0
  37. package/lib/field/Percentage/Percentage.tsx +3 -7
  38. package/lib/field/Phone/Phone.tsx +7 -5
  39. package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
  40. package/lib/field/RichText/RichText.css +79 -0
  41. package/lib/field/RichText/RichText.tsx +3 -1
  42. package/lib/field/ScalarList/ScalarList.tsx +2 -3
  43. package/lib/field/SelectableCard/SelectableCard.tsx +189 -0
  44. package/lib/field/SelectableCard/index.tsx +1 -0
  45. package/lib/field/SelectableCard/utils.tsx +223 -0
  46. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  47. package/lib/field/SemanticLink/utils.ts +1 -1
  48. package/lib/field/TextArea/TextArea.tsx +5 -7
  49. package/lib/field/TextContent/TextContent.tsx +1 -2
  50. package/lib/field/TextInput/TextInput.tsx +5 -7
  51. package/lib/field/Time/Time.tsx +3 -7
  52. package/lib/field/URL/URL.tsx +5 -7
  53. package/lib/field/UserReference/UserReference.tsx +2 -3
  54. package/lib/helpers/attachmentShared.ts +6 -0
  55. package/lib/helpers/common-utils.ts +3 -4
  56. package/lib/helpers/data_page.ts +0 -1
  57. package/lib/helpers/field-group-utils.ts +1 -1
  58. package/lib/helpers/formatters/Currency.ts +9 -4
  59. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  60. package/lib/helpers/object-utils.ts +10 -0
  61. package/lib/helpers/simpleTableHelpers.ts +118 -6
  62. package/lib/helpers/utils.ts +8 -1
  63. package/lib/helpers/versionHelpers.ts +0 -1
  64. package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
  65. package/lib/infra/Assignment/Assignment.tsx +47 -31
  66. package/lib/infra/Assignment/useValidationBanner.ts +29 -0
  67. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  68. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +22 -102
  69. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
  70. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +12 -6
  71. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +8 -13
  72. package/lib/infra/Containers/container-helpers.ts +47 -1
  73. package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
  74. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  75. package/lib/infra/DeferLoad/DeferLoad.tsx +26 -13
  76. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  77. package/lib/infra/MultiStep/MultiStep.css +48 -70
  78. package/lib/infra/MultiStep/MultiStep.tsx +27 -53
  79. package/lib/infra/NavBar/NavBar.css +1 -1
  80. package/lib/infra/NavBar/NavBar.tsx +49 -34
  81. package/lib/infra/Reference/Reference.tsx +8 -4
  82. package/lib/infra/Region/Region.tsx +1 -1
  83. package/lib/infra/RootContainer/RootContainer.tsx +6 -8
  84. package/lib/infra/Stages/Stages.tsx +3 -4
  85. package/lib/infra/View/View.tsx +9 -9
  86. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
  87. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
  88. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
  89. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  90. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  91. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  92. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  93. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  94. package/lib/template/AdvancedSearch/index.tsx +1 -0
  95. package/lib/template/AppShell/AppShell.css +1 -5
  96. package/lib/template/AppShell/AppShell.tsx +16 -17
  97. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  98. package/lib/template/CaseSummary/CaseSummary.tsx +25 -43
  99. package/lib/template/CaseView/CaseView.tsx +28 -35
  100. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  101. package/lib/template/Confirmation/Confirmation.tsx +2 -3
  102. package/lib/template/DataReference/DataReference.tsx +312 -106
  103. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
  104. package/lib/template/DataReference/SearchForm.tsx +149 -0
  105. package/lib/template/DataReference/utils.ts +90 -0
  106. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  107. package/lib/template/DefaultForm/utils/index.ts +1 -3
  108. package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
  109. package/lib/template/DefaultPage/index.tsx +1 -0
  110. package/lib/template/Details/Details/Details.tsx +11 -11
  111. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  112. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  113. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  114. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
  115. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -6
  116. package/lib/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
  117. package/lib/template/HierarchicalForm/hooks.ts +224 -0
  118. package/lib/template/HierarchicalForm/index.tsx +1 -0
  119. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  120. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  121. package/lib/template/ListPage/ListPage.tsx +1 -1
  122. package/lib/template/ListView/ListView.tsx +342 -204
  123. package/lib/template/ListView/hooks.ts +1 -5
  124. package/lib/template/ListView/utils.ts +38 -5
  125. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +17 -2
  126. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  127. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  128. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  129. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  130. package/lib/template/ObjectPage/index.tsx +1 -0
  131. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  132. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  133. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  134. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  135. package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
  136. package/lib/template/SelfServiceCaseView/index.tsx +1 -0
  137. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
  138. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +45 -34
  139. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
  140. package/lib/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +179 -0
  141. package/lib/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
  142. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
  143. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  144. package/lib/template/SubTabs/tabUtils.ts +118 -1
  145. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  146. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  147. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  148. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  149. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  150. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  151. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  152. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  153. package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
  154. package/lib/template/utils.tsx +58 -0
  155. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  156. package/lib/widget/Attachment/Attachment.css +6 -8
  157. package/lib/widget/Attachment/Attachment.tsx +303 -225
  158. package/lib/widget/Attachment/Attachment.types.ts +96 -0
  159. package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
  160. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  161. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  162. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  163. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  164. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
  165. package/lib/widget/Followers/Followers.tsx +2 -4
  166. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  167. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  168. package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
  169. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  170. package/lib/widget/ToDo/ToDo.css +1 -13
  171. package/lib/widget/ToDo/ToDo.tsx +37 -36
  172. package/package.json +1 -1
  173. package/lib/helpers/attachmentHelpers.ts +0 -76
@@ -1,10 +1,12 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
2
  import React, { createElement, useContext, useEffect, useState } from 'react';
2
3
  import { Box, CircularProgress } from '@mui/material';
3
4
 
4
5
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
6
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
6
7
  import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
7
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
+ import { configureBrowserBookmark } from '@pega/react-sdk-components/lib/components/infra/Containers/container-helpers';
8
10
 
9
11
  interface ViewContainerProps extends PConnProps {
10
12
  // If any, enter additional props that only exist on this component
@@ -15,14 +17,10 @@ interface ViewContainerProps extends PConnProps {
15
17
  limit?: number;
16
18
  }
17
19
 
18
- // ViewContainer can emit View
19
- // import View from '../View';
20
-
21
- //
22
- // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
23
- // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
24
- // is totally at your own risk.
25
- //
20
+ /**
21
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
22
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
23
+ */
26
24
 
27
25
  export default function ViewContainer(props: ViewContainerProps) {
28
26
  // const { getPConnect, children, routingInfo, name } = props;
@@ -131,10 +129,7 @@ export default function ViewContainer(props: ViewContainerProps) {
131
129
 
132
130
  if (!displayOnlyFA) {
133
131
  // configureForBrowserBookmark not applicable in Embedded mode
134
- PCore.configureForBrowserBookmark({
135
- ...objectForAddContainer,
136
- defaultViewLabel
137
- });
132
+ configureBrowserBookmark(pConn);
138
133
  }
139
134
  }, []);
140
135
 
@@ -1,6 +1,52 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
1
  export const isContainerInitialized = pConnect => {
3
2
  const context = pConnect.getContextName();
4
3
  const containerName = pConnect.getContainerName();
5
4
  return PCore.getContainerUtils().isContainerInitialized(context, containerName);
6
5
  };
6
+
7
+ export const configureBrowserBookmark = pConnect => {
8
+ const context = pConnect.getContextName();
9
+ const containerName = pConnect.getContainerName();
10
+ const envInfo = PCore.getEnvironmentInfo();
11
+ const { APP } = PCore.getConstants();
12
+
13
+ const navPages = pConnect.getValue('pyPortal.pyPrimaryNavPages');
14
+ let ruleName = '';
15
+ let className = '';
16
+ let defaultViewLabel = '';
17
+
18
+ const isNextGenLandingPageRouting = (envInfo?.environmentInfoObject as any)?.pyExecutionRuntimeName === (APP as any).INFINITY_RUNTIME;
19
+
20
+ if (Array.isArray(navPages) && navPages.length > 0) {
21
+ const firstNavPage = navPages[0];
22
+ const nestedNavPage = firstNavPage.NavigationPages?.[0];
23
+
24
+ if (isNextGenLandingPageRouting) {
25
+ if (nestedNavPage?.pyRuleName) {
26
+ ruleName = nestedNavPage.pyRuleName;
27
+ className = nestedNavPage.pyClassName || '';
28
+ } else if (firstNavPage?.pyRuleName) {
29
+ ruleName = firstNavPage.pyRuleName;
30
+ className = firstNavPage.pyClassName || '';
31
+ } else if (nestedNavPage?.pyLabel) {
32
+ defaultViewLabel = nestedNavPage.pyLabel;
33
+ } else if (firstNavPage?.pyLabel) {
34
+ defaultViewLabel = firstNavPage.pyLabel;
35
+ }
36
+ } else if (nestedNavPage?.pyLabel) {
37
+ defaultViewLabel = nestedNavPage.pyLabel;
38
+ } else if (firstNavPage?.pyLabel) {
39
+ defaultViewLabel = firstNavPage.pyLabel;
40
+ }
41
+ }
42
+
43
+ PCore.configureForBrowserBookmark({
44
+ context,
45
+ containerName,
46
+ acName: containerName,
47
+ semanticURL: '',
48
+ defaultViewLabel,
49
+ ruleName,
50
+ className
51
+ });
52
+ };
@@ -1,12 +1,10 @@
1
- /* eslint-disable @typescript-eslint/no-shadow */
2
- import { forwardRef, PropsWithChildren, useEffect, useRef, useState } from 'react';
1
+ import { forwardRef, type PropsWithChildren, useEffect, useRef, useState } from 'react';
3
2
  import { TextField } from '@mui/material';
4
- import { v4 as uuidv4 } from 'uuid';
5
3
  import { debounce } from 'throttle-debounce';
6
4
  import DatePicker from 'react-datepicker';
7
5
 
8
6
  import { createFilter, combineFilters, getFormattedDate, getFilterExpression } from './filterUtils';
9
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
8
 
11
9
  import 'react-datepicker/dist/react-datepicker.css';
12
10
 
@@ -20,7 +18,7 @@ interface DashboardFilterProps extends PConnProps {
20
18
 
21
19
  export default function DashboardFilter(props: PropsWithChildren<DashboardFilterProps>) {
22
20
  const { children, name, filterProp, type = '', metadata = null, getPConnect } = props;
23
- const { current: filterId } = useRef(uuidv4());
21
+ const { current: filterId } = useRef(crypto.randomUUID());
24
22
 
25
23
  const [startDate, setStartDate] = useState(null);
26
24
  const [endDate, setEndDate] = useState(null);
@@ -110,7 +108,6 @@ export default function DashboardFilter(props: PropsWithChildren<DashboardFilter
110
108
 
111
109
  const label = metadata.config.label.substring(3);
112
110
 
113
- // eslint-disable-next-line react/no-unstable-nested-components
114
111
  const CustomDateInput = forwardRef<HTMLInputElement, TextProps>(({ value, onClick }, ref: any) => (
115
112
  <TextField label={label} variant='outlined' fullWidth value={value} size='small' onClick={onClick} ref={ref}>
116
113
  {value}
@@ -1,7 +1,6 @@
1
- /* eslint-disable prefer-template */
2
1
  /** This file contains various utility methods to generate filter components, regionLayout data, filter expressions, etc. */
3
2
 
4
- import { Grid, Link } from '@mui/material';
3
+ import { Grid2, Link } from '@mui/material';
5
4
 
6
5
  import DashboardFilter from './DashboardFilter';
7
6
 
@@ -77,7 +76,7 @@ export const buildFilterComponents = (getPConnect, allFilters) => {
77
76
  const filterComponents = allFilters.children.map((filter, index) => createFilterComponent(getPConnect, filter, index));
78
77
  if (filterComponents && filterComponents.length > 0) {
79
78
  filterComponents.push(
80
- <Grid style={{ display: 'flex', alignItems: 'center' }}>
79
+ <Grid2 style={{ display: 'flex', alignItems: 'center' }}>
81
80
  <Link
82
81
  style={{ cursor: 'pointer' }}
83
82
  onClick={() => {
@@ -87,7 +86,7 @@ export const buildFilterComponents = (getPConnect, allFilters) => {
87
86
  >
88
87
  Clear All
89
88
  </Link>
90
- </Grid>
89
+ </Grid2>
91
90
  );
92
91
  }
93
92
  return filterComponents;
@@ -4,7 +4,7 @@ import makeStyles from '@mui/styles/makeStyles';
4
4
 
5
5
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
6
6
 
7
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  interface DeferLoadProps extends PConnProps {
10
10
  // If any, enter additional props that only exist on this component
@@ -13,13 +13,13 @@ interface DeferLoadProps extends PConnProps {
13
13
  isTab: boolean;
14
14
  deferLoadId: string;
15
15
  lastUpdateCaseTime: any;
16
+ template?: string;
16
17
  }
17
18
 
18
- //
19
- // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
20
- // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
21
- // is totally at your own risk.
22
- //
19
+ /**
20
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
21
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
22
+ */
23
23
 
24
24
  const useStyles = makeStyles(theme => ({
25
25
  root: {
@@ -35,7 +35,7 @@ const useStyles = makeStyles(theme => ({
35
35
  }));
36
36
 
37
37
  export default function DeferLoad(props: DeferLoadProps) {
38
- const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime } = props;
38
+ const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime, template } = props;
39
39
  const [content, setContent] = useState<any>(null);
40
40
  const [isLoading, setLoading] = useState(true);
41
41
  const [currentLoadedAssignment, setCurrentLoadedAssignment] = useState('');
@@ -75,7 +75,7 @@ export default function DeferLoad(props: DeferLoadProps) {
75
75
  updateData: isContainerPreview
76
76
  });
77
77
 
78
- const onResponse = data => {
78
+ const onResponse = (data: any, isEditable = false) => {
79
79
  setLoading(false);
80
80
  if (deferLoadId) {
81
81
  PCore.getDeferLoadManager().start(
@@ -92,11 +92,16 @@ export default function DeferLoad(props: DeferLoadProps) {
92
92
  meta: data,
93
93
  options: {
94
94
  context: pConnect.getContextName(),
95
- pageReference: pConnect.getPageReference()
95
+ pageReference: pConnect.getPageReference(),
96
+ target: pConnect.getTarget(),
97
+ hasForm: true,
98
+ viewName: (pConnect as any).viewName
96
99
  }
97
100
  };
98
101
  const configObject = PCore.createPConnect(config);
99
- configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
102
+ if (!isEditable) {
103
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
104
+ }
100
105
  setContent(createElement(createPConnectComponent(), configObject));
101
106
  if (deferLoadId) {
102
107
  PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
@@ -115,14 +120,13 @@ export default function DeferLoad(props: DeferLoadProps) {
115
120
  .getActionsApi()
116
121
  .showData(name, dataContext, dataContextParameters, {
117
122
  skipSemanticUrl: true,
118
- // @ts-ignore
123
+ // @ts-expect-error
119
124
  isDeferLoaded: true
120
125
  })
121
126
  .then(data => {
122
127
  onResponse(data);
123
128
  });
124
129
  } else {
125
- // eslint-disable-next-line no-console
126
130
  console.error('Cannot load the defer loaded view without container information');
127
131
  }
128
132
  } else if (resourceType === PAGE) {
@@ -133,6 +137,16 @@ export default function DeferLoad(props: DeferLoadProps) {
133
137
  .then(data => {
134
138
  onResponse(data);
135
139
  });
140
+ } else if (template === 'HierarchicalForm') {
141
+ const root = {
142
+ config: {
143
+ context: pConnect.getPageReference(),
144
+ name,
145
+ type: 'view'
146
+ },
147
+ type: 'reference'
148
+ };
149
+ onResponse(root, true);
136
150
  } else {
137
151
  getPConnect()
138
152
  .getActionsApi()
@@ -141,7 +155,6 @@ export default function DeferLoad(props: DeferLoadProps) {
141
155
  onResponse(data.root);
142
156
  })
143
157
  .catch(error => {
144
- // eslint-disable-next-line no-console
145
158
  console.log(`deferload: ${error}`);
146
159
  });
147
160
  }
@@ -1,4 +1,4 @@
1
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
2
 
3
3
  interface ErrorBoundaryProps extends PConnProps {
4
4
  // If any, enter additional props that only exist on this component
@@ -23,7 +23,6 @@ export default function ErrorBoundary(props: ErrorBoundaryProps) {
23
23
  const pConn = getPConnect();
24
24
 
25
25
  if (!isInternalError) {
26
- // eslint-disable-next-line no-console
27
26
  console.error(`
28
27
  ${localizedVal('Unable to load the component', localeCategory)} ${pConn.getComponentName()}
29
28
  ${localizedVal('This might be due to the view metadata getting corrupted or the component file missing.', localeCategory)}
@@ -37,7 +36,6 @@ export default function ErrorBoundary(props: ErrorBoundaryProps) {
37
36
 
38
37
  if (pConn.getContainerName() === WORK_AREA || pConn.isInsideList() === true || pConn.getContainerName() === 'modal') {
39
38
  const { publish } = PCore.getPubSubUtils();
40
- // @ts-ignore - second parameter “payload” for publish method should be optional
41
39
  publish(ERROR_WHILE_RENDERING);
42
40
  return null;
43
41
  }
@@ -17,7 +17,7 @@
17
17
 
18
18
  .psdk-current-svg-icon {
19
19
  width: 1rem;
20
- filter: var(--app-primary-color-filter);
20
+ filter: var(--svg-color);
21
21
  }
22
22
 
23
23
  .psdk-not-current-svg-icon {
@@ -40,7 +40,7 @@ mat-horizontal-stepper {
40
40
 
41
41
  .psdk-sub-step-not-current {
42
42
  padding-left: 0.625rem;
43
- color: rgba(0, 0, 0, 0.54);
43
+ color: var(--step-label-color);
44
44
  }
45
45
 
46
46
  .psdk-flow-container-top {
@@ -79,36 +79,37 @@ mat-horizontal-stepper {
79
79
 
80
80
  .psdk-vertical-step-icon {
81
81
  margin-right: 12px;
82
- background-color: var(--app-neutral-color);
83
- color: #fff;
84
82
  border-radius: 50%;
85
83
  height: 24px;
86
84
  width: 24px;
87
- flex-shrink: 0;
88
85
  position: relative;
89
86
  }
90
87
 
88
+ .success .psdk-vertical-step-icon {
89
+ background-color: var(--stepper-completed-bg-color);
90
+ color: var(--app-text-color);
91
+ }
92
+
93
+ .future .psdk-vertical-step-icon {
94
+ color: var(--app-neutral-color);
95
+ border: 1px solid var(--app-neutral-color);
96
+ }
97
+
98
+ .current .psdk-vertical-step-icon {
99
+ background-color: var(--app-primary-color);
100
+ color: var(--app-text-color);
101
+ flex-shrink: 0;
102
+ }
103
+
91
104
  .psdk-vertical-step-icon-content {
92
105
  position: absolute;
93
106
  top: 50%;
94
107
  left: 50%;
95
108
  transform: translate(-50%, -50%);
96
- color: #fff;
97
- }
98
-
99
- .psdk-vertical-step-icon-selected {
100
- margin-right: 12px;
101
- background-color: var(--app-primary-color);
102
- color: #fff;
103
- border-radius: 50%;
104
- height: 24px;
105
- width: 24px;
106
- flex-shrink: 0;
107
- position: relative;
108
109
  }
109
110
 
110
111
  .psdk-vertical-step-label {
111
- color: rgba(0, 0, 0, 0.54);
112
+ color: var(--step-label-color);
112
113
  display: inline-block;
113
114
  white-space: nowrap;
114
115
  overflow: hidden;
@@ -119,16 +120,8 @@ mat-horizontal-stepper {
119
120
  font-weight: 500;
120
121
  }
121
122
 
122
- .psdk-vertical-step-label-selected {
123
- color: rgba(0, 0, 0, 0.87);
124
- display: inline-block;
125
- white-space: nowrap;
126
- overflow: hidden;
127
- text-overflow: ellipsis;
128
- min-width: 50px;
129
- vertical-align: middle;
130
- font-size: 14px;
131
- font-weight: 500;
123
+ .current .psdk-vertical-step-label {
124
+ color: var(--text-primary-color);
132
125
  }
133
126
 
134
127
  .psdk-vertical-step-body {
@@ -150,7 +143,7 @@ mat-horizontal-stepper {
150
143
  border-left-style: solid;
151
144
  top: -16px;
152
145
  bottom: -16px;
153
- border-left-color: rgba(0, 0, 0, 0.12);
146
+ border-left-color: var(--app-neutral-color);
154
147
  }
155
148
 
156
149
  .psdk-horizontal-stepper {
@@ -162,33 +155,39 @@ mat-horizontal-stepper {
162
155
  white-space: nowrap;
163
156
  display: flex;
164
157
  align-items: center;
165
- text-align: left;
166
158
  }
167
159
 
168
160
  .psdk-horizontal-step-header {
169
- overflow: hidden;
170
161
  outline: none;
171
162
  cursor: pointer;
172
163
  position: relative;
173
164
  box-sizing: content-box;
174
165
  display: flex;
175
166
  height: 72px;
176
- overflow: hidden;
177
167
  align-items: center;
178
- padding: 0 24px;
179
168
  }
180
169
 
181
170
  .psdk-horizontal-step-icon {
182
- background-color: var(--app-neutral-color);
183
- color: #fff;
171
+ color: white;
184
172
  border-radius: 50%;
185
173
  height: 24px;
186
174
  width: 24px;
187
- flex-shrink: 0;
188
175
  position: relative;
189
- display: block;
190
- margin-right: 8px;
191
- flex: none;
176
+ }
177
+
178
+ .future .psdk-horizontal-step-icon {
179
+ color: var(--app-neutral-color);
180
+ border: 1px solid var(--app-neutral-color);
181
+ }
182
+
183
+ .current .psdk-horizontal-step-icon {
184
+ color: var(--app-text-color);
185
+ background-color: var(--app-primary-color);
186
+ }
187
+
188
+ .success .psdk-horizontal-step-icon {
189
+ color: var(--app-text-color);
190
+ background-color: var(--stepper-completed-bg-color);
192
191
  }
193
192
 
194
193
  .psdk-horizontal-step-icon-content {
@@ -199,45 +198,24 @@ mat-horizontal-stepper {
199
198
  transform: translate(-50%, -50%);
200
199
  }
201
200
 
202
- .psdk-horizontal-step-icon-selected {
203
- background-color: var(--app-primary-color);
204
- color: #fff;
205
- border-radius: 50%;
206
- height: 24px;
207
- width: 24px;
208
- flex-shrink: 0;
209
- position: relative;
210
- display: block;
211
- margin-right: 8px;
212
- flex: none;
213
- }
214
-
215
201
  .psdk-horizontal-step-label {
216
- color: rgba(0, 0, 0, 0.54);
217
- display: inline-block;
218
- min-width: 50px;
219
- vertical-align: middle;
202
+ color: var(--text-secondary-color);
220
203
  font-size: 14px;
221
204
  font-weight: 500;
222
205
  white-space: initial;
223
206
  }
224
207
 
225
- .psdk-horizontal-step-label-selected {
226
- color: rgba(0, 0, 0, 0.87);
227
- display: inline-block;
228
- min-width: 50px;
229
- vertical-align: middle;
230
- font-size: 14px;
231
- font-weight: 500;
232
- white-space: initial;
208
+ .current .psdk-horizontal-step-label {
209
+ color: var(--text-primary-color);
210
+ margin-left: 8px;
233
211
  }
234
212
 
235
- .psdk-horizontal-step-line {
236
- border-top-color: rgba(0, 0, 0, 0.12);
237
- border-top-width: 1px;
238
- border-top-style: solid;
213
+ .flex-auto {
239
214
  flex: auto;
240
- height: 0;
241
- margin: 0 -16px;
215
+ }
216
+
217
+ .psdk-horizontal-step-line {
218
+ border-top: 1px solid var(--app-neutral-color);
242
219
  min-width: 32px;
220
+ margin: 0px 8px;
243
221
  }
@@ -1,7 +1,7 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React, { type PropsWithChildren } from 'react';
2
2
 
3
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';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  import './MultiStep.css';
7
7
 
@@ -27,51 +27,27 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
27
27
  currentStep = arNavigationSteps[lastActiveStepIndex >= 0 ? lastActiveStepIndex : 0];
28
28
  }
29
29
 
30
- // const svgCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
31
- // const svgNotCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
32
-
33
- function _getVIconClass(status): string {
34
- if (status === 'current') {
35
- return 'psdk-vertical-step-icon-selected';
36
- }
37
-
38
- return 'psdk-vertical-step-icon';
39
- }
40
-
41
- function _getVLabelClass(status): string {
42
- if (status === 'current') {
43
- return 'psdk-vertical-step-label-selected';
44
- }
45
-
46
- return 'psdk-vertical-step-label';
47
- }
48
-
49
30
  function _getVBodyClass(index: number): string {
50
- if (index < arNavigationSteps.length - 1) {
51
- return 'psdk-vertical-step-body psdk-vertical-step-line';
52
- }
31
+ const baseClass = 'psdk-vertical-step-body';
32
+ const isNotLastStep = index < arNavigationSteps.length - 1;
53
33
 
54
- return 'psdk-vertical-step-body';
34
+ return isNotLastStep ? `${baseClass} psdk-vertical-step-line` : baseClass;
55
35
  }
56
36
 
57
- function _getHIconClass(step): string {
58
- if (step.ID === currentStep?.ID) {
59
- return 'psdk-horizontal-step-icon-selected';
60
- }
61
-
62
- return 'psdk-horizontal-step-icon';
63
- }
37
+ function _getAutoFlexClass(currentStep): string {
38
+ const currentStepIndex = arNavigationSteps.findIndex(step => step.ID === currentStep?.ID);
39
+ const totalSteps = arNavigationSteps.length;
40
+ const lastStep = arNavigationSteps[totalSteps - 1];
64
41
 
65
- function _getHLabelClass(step): string {
66
- if (step.ID === currentStep?.ID) {
67
- return 'psdk-horizontal-step-label-selected';
68
- }
42
+ // Apply flex-auto class if current step is active OR if current step is second-to-last and the last step is active
43
+ const isCurrentStepActive = currentStep.visited_status === 'current';
44
+ const isSecondToLastWithActiveLastStep = currentStepIndex === totalSteps - 2 && lastStep?.visited_status === 'current';
69
45
 
70
- return 'psdk-horizontal-step-label';
46
+ return isCurrentStepActive || isSecondToLastWithActiveLastStep ? 'flex-auto' : '';
71
47
  }
72
48
 
73
- function _showHLine(index: number): boolean {
74
- return index < arNavigationSteps.length - 1;
49
+ function isLastStep(index: number): boolean {
50
+ return index === arNavigationSteps.length - 1;
75
51
  }
76
52
 
77
53
  function buttonPress(sAction: string, sButtonType: string) {
@@ -86,13 +62,13 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
86
62
  return (
87
63
  <React.Fragment key={mainStep.actionID}>
88
64
  <div className='psdk-vertical-step'>
89
- <div className='psdk-vertical-step-header'>
90
- <div className={_getVIconClass(mainStep.visited_status)}>
65
+ <div className={`psdk-vertical-step-header ${mainStep.visited_status}`}>
66
+ <div className={`psdk-vertical-step-icon`}>
91
67
  <div className='psdk-vertical-step-icon-content'>
92
68
  <span>{index + 1}</span>
93
69
  </div>
94
70
  </div>
95
- <div className={_getVLabelClass(mainStep.visited_status)}>{mainStep.name}</div>
71
+ <div className='psdk-vertical-step-label'>{mainStep.visited_status === 'current' && mainStep.name}</div>
96
72
  </div>
97
73
  <div className={_getVBodyClass(index)}>
98
74
  {mainStep?.steps && (
@@ -122,9 +98,11 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
122
98
  </ul>
123
99
  )}
124
100
  {!mainStep?.steps && mainStep.visited_status === 'current' && (
125
- <AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
126
- {children}
127
- </AssignmentCard>
101
+ <div style={{ paddingLeft: 20 }}>
102
+ <AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
103
+ {children}
104
+ </AssignmentCard>
105
+ </div>
128
106
  )}
129
107
  </div>
130
108
  </div>
@@ -138,19 +116,15 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
138
116
  {arNavigationSteps.map((mainStep, index) => {
139
117
  return (
140
118
  <React.Fragment key={mainStep.actionID}>
141
- <div className='psdk-horizontal-step-header'>
142
- <div className={_getHIconClass(mainStep)}>
119
+ <div className={`psdk-horizontal-step-header ${mainStep.visited_status}`}>
120
+ <div className='psdk-horizontal-step-icon'>
143
121
  <div className='psdk-horizontal-step-icon-content'>
144
122
  <span>{index + 1}</span>
145
123
  </div>
146
124
  </div>
147
- <div className={_getHLabelClass(mainStep)}>
148
- <div className='psdk-horizontal-step-text-label' id='selected-label'>
149
- {mainStep.name}
150
- </div>
151
- </div>
125
+ <div className='psdk-horizontal-step-label'>{mainStep.visited_status === 'current' && mainStep.name}</div>
152
126
  </div>
153
- {_showHLine(index) && <div className='psdk-horizontal-step-line' />}
127
+ {!isLastStep(index) && <div className={`psdk-horizontal-step-line ${_getAutoFlexClass(mainStep)}`} />}
154
128
  </React.Fragment>
155
129
  );
156
130
  })}
@@ -154,7 +154,7 @@
154
154
  text-align: center;
155
155
  display: inline-flex;
156
156
  background: var(--app-neutral-color);
157
- color: white;
157
+ color: var(--app-text-color);
158
158
  font-weight: normal;
159
159
  font-size: 1rem;
160
160
  }