@pega/angular-sdk-overrides 23.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 (137) 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.html +7 -4
  4. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  5. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
  6. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
  7. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
  8. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
  9. package/lib/designSystemExtension/operator/operator.component.ts +11 -6
  10. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
  11. package/lib/field/auto-complete/auto-complete.component.ts +17 -14
  12. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
  13. package/lib/field/check-box/check-box.component.html +16 -15
  14. package/lib/field/check-box/check-box.component.scss +14 -1
  15. package/lib/field/check-box/check-box.component.ts +128 -45
  16. package/lib/field/currency/currency.component.html +16 -7
  17. package/lib/field/currency/currency.component.ts +55 -20
  18. package/lib/field/date/date.component.html +1 -6
  19. package/lib/field/date/date.component.ts +22 -39
  20. package/lib/field/date-time/date-time.component.html +6 -7
  21. package/lib/field/date-time/date-time.component.ts +28 -45
  22. package/lib/field/decimal/decimal.component.html +14 -4
  23. package/lib/field/decimal/decimal.component.ts +47 -7
  24. package/lib/field/dropdown/dropdown.component.ts +132 -21
  25. package/lib/field/email/email.component.ts +14 -4
  26. package/lib/field/group/group.component.html +1 -1
  27. package/lib/field/group/group.component.ts +6 -2
  28. package/lib/field/integer/integer.component.html +1 -1
  29. package/lib/field/integer/integer.component.ts +13 -5
  30. package/lib/field/multiselect/multiselect.component.html +33 -0
  31. package/lib/field/multiselect/multiselect.component.scss +7 -0
  32. package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
  33. package/lib/field/multiselect/multiselect.component.ts +369 -0
  34. package/lib/field/multiselect/utils.ts +209 -0
  35. package/lib/field/percentage/percentage.component.html +17 -6
  36. package/lib/field/percentage/percentage.component.ts +51 -12
  37. package/lib/field/phone/phone.component.html +1 -1
  38. package/lib/field/phone/phone.component.ts +11 -14
  39. package/lib/field/radio-buttons/radio-buttons.component.ts +9 -12
  40. package/lib/field/rich-text/config-ext.json +10 -0
  41. package/lib/field/rich-text/rich-text.component.html +1 -1
  42. package/lib/field/rich-text/rich-text.component.ts +8 -6
  43. package/lib/field/scalar-list/scalar-list.component.ts +4 -4
  44. package/lib/field/text/text.component.ts +2 -0
  45. package/lib/field/text-area/text-area.component.html +2 -1
  46. package/lib/field/text-area/text-area.component.ts +13 -8
  47. package/lib/field/text-input/text-input.component.html +1 -1
  48. package/lib/field/text-input/text-input.component.ts +13 -5
  49. package/lib/field/time/time.component.html +3 -2
  50. package/lib/field/time/time.component.ts +23 -7
  51. package/lib/field/url/url.component.html +2 -1
  52. package/lib/field/url/url.component.ts +15 -5
  53. package/lib/field/user-reference/user-reference.component.html +42 -45
  54. package/lib/field/user-reference/user-reference.component.ts +73 -27
  55. package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
  56. package/lib/infra/Containers/base-components/helper.ts +89 -0
  57. package/lib/infra/Containers/flow-container/flow-container.component.html +9 -4
  58. package/lib/infra/Containers/flow-container/flow-container.component.ts +38 -33
  59. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +41 -9
  60. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  61. package/lib/infra/Containers/view-container/helper.ts +22 -0
  62. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  63. package/lib/infra/assignment/assignment.component.ts +37 -39
  64. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  65. package/lib/infra/defer-load/defer-load.component.ts +9 -12
  66. package/lib/infra/multi-step/multi-step.component.html +1 -1
  67. package/lib/infra/multi-step/multi-step.component.scss +1 -0
  68. package/lib/infra/navbar/navbar.component.html +4 -4
  69. package/lib/infra/navbar/navbar.component.ts +9 -6
  70. package/lib/infra/root-container/root-container.component.ts +3 -3
  71. package/lib/infra/stages/stages.component.scss +2 -2
  72. package/lib/infra/view/view.component.html +7 -20
  73. package/lib/infra/view/view.component.ts +21 -3
  74. package/lib/template/app-shell/app-shell.component.ts +20 -2
  75. package/lib/template/banner-page/config-ext.json +9 -0
  76. package/lib/template/base/details-template-base.ts +67 -0
  77. package/lib/template/base/form-template-base.ts +10 -0
  78. package/lib/template/case-summary/case-summary.component.ts +38 -4
  79. package/lib/template/case-view/case-view.component.html +7 -7
  80. package/lib/template/case-view/case-view.component.scss +2 -0
  81. package/lib/template/case-view/case-view.component.ts +8 -19
  82. package/lib/template/confirmation/confirmation.component.ts +1 -1
  83. package/lib/template/data-reference/data-reference.component.ts +37 -43
  84. package/lib/template/default-form/default-form.component.html +0 -4
  85. package/lib/template/default-form/default-form.component.ts +7 -23
  86. package/lib/template/details/details.component.ts +7 -41
  87. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
  88. package/lib/template/details-one-column/details-one-column.component.ts +7 -42
  89. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  90. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  91. package/lib/template/details-three-column/details-three-column.component.ts +7 -43
  92. package/lib/template/details-two-column/details-two-column.component.ts +8 -44
  93. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
  94. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  95. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  96. package/lib/template/field-group-template/field-group-template.component.ts +4 -14
  97. package/lib/template/field-value-list/field-value-list.component.html +8 -3
  98. package/lib/template/field-value-list/field-value-list.component.scss +2 -1
  99. package/lib/template/field-value-list/field-value-list.component.ts +1 -0
  100. package/lib/template/inline-dashboard-page/config-ext.json +9 -0
  101. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
  102. package/lib/template/list-view/list-view.component.html +9 -6
  103. package/lib/template/list-view/list-view.component.scss +11 -0
  104. package/lib/template/list-view/list-view.component.ts +60 -32
  105. package/lib/template/list-view/listViewHelpers.ts +1 -2
  106. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
  107. package/lib/template/one-column/one-column.component.ts +4 -3
  108. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
  109. package/lib/template/page/page.component.ts +1 -1
  110. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
  111. package/lib/template/repeating-structures/repeating-structures.component.ts +2 -3
  112. package/lib/template/simple-table/simple-table.component.ts +0 -2
  113. package/lib/template/simple-table-manual/helpers.ts +2 -2
  114. package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
  115. package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
  116. package/lib/template/simple-table-manual/simple-table-manual.component.ts +60 -28
  117. package/lib/template/simple-table-select/simple-table-select.component.ts +5 -7
  118. package/lib/template/three-column/three-column.component.ts +4 -3
  119. package/lib/template/two-column/two-column.component.ts +4 -3
  120. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
  121. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
  122. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
  123. package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
  124. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +5 -4
  125. package/lib/widget/attachment/attachment.component.html +50 -26
  126. package/lib/widget/attachment/attachment.component.scss +118 -0
  127. package/lib/widget/attachment/attachment.component.ts +256 -503
  128. package/lib/widget/case-history/case-history.component.ts +1 -2
  129. package/lib/widget/feed-container/feed-container.component.ts +7 -11
  130. package/lib/widget/file-utility/file-utility.component.html +2 -2
  131. package/lib/widget/file-utility/file-utility.component.ts +15 -22
  132. package/lib/widget/list-utility/list-utility.component.html +1 -1
  133. package/lib/widget/quick-create/config-ext.json +9 -0
  134. package/lib/widget/quick-create/quick-create.component.ts +1 -1
  135. package/lib/widget/todo/todo.component.html +8 -7
  136. package/lib/widget/todo/todo.component.ts +97 -86
  137. package/package.json +1 -1
@@ -44,7 +44,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
44
44
 
45
45
  ngOnInit(): void {
46
46
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
47
- this.loadActiveTab();
47
+ // The below call is causing an error while creating/opening a case, hence commenting it out
48
+ // this.loadActiveTab();
48
49
  }
49
50
 
50
51
  ngOnDestroy(): void {
@@ -56,7 +57,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
56
57
  onStateChange() {
57
58
  // Should always check the bridge to see if the component should
58
59
  // update itself (re-render)
59
- // @ts-ignore - second parameter pageReference for getValue method should be optional
60
60
  const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
61
61
  if (theRequestedAssignment !== this.currentLoadedAssignment) {
62
62
  this.currentLoadedAssignment = theRequestedAssignment;
@@ -65,7 +65,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
65
65
  }
66
66
 
67
67
  ngOnChanges() {
68
- // @ts-ignore - second parameter pageReference for getValue method should be optional
69
68
  this.loadViewCaseID = this.pConn$.getValue(this.constants.PZINSKEY) || this.pConn$.getValue(this.constants.CASE_INFO.CASE_INFO_ID);
70
69
  let containerItemData;
71
70
  const targetName = this.pConn$.getTarget();
@@ -82,7 +81,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
82
81
  this.resourceType = resourceType;
83
82
  this.isContainerPreview = /preview_[0-9]*/g.test(this.pConn$.getContextName());
84
83
 
85
- const theConfigProps: any = this.pConn$.getConfigProps();
84
+ const theConfigProps = this.pConn$.getConfigProps();
86
85
  this.deferLoadId = theConfigProps.deferLoadId;
87
86
  this.name = this.name || theConfigProps.name;
88
87
 
@@ -91,10 +90,9 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
91
90
 
92
91
  getViewOptions = () => ({
93
92
  viewContext: this.resourceType,
94
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
95
93
  pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID,
96
- container: this.isContainerPreview ? 'preview' : null,
97
- containerName: this.isContainerPreview ? 'preview' : null,
94
+ container: this.isContainerPreview ? 'preview' : undefined,
95
+ containerName: this.isContainerPreview ? 'preview' : undefined,
98
96
  updateData: this.isContainerPreview
99
97
  });
100
98
 
@@ -118,7 +116,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
118
116
  }
119
117
  };
120
118
  const configObject = PCore.createPConnect(config);
121
- configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
119
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
122
120
  this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
123
121
  this.componentName$ = this.loadedPConn$.getComponentName();
124
122
  if (this.deferLoadId) {
@@ -138,9 +136,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
138
136
  this.pConn$
139
137
  .getActionsApi()
140
138
  .showData(this.name, dataContext, dataContextParameters, {
141
- // @ts-ignore - skipSemanticUrl should be boolean type
142
139
  skipSemanticUrl: true,
143
- // @ts-ignore
140
+ // @ts-ignore - Object literal may only specify known properties, and 'isDeferLoaded' does not exist in type '{ containerName: string; skipSemanticUrl: boolean; }'
144
141
  isDeferLoaded: true
145
142
  })
146
143
  .then(data => {
@@ -160,8 +157,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
160
157
  } else {
161
158
  this.pConn$
162
159
  .getActionsApi()
163
- .refreshCaseView(encodeURI(this.loadViewCaseID), this.name, null)
164
- .then(data => {
160
+ .refreshCaseView(encodeURI(this.loadViewCaseID), this.name, '')
161
+ .then((data: any) => {
165
162
  this.onResponse(data.root);
166
163
  });
167
164
  }
@@ -54,7 +54,7 @@
54
54
  <span>{{ i + 1 }}</span>
55
55
  </div>
56
56
  </div>
57
- <div class="{{ _getHLabelClass(mainStep.visited_status) }}">
57
+ <div id="multi-step-label" class="{{ _getHLabelClass(mainStep.visited_status) }}">
58
58
  <div class="psdk-horizontal-step-text-label">
59
59
  {{ mainStep.name }}
60
60
  </div>
@@ -163,6 +163,7 @@ mat-horizontal-stepper {
163
163
  .psdk-horizontal-stepper-header-container {
164
164
  white-space: nowrap;
165
165
  display: flex;
166
+ flex-wrap: wrap;
166
167
  align-items: center;
167
168
  text-align: left;
168
169
  }
@@ -22,7 +22,7 @@
22
22
  *ngFor="let caseType of caseTypes$"
23
23
  (click)="navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)"
24
24
  >
25
- <span class="psdk-nav-button-span">{{ caseType.pyLabel }}</span>
25
+ <span class="psdk-nav-button-span">{{ localeUtils.getLocaleValue(caseType.pyLabel, '', localeReference) }}</span>
26
26
  </mat-list-item>
27
27
  </mat-list>
28
28
  </mat-list>
@@ -32,14 +32,14 @@
32
32
  <mat-list-item (click)="navPanelButtonClick(page)">
33
33
  <div class="flex-box">
34
34
  <img class="psdk-nav-svg-icon" src="{{ page.iconName }}" />
35
- <span class="psdk-nav-button-span">{{ localizedVal(page.pyLabel, localeCategory) }}</span>
35
+ <span class="psdk-nav-button-span">{{ localeUtils.getLocaleValue(page.pyLabel, '', localeReference) }}</span>
36
36
  </div>
37
37
  </mat-list-item>
38
38
  </mat-list>
39
39
  </div>
40
40
  <div class="psdk-nav-divider"></div>
41
41
  <div>
42
- <mat-list>
42
+ <mat-list id="profile">
43
43
  <mat-list-item [matMenuTriggerFor]="menu" class="psdk-profile-list-item">
44
44
  <div class="flex-box">
45
45
  <div class="psdk-nav-oper-avatar">{{ portalOperatorInitials$ }}</div>
@@ -48,7 +48,7 @@
48
48
  </mat-list-item>
49
49
  <mat-menu #menu="matMenu">
50
50
  <button mat-menu-item>Profile</button>
51
- <button mat-menu-item (click)="navPanelLogoutClick()">{{ localizedVal('Logoff', localeCategory) }}</button>
51
+ <button mat-menu-item (click)="navPanelLogoutClick()">{{ localizedVal('Log off', localeCategory) }}</button>
52
52
  </mat-menu>
53
53
  </mat-list>
54
54
  </div>
@@ -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;
@@ -51,7 +51,8 @@ export class NavbarComponent implements OnInit, OnDestroy {
51
51
  navIcon$: string;
52
52
  localizedVal: any;
53
53
  localeCategory = 'AppShell';
54
-
54
+ localeUtils = PCore.getLocaleUtils();
55
+ localeReference: any;
55
56
  constructor(
56
57
  private angularPConnect: AngularPConnectService,
57
58
  private chRef: ChangeDetectorRef,
@@ -119,7 +120,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
119
120
  this.navPages$.forEach(page => {
120
121
  page.iconName = this.utils.getImageSrc(page.pxPageViewIcon, this.utils.getSDKStaticContentUrl());
121
122
  });
122
-
123
+ this.localeReference = this.pConn$.getValue('.pyLocaleReference');
123
124
  this.actionsAPI = this.pConn$.getActionsApi();
124
125
  this.createWork = this.actionsAPI.createWork.bind(this.actionsAPI);
125
126
  this.showPage = this.actionsAPI.showPage.bind(this.actionsAPI);
@@ -130,7 +131,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
130
131
 
131
132
  this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');
132
133
  this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName();
133
- this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$);
134
+ this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? '');
134
135
  this.showAppName$ = this.configProps$.showAppName;
135
136
 
136
137
  this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel();
@@ -163,7 +164,9 @@ export class NavbarComponent implements OnInit, OnDestroy {
163
164
  containerName: 'primary',
164
165
  flowType: sFlowType || 'pyStartCase'
165
166
  };
166
- this.createWork(sCaseType, actionInfo);
167
+ this.createWork(sCaseType, actionInfo).then(() => {
168
+ console.log('createWork completed');
169
+ });
167
170
  }
168
171
 
169
172
  navPanelLogoutClick() {
@@ -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$;
@@ -159,7 +177,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
159
177
  * The resolution lies in transferring this responsibility to the Reference component, eliminating the need for this code when Reference
160
178
  * component is able to handle it.
161
179
  */
162
- if (this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
180
+ if (!this.configProps$.visibility && this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
163
181
  this.visibility$ = evaluateVisibility(this.pConn$);
164
182
  }
165
183
 
@@ -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,9 @@
1
+ {
2
+ "name": "BannerPage",
3
+ "label": "Banner",
4
+ "description": "Banner Page Template",
5
+ "type": "Template",
6
+ "subtype": "PAGE",
7
+ "icon": "BannerPage.svg",
8
+ "properties": []
9
+ }
@@ -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
 
@@ -92,9 +92,43 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
92
92
  this.primaryFields$.push(kid.resolveConfigProps(kid.getRawMetadata()));
93
93
  }
94
94
 
95
- for (const oField of this.arChildren$[1].getPConnect().getChildren()) {
95
+ const secondarySummaryFields = this.prepareCaseSummaryData(this.arChildren$[1].getPConnect());
96
+ const secondaryChildren = this.arChildren$[1].getPConnect().getChildren();
97
+ secondaryChildren.forEach((oField, index) => {
96
98
  const kid = oField.getPConnect();
97
- this.secondaryFields$.push({ ...kid.resolveConfigProps(kid.getRawMetadata()), kid });
98
- }
99
+ const displayLabel = secondarySummaryFields[index].value.getPConnect().getConfigProps().label;
100
+ this.secondaryFields$.push({ ...kid.resolveConfigProps(kid.getRawMetadata()), kid, displayLabel });
101
+ });
102
+ }
103
+
104
+ prepareComponentInCaseSummary(pConnectMeta, getPConnect) {
105
+ const { config, children } = pConnectMeta;
106
+ const pConnect = getPConnect();
107
+
108
+ const caseSummaryComponentObject: any = {};
109
+
110
+ const { type } = pConnectMeta;
111
+ const createdComponent = pConnect.createComponent({
112
+ type,
113
+ children: children ? [...children] : [],
114
+ config: {
115
+ ...config
116
+ }
117
+ });
118
+
119
+ caseSummaryComponentObject.value = createdComponent;
120
+ return caseSummaryComponentObject;
121
+ }
122
+
123
+ prepareCaseSummaryData(summaryFieldChildren) {
124
+ const convertChildrenToSummaryData = kid => {
125
+ return kid?.map((childItem, index) => {
126
+ const childMeta = childItem.getPConnect().meta;
127
+ const caseSummaryComponentObject = this.prepareComponentInCaseSummary(childMeta, childItem.getPConnect);
128
+ caseSummaryComponentObject.id = index + 1;
129
+ return caseSummaryComponentObject;
130
+ });
131
+ };
132
+ return summaryFieldChildren ? convertChildrenToSummaryData(summaryFieldChildren?.getChildren()) : undefined;
99
133
  }
100
134
  }
@@ -1,16 +1,16 @@
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">
6
6
  <img class="psdk-case-svg-icon" src="{{ svgCase$ }}" />
7
7
  </div>
8
8
  <div class="psdk-case-view-heading">
9
- <div id="current-caseID" [hidden]="true">{{ currentCaseID }}</div>
10
- <div class="psdk-case-view-heading-id" id="caseId">{{ id$ }}</div>
11
9
  <div>
12
- <h1>{{ heading$ }}</h1>
10
+ <h1 id="case-name">{{ heading$ }}</h1>
13
11
  </div>
12
+ <div id="current-caseID" [hidden]="true">{{ currentCaseID }}</div>
13
+ <div class="psdk-case-view-heading-id" id="caseId">{{ id$ }}</div>
14
14
  </div>
15
15
  </mat-toolbar-row>
16
16
  </mat-toolbar>
@@ -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'">
@@ -48,6 +48,8 @@ h1 {
48
48
  width: 25rem;
49
49
  float: left;
50
50
  padding: 0rem 0.3125rem 0rem 0rem;
51
+ margin-left: 0.5rem;
52
+ margin-top: 0.5rem;
51
53
  height: 100%; /* Should be removed. Only for demonstration */
52
54
  background-color: var(--app-form-color);
53
55
  }
@@ -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 = {};
@@ -106,9 +105,7 @@ export class CaseViewComponent implements OnInit, OnDestroy {
106
105
  }
107
106
 
108
107
  hasCaseIDChanged(): boolean {
109
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
110
108
  if (this.currentCaseID !== this.pConn$.getDataObject().caseInfo.ID) {
111
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
112
109
  this.currentCaseID = this.pConn$.getDataObject().caseInfo.ID;
113
110
  return true;
114
111
  }
@@ -117,14 +114,12 @@ export class CaseViewComponent implements OnInit, OnDestroy {
117
114
 
118
115
  updateHeaderAndSummary() {
119
116
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseViewProps;
120
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
121
117
  const hasNewAttachments = this.pConn$.getDataObject().caseInfo?.hasNewAttachments;
122
118
 
123
119
  if (hasNewAttachments !== this.bHasNewAttachments) {
124
120
  this.bHasNewAttachments = hasNewAttachments;
125
121
  if (this.bHasNewAttachments) {
126
- // @ts-ignore - Argument of type 'boolean' is not assignable to parameter of type 'object'
127
- 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);
128
123
  }
129
124
  }
130
125
 
@@ -142,7 +137,6 @@ export class CaseViewComponent implements OnInit, OnDestroy {
142
137
 
143
138
  this.heading$ = PCore.getLocaleUtils().getLocaleValue(this.configProps$.header, '', this.localeKey);
144
139
  this.id$ = this.configProps$.subheader;
145
- // @ts-ignore - second parameter pageReference for getValue method should be optional
146
140
  this.status$ = this.pConn$.getValue('.pyStatusWork');
147
141
  });
148
142
  }
@@ -158,7 +152,6 @@ export class CaseViewComponent implements OnInit, OnDestroy {
158
152
 
159
153
  this.arChildren$ = this.pConn$.getChildren() as any[];
160
154
 
161
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
162
155
  const caseInfo = this.pConn$.getDataObject().caseInfo;
163
156
  this.currentCaseID = caseInfo.ID;
164
157
  this.arAvailableActions$ = caseInfo?.availableActions ? caseInfo.availableActions : [];
@@ -167,19 +160,15 @@ export class CaseViewComponent implements OnInit, OnDestroy {
167
160
 
168
161
  this.svgCase$ = this.utils.getImageSrc(this.configProps$.icon, this.utils.getSDKStaticContentUrl());
169
162
 
170
- // this.utils.consoleKidDump(this.pConn$);
171
-
172
- if (!this.displayOnlyFA$) {
173
- for (const kid of this.arChildren$) {
174
- const kidPConn = kid.getPConnect();
175
- if (kidPConn.getRawMetadata().name == 'Tabs') {
176
- this.mainTabs = kid;
177
- this.mainTabData = this.mainTabs.getPConnect().getChildren();
178
- }
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();
179
168
  }
180
-
181
- this.generateTabsData();
182
169
  }
170
+
171
+ this.generateTabsData();
183
172
  }
184
173
 
185
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
  }