@pega/angular-sdk-overrides 0.23.8 → 0.23.10

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 (31) hide show
  1. package/lib/field/auto-complete/auto-complete.component.ts +3 -1
  2. package/lib/field/check-box/check-box.component.ts +4 -3
  3. package/lib/field/currency/currency.component.ts +4 -1
  4. package/lib/field/date/date.component.ts +5 -2
  5. package/lib/field/date-time/date-time.component.ts +3 -4
  6. package/lib/field/dropdown/dropdown.component.ts +0 -5
  7. package/lib/field/email/email.component.ts +4 -2
  8. package/lib/field/integer/integer.component.ts +4 -2
  9. package/lib/field/percentage/percentage.component.ts +4 -3
  10. package/lib/field/phone/phone.component.ts +3 -2
  11. package/lib/field/radio-buttons/radio-buttons.component.ts +4 -6
  12. package/lib/field/text-area/text-area.component.ts +4 -7
  13. package/lib/field/text-input/text-input.component.ts +4 -2
  14. package/lib/field/time/time.component.ts +4 -3
  15. package/lib/field/url/url.component.ts +4 -2
  16. package/lib/field/user-reference/user-reference.component.ts +4 -5
  17. package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
  18. package/lib/infra/Containers/base-components/helper.ts +89 -0
  19. package/lib/infra/Containers/flow-container/flow-container.component.html +7 -2
  20. package/lib/infra/Containers/flow-container/flow-container.component.ts +16 -9
  21. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +39 -13
  22. package/lib/infra/assignment/assignment.component.ts +49 -23
  23. package/lib/infra/reference/reference.component.ts +14 -12
  24. package/lib/infra/root-container/root-container.component.html +2 -15
  25. package/lib/infra/root-container/root-container.component.ts +0 -10
  26. package/lib/infra/view/view.component.ts +1 -1
  27. package/lib/template/default-form/default-form.component.ts +46 -5
  28. package/lib/template/field-group-template/field-group-template.component.ts +1 -1
  29. package/lib/template/simple-table-manual/simple-table-manual.component.ts +1 -3
  30. package/lib/widget/todo/todo.component.ts +1 -1
  31. package/package.json +1 -1
@@ -301,7 +301,9 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
301
301
  // this.angularPConnect.changeHandler( this, event);
302
302
  this.filterValue = (event.target as HTMLInputElement).value;
303
303
 
304
- this.angularPConnectData.actions?.onChange(this, event);
304
+ const actionsApi = this.pConn$?.getActionsApi();
305
+ const propName = (this.pConn$?.getStateProps() as any).value;
306
+ handleEvent(actionsApi, 'change', propName, this.filterValue);
305
307
  }
306
308
 
307
309
  optionChanged(event: MatAutocompleteSelectedEvent) {
@@ -9,8 +9,8 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
9
9
  import { Utils } from '@pega/angular-sdk-components';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
12
- import { deleteInstruction, insertInstruction, updateNewInstructions } from '@pega/angular-sdk-components';
13
12
  import { handleEvent } from '@pega/angular-sdk-components';
13
+ import { deleteInstruction, insertInstruction, updateNewInstructions } from '@pega/angular-sdk-components';
14
14
 
15
15
  interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
16
16
  // If any, enter additional props that only exist on Checkbox here
@@ -234,8 +234,9 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
234
234
  if (this.selectionMode === 'multi') {
235
235
  this.pConn$.getValidationApi().validate(this.selectedvalues, this.selectionList);
236
236
  } else {
237
- event.value = event.checked;
238
- this.angularPConnectData.actions?.onBlur(this, event);
237
+ const actionsApi = this.pConn$?.getActionsApi();
238
+ const propName = (this.pConn$?.getStateProps() as any).value;
239
+ handleEvent(actionsApi, 'changeNblur', propName, event.checked);
239
240
  }
240
241
  }
241
242
 
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { getCurrencyCharacters } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
  import { PConnFieldProps } from '@pega/angular-sdk-components';
12
13
 
13
14
  interface CurrrencyProps extends PConnFieldProps {
@@ -175,7 +176,9 @@ export class CurrencyComponent implements OnInit, OnDestroy {
175
176
  fieldOnBlur(event: any) {
176
177
  // PConnect wants to use eventHandler for onBlur
177
178
 
178
- this.angularPConnectData.actions?.onBlur(this, event);
179
+ const actionsApi = this.pConn$?.getActionsApi();
180
+ const propName = (this.pConn$?.getStateProps() as any).value;
181
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
179
182
  }
180
183
 
181
184
  getErrorMessage() {
@@ -13,8 +13,9 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
13
13
  import { Utils } from '@pega/angular-sdk-components';
14
14
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
15
15
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/angular-sdk-components';
16
- import { PConnFieldProps } from '@pega/angular-sdk-components';
16
+ import { handleEvent } from '@pega/angular-sdk-components';
17
17
  import { format } from '@pega/angular-sdk-components';
18
+ import { PConnFieldProps } from '@pega/angular-sdk-components';
18
19
 
19
20
  interface DateProps extends PConnFieldProps {
20
21
  // If any, enter additional props that only exist on Date here
@@ -222,7 +223,9 @@ export class DateComponent implements OnInit, OnDestroy {
222
223
  // convert date to pega "date" format
223
224
  event.value = event.value?.toISOString();
224
225
  }
225
- this.angularPConnectData.actions?.onBlur(this, { value: event.value });
226
+ const actionsApi = this.pConn$?.getActionsApi();
227
+ const propName = (this.pConn$?.getStateProps() as any).value;
228
+ handleEvent(actionsApi, 'changeNblur', propName, event?.value);
226
229
  }
227
230
 
228
231
  hasErrors() {
@@ -202,10 +202,9 @@ export class DateTimeComponent implements OnInit, OnDestroy {
202
202
  }
203
203
 
204
204
  fieldOnBlur(event: any) {
205
- // PConnect wants to use eventHandler for onBlur
206
- if (event.target.value) event.value = event.target.value;
207
-
208
- this.angularPConnectData.actions?.onBlur(this, event);
205
+ const actionsApi = this.pConn$?.getActionsApi();
206
+ const propName = (this.pConn$?.getStateProps() as any).value;
207
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
209
208
  }
210
209
 
211
210
  getErrorMessage() {
@@ -214,11 +214,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
214
214
  }
215
215
  }
216
216
 
217
- fieldOnBlur(event: any) {
218
- // PConnect wants to use eventHandler for onBlur
219
- this.angularPConnectData.actions?.onBlur(this, event);
220
- }
221
-
222
217
  getLocalizedOptionValue(opt: IOption) {
223
218
  return this.pConn$.getLocalizedValue(
224
219
  opt.value,
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface EmailProps extends PConnFieldProps {
@@ -157,8 +158,9 @@ export class EmailComponent implements OnInit, OnDestroy {
157
158
  }
158
159
 
159
160
  fieldOnBlur(event: any) {
160
- // PConnect wants to use eventHandler for onBlur
161
- this.angularPConnectData.actions?.onBlur(this, event);
161
+ const actionsApi = this.pConn$?.getActionsApi();
162
+ const propName = (this.pConn$?.getStateProps() as any).value;
163
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
162
164
  }
163
165
 
164
166
  getErrorMessage() {
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface IntegerProps extends PConnFieldProps {
@@ -160,8 +161,9 @@ export class IntegerComponent implements OnInit, OnDestroy {
160
161
  }
161
162
 
162
163
  fieldOnBlur(event: any) {
163
- // PConnect wants to use eventHandler for onBlur
164
- this.angularPConnectData.actions?.onBlur(this, event);
164
+ const actionsApi = this.pConn$?.getActionsApi();
165
+ const propName = (this.pConn$?.getStateProps() as any).value;
166
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
165
167
  }
166
168
 
167
169
  getErrorMessage() {
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface PercentageProps extends PConnFieldProps {
@@ -158,9 +159,9 @@ export class PercentageComponent implements OnInit, OnDestroy {
158
159
  }
159
160
 
160
161
  fieldOnBlur(event: any) {
161
- // PConnect wants to use eventHandler for onBlur
162
-
163
- this.angularPConnectData.actions?.onBlur(this, event);
162
+ const actionsApi = this.pConn$?.getActionsApi();
163
+ const propName = (this.pConn$?.getStateProps() as any).value;
164
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
164
165
  }
165
166
 
166
167
  getErrorMessage() {
@@ -176,8 +176,9 @@ export class PhoneComponent implements OnInit, OnDestroy {
176
176
  }
177
177
 
178
178
  fieldOnBlur(event: any) {
179
- // PConnect wants to use eventHandler for onBlur
180
- this.angularPConnectData.actions?.onBlur(this, event);
179
+ const actionsApi = this.pConn$?.getActionsApi();
180
+ const propName = (this.pConn$?.getStateProps() as any).value;
181
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
181
182
  }
182
183
 
183
184
  getErrorMessage() {
@@ -8,6 +8,7 @@ import { interval } from 'rxjs';
8
8
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
9
9
  import { Utils } from '@pega/angular-sdk-components';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
  import { PConnFieldProps } from '@pega/angular-sdk-components';
12
13
 
13
14
  interface IOption {
@@ -205,12 +206,9 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
205
206
  }
206
207
 
207
208
  fieldOnChange(event: any) {
208
- this.angularPConnectData.actions?.onChange(this, event);
209
- }
210
-
211
- fieldOnBlur(event: any) {
212
- // PConnect wants to use eventHandler for onBlur
213
- this.angularPConnectData.actions?.onBlur(this, event);
209
+ const actionsApi = this.pConn$?.getActionsApi();
210
+ const propName = (this.pConn$?.getStateProps() as any).value;
211
+ handleEvent(actionsApi, 'changeNblur', propName, event?.value);
214
212
  }
215
213
 
216
214
  getLocalizedOptionValue(opt: IOption) {
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface TextAreaProps extends PConnFieldProps {
@@ -156,13 +157,9 @@ export class TextAreaComponent implements OnInit, OnDestroy {
156
157
  }
157
158
 
158
159
  fieldOnChange(event: any) {
159
- // PConnect wants to use changeHandler for onChange
160
- this.angularPConnectData.actions?.onChange(this, event);
161
- }
162
-
163
- fieldOnBlur(event: any) {
164
- // PConnect wants to use eventHandler for onBlur
165
- this.angularPConnectData.actions?.onBlur(this, event);
160
+ const actionsApi = this.pConn$?.getActionsApi();
161
+ const propName = (this.pConn$?.getStateProps() as any).value;
162
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
166
163
  }
167
164
 
168
165
  getErrorMessage() {
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectService, AngularPConnectData } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface TextInputProps extends PConnFieldProps {
@@ -160,8 +161,9 @@ export class TextInputComponent implements OnInit, OnDestroy {
160
161
  }
161
162
 
162
163
  fieldOnBlur(event: any) {
163
- // PConnect wants to use eventHandler for onBlur
164
- this.angularPConnectData.actions?.onBlur(this, event);
164
+ const actionsApi = this.pConn$?.getActionsApi();
165
+ const propName = (this.pConn$?.getStateProps() as any).value;
166
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
165
167
  }
166
168
 
167
169
  getErrorMessage() {
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface TimeProps extends PConnFieldProps {
@@ -157,9 +158,9 @@ export class TimeComponent implements OnInit, OnDestroy {
157
158
  }
158
159
 
159
160
  fieldOnBlur(event: any) {
160
- // PConnect wants to use eventHandler for onBlur
161
- event.value = event.target.value;
162
- this.angularPConnectData.actions?.onBlur(this, event);
161
+ const actionsApi = this.pConn$?.getActionsApi();
162
+ const propName = (this.pConn$?.getStateProps() as any).value;
163
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
163
164
  }
164
165
 
165
166
  getErrorMessage() {
@@ -7,6 +7,7 @@ import { interval } from 'rxjs';
7
7
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
+ import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface URLProps extends PConnFieldProps {
@@ -158,8 +159,9 @@ export class UrlComponent implements OnInit, OnDestroy {
158
159
  }
159
160
 
160
161
  fieldOnBlur(event: any) {
161
- // PConnect wants to use eventHandler for onBlur
162
- this.angularPConnectData.actions?.onBlur(this, event);
162
+ const actionsApi = this.pConn$?.getActionsApi();
163
+ const propName = (this.pConn$?.getStateProps() as any).value;
164
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
163
165
  }
164
166
 
165
167
  getErrorMessage() {
@@ -9,6 +9,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
9
9
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
10
10
  import { Utils } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
+ import { handleEvent } from '@pega/angular-sdk-components';
12
13
  import { PConnFieldProps } from '@pega/angular-sdk-components';
13
14
 
14
15
  const OPERATORS_DP = 'D_pyGetOperatorsForCurrentApplication';
@@ -189,11 +190,9 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
189
190
  key = index > -1 ? (key = this.options$[index].key) : event.target.value;
190
191
  }
191
192
 
192
- const eve = {
193
- value: key
194
- };
195
- // PConnect wants to use eventHandler for onBlur
196
- this.angularPConnectData.actions?.onChange(this, eve);
193
+ const actionsApi = this.pConn$?.getActionsApi();
194
+ const propName = (this.pConn$?.getStateProps() as any).value;
195
+ handleEvent(actionsApi, 'changeNblur', propName, key);
197
196
  }
198
197
 
199
198
  getErrorMessage() {
@@ -0,0 +1,22 @@
1
+ import { Injector } from '@angular/core';
2
+ import { getPConnectOfActiveContainerItem } from './helper';
3
+ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
+
5
+ export class FlowContainerBaseComponent {
6
+ // For interaction with AngularPConnect
7
+ protected angularPConnectData: AngularPConnectData = {};
8
+ protected angularPConnect;
9
+
10
+ constructor(injector: Injector) {
11
+ this.angularPConnect = injector.get(AngularPConnectService);
12
+ }
13
+
14
+ getPConnectOfActiveContainerItem(parentPConnect) {
15
+ const routingInfo = this.angularPConnect.getComponentProp(this, 'routingInfo');
16
+ const isAssignmentView = this.angularPConnect.getComponentProp(this, 'isAssignmentView');
17
+ return getPConnectOfActiveContainerItem(routingInfo, {
18
+ isAssignmentView,
19
+ parentPConnect
20
+ });
21
+ }
22
+ }
@@ -0,0 +1,89 @@
1
+ const processRootViewDetails = (rootView, containerItem, options) => {
2
+ const {
3
+ config: { context: viewContext, name: viewName }
4
+ } = rootView;
5
+ const { context: containerContext } = containerItem;
6
+ const { parentPConnect } = options;
7
+ let resolvedViewName = viewName;
8
+ let resolvedViewContext = viewContext;
9
+
10
+ const isAnnotedViewName = PCore.getAnnotationUtils().isProperty(viewName);
11
+ const isAnnotedViewContext = PCore.getAnnotationUtils().isProperty(viewContext);
12
+
13
+ // resolving annoted view context
14
+ if (isAnnotedViewContext) {
15
+ const viewContextProperty = PCore.getAnnotationUtils().getPropertyName(viewContext);
16
+ resolvedViewContext = PCore.getStoreValue(
17
+ `.${viewContextProperty}`,
18
+ viewContextProperty.startsWith('.') ? parentPConnect.getPageReference() : '',
19
+ containerContext
20
+ );
21
+ }
22
+
23
+ if (!resolvedViewContext) {
24
+ resolvedViewContext = parentPConnect.getPageReference();
25
+ }
26
+
27
+ // resolving annoted view name
28
+ if (isAnnotedViewName) {
29
+ const viewNameProperty = PCore.getAnnotationUtils().getPropertyName(viewName);
30
+ resolvedViewName = PCore.getStoreValue(`.${viewNameProperty}`, resolvedViewContext, containerContext);
31
+ }
32
+
33
+ /* Special case where context and viewname are dynamic values
34
+ Use case - split for each shape
35
+ Ex - (caseInfo.content.SCRequestWorkQueues[1]):context --> .pyViewName:viewName
36
+ */
37
+ if (isAnnotedViewName && isAnnotedViewContext && resolvedViewName !== '') {
38
+ /* Allow context processor to resolve view and context when both are dynamic */
39
+ resolvedViewName = viewName;
40
+ resolvedViewContext = viewContext;
41
+ }
42
+
43
+ return {
44
+ viewName: resolvedViewName,
45
+ viewContext: resolvedViewContext
46
+ };
47
+ };
48
+
49
+ export const getPConnectOfActiveContainerItem = (containerInfo, options) => {
50
+ const { accessedOrder, items } = containerInfo;
51
+ const { isAssignmentView = false, parentPConnect } = options;
52
+ const containerName = parentPConnect.getContainerName();
53
+ const { CONTAINER_NAMES } = PCore.getContainerUtils();
54
+ const { CREATE_DETAILS_VIEW_NAME } = PCore.getConstants();
55
+
56
+ if (accessedOrder && items) {
57
+ const activeContainerItemKey = accessedOrder[accessedOrder.length - 1];
58
+
59
+ if (items[activeContainerItemKey] && items[activeContainerItemKey].view && Object.keys(items[activeContainerItemKey].view).length > 0) {
60
+ const activeContainerItem = items[activeContainerItemKey];
61
+ const target = activeContainerItemKey.substring(0, activeContainerItemKey.lastIndexOf('_'));
62
+
63
+ const { view: rootView, context } = activeContainerItem;
64
+ const { viewName, viewContext } = processRootViewDetails(rootView, activeContainerItem, { parentPConnect });
65
+
66
+ if (!viewName) return null;
67
+
68
+ const config = {
69
+ meta: rootView,
70
+ options: {
71
+ context,
72
+ pageReference: viewContext || parentPConnect.getPageReference(),
73
+ containerName,
74
+ containerItemID: activeContainerItemKey,
75
+ parentPageReference: parentPConnect.getPageReference(),
76
+ hasForm:
77
+ isAssignmentView ||
78
+ containerName === CONTAINER_NAMES.WORKAREA ||
79
+ containerName === CONTAINER_NAMES.MODAL ||
80
+ viewName === CREATE_DETAILS_VIEW_NAME,
81
+ target
82
+ }
83
+ };
84
+
85
+ return PCore.createPConnect(config).getPConnect();
86
+ }
87
+ }
88
+ return null;
89
+ };
@@ -8,9 +8,10 @@
8
8
  </div>
9
9
  <div *ngIf="todo_showTodo$">
10
10
  <component-mapper
11
+ *ngIf="pConnectOfActiveContainerItem"
11
12
  name="Todo"
12
13
  [props]="{
13
- pConn$: todo_pConn$,
14
+ pConn$: pConnectOfActiveContainerItem,
14
15
  caseInfoID$: todo_caseInfoID$,
15
16
  datasource$: todo_datasource$,
16
17
  showTodoList$: todo_showTodoList$,
@@ -23,7 +24,11 @@
23
24
  ></component-mapper>
24
25
  </div>
25
26
  <div *ngIf="!todo_showTodo$">
26
- <component-mapper name="Assignment" [props]="{ pConn$, formGroup$, arChildren$, itemKey$ }"></component-mapper>
27
+ <component-mapper
28
+ *ngIf="pConnectOfActiveContainerItem"
29
+ name="Assignment"
30
+ [props]="{ pConn$: pConnectOfActiveContainerItem, formGroup$, arChildren$, itemKey$ }"
31
+ ></component-mapper>
27
32
  </div>
28
33
  </div>
29
34
  <div *ngIf="bHasCaseMessages$">
@@ -1,14 +1,14 @@
1
- import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy, Injector } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormBuilder, FormGroup } from '@angular/forms';
4
4
  import { MatCardModule } from '@angular/material/card';
5
5
  import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
6
- import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
7
6
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
8
7
  import { ReferenceComponent } from '@pega/angular-sdk-components';
9
8
  import { Utils } from '@pega/angular-sdk-components';
10
9
  import { getToDoAssignments, hasAssignments, showBanner } from './helpers';
11
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
+ import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
14
14
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
@@ -32,11 +32,9 @@ interface FlowContainerProps {
32
32
  standalone: true,
33
33
  imports: [CommonModule, MatCardModule, forwardRef(() => ComponentMapperComponent)]
34
34
  })
35
- export class FlowContainerComponent implements OnInit, OnDestroy {
35
+ export class FlowContainerComponent extends FlowContainerBaseComponent implements OnInit, OnDestroy {
36
36
  @Input() pConn$: typeof PConnect;
37
37
 
38
- // For interaction with AngularPConnect
39
- angularPConnectData: AngularPConnectData = {};
40
38
  pCoreConstants: typeof publicConstants;
41
39
  configProps$: FlowContainerProps;
42
40
 
@@ -72,14 +70,17 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
72
70
  banners: any[];
73
71
  // itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
74
72
 
73
+ pConnectOfActiveContainerItem;
74
+
75
75
  constructor(
76
- private angularPConnect: AngularPConnectService,
76
+ injector: Injector,
77
77
  private cdRef: ChangeDetectorRef,
78
78
  private psService: ProgressSpinnerService,
79
79
  private fb: FormBuilder,
80
80
  private ngZone: NgZone,
81
81
  private utils: Utils
82
82
  ) {
83
+ super(injector);
83
84
  // create the formGroup
84
85
  this.formGroup$ = this.fb.group({ hideRequired: false });
85
86
  }
@@ -148,10 +149,14 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
148
149
  // Should always check the bridge to see if the component should update itself (re-render)
149
150
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
150
151
 
152
+ const pConn = this.pConnectOfActiveContainerItem || this.pConn$;
153
+ const caseViewModeFromProps = this.angularPConnect.getComponentProp(this, 'caseViewMode');
154
+ const caseViewModeFromRedux = pConn.getValue('context_data.caseViewMode', '');
155
+
151
156
  // ONLY call updateSelf when the component should update
152
157
  // AND removing the "gate" that was put there since shouldComponentUpdate
153
158
  // should be the real "gate"
154
- if (bUpdateSelf) {
159
+ if (bUpdateSelf || caseViewModeFromProps !== caseViewModeFromRedux) {
155
160
  // don't want to redraw the flow container when there are page messages, because
156
161
  // the redraw causes us to loose the errors on the elements
157
162
  const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
@@ -340,8 +345,10 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
340
345
  // const { getPConnect } = this.arChildren$[0].getPConnect();
341
346
  const localPConn = this.arChildren$[0].getPConnect();
342
347
 
343
- // @ts-ignore - second parameter pageReference for getValue method should be optional
344
- const caseViewMode = this.pConn$.getValue('context_data.caseViewMode');
348
+ this.pConnectOfActiveContainerItem = this.getPConnectOfActiveContainerItem(this.pConn$) || this.pConn$;
349
+
350
+ const caseViewMode = this.pConnectOfActiveContainerItem.getValue('context_data.caseViewMode');
351
+
345
352
  this.bShowBanner = showBanner(this.pConn$);
346
353
 
347
354
  if (caseViewMode && caseViewMode == 'review') {
@@ -6,6 +6,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
6
6
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
7
7
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
8
  import { getBanners } from '@pega/angular-sdk-components';
9
+ import { ReferenceComponent } from '@pega/angular-sdk-components';
9
10
 
10
11
  /**
11
12
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
@@ -22,7 +23,6 @@ import { getBanners } from '@pega/angular-sdk-components';
22
23
  })
23
24
  export class ModalViewContainerComponent implements OnInit, OnDestroy {
24
25
  @Input() pConn$: typeof PConnect;
25
- @Input() displayOnlyFA$: boolean;
26
26
 
27
27
  // for when non modal
28
28
  @Output() modalVisibleChange = new EventEmitter<boolean>();
@@ -72,11 +72,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
72
72
  }
73
73
 
74
74
  ngOnInit(): void {
75
- if (this.displayOnlyFA$) {
76
- // for when non modal
77
- this.bShowAsModal$ = false;
78
- }
79
-
80
75
  // First thing in initialization is registering and subscribing to the AngularPConnect service
81
76
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
82
77
 
@@ -200,7 +195,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
200
195
  }
201
196
 
202
197
  createView(routingInfo, currentItem, latestItem, key) {
203
- const configObject = this.getConfigObject(currentItem, this.pConn$);
198
+ const configObject = this.getConfigObject(currentItem, null, false);
204
199
  const newComp = configObject?.getPConnect();
205
200
  // const newCompName = newComp.getComponentName();
206
201
  // @ts-ignore - parameter “contextName” for getDataObject method should be optional
@@ -248,8 +243,16 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
248
243
  ID,
249
244
  `${theNewCaseInfo?.getClassName()}!CASE!${theNewCaseInfo.getName()}`.toUpperCase()
250
245
  );
251
- // // update children with new view's children
252
- this.arChildren$ = newComp.getChildren() as any[];
246
+ const bIsRefComponent = this.checkIfRefComponent(newComp);
247
+
248
+ if (bIsRefComponent) {
249
+ const newPConn = ReferenceComponent.normalizePConn(newComp);
250
+ this.arChildren$ = ReferenceComponent.normalizePConnArray(newPConn.getChildren());
251
+ } else {
252
+ // update children with new view's children
253
+ this.arChildren$ = newComp.getChildren() as any;
254
+ }
255
+
253
256
  this.bShowModal$ = true;
254
257
 
255
258
  // for when non modal
@@ -280,16 +283,30 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
280
283
  });
281
284
  }
282
285
 
283
- getConfigObject(item, pConnect) {
286
+ getConfigObject(item, pConnect, isReverseCoexistence = false) {
287
+ let config;
288
+ if (isReverseCoexistence) {
289
+ config = {
290
+ options: {
291
+ pageReference: pConnect?.getPageReference(),
292
+ hasForm: true,
293
+ containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL
294
+ }
295
+ };
296
+ return PCore.createPConnect(config);
297
+ }
284
298
  if (item) {
285
- const { context, view } = item;
286
- const config = {
299
+ const { context, view, isBulkAction } = item;
300
+ const target = PCore.getContainerUtils().getTargetFromContainerItemID(context);
301
+ config = {
287
302
  meta: view,
288
303
  options: {
289
304
  context,
290
305
  pageReference: view.config.context || pConnect.getPageReference(),
291
306
  hasForm: true,
292
- containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL
307
+ ...(isBulkAction && { isBulkAction }),
308
+ containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL,
309
+ target
293
310
  }
294
311
  };
295
312
  return PCore.createPConnect(config);
@@ -297,6 +314,15 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
297
314
  return null;
298
315
  }
299
316
 
317
+ checkIfRefComponent(thePConn: any): boolean {
318
+ let bReturn = false;
319
+ if (thePConn && thePConn.getComponentName() == 'reference') {
320
+ bReturn = true;
321
+ }
322
+
323
+ return bReturn;
324
+ }
325
+
300
326
  onAlertState(bData: boolean) {
301
327
  this.bAlertState = bData;
302
328
  this.bShowCancelAlert$ = false;
@@ -9,6 +9,14 @@ import { ProgressSpinnerService } from '@pega/angular-sdk-components';
9
9
  import { ReferenceComponent } from '@pega/angular-sdk-components';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
 
12
+ function getRefreshProps(refreshConditions) {
13
+ // refreshConditions cuurently supports only "Changes" event
14
+ if (!refreshConditions) {
15
+ return [];
16
+ }
17
+ return refreshConditions.filter(item => item.event && item.event === 'Changes').map(item => [item.field, item.field?.substring(1)]) || [];
18
+ }
19
+
12
20
  interface AssignmentProps {
13
21
  // If any, enter additional props that only exist on this component
14
22
  template: string;
@@ -38,7 +46,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
38
46
  newPConn$: any;
39
47
  containerName$: string;
40
48
 
41
- bIsRefComponent = false;
42
49
  bInitialized = false;
43
50
 
44
51
  templateName$: string;
@@ -127,21 +134,14 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
127
134
  }
128
135
 
129
136
  updateChanges() {
130
- this.bIsRefComponent = this.checkIfRefComponent(this.pConn$);
137
+ this.registerForRefresh();
131
138
 
132
- this.ngZone.run(() => {
133
- // pConn$ may be a 'reference' component, so normalize it
134
- // this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
135
- this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
136
-
137
- // If 'reference' so we need to get the children of the normalized pConn
138
- if (this.bIsRefComponent) {
139
- // this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
140
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
141
- }
142
- });
139
+ // pConn$ may be a 'reference' component, so normalize it
140
+ this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
143
141
 
144
- this.createButtons();
142
+ if (this.arChildren$) {
143
+ this.createButtons();
144
+ }
145
145
  }
146
146
 
147
147
  checkIfRefComponent(thePConn: any): boolean {
@@ -154,18 +154,10 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
154
154
  }
155
155
 
156
156
  initComponent() {
157
- this.bIsRefComponent = this.checkIfRefComponent(this.pConn$);
158
-
159
157
  // pConn$ may be a 'reference' component, so normalize it
160
158
  // this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
161
159
  this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
162
160
 
163
- // If 'reference' so we need to get the children of the normalized pConn
164
- if (this.bIsRefComponent) {
165
- // this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
166
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
167
- }
168
-
169
161
  // prevent re-intializing with flowContainer update unless an action is taken
170
162
  this.bReInit = false;
171
163
  this.bHasNavigation$ = false;
@@ -206,7 +198,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
206
198
 
207
199
  this.cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);
208
200
 
209
- this.createButtons();
201
+ if (this.arChildren$) {
202
+ this.createButtons();
203
+ }
210
204
  }
211
205
 
212
206
  createButtons() {
@@ -460,4 +454,36 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
460
454
  control.markAsTouched();
461
455
  });
462
456
  }
457
+
458
+ registerForRefresh() {
459
+ // @ts-ignore - Property 'getActionRefreshConditions' is private and only accessible within class 'CaseInfo'
460
+ const refreshConditions = this.pConn$.getCaseInfo()?.getActionRefreshConditions();
461
+ const pageReference = this.pConn$.getPageReference();
462
+ const context = this.pConn$.getContextName();
463
+
464
+ // refresh api de-registration
465
+ PCore.getRefreshManager().deRegisterForRefresh(context);
466
+
467
+ // refresh api registration
468
+ const refreshProps = getRefreshProps(refreshConditions);
469
+ const caseKey = this.pConn$.getCaseInfo().getKey();
470
+ const refreshOptions = {
471
+ autoDetectRefresh: true,
472
+ preserveClientChanges: false
473
+ };
474
+ if (refreshProps.length > 0) {
475
+ refreshProps.forEach(prop => {
476
+ PCore.getRefreshManager().registerForRefresh(
477
+ 'PROP_CHANGE',
478
+ this.pConn$.getActionsApi().refreshCaseView.bind(this.pConn$.getActionsApi(), caseKey, null, pageReference, {
479
+ ...refreshOptions,
480
+ refreshFor: prop[0]
481
+ }),
482
+ `${pageReference}.${prop[1]}`,
483
+ `${context}/${pageReference}`,
484
+ context
485
+ );
486
+ });
487
+ }
488
+ }
463
489
  }
@@ -33,13 +33,9 @@ export class ReferenceComponent {
33
33
  static createFullReferencedViewFromRef(inPConn: any) {
34
34
  // BAIL and ERROR if inPConn is NOT a reference!
35
35
  if (inPConn.getComponentName() !== 'reference') {
36
- // debugger;
37
-
38
36
  console.error(`Reference component: createFullReferencedViewFromRef inPConn is NOT a reference! ${inPConn.getComponentName()}`);
39
37
  }
40
38
 
41
- const theResolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
42
-
43
39
  const referenceConfig = { ...inPConn.getComponentConfig() } || {};
44
40
 
45
41
  // Since SDK-A implements Reference as static methods and we don't rely on
@@ -47,8 +43,8 @@ export class ReferenceComponent {
47
43
  // (and also leaving the others in for now) so the referenced View can act on
48
44
  // the visibility prop. (The following 3 lines were carried over from React SDK)
49
45
  delete referenceConfig?.name;
50
- // delete referenceConfig?.type;
51
- // delete referenceConfig?.visibility;
46
+ delete referenceConfig?.type;
47
+ delete referenceConfig?.visibility;
52
48
 
53
49
  const viewMetadata = inPConn.getReferencedView();
54
50
 
@@ -67,13 +63,15 @@ export class ReferenceComponent {
67
63
  ...referenceConfig
68
64
  }
69
65
  };
66
+ const theResolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
67
+ const { visibility = true, context, readOnly = false, displayMode = '' } = theResolvedConfigProps;
70
68
 
71
69
  if (ReferenceComponent.bLogging) {
72
- console.log(`Reference: about to call createComponent with pageReference: context: ${theResolvedConfigProps.context}`);
70
+ console.log(`Reference: about to call createComponent with pageReference: context: ${inPConn.getContextName()}`);
73
71
  }
74
72
 
75
73
  const viewComponent = inPConn.createComponent(viewObject, null, null, {
76
- pageReference: theResolvedConfigProps.context
74
+ pageReference: context && context.startsWith('@CLASS') ? '' : context
77
75
  });
78
76
 
79
77
  // updating the referencedComponent should trigger a render
@@ -81,8 +79,8 @@ export class ReferenceComponent {
81
79
 
82
80
  newCompPConnect.setInheritedConfig({
83
81
  ...referenceConfig,
84
- readOnly: theResolvedConfigProps.readOnly ? theResolvedConfigProps.readOnly : false,
85
- displayMode: theResolvedConfigProps.displayMode ? theResolvedConfigProps.displayMode : null
82
+ readOnly,
83
+ displayMode
86
84
  });
87
85
 
88
86
  if (ReferenceComponent.bLogging) {
@@ -93,7 +91,11 @@ export class ReferenceComponent {
93
91
  );
94
92
  }
95
93
 
96
- return newCompPConnect;
94
+ if (visibility !== false) {
95
+ return newCompPConnect;
96
+ }
97
+
98
+ return null;
97
99
  }
98
100
 
99
101
  // STATIC method that other components can call to normalize
@@ -130,7 +132,7 @@ export class ReferenceComponent {
130
132
  // debugger;
131
133
  let theRefViewPConn = this.createFullReferencedViewFromRef(inPConn.getPConnect());
132
134
  // now return its PConnect
133
- theRefViewPConn = theRefViewPConn.getComponent();
135
+ theRefViewPConn = theRefViewPConn?.getComponent();
134
136
 
135
137
  // const theFullReference = theRefViewPConn.getPConnect().getFullReference();
136
138
  // console.log(`theFullReference: ${theFullReference}`);
@@ -5,20 +5,11 @@
5
5
  <div *ngIf="bShowRoot$">
6
6
  <div [ngSwitch]="componentName$">
7
7
  <component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$, displayOnlyFA$ }"></component-mapper>
8
- <!-- <app-reference *ngSwitchCase="'reference'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-reference> -->
9
8
  <component-mapper
10
9
  *ngSwitchCase="'ViewContainer'"
11
10
  name="ViewContainer"
12
- [props]="{ pConn$: displayOnlyFA$ ? viewContainerPConn$ : pConn$, displayOnlyFA$ }"
11
+ [props]="{ pConn$: viewContainerPConn$, displayOnlyFA$ }"
13
12
  ></component-mapper>
14
- <app-hybrid-view-container *ngSwitchCase="'HybridViewContainer'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-hybrid-view-container>
15
- <app-modal-view-container
16
- *ngSwitchCase="'ModalViewContainer'"
17
- [pConn$]="pConn$"
18
- [displayOnlyFA$]="displayOnlyFA$"
19
- (modalVisibleChange)="modalVisibleChanged($event)"
20
- ></app-modal-view-container>
21
- <div *ngSwitchCase="''"></div>
22
13
  <div *ngSwitchDefault>{{ localizedVal('RootContainer Missing: ' + componentName$, localeCategory) }}.</div>
23
14
  </div>
24
15
  </div>
@@ -28,9 +19,5 @@
28
19
  </div>
29
20
 
30
21
  <div *ngIf="mConn$ != null">
31
- <app-modal-view-container
32
- [pConn$]="mConn$"
33
- [displayOnlyFA$]="displayOnlyFA$"
34
- (modalVisibleChange)="modalVisibleChanged($event)"
35
- ></app-modal-view-container>
22
+ <app-modal-view-container [pConn$]="mConn$"></app-modal-view-container>
36
23
  </div>
@@ -128,16 +128,6 @@ export class RootContainerComponent implements OnInit, OnDestroy {
128
128
  }
129
129
  }
130
130
 
131
- modalVisibleChanged(isVisible) {
132
- if (this.displayOnlyFA$) {
133
- if (isVisible) {
134
- this.bShowRoot$ = false;
135
- } else {
136
- this.bShowRoot$ = true;
137
- }
138
- }
139
- }
140
-
141
131
  updateSelf() {
142
132
  // need to call this.getCurrentCompleteProps (not this.thePConn.getConfigProps)
143
133
  // to get full set of props that affect this component in Redux
@@ -159,7 +159,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
159
159
  * The resolution lies in transferring this responsibility to the Reference component, eliminating the need for this code when Reference
160
160
  * component is able to handle it.
161
161
  */
162
- if (this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
162
+ if (!this.configProps$.visibility && this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
163
163
  this.visibility$ = evaluateVisibility(this.pConn$);
164
164
  }
165
165
 
@@ -1,10 +1,22 @@
1
- import { Component, OnInit, Input, forwardRef } from '@angular/core';
1
+ import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ReferenceComponent } from '@pega/angular-sdk-components';
5
+ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
5
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
7
  import { TemplateUtils } from '@pega/angular-sdk-components';
7
8
 
9
+ function areViewsChanged(oldViews: any[], newViews: any[]): boolean {
10
+ if (oldViews.length !== newViews.length) {
11
+ return true;
12
+ }
13
+
14
+ return !oldViews.every((oldView, index) => {
15
+ const newView = newViews[index];
16
+ return oldView.getPConnect().viewName === newView.getPConnect().viewName;
17
+ });
18
+ }
19
+
8
20
  interface DefaultFormProps {
9
21
  // If any, enter additional props that only exist on this component
10
22
  NumCols: string;
@@ -19,11 +31,14 @@ interface DefaultFormProps {
19
31
  standalone: true,
20
32
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
21
33
  })
22
- export class DefaultFormComponent implements OnInit {
34
+ export class DefaultFormComponent implements OnInit, OnDestroy {
23
35
  @Input() pConn$: typeof PConnect;
24
36
  @Input() formGroup$: FormGroup;
25
37
 
26
- arChildren$: any[];
38
+ // Used with AngularPConnect
39
+ angularPConnectData: AngularPConnectData = {};
40
+
41
+ arChildren$: any[] = [];
27
42
  divClass$: string;
28
43
  template: any;
29
44
  showLabel: any;
@@ -41,9 +56,29 @@ export class DefaultFormComponent implements OnInit {
41
56
  'Confirmation'
42
57
  ];
43
58
 
44
- constructor(private templateUtils: TemplateUtils) {}
59
+ constructor(
60
+ private angularPConnect: AngularPConnectService,
61
+ private templateUtils: TemplateUtils
62
+ ) {}
45
63
 
46
64
  ngOnInit(): void {
65
+ // First thing in initialization is registering and subscribing to the AngularPConnect service
66
+ this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
67
+
68
+ this.updateSelf();
69
+ }
70
+
71
+ ngOnDestroy() {
72
+ if (this.angularPConnectData.unsubscribeFn) {
73
+ this.angularPConnectData.unsubscribeFn();
74
+ }
75
+ }
76
+
77
+ onStateChange() {
78
+ this.updateSelf();
79
+ }
80
+
81
+ updateSelf() {
47
82
  const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
48
83
  this.template = configProps?.template;
49
84
  const propToUse: any = { ...this.pConn$.getInheritedProps() };
@@ -71,6 +106,12 @@ export class DefaultFormComponent implements OnInit {
71
106
  // repoint children before getting templateArray
72
107
  // Children may contain 'reference' component, so we need to
73
108
  // normalize them
74
- this.arChildren$ = ReferenceComponent.normalizePConnArray(kids[0].getPConnect().getChildren());
109
+ const children = ReferenceComponent.normalizePConnArray(kids[0].getPConnect().getChildren());
110
+
111
+ const visibleChildren = children.filter(child => child !== undefined);
112
+
113
+ if (areViewsChanged(this.arChildren$, visibleChildren)) {
114
+ this.arChildren$ = visibleChildren;
115
+ }
75
116
  }
76
117
  }
@@ -117,7 +117,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
117
117
  this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
118
118
  }
119
119
  this.referenceList = this.configProps$.referenceList;
120
- if (this.prevRefLength != this.referenceList.length) {
120
+ if (this.prevRefLength != this.referenceList?.length) {
121
121
  // eslint-disable-next-line sonarjs/no-collapsible-if
122
122
  if (!this.readonlyMode) {
123
123
  if (this.referenceList?.length === 0 && this.allowAddEdit !== false) {
@@ -965,9 +965,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
965
965
  this.rawFields?.forEach(item => {
966
966
  const referenceListData = getReferenceList(this.pConn$);
967
967
  const isDatapage = referenceListData.startsWith('D_');
968
- const pageReferenceValue = isDatapage
969
- ? `${referenceListData}[${index}]`
970
- : `${this.pConn$.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
968
+ const pageReferenceValue = isDatapage ? `${referenceListData}[${index}]` : `${this.pConn$.getPageReference()}${referenceListData}[${index}]`;
971
969
  const config = {
972
970
  meta: item,
973
971
  options: {
@@ -234,7 +234,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
234
234
  const sTarget = this.pConn$.getContainerName();
235
235
  const sTargetContainerName = sTarget;
236
236
 
237
- const options: any = { containerName: sTargetContainerName };
237
+ const options: any = { containerName: sTargetContainerName, channelName: '' };
238
238
 
239
239
  if (classname === null || classname === '') {
240
240
  classname = this.pConn$.getCaseInfo().getClassName();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.23.8",
3
+ "version": "0.23.10",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"