@pega/dx-component-builder-sdk 24.2.13 → 24.2.15

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 (128) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/index.tsx.mustache +1 -1
  3. package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +7 -4
  4. package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +3 -2
  5. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +1 -0
  6. package/src/tasks/publish/helper.js +1 -1
  7. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -1
  8. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  9. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +4 -4
  10. package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +1 -4
  11. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +8 -5
  12. package/tests/assets/sdk-r/components/create/override-sdk/field/Date/Date.tsx +5 -1
  13. package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/DateTime.tsx +13 -5
  14. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +7 -2
  15. package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/Dropdown.tsx +34 -24
  16. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +6 -2
  17. package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/RadioButtons.tsx +3 -5
  18. package/tests/assets/sdk-r/components/create/override-sdk/field/ScalarList/ScalarList.tsx +1 -2
  19. package/tests/assets/sdk-r/components/create/override-sdk/field/Time/Time.tsx +1 -1
  20. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +1 -3
  21. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +2 -6
  22. package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +2 -3
  23. package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/filterUtils.tsx +1 -3
  24. package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -5
  25. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx +18 -108
  26. package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/helpers.ts +1 -5
  27. package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +3 -1
  28. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +1 -6
  29. package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/RootContainer.tsx +1 -1
  30. package/tests/assets/sdk-r/components/create/override-sdk/infra/SimpleView/helper.ts +1 -1
  31. package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.tsx +6 -6
  32. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +5 -4
  33. package/tests/assets/sdk-r/components/create/override-sdk/template/Confirmation/Confirmation.tsx +1 -1
  34. package/tests/assets/sdk-r/components/create/override-sdk/template/DynamicTabs/DynamicTabs.tsx +0 -1
  35. package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -5
  36. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +13 -9
  37. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/hooks.ts +2 -0
  38. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +0 -1
  39. package/tests/assets/sdk-r/components/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +0 -1
  40. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTable/SimpleTable.tsx +0 -2
  41. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +111 -94
  42. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +2 -4
  43. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.css +1 -0
  44. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +91 -73
  45. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
  46. package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +0 -1
  47. package/tests/assets/sdk-r/components/create/override-sdk/widget/SummaryItem/SummaryItem.tsx +1 -1
  48. package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/ToDo.tsx +1 -1
  49. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/demo.stories.tsx +0 -1
  50. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/demo.stories.tsx +0 -16
  51. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/demo.stories.tsx +0 -17
  52. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/demo.stories.tsx +0 -1
  53. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/demo.stories.tsx +0 -1
  54. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/mock.ts +1 -0
  55. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +9 -20
  56. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/demo.stories.tsx +0 -1
  57. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/demo.stories.tsx +0 -1
  58. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/mock.ts +1 -0
  59. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/demo.stories.tsx +1 -2
  60. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/demo.stories.tsx +0 -1
  61. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +0 -1
  62. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/demo.stories.tsx +0 -1
  63. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/demo.stories.tsx +0 -1
  64. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/demo.stories.tsx +0 -1
  65. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +0 -1
  66. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/demo.stories.tsx +0 -1
  67. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +10 -0
  68. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -13
  69. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +10 -32
  70. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +10 -22
  71. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +10 -21
  72. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +0 -14
  73. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +0 -24
  74. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +0 -24
  75. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/demo.stories.tsx +0 -14
  76. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +2 -6
  77. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +1 -1
  78. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/demo.stories.tsx +0 -14
  79. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +7 -4
  80. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +3 -2
  81. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +8 -28
  82. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +10 -16
  83. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +8 -28
  84. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +10 -20
  85. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +10 -20
  86. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +1 -0
  87. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +9 -19
  88. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  89. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +4 -4
  90. package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +1 -4
  91. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +8 -5
  92. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Date/Date.tsx +5 -1
  93. package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/DateTime.tsx +13 -5
  94. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +7 -2
  95. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/Dropdown.tsx +34 -24
  96. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +6 -2
  97. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +3 -5
  98. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ScalarList/ScalarList.tsx +1 -2
  99. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/Time.tsx +1 -1
  100. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +1 -3
  101. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +2 -6
  102. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +2 -3
  103. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/filterUtils.tsx +1 -3
  104. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -5
  105. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/FlowContainer.tsx +18 -108
  106. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/helpers.ts +1 -5
  107. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +3 -1
  108. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +1 -6
  109. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/RootContainer.tsx +1 -1
  110. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/SimpleView/helper.ts +1 -1
  111. package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.tsx +6 -6
  112. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +5 -4
  113. package/tests/assets/sdk-r/components/createAll/override-sdk/template/Confirmation/Confirmation.tsx +1 -1
  114. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DynamicTabs/DynamicTabs.tsx +0 -1
  115. package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -5
  116. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +13 -9
  117. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/hooks.ts +2 -0
  118. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +0 -1
  119. package/tests/assets/sdk-r/components/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +0 -1
  120. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTable/SimpleTable.tsx +0 -2
  121. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +111 -94
  122. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +2 -4
  123. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.css +1 -0
  124. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +91 -73
  125. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
  126. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +0 -1
  127. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/SummaryItem/SummaryItem.tsx +1 -1
  128. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/ToDo.tsx +1 -1
@@ -6,12 +6,12 @@ import { Alert, Card, CardHeader, Avatar, Typography } from '@mui/material';
6
6
 
7
7
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
8
8
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
9
- import { isContainerInitialized } from '@pega/react-sdk-components/lib/components/helpers';
9
+ import { isContainerInitialized } from '@pega/react-sdk-components/lib/components/infra/Containers/container-helpers';
10
10
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
11
- import { withSimpleViewContainerRenderer } from '../SimpleView/SimpleView';
11
+ import { withSimpleViewContainerRenderer } from '@pega/react-sdk-components/lib/components/infra/Containers/SimpleView/SimpleView';
12
12
 
13
13
  import { addContainerItem, getToDoAssignments, showBanner, hasContainerItems } from './helpers';
14
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
14
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
15
15
  import { LocalizationProvider } from '@mui/x-date-pickers';
16
16
  import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
17
17
 
@@ -58,7 +58,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
58
58
  const AlertBanner = getComponentFromMap('AlertBanner');
59
59
 
60
60
  const pCoreConstants = PCore.getConstants();
61
- const PCoreVersion = PCore.getPCoreVersion();
62
61
  const { TODO } = pCoreConstants;
63
62
  const todo_headerText = 'To do';
64
63
 
@@ -78,6 +77,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
78
77
  const getPConnect = getPConnectOfActiveContainerItem || getPConnectOfFlowContainer;
79
78
  const thePConn = getPConnect();
80
79
  const containerName = assignmentNames && assignmentNames.length > 0 ? assignmentNames[0] : '';
80
+ const bShowBanner = showBanner(getPConnect);
81
81
  // const [init, setInit] = useState(true);
82
82
  // const [fcState, setFCState] = useState({ hasError: false });
83
83
 
@@ -104,7 +104,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
104
104
  function getBuildName(): string {
105
105
  const ourPConn = getPConnect();
106
106
 
107
- // let { getPConnect, name } = this.pConn$.pConn;
108
107
  const context = ourPConn.getContextName();
109
108
  let viewContainerName = ourPConn.getContainerName();
110
109
 
@@ -113,31 +112,16 @@ export const FlowContainer = (props: FlowContainerProps) => {
113
112
  }
114
113
 
115
114
  function getTodoVisibility() {
116
- const caseViewMode = getPConnect().getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
115
+ const caseViewMode = getPConnect().getValue('context_data.caseViewMode');
117
116
  if (caseViewMode && caseViewMode === 'review') {
118
117
  return true;
119
118
  }
120
- // eslint-disable-next-line sonarjs/prefer-single-boolean-return
121
- if (caseViewMode && caseViewMode === 'perform') {
122
- return false;
123
- }
124
-
125
- return true;
119
+ return !(caseViewMode && caseViewMode === 'perform');
126
120
  }
127
121
 
128
122
  function initComponent() {
129
123
  const ourPConn = getPConnect();
130
124
 
131
- // debugging/investigation help
132
- // console.log(`${ourPConn.getComponentName()}: children update for main draw`);
133
-
134
- // const oData = ourPConn.getDataObject();
135
-
136
- // const activeActionLabel = "";
137
- // const child0_getPConnect = arNewChildren[0].getPConnect();
138
-
139
- // this.templateName$ = this.configProps$["template"];
140
-
141
125
  // debugger;
142
126
  setShowTodo(getTodoVisibility());
143
127
 
@@ -161,67 +145,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
161
145
  }
162
146
  }, [isInitialized, hasItems]);
163
147
 
164
- function isCaseWideLocalAction() {
165
- const ourPConn = getPConnect();
166
-
167
- const actionID = ourPConn.getValue(pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID, ''); // 2nd arg empty string until typedefs properly allow optional
168
- const caseActions = ourPConn.getValue(pCoreConstants.CASE_INFO.AVAILABLEACTIONS, ''); // 2nd arg empty string until typedefs properly allow optional
169
- let bCaseWideAction = false;
170
- if (caseActions && actionID) {
171
- const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
172
- if (actionObj) {
173
- bCaseWideAction = actionObj.type === 'Case';
174
- }
175
- }
176
- return bCaseWideAction;
177
- }
178
-
179
- function hasChildCaseAssignments() {
180
- const ourPConn = getPConnect();
181
-
182
- const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS, ''); // 2nd arg empty string until typedefs properly allow optional
183
- // const allAssignments = [];
184
- // eslint-disable-next-line sonarjs/prefer-single-boolean-return
185
- if (childCases && childCases.length > 0) {
186
- return true;
187
- }
188
- return false;
189
- }
190
-
191
- function hasAssignments() {
192
- const ourPConn = getPConnect();
193
-
194
- let bHasAssignments = false;
195
- const assignmentsList: any[] = ourPConn.getValue(pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS, ''); // 2nd arg empty string until typedefs properly allow optional
196
- const isEmbedded = window.location.href.includes('embedded');
197
- let bAssignmentsForThisOperator = false;
198
- // 8.7 includes assignments in Assignments List that may be assigned to
199
- // a different operator. So, see if there are any assignments for
200
- // the current operator
201
- if (PCoreVersion?.includes('8.7') || isEmbedded) {
202
- const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
203
- for (const assignment of assignmentsList) {
204
- if (assignment.assigneeInfo.ID === thisOperator) {
205
- bAssignmentsForThisOperator = true;
206
- }
207
- }
208
- } else {
209
- bAssignmentsForThisOperator = true;
210
- }
211
- // Bail out if there isn't an assignmentsList
212
- if (!assignmentsList) {
213
- return bHasAssignments;
214
- }
215
-
216
- const bHasChildCaseAssignments = hasChildCaseAssignments();
217
-
218
- if (bAssignmentsForThisOperator || bHasChildCaseAssignments || isCaseWideLocalAction()) {
219
- bHasAssignments = true;
220
- }
221
-
222
- return bHasAssignments;
223
- }
224
-
225
148
  // From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...
226
149
  useEffect(() => {
227
150
  setBuildName(getBuildName());
@@ -231,29 +154,21 @@ export const FlowContainer = (props: FlowContainerProps) => {
231
154
 
232
155
  let loadingInfo: any;
233
156
  try {
234
- loadingInfo = thePConn.getLoadingStatus(''); // 1st arg empty string until typedefs properly allow optional
157
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
158
+ loadingInfo = thePConn.getLoadingStatus();
235
159
  } catch (ex) {
236
160
  // eslint-disable-next-line no-console
237
161
  console.error(`${thePConn.getComponentName()}: loadingInfo catch block`);
238
162
  }
239
163
 
240
- // let configProps = this.thePConn.resolveConfigProps(this.thePConn.getConfigProps());
241
-
242
- if (!loadingInfo) {
243
- // turn off spinner
244
- // this.psService.sendMessage(false);
245
- }
246
-
247
- const caseViewMode = thePConn.getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
164
+ const caseViewMode = thePConn.getValue('context_data.caseViewMode');
248
165
  const { CASE_INFO: CASE_CONSTS } = pCoreConstants;
249
166
  if (caseViewMode && caseViewMode === 'review') {
250
167
  setTimeout(() => {
251
168
  // updated for 8.7 - 30-Mar-2022
252
169
  const todoAssignments = getToDoAssignments(thePConn);
253
- if (todoAssignments && todoAssignments.length > 0) {
254
- setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID, '')); // 2nd arg empty string until typedefs properly allow optional
255
- setTodoDatasource({ source: todoAssignments });
256
- }
170
+ setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID));
171
+ setTodoDatasource({ source: todoAssignments });
257
172
  setShowTodo(true);
258
173
  setShowTodoList(false);
259
174
  }, 100);
@@ -264,21 +179,18 @@ export const FlowContainer = (props: FlowContainerProps) => {
264
179
  }
265
180
 
266
181
  // if have caseMessage show message and end
267
- const theCaseMessages = localizedVal(thePConn.getValue('caseMessages', ''), localeCategory); // 2nd arg empty string until typedefs properly allow optional
182
+ const theCaseMessages = localizedVal(thePConn.getValue('caseMessages'), localeCategory);
268
183
 
269
- // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
270
- // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
271
- if (!hasAssignments()) {
184
+ const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), itemKey);
185
+ const bConfirmView = rootInfo && bShowBanner;
186
+
187
+ if (bConfirmView) {
272
188
  // Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.
273
189
  // So, if we get here and caseMessages$ is empty, use default value in DX API response
274
190
  setCaseMessages(theCaseMessages || localizedVal('Thank you! The next step in this case has been routed appropriately.', localeCategory));
275
191
  setHasCaseMessages(true);
276
192
  setShowConfirm(true);
277
193
 
278
- // publish this "assignmentFinished" for mashup, need to get approved as a standard
279
- // @ts-ignore - second parameter “payload” for publish method should be optional
280
- PCore.getPubSubUtils().publish('assignmentFinished');
281
-
282
194
  // debugger;
283
195
  setCheckSvg(Utils.getImageSrc('check', Utils.getSDKStaticConentUrl()));
284
196
  } else {
@@ -289,10 +201,8 @@ export const FlowContainer = (props: FlowContainerProps) => {
289
201
  }, [props]);
290
202
 
291
203
  const caseId = thePConn.getCaseSummary().content.pyID;
292
- const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0].urgency : '';
293
- const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName());
294
-
295
- const bShowBanner = showBanner(getPConnect);
204
+ const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0]?.urgency : '';
205
+ const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName() || '');
296
206
 
297
207
  const displayPageMessages = () => {
298
208
  let hasBanner = false;
@@ -88,11 +88,7 @@ export const hasAssignments = pConnect => {
88
88
  const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
89
89
  const childCasesAssignments = getChildCaseAssignments(pConnect);
90
90
 
91
- // eslint-disable-next-line sonarjs/prefer-single-boolean-return
92
- if (assignments || childCasesAssignments || isCaseWideLocalAction(pConnect)) {
93
- return true;
94
- }
95
- return false;
91
+ return !!(assignments || childCasesAssignments || isCaseWideLocalAction(pConnect));
96
92
  };
97
93
 
98
94
  export const showBanner = getPConnect => {
@@ -50,12 +50,14 @@ function ListViewActionButtons(props: ListViewActionButtonsProps) {
50
50
  .getActionsApi()
51
51
  .submitEmbeddedDataModal(context)
52
52
  .then(() => {
53
- setIsDisabled(false);
54
53
  closeActionsDialog();
55
54
  })
56
55
  .catch(err => {
57
56
  // eslint-disable-next-line no-console
58
57
  console.log(err);
58
+ })
59
+ .finally(() => {
60
+ setIsDisabled(false);
59
61
  });
60
62
  }}
61
63
  >
@@ -71,12 +71,7 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
71
71
  }
72
72
 
73
73
  function _showHLine(index: number): boolean {
74
- // eslint-disable-next-line sonarjs/prefer-single-boolean-return
75
- if (index < arNavigationSteps.length - 1) {
76
- return true;
77
- }
78
-
79
- return false;
74
+ return index < arNavigationSteps.length - 1;
80
75
  }
81
76
 
82
77
  function buttonPress(sAction: string, sButtonType: string) {
@@ -179,7 +179,7 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
179
179
  }
180
180
  };
181
181
 
182
- if (!PCore.isDeepEqual(currentRootConfig, prevRootConfig)) {
182
+ if (prevRootConfig === null || !PCore.isDeepEqual(currentRootConfig, prevRootConfig)) {
183
183
  rootView.current = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig)) as any;
184
184
  }
185
185
 
@@ -1,7 +1,7 @@
1
1
  import { useEffect, createElement } from 'react';
2
2
 
3
3
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
4
- import { isContainerInitialized } from '@pega/react-sdk-components/lib/components/helpers';
4
+ import { isContainerInitialized } from '@pega/react-sdk-components/lib/components/infra/Containers/container-helpers';
5
5
 
6
6
  const processRootViewDetails = (rootView, containerItem, options) => {
7
7
  const {
@@ -73,7 +73,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
73
73
  const pConn = getPConnect();
74
74
  const envInfo = PCore.getEnvironmentInfo();
75
75
  const imageKey = envInfo.getOperatorImageInsKey();
76
- const userName = envInfo.getOperatorName();
76
+ const userName = envInfo.getOperatorName() || '';
77
77
  const currentUserInitials = Utils.getInitials(userName);
78
78
  const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
79
79
  const portalClass = pConn.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
@@ -101,7 +101,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
101
101
  );
102
102
  // Initial setting of appName and mapChildren
103
103
  useEffect(() => {
104
- setAppName(PCore.getEnvironmentInfo().getApplicationName());
104
+ setAppName(PCore.getEnvironmentInfo().getApplicationName() || '');
105
105
 
106
106
  const tempMap: any = (pConn.getChildren() as any)?.map((child: any, index) => {
107
107
  const theChildComp = child.getPConnect().getComponentName();
@@ -125,7 +125,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
125
125
  .getPageDataAsync(caseTypesAvailableToCreateDP, pConn.getContextName(), {
126
126
  PortalName: portalID
127
127
  })
128
- .then(response => {
128
+ .then((response: { pyCaseTypesAvailableToCreate?: any }) => {
129
129
  if (response?.pyCaseTypesAvailableToCreate) {
130
130
  pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
131
131
  skipDirtyValidation: true
@@ -218,10 +218,10 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
218
218
  portalName={portalName}
219
219
  imageSrc={iconURL}
220
220
  fullImageSrc={fullIconURL}
221
- appName={localizedVal(appNameToDisplay, '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
221
+ appName={localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
222
222
  appInfo={{
223
223
  imageSrc: iconURL,
224
- appName: localizedVal(appNameToDisplay, '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase()),
224
+ appName: localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase()),
225
225
  onClick: links[0] && /* links[0].onClick ? */ links[0].onClick /* : undefined */
226
226
  }}
227
227
  navLinks={links.filter((link, index) => {
@@ -245,7 +245,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
245
245
  <NavBar
246
246
  getPConnect={getPConnect}
247
247
  pConn={getPConnect()}
248
- appName={localizedVal(appNameToDisplay, '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
248
+ appName={localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
249
249
  pages={pages}
250
250
  caseTypes={caseTypes}
251
251
  />
@@ -19,6 +19,7 @@ interface CaseViewProps extends PConnProps {
19
19
  header: string;
20
20
  showIconInHeader: boolean;
21
21
  caseInfo: any;
22
+ lastUpdateCaseTime: any;
22
23
  }
23
24
 
24
25
  const useStyles = makeStyles(theme => ({
@@ -64,10 +65,10 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
64
65
  showIconInHeader = true,
65
66
  caseInfo: { availableActions = [], availableProcesses = [], hasNewAttachments, caseTypeID = '', caseTypeName = '' }
66
67
  } = props;
68
+ const { lastUpdateCaseTime = getPConnect().getValue('caseInfo.lastUpdateTime') } = props;
67
69
 
68
70
  const currentCaseID = props.caseInfo.ID;
69
71
  let isComponentMounted = true;
70
-
71
72
  const { displayOnlyFA } = useContext<any>(StoreContext);
72
73
 
73
74
  const thePConn = getPConnect();
@@ -79,7 +80,6 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
79
80
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
80
81
  const localeCategory = 'CaseView';
81
82
  const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();
82
-
83
83
  /**
84
84
  *
85
85
  * @param inName the metadata <em>name</em> that will cause a region to be returned
@@ -169,7 +169,6 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
169
169
 
170
170
  useEffect(() => {
171
171
  if (hasNewAttachments) {
172
- // @ts-ignore - Argument of type 'boolean' is not assignable to parameter of type 'object'
173
172
  PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
174
173
  }
175
174
  }, [hasNewAttachments]);
@@ -244,7 +243,9 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
244
243
  <Grid item xs={6}>
245
244
  {theStagesRegion}
246
245
  {theTodoRegion}
247
- {deferLoadInfo.length > 0 && <DeferLoad getPConnect={getPConnect} name={deferLoadInfo[activeVertTab].config.name} isTab />}
246
+ {deferLoadInfo.length > 0 && (
247
+ <DeferLoad getPConnect={getPConnect} name={deferLoadInfo[activeVertTab].config.name} isTab lastUpdateCaseTime={lastUpdateCaseTime} />
248
+ )}
248
249
  </Grid>
249
250
 
250
251
  <Grid item xs={3}>
@@ -41,7 +41,7 @@ export default function Confirmation(props: PropsWithChildren<ConfirmationProps>
41
41
  // Not using whatsNext at the moment, need to figure out the use of it
42
42
  // const whatsNext = datasource?.source;
43
43
  // const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';
44
- const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget());
44
+ const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget() || '');
45
45
  const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID);
46
46
  const onConfirmViewClose = () => {
47
47
  setShowConfirmView(false);
@@ -26,7 +26,6 @@ function DynamicTabs(props: DynamicTabsProps) {
26
26
  // Get the inherited props from the parent to determine label settings
27
27
  const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() };
28
28
  const defaultTabIndex = 0;
29
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
30
29
  const { tablabel } = pConnect.getComponentConfig();
31
30
  const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
32
31
  const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
@@ -15,6 +15,7 @@ interface FieldGroupTemplateProps extends PConnProps {
15
15
  displayMode?: string;
16
16
  fieldHeader?: string;
17
17
  allowTableEdit: boolean;
18
+ allowActions?: any;
18
19
  }
19
20
 
20
21
  export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
@@ -31,6 +32,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
31
32
  heading = '',
32
33
  displayMode,
33
34
  fieldHeader,
35
+ allowActions,
34
36
  allowTableEdit: allowAddEdit
35
37
  } = props;
36
38
  const pConn = getPConnect();
@@ -40,6 +42,11 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
40
42
  const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
41
43
  const HEADING = heading ?? 'Row';
42
44
 
45
+ const hasAllowActions = Object.keys(allowActions ?? {}).length > 0;
46
+ const { allowAdd: actionAdd, allowDelete: actionDelete } = allowActions ?? {};
47
+ const allowAdd = hasAllowActions ? (actionAdd ?? true) : (allowAddEdit ?? true);
48
+ const allowDelete = hasAllowActions ? (actionDelete ?? true) : (allowAddEdit ?? true);
49
+
43
50
  useLayoutEffect(() => {
44
51
  if (!isReadonlyMode) {
45
52
  // @ts-ignore - Expected 3 arguments, but got 1
@@ -58,7 +65,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
58
65
  if (PCore.getPCoreVersion()?.includes('8.7')) {
59
66
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
60
67
  } else {
61
- // @ts-ignore - An argument for 'pageRef' was not provided.
62
68
  pConn.getListActions().insert({}, referenceList.length);
63
69
  }
64
70
  };
@@ -71,11 +77,10 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
71
77
  if (PCore.getPCoreVersion()?.includes('8.7')) {
72
78
  pConn.getListActions().deleteEntry(index, pageReference);
73
79
  } else {
74
- // @ts-ignore - An argument for 'pageRef' was not provided.
75
80
  pConn.getListActions().deleteEntry(index);
76
81
  }
77
82
  };
78
- if (referenceList.length === 0 && allowAddEdit !== false) {
83
+ if (referenceList.length === 0 && allowAdd) {
79
84
  addFieldGroupItem();
80
85
  }
81
86
 
@@ -90,8 +95,8 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
90
95
  return (
91
96
  <FieldGroupList
92
97
  items={MemoisedChildren}
93
- onAdd={allowAddEdit !== false ? addFieldGroupItem : undefined}
94
- onDelete={allowAddEdit !== false ? deleteFieldGroupItem : undefined}
98
+ onAdd={allowAdd ? addFieldGroupItem : undefined}
99
+ onDelete={allowDelete ? deleteFieldGroupItem : undefined}
95
100
  />
96
101
  );
97
102
  }
@@ -43,6 +43,7 @@ import { filterData } from '@pega/react-sdk-components/lib/components/helpers/si
43
43
  import './ListView.css';
44
44
  import { getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
45
45
  import { getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
46
+ import { getGenericFieldsLocalizedValue } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
46
47
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
47
48
 
48
49
  import useInit from './hooks';
@@ -109,7 +110,6 @@ export default function ListView(props: ListViewProps) {
109
110
  });
110
111
 
111
112
  const thePConn = getPConnect();
112
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
113
113
  const componentConfig = thePConn.getComponentConfig();
114
114
  const resolvedConfigProps: any = thePConn.getConfigProps() as ListViewProps;
115
115
 
@@ -222,11 +222,12 @@ export default function ListView(props: ListViewProps) {
222
222
 
223
223
  type Order = 'asc' | 'desc';
224
224
 
225
- function getComparator<Key extends keyof any>(
226
- theOrder: Order,
227
- orderedBy: Key
228
- ): (a: { [key in Key]: number | string }, b: { [key in Key]: number | string }) => number {
229
- return theOrder === 'desc' ? (a, b) => descendingComparator(a, b, orderedBy) : (a, b) => -descendingComparator(a, b, orderedBy);
225
+ interface Comparator<T> {
226
+ (a: T, b: T): number;
227
+ }
228
+
229
+ function getComparator<T, Key extends keyof T>(theOrder: Order, orderedBy: Key): Comparator<T> {
230
+ return theOrder === 'desc' ? (a: T, b: T) => descendingComparator(a, b, orderedBy) : (a: T, b: T) => -descendingComparator(a, b, orderedBy);
230
231
  }
231
232
 
232
233
  function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
@@ -642,7 +643,6 @@ export default function ListView(props: ListViewProps) {
642
643
 
643
644
  thePConn
644
645
  .getActionsApi()
645
- // @ts-ignore
646
646
  .openAssignment(pzInsKey, pxRefObjectClass, options)
647
647
  .then(() => {
648
648
  // console.log("openAssignment successful");
@@ -875,7 +875,6 @@ export default function ListView(props: ListViewProps) {
875
875
  pzInsKey = row[`${associationCategory}:pzInsKey`];
876
876
  }
877
877
  if (column.isAssignmentLink) {
878
- // @ts-ignore
879
878
  thePConn.getActionsApi().openAssignment(pzInsKey, pxObjClass, {
880
879
  containerName: 'primary',
881
880
  channelName: ''
@@ -1065,6 +1064,9 @@ export default function ListView(props: ListViewProps) {
1065
1064
  })}
1066
1065
  </TableBody>
1067
1066
  </Table>
1067
+ {arRows && arRows.length === 0 && (
1068
+ <div className='no-records'>{getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}</div>
1069
+ )}
1068
1070
  </TableContainer>
1069
1071
  ) : (
1070
1072
  <TableContainer id='list-view'>
@@ -1131,7 +1133,9 @@ export default function ListView(props: ListViewProps) {
1131
1133
  })}
1132
1134
  </TableBody>
1133
1135
  </Table>
1134
- {arRows && arRows.length === 0 && <div className='no-records'>No records found.</div>}
1136
+ {arRows && arRows.length === 0 && (
1137
+ <div className='no-records'>{getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}</div>
1138
+ )}
1135
1139
  </TableContainer>
1136
1140
  )}
1137
1141
  </>
@@ -22,6 +22,7 @@ export default function useInit(props) {
22
22
  const runtimeParams = PCore.getRuntimeParamsAPI().getRuntimeParams();
23
23
 
24
24
  let selectionCountThreshold;
25
+ /* eslint-disable react-hooks/exhaustive-deps */
25
26
  useEffect(() => {
26
27
  let isCompStillMounted = true; // react hooks cleanup function will toggle this flag and use it before setting a state variable
27
28
 
@@ -94,4 +95,5 @@ export default function useInit(props) {
94
95
  isCompStillMounted = false;
95
96
  };
96
97
  }, []);
98
+ /* eslint-enable react-hooks/exhaustive-deps */
97
99
  }
@@ -202,7 +202,6 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) {
202
202
  if (value.includes('[')) {
203
203
  value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
204
204
  }
205
- // @ts-ignore - Expected 3 arguments, but got 2.
206
205
  const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
207
206
  meta.fieldID = field;
208
207
  configEmbeddedFieldsMeta.push(meta);
@@ -87,7 +87,6 @@ export default function PromotedFilters(props: PromotedFilterProps) {
87
87
  };
88
88
  return getPConnect().getContainerManager().addTransientItem({
89
89
  id: viewName,
90
- // @ts-ignore - Property 'coreHeaders' is missing in type '{ classID: string; }' but required in type '{ coreHeaders: any; }'.
91
90
  data: filtersWithClassID
92
91
  });
93
92
  }, []);
@@ -50,11 +50,9 @@ export default function SimpleTable(props: SimpleTableProps) {
50
50
 
51
51
  let { contextClass } = props;
52
52
  if (!contextClass) {
53
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
54
53
  let listName = getPConnect().getComponentConfig().referenceList;
55
54
  listName = PCore.getAnnotationUtils().getPropertyName(listName);
56
55
  // was... contextClass = getPConnect().getFieldMetadata(listName)?.pageClass;
57
- // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
58
56
  const theFieldMetadata = getPConnect().getFieldMetadata(listName);
59
57
  if (theFieldMetadata) {
60
58
  contextClass = theFieldMetadata.pageClass;