@pega/angular-sdk-overrides 24.1.10 → 24.2.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 (104) hide show
  1. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -1
  2. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
  3. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  4. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
  5. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
  6. package/lib/designSystemExtension/operator/operator.component.ts +1 -1
  7. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
  8. package/lib/field/auto-complete/auto-complete.component.ts +16 -13
  9. package/lib/field/check-box/check-box.component.ts +11 -10
  10. package/lib/field/currency/currency.component.html +4 -4
  11. package/lib/field/currency/currency.component.ts +32 -15
  12. package/lib/field/date/date.component.html +1 -6
  13. package/lib/field/date/date.component.ts +22 -39
  14. package/lib/field/date-time/date-time.component.html +1 -2
  15. package/lib/field/date-time/date-time.component.ts +18 -13
  16. package/lib/field/decimal/decimal.component.html +3 -3
  17. package/lib/field/decimal/decimal.component.ts +21 -18
  18. package/lib/field/dropdown/dropdown.component.ts +132 -18
  19. package/lib/field/email/email.component.ts +14 -4
  20. package/lib/field/group/group.component.ts +2 -2
  21. package/lib/field/integer/integer.component.html +1 -1
  22. package/lib/field/integer/integer.component.ts +13 -5
  23. package/lib/field/multiselect/multiselect.component.ts +15 -5
  24. package/lib/field/percentage/percentage.component.html +4 -4
  25. package/lib/field/percentage/percentage.component.ts +34 -19
  26. package/lib/field/phone/phone.component.html +1 -1
  27. package/lib/field/phone/phone.component.ts +11 -14
  28. package/lib/field/radio-buttons/radio-buttons.component.ts +9 -9
  29. package/lib/field/rich-text/rich-text.component.ts +8 -6
  30. package/lib/field/scalar-list/scalar-list.component.ts +3 -4
  31. package/lib/field/text/text.component.ts +2 -0
  32. package/lib/field/text-area/text-area.component.html +2 -1
  33. package/lib/field/text-area/text-area.component.ts +13 -6
  34. package/lib/field/text-input/text-input.component.html +1 -1
  35. package/lib/field/text-input/text-input.component.ts +13 -5
  36. package/lib/field/time/time.component.html +2 -2
  37. package/lib/field/time/time.component.ts +21 -7
  38. package/lib/field/url/url.component.html +1 -1
  39. package/lib/field/url/url.component.ts +13 -5
  40. package/lib/field/user-reference/user-reference.component.html +2 -10
  41. package/lib/field/user-reference/user-reference.component.ts +42 -14
  42. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  43. package/lib/infra/Containers/flow-container/flow-container.component.ts +10 -6
  44. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -1
  45. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  46. package/lib/infra/Containers/view-container/helper.ts +22 -0
  47. package/lib/infra/Containers/view-container/view-container.component.ts +5 -17
  48. package/lib/infra/assignment/assignment.component.ts +0 -1
  49. package/lib/infra/defer-load/defer-load.component.ts +4 -4
  50. package/lib/infra/navbar/navbar.component.ts +3 -3
  51. package/lib/infra/root-container/root-container.component.ts +3 -3
  52. package/lib/infra/stages/stages.component.scss +2 -2
  53. package/lib/infra/view/view.component.html +7 -20
  54. package/lib/infra/view/view.component.ts +20 -2
  55. package/lib/template/app-shell/app-shell.component.ts +20 -2
  56. package/lib/template/base/details-template-base.ts +67 -0
  57. package/lib/template/base/form-template-base.ts +10 -0
  58. package/lib/template/case-summary/case-summary.component.ts +1 -1
  59. package/lib/template/case-view/case-view.component.html +4 -4
  60. package/lib/template/case-view/case-view.component.ts +8 -13
  61. package/lib/template/confirmation/confirmation.component.ts +1 -1
  62. package/lib/template/data-reference/data-reference.component.ts +36 -40
  63. package/lib/template/default-form/default-form.component.html +0 -4
  64. package/lib/template/default-form/default-form.component.ts +7 -23
  65. package/lib/template/details/details.component.ts +7 -41
  66. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
  67. package/lib/template/details-one-column/details-one-column.component.ts +7 -42
  68. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  69. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  70. package/lib/template/details-three-column/details-three-column.component.ts +7 -43
  71. package/lib/template/details-two-column/details-two-column.component.ts +8 -44
  72. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
  73. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  74. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -3
  75. package/lib/template/field-group-template/field-group-template.component.ts +2 -4
  76. package/lib/template/field-value-list/field-value-list.component.html +1 -1
  77. package/lib/template/field-value-list/field-value-list.component.scss +2 -1
  78. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
  79. package/lib/template/list-view/list-view.component.html +3 -0
  80. package/lib/template/list-view/list-view.component.scss +11 -0
  81. package/lib/template/list-view/list-view.component.ts +24 -4
  82. package/lib/template/list-view/listViewHelpers.ts +1 -1
  83. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
  84. package/lib/template/one-column/one-column.component.ts +4 -3
  85. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
  86. package/lib/template/page/page.component.ts +1 -1
  87. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
  88. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -1
  89. package/lib/template/simple-table-manual/helpers.ts +1 -1
  90. package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
  91. package/lib/template/simple-table-manual/simple-table-manual.component.ts +15 -13
  92. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -3
  93. package/lib/template/three-column/three-column.component.ts +4 -3
  94. package/lib/template/two-column/two-column.component.ts +4 -3
  95. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
  96. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
  97. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
  98. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -3
  99. package/lib/widget/attachment/attachment.component.ts +7 -9
  100. package/lib/widget/feed-container/feed-container.component.ts +7 -7
  101. package/lib/widget/file-utility/file-utility.component.ts +2 -5
  102. package/lib/widget/todo/todo.component.html +2 -2
  103. package/lib/widget/todo/todo.component.ts +93 -83
  104. package/package.json +1 -1
@@ -104,6 +104,8 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
104
104
 
105
105
  this.initContainer();
106
106
 
107
+ this.checkAndUpdate();
108
+
107
109
  PCore.getPubSubUtils().subscribe(
108
110
  PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
109
111
  () => {
@@ -198,7 +200,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
198
200
  }
199
201
 
200
202
  initContainer() {
201
- const containerMgr: any = this.pConn$.getContainerManager();
203
+ const containerMgr = this.pConn$.getContainerManager();
202
204
  const baseContext = this.pConn$.getContextName();
203
205
  const containerName = this.pConn$.getContainerName();
204
206
  const containerType = 'single';
@@ -237,7 +239,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
237
239
 
238
240
  // when true, update arChildren from pConn, otherwise, arChilren will be updated in updateSelf()
239
241
  if (bLoadChildren) {
240
- this.arChildren$ = this.pConn$.getChildren() as any[];
242
+ this.arChildren$ = this.pConn$.getChildren();
241
243
  }
242
244
 
243
245
  // const oData = this.pConn$.getDataObject();
@@ -277,7 +279,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
277
279
 
278
280
  hasAssignments() {
279
281
  let hasAssignments = false;
280
- const assignmentsList: any[] = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
282
+ const assignmentsList = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
281
283
  // const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
282
284
  // 8.7 includes assignments in Assignments List that may be assigned to
283
285
  // a different operator. So, see if there are any assignments for
@@ -312,7 +314,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
312
314
 
313
315
  isCaseWideLocalAction() {
314
316
  const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);
315
- const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS) as any[];
317
+ const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS);
316
318
  let bCaseWideAction = false;
317
319
  if (caseActions && actionID) {
318
320
  const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
@@ -457,7 +459,9 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
457
459
 
458
460
  showCaseMessages() {
459
461
  this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
460
- if (this.caseMessages$ || !this.hasAssignments()) {
462
+ // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
463
+ // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
464
+ if (!this.hasAssignments()) {
461
465
  this.bHasCaseMessages$ = true;
462
466
  this.bShowConfirm = true;
463
467
  this.checkSvg$ = this.utils.getImageSrc('check', this.utils.getSDKStaticContentUrl());
@@ -480,6 +484,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
480
484
  updateFlowContainerChildren() {
481
485
  // routingInfo was added as component prop in populateAdditionalProps
482
486
  const routingInfo = this.angularPConnect.getComponentProp(this, 'routingInfo');
487
+ this.confirm_pconn = null;
483
488
 
484
489
  let loadingInfo: any;
485
490
  try {
@@ -593,7 +598,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
593
598
  });
594
599
  }
595
600
 
596
- // eslint-disable-next-line sonarjs/no-identical-functions
597
601
  topViewRefresh(): void {
598
602
  Object.values(this.formGroup$.controls).forEach(control => {
599
603
  control.markAsTouched();
@@ -89,7 +89,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
89
89
  this.itemKey$ = baseContext.concat('/').concat(acName);
90
90
  }
91
91
 
92
- const containerMgr: any = this.pConn$.getContainerManager();
92
+ const containerMgr = this.pConn$.getContainerManager();
93
93
 
94
94
  containerMgr.initializeContainers({
95
95
  type: 'multiple'
@@ -18,7 +18,7 @@ export class PreviewViewContainerComponent implements OnInit {
18
18
  @Input() pConn$: typeof PConnect;
19
19
 
20
20
  ngOnInit(): void {
21
- const containerMgr: any = this.pConn$.getContainerManager();
21
+ const containerMgr = this.pConn$.getContainerManager();
22
22
 
23
23
  containerMgr.initializeContainers({
24
24
  type: 'multiple'
@@ -0,0 +1,22 @@
1
+ export const addContainerItem = pConnect => {
2
+ const containerManager = pConnect.getContainerManager();
3
+ const context = pConnect.getContextName();
4
+ containerManager.addContainerItem({
5
+ context,
6
+ semanticURL: ''
7
+ });
8
+ };
9
+
10
+ export const configureBrowserBookmark = pConnect => {
11
+ const context = pConnect.getContextName();
12
+ const containerName = pConnect.getContainerName();
13
+ const navPages = pConnect.getValue('pyPortal.pyPrimaryNavPages');
14
+ const defaultViewLabel = Array.isArray(navPages) && navPages[0] ? navPages[0].pyLabel : '';
15
+ PCore.configureForBrowserBookmark({
16
+ context,
17
+ containerName,
18
+ acName: containerName,
19
+ semanticURL: '',
20
+ defaultViewLabel
21
+ });
22
+ };
@@ -5,6 +5,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
5
5
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
6
6
  import { ReferenceComponent } from '@pega/angular-sdk-components';
7
7
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
+ import { configureBrowserBookmark } from './helper';
8
9
 
9
10
  /**
10
11
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
@@ -86,7 +87,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
86
87
 
87
88
  this.pConn$.isBoundToState();
88
89
 
89
- const containerMgr: any = this.pConn$.getContainerManager();
90
+ const containerMgr = this.pConn$.getContainerManager();
90
91
 
91
92
  this.prepareDispatchObject = this.prepareDispatchObject.bind(this);
92
93
 
@@ -96,20 +97,10 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
96
97
  // And expose less via ui-bootstrap.js
97
98
  this.state = {
98
99
  dispatchObject: this.dispatchObject,
99
- // PCore is defined in pxBootstrapShell - eventually will be exported in place of constellationCore
100
-
101
100
  visible: !PCore.checkIfSemanticURL()
102
101
  };
103
102
 
104
- // here, to match Nebula/Constellation, the constructor of ViewContainer is only called once, and thus init/add container is only
105
- // called once. Because of Angular creating and destroy components if the parent changes a lot, this component will be
106
- // created and destroyed more than once. So the sessionStore "hasViewContainer" is set to false in rootContainer and then
107
- // after first round is true here. Subsequent ViewContainer creation will not init/add more containers.
108
-
109
103
  if (sessionStorage.getItem('hasViewContainer') == 'false') {
110
- // unlike Nebula/Constellation, have to initializeContainer after we create a dispatcObject and state, otherwise, when calling
111
- // initializeContainer before, code will get executed that needs state that wasn't defined.
112
-
113
104
  containerMgr.initializeContainers({
114
105
  type: mode === CONTAINER_TYPE.MULTIPLE ? CONTAINER_TYPE.MULTIPLE : CONTAINER_TYPE.SINGLE
115
106
  });
@@ -118,12 +109,9 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
118
109
  /* NOTE: setContainerLimit use is temporary. It is a non-public, unsupported API. */
119
110
  PCore.getContainerUtils().setContainerLimit(`${APP.APP}/${name}`, limit);
120
111
  }
121
- }
122
112
 
123
- if (sessionStorage.getItem('hasViewContainer') == 'false') {
124
- if (this.pConn$.getMetadata().children) {
125
- containerMgr.addContainerItem(this.dispatchObject);
126
- }
113
+ if (!PCore.checkIfSemanticURL()) containerMgr.addContainerItem(this.pConn$ as any);
114
+ if (!this.displayOnlyFA$) configureBrowserBookmark(this.pConn$);
127
115
 
128
116
  sessionStorage.setItem('hasViewContainer', 'true');
129
117
  }
@@ -254,7 +242,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
254
242
  console.error(`ViewContainer has a newComp that is NOT a reference!`);
255
243
 
256
244
  this.createdViewPConn$ = newComp;
257
- const newConfigProps: any = newComp.getConfigProps();
245
+ const newConfigProps = newComp.getConfigProps();
258
246
  this.templateName$ = newConfigProps.template || '';
259
247
  this.title$ = newConfigProps.title || '';
260
248
  // update children with new view's children
@@ -332,7 +332,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
332
332
 
333
333
  savePromise
334
334
  .then(() => {
335
- // @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'.
336
335
  const caseType = this.pConn$.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
337
336
  PCore.getPubSubUtils().publish('cancelPressed');
338
337
  this.onSaveActionSuccess({ caseType, caseID, assignmentID });
@@ -81,7 +81,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
81
81
  this.resourceType = resourceType;
82
82
  this.isContainerPreview = /preview_[0-9]*/g.test(this.pConn$.getContextName());
83
83
 
84
- const theConfigProps: any = this.pConn$.getConfigProps();
84
+ const theConfigProps = this.pConn$.getConfigProps();
85
85
  this.deferLoadId = theConfigProps.deferLoadId;
86
86
  this.name = this.name || theConfigProps.name;
87
87
 
@@ -91,8 +91,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
91
91
  getViewOptions = () => ({
92
92
  viewContext: this.resourceType,
93
93
  pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID,
94
- container: this.isContainerPreview ? 'preview' : null,
95
- containerName: this.isContainerPreview ? 'preview' : null,
94
+ container: this.isContainerPreview ? 'preview' : undefined,
95
+ containerName: this.isContainerPreview ? 'preview' : undefined,
96
96
  updateData: this.isContainerPreview
97
97
  });
98
98
 
@@ -116,7 +116,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
116
116
  }
117
117
  };
118
118
  const configObject = PCore.createPConnect(config);
119
- configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
119
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
120
120
  this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
121
121
  this.componentName$ = this.loadedPConn$.getComponentName();
122
122
  if (this.deferLoadId) {
@@ -36,11 +36,11 @@ export class NavbarComponent implements OnInit, OnDestroy {
36
36
  navExpandCollapse$: string;
37
37
  bShowCaseTypes$ = false;
38
38
 
39
- portalApp$ = '';
39
+ portalApp$: string | undefined = '';
40
40
  portalLogoImage$: string;
41
41
  showAppName$?: boolean = false;
42
42
 
43
- portalOperator$: string;
43
+ portalOperator$: string | undefined;
44
44
  portalOperatorInitials$: string;
45
45
 
46
46
  actionsAPI: any;
@@ -131,7 +131,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
131
131
 
132
132
  this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');
133
133
  this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName();
134
- this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$);
134
+ this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? '');
135
135
  this.showAppName$ = this.configProps$.showAppName;
136
136
 
137
137
  this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel();
@@ -67,7 +67,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
67
67
  const { containers } = PCore.getStore().getState();
68
68
  const items = Object.keys(containers).filter(item => item.includes('root'));
69
69
 
70
- (PCore.getContainerUtils().getContainerAPI() as any).addContainerItems(items);
70
+ PCore.getContainerUtils().getContainerAPI().addContainerItems(items);
71
71
 
72
72
  // add preview and modalview containers to redux
73
73
  // keep local copies of the the pConnect that is related
@@ -156,7 +156,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
156
156
  if (items[key] && items[key].view && Object.keys(items[key].view).length > 0) {
157
157
  const itemView = items[key].view;
158
158
 
159
- const rootObject: any = PCore.createPConnect({
159
+ const rootObject = PCore.createPConnect({
160
160
  meta: itemView,
161
161
  options: {
162
162
  context: items[key].context
@@ -202,7 +202,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
202
202
 
203
203
  this.componentName$ = localPConn.getComponentName();
204
204
  if (this.componentName$ === 'ViewContainer') {
205
- const configProps: any = this.pConn$.getConfigProps();
205
+ const configProps = this.pConn$.getConfigProps();
206
206
  const viewContConfig = {
207
207
  meta: {
208
208
  type: 'ViewContainer',
@@ -59,13 +59,13 @@
59
59
  border-radius: 0.5rem;
60
60
  border: 0.0625rem solid var(--app-neutral-light-color);
61
61
  overflow: hidden;
62
- height: 2rem;
63
62
  display: flex;
63
+ flex-wrap: wrap;
64
64
  }
65
65
 
66
66
  .psdk-stages-chevron {
67
67
  position: relative;
68
- padding: calc(1rem);
68
+ padding: calc(0.5rem);
69
69
  display: flex;
70
70
  justify-content: center;
71
71
  align-items: center;
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="visibility$ !== false" class="ng-view-top">
2
- <div *ngIf="showLabel$ && label$ && templateName$ !== 'SimpleTable' && templateName$ !== 'DefaultForm'" class="template-title-container">
2
+ <div *ngIf="showLabel$ && label$ && !noHeaderTemplates.includes(templateName$)" class="template-title-container">
3
3
  <span>{{ label$ }}</span>
4
4
  </div>
5
5
 
@@ -14,25 +14,12 @@
14
14
  </ng-container>
15
15
 
16
16
  <ng-template #noTemplate>
17
- <div *ngIf="displayOnlyFA$; else displayAll">
18
- <div *ngFor="let kid of arChildren$">
19
- <div [ngSwitch]="kid.getPConnect().getComponentName()">
20
- <component-mapper
21
- [name]="kid.getPConnect().getComponentName()"
22
- [props]="{ pConn$: kid.getPConnect() }"
23
- errorMsg="View Missing (displayOnlyFA): {{ kid.getPConnect().getComponentName() }}"
24
- ></component-mapper>
25
- </div>
26
- </div>
17
+ <div *ngFor="let kid of arChildren$">
18
+ <component-mapper
19
+ [name]="kid.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: kid.getPConnect() }"
21
+ errorMsg="View Missing (displayAll): {{ kid.getPConnect().getComponentName() }}"
22
+ ></component-mapper>
27
23
  </div>
28
- <ng-template #displayAll>
29
- <div *ngFor="let kid of arChildren$">
30
- <component-mapper
31
- [name]="kid.getPConnect().getComponentName()"
32
- [props]="{ pConn$: kid.getPConnect() }"
33
- errorMsg="View Missing (displayAll): {{ kid.getPConnect().getComponentName() }}"
34
- ></component-mapper>
35
- </div>
36
- </ng-template>
37
24
  </ng-template>
38
25
  </div>
@@ -7,6 +7,22 @@ import { getAllFields } from '@pega/angular-sdk-components';
7
7
  import { ReferenceComponent } from '@pega/angular-sdk-components';
8
8
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
9
 
10
+ const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs'];
11
+ const DETAILS_TEMPLATES = [
12
+ 'Details',
13
+ 'DetailsFields',
14
+ 'DetailsOneColumn',
15
+ 'DetailsSubTabs',
16
+ 'DetailsThreeColumn',
17
+ 'DetailsTwoColumn',
18
+ 'NarrowWideDetails',
19
+ 'WideNarrowDetails'
20
+ ];
21
+
22
+ function isDetailsTemplate(template) {
23
+ return DETAILS_TEMPLATES.includes(template);
24
+ }
25
+
10
26
  /**
11
27
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
12
28
  * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
@@ -77,13 +93,15 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
77
93
 
78
94
  angularPConnectData: AngularPConnectData = {};
79
95
 
96
+ noHeaderTemplates = NO_HEADER_TEMPLATES;
97
+
80
98
  configProps$: ViewProps;
81
99
  inheritedProps$: any;
82
100
  arChildren$: any[];
83
101
  templateName$: string;
84
102
  title$ = '';
85
103
  label$ = '';
86
- showLabel$ = true;
104
+ showLabel$ = false;
87
105
  visibility$ = true;
88
106
 
89
107
  constructor(
@@ -142,7 +160,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
142
160
  this.templateName$ = this.configProps$.template || '';
143
161
  this.title$ = this.configProps$.title || '';
144
162
  this.label$ = this.configProps$.label || '';
145
- this.showLabel$ = this.configProps$.showLabel || this.showLabel$;
163
+ this.showLabel$ = this.configProps$.showLabel || isDetailsTemplate(this.templateName$) || this.showLabel$;
146
164
  // label & showLabel within inheritedProps takes precedence over configProps
147
165
  this.label$ = this.inheritedProps$.label || this.label$;
148
166
  this.showLabel$ = this.inheritedProps$.showLabel || this.showLabel$;
@@ -78,9 +78,27 @@ export class AppShellComponent implements OnInit, OnDestroy {
78
78
  if (this.pages$) {
79
79
  this.bShowAppShell$ = true;
80
80
  }
81
+
82
+ // @ts-ignore - Property 'pyCaseTypesAvailableToCreateDP' does not exist on type pxApplication
83
+ const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
84
+ if (caseTypesAvailableToCreateDP) {
85
+ const portalID = this.pConn$.getValue('.pyOwner');
86
+ PCore.getDataPageUtils()
87
+ .getPageDataAsync(caseTypesAvailableToCreateDP, this.pConn$.getContextName(), {
88
+ PortalName: portalID
89
+ })
90
+ .then((response: any) => {
91
+ if (response?.pyCaseTypesAvailableToCreate) {
92
+ this.pConn$.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
93
+ skipDirtyValidation: true
94
+ });
95
+ }
96
+ });
97
+ }
98
+
81
99
  this.caseTypes$ = this.configProps$.caseTypes;
82
100
 
83
- this.arChildren$ = this.pConn$.getChildren() as any[];
101
+ this.arChildren$ = this.pConn$.getChildren();
84
102
 
85
103
  this.portalTemplate = this.configProps$.portalTemplate;
86
104
 
@@ -129,7 +147,7 @@ export class AppShellComponent implements OnInit, OnDestroy {
129
147
  }
130
148
 
131
149
  this.caseTypes$ = this.configProps$.caseTypes;
132
- this.arChildren$ = this.pConn$.getChildren() as any[];
150
+ this.arChildren$ = this.pConn$.getChildren();
133
151
  });
134
152
  }
135
153
 
@@ -0,0 +1,67 @@
1
+ import { Directive, OnInit, OnDestroy, Injector, Input } from '@angular/core';
2
+ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
3
+
4
+ @Directive()
5
+ export class DetailsTemplateBase implements OnInit, OnDestroy {
6
+ @Input() pConn$: typeof PConnect;
7
+
8
+ // For interaction with AngularPConnect
9
+ protected angularPConnectData: AngularPConnectData = {};
10
+ protected angularPConnect;
11
+
12
+ childrenMetadataOld;
13
+
14
+ constructor(injector: Injector) {
15
+ this.angularPConnect = injector.get(AngularPConnectService);
16
+ }
17
+
18
+ ngOnInit(): void {
19
+ // First thing in initialization is registering and subscribing to the AngularPConnect service
20
+ this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
21
+
22
+ this.checkAndUpdate();
23
+ }
24
+
25
+ ngOnDestroy() {
26
+ if (this.angularPConnectData.unsubscribeFn) {
27
+ this.angularPConnectData.unsubscribeFn();
28
+ }
29
+ }
30
+
31
+ onStateChange() {
32
+ this.checkAndUpdate();
33
+ }
34
+
35
+ checkAndUpdate() {
36
+ // Should always check the bridge to see if the component should update itself (re-render)
37
+ const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
38
+
39
+ // Only call updateSelf when the component should update
40
+ if (bUpdateSelf || this.hasRawMetadataChanged()) {
41
+ this.updateSelf();
42
+ }
43
+ }
44
+
45
+ // this method will get overriden by the child component
46
+ updateSelf() {}
47
+
48
+ hasRawMetadataChanged(): boolean {
49
+ const newChildrenMetadata = this.fetchChildrenMetadata();
50
+
51
+ if (!PCore.isDeepEqual(newChildrenMetadata, this.childrenMetadataOld)) {
52
+ this.childrenMetadataOld = newChildrenMetadata;
53
+ return true;
54
+ }
55
+
56
+ return false;
57
+ }
58
+
59
+ fetchChildrenMetadata() {
60
+ const children = this.pConn$.getChildren() || [];
61
+
62
+ return children.map(child => {
63
+ const pConnect = child.getPConnect();
64
+ return pConnect.resolveConfigProps(pConnect.getRawMetadata());
65
+ });
66
+ }
67
+ }
@@ -0,0 +1,10 @@
1
+ import { Directive, OnDestroy } from '@angular/core';
2
+
3
+ @Directive()
4
+ export class FormTemplateBase implements OnDestroy {
5
+ pConn$: any;
6
+
7
+ ngOnDestroy(): void {
8
+ PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
9
+ }
10
+ }
@@ -55,7 +55,7 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
55
55
  // Then, continue on with other initialization
56
56
 
57
57
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
58
- this.arChildren$ = this.pConn$.getChildren() as any[];
58
+ this.arChildren$ = this.pConn$.getChildren();
59
59
 
60
60
  this.generatePrimaryAndSecondaryFields();
61
61
 
@@ -1,5 +1,5 @@
1
1
  <div class="psdk-case-view" id="case-view">
2
- <div *ngIf="!displayOnlyFA$" class="psdk-case-view-info">
2
+ <div class="psdk-case-view-info">
3
3
  <mat-toolbar color="primary" class="psdk-case-view-toolbar">
4
4
  <mat-toolbar-row style="padding-left: 1rem">
5
5
  <div class="psdk-case-icon-div">
@@ -47,7 +47,7 @@
47
47
  ></component-mapper>
48
48
  </div>
49
49
  <div class="psdk-case-view-main">
50
- <div *ngIf="!displayOnlyFA$">
50
+ <div>
51
51
  <div *ngFor="let kid of arChildren$">
52
52
  <div
53
53
  *ngIf="
@@ -73,11 +73,11 @@
73
73
  </div>
74
74
  </div>
75
75
 
76
- <div *ngIf="!displayOnlyFA$">
76
+ <div>
77
77
  <component-mapper name="DeferLoad" [props]="{ pConn$, loadData$: tabData$, name: tabData$?.config?.name }"></component-mapper>
78
78
  </div>
79
79
  </div>
80
- <div *ngIf="!displayOnlyFA$">
80
+ <div>
81
81
  <div *ngIf="arChildren$" class="psdk-case-view-utilities">
82
82
  <div *ngFor="let kid of arChildren$">
83
83
  <div *ngIf="kid.getPConnect().getRawMetadata()?.type.toLowerCase() == 'region' && kid.getPConnect().getRawMetadata()?.name == 'Utilities'">
@@ -27,7 +27,6 @@ interface CaseViewProps {
27
27
  export class CaseViewComponent implements OnInit, OnDestroy {
28
28
  @Input() pConn$: typeof PConnect;
29
29
  @Input() formGroup$: FormGroup;
30
- @Input() displayOnlyFA$: boolean;
31
30
 
32
31
  // Used with AngularPConnect
33
32
  angularPConnectData: AngularPConnectData = {};
@@ -120,7 +119,7 @@ export class CaseViewComponent implements OnInit, OnDestroy {
120
119
  if (hasNewAttachments !== this.bHasNewAttachments) {
121
120
  this.bHasNewAttachments = hasNewAttachments;
122
121
  if (this.bHasNewAttachments) {
123
- PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
122
+ PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
124
123
  }
125
124
  }
126
125
 
@@ -161,19 +160,15 @@ export class CaseViewComponent implements OnInit, OnDestroy {
161
160
 
162
161
  this.svgCase$ = this.utils.getImageSrc(this.configProps$.icon, this.utils.getSDKStaticContentUrl());
163
162
 
164
- // this.utils.consoleKidDump(this.pConn$);
165
-
166
- if (!this.displayOnlyFA$) {
167
- for (const kid of this.arChildren$) {
168
- const kidPConn = kid.getPConnect();
169
- if (kidPConn.getRawMetadata().name == 'Tabs') {
170
- this.mainTabs = kid;
171
- this.mainTabData = this.mainTabs.getPConnect().getChildren();
172
- }
163
+ for (const kid of this.arChildren$) {
164
+ const kidPConn = kid.getPConnect();
165
+ if (kidPConn.getRawMetadata().name == 'Tabs') {
166
+ this.mainTabs = kid;
167
+ this.mainTabData = this.mainTabs.getPConnect().getChildren();
173
168
  }
174
-
175
- this.generateTabsData();
176
169
  }
170
+
171
+ this.generateTabsData();
177
172
  }
178
173
 
179
174
  generateTabsData() {
@@ -43,7 +43,7 @@ export class ConfirmationComponent implements OnInit, OnDestroy {
43
43
  // First thing in initialization is registering and subscribing to the AngularPConnect service
44
44
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
45
45
  this.CONSTS = PCore.getConstants();
46
- const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(this.pConn$.getTarget());
46
+ const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(this.pConn$.getTarget() ?? null);
47
47
  this.rootInfo = PCore.getContainerUtils().getContainerItemData(this.pConn$.getTarget(), activeContainerItemID);
48
48
  this.checkAndUpdate();
49
49
  }