@pega/angular-sdk-overrides 25.1.10 → 25.1.12

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 (24) hide show
  1. package/lib/field/check-box/check-box.component.html +5 -3
  2. package/lib/field/check-box/check-box.component.scss +6 -0
  3. package/lib/field/date-time/date-time.component.html +1 -1
  4. package/lib/field/location/location.component.html +1 -0
  5. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  6. package/lib/infra/Containers/flow-container/flow-container.component.ts +8 -5
  7. package/lib/infra/Containers/flow-container/helpers.ts +1 -1
  8. package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +2 -3
  9. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +2 -3
  10. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +2 -3
  11. package/lib/infra/Containers/view-container/view-container.component.ts +2 -3
  12. package/lib/infra/assignment/assignment.component.ts +1 -1
  13. package/lib/infra/defer-load/defer-load.component.ts +2 -3
  14. package/lib/infra/reference/reference.component.ts +2 -3
  15. package/lib/infra/root-container/root-container.component.ts +2 -3
  16. package/lib/infra/view/view.component.ts +2 -3
  17. package/lib/template/field-group-template/field-group-template.component.html +1 -1
  18. package/lib/template/field-group-template/field-group-template.component.scss +1 -0
  19. package/lib/template/field-group-template/field-group-template.component.ts +24 -19
  20. package/lib/template/list-view/list-view.component.html +2 -2
  21. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.html +1 -1
  22. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +27 -0
  23. package/lib/template/simple-table-manual/helpers.ts +1 -1
  24. package/package.json +1 -1
@@ -12,7 +12,9 @@
12
12
  <div [formGroup]="formGroup$" *ngIf="bVisible$">
13
13
  <div class="mat-form-field-infix" *ngIf="showLabel$">
14
14
  <span>
15
- <label class="mat-form-field-label psdk-label-readonly">{{ label$ }}</label>
15
+ <label class="mat-form-field-label psdk-label-readonly" [ngClass]="{ 'label-required': bRequired$ && selectionMode === 'multi' }">{{
16
+ label$
17
+ }}</label>
16
18
  </span>
17
19
  </div>
18
20
  <div *ngIf="selectionMode === 'multi'; else single">
@@ -38,11 +40,11 @@
38
40
  [formControl]="fieldControl"
39
41
  (change)="fieldOnChange($event)"
40
42
  (blur)="fieldOnBlur($event)"
41
- >{{ caption$ }}</mat-checkbox
43
+ ><span [ngClass]="{ 'label-required': bRequired$ }">{{ caption$ }}</span></mat-checkbox
42
44
  >
43
45
  <p *ngIf="helperText">{{ helperText }}</p>
44
46
  </ng-template>
45
- <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
47
+ <mat-error *ngIf="fieldControl.invalid && (fieldControl.touched || fieldControl.dirty)">{{ getErrorMessage() }}</mat-error>
46
48
  </div>
47
49
  </div>
48
50
  </ng-template>
@@ -34,3 +34,9 @@ mat-checkbox {
34
34
  .mat-mdc-option {
35
35
  margin-left: -16px;
36
36
  }
37
+
38
+ .label-required::after {
39
+ display: inline;
40
+ content: ' *';
41
+ vertical-align: top;
42
+ }
@@ -18,7 +18,7 @@
18
18
  />
19
19
  <mat-datepicker-toggle matSuffix [owlDateTimeTrigger]="dtPicker"></mat-datepicker-toggle>
20
20
  <owl-date-time #dtPicker [disabled]="bDisabled$" [scrollStrategy]="scrollStrategy"></owl-date-time>
21
- <mat-error *ngIf="fieldControl?.invalid">{{ getErrorMessage() }}</mat-error>
21
+ <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
22
22
  </mat-form-field>
23
23
  </div>
24
24
  </div>
@@ -9,6 +9,7 @@
9
9
  [formControl]="fieldControl"
10
10
  [required]="bRequired$"
11
11
  [matAutocomplete]="auto"
12
+ [readonly]="bReadonly$"
12
13
  [attr.data-test-id]="testId"
13
14
  (blur)="fieldOnBlur()"
14
15
  />
@@ -2,7 +2,7 @@
2
2
  <div *ngIf="!bShowConfirm">
3
3
  <div *ngIf="!todo_showTodo$">
4
4
  <h2 *ngIf="!isMultiStep">{{ containerName$ }}</h2>
5
- <div *ngIf="banners?.length">
5
+ <div *ngIf="banners.length">
6
6
  <component-mapper name="AlertBanner" [props]="{ banners }"></component-mapper>
7
7
  </div>
8
8
  </div>
@@ -11,9 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
14
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
15
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
16
- * is totally at your own risk.
14
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
15
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
17
16
  */
18
17
 
19
18
  interface FlowContainerProps {
@@ -66,7 +65,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
66
65
  localizedVal: any;
67
66
  localeCategory = 'Messages';
68
67
  localeReference: any;
69
- banners: any[];
68
+ banners: any[] = [];
70
69
  // itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
71
70
 
72
71
  pConnectOfActiveContainerItem;
@@ -547,7 +546,11 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
547
546
  const oWorkItem = configObject.getPConnect();
548
547
  const oWorkData: any = oWorkItem.getDataObject();
549
548
 
550
- this.containerName$ = this.localizedVal(this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name, undefined, this.localeReference);
549
+ this.containerName$ = this.localizedVal(
550
+ this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0]?.name,
551
+ undefined,
552
+ this.localeReference
553
+ );
551
554
  });
552
555
  }
553
556
 
@@ -33,7 +33,7 @@ export function hasAssignments(pConnect) {
33
33
  const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
34
34
  const childCasesAssignments = getChildCaseAssignments(pConnect);
35
35
 
36
- return assignments || childCasesAssignments?.length || isCaseWideLocalAction(pConnect);
36
+ return assignments?.length || childCasesAssignments?.length || isCaseWideLocalAction(pConnect);
37
37
  }
38
38
 
39
39
  export const showBanner = getPConnect => {
@@ -3,9 +3,8 @@ import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
 
5
5
  /**
6
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
7
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
8
- * is totally at your own risk.
6
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
7
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
9
8
  */
10
9
 
11
10
  // Right this is a skeleton, as Hybrid ViewContainer hasn't been implemented
@@ -9,9 +9,8 @@ import { getBanners } from '@pega/angular-sdk-components';
9
9
  import { ReferenceComponent } from '@pega/angular-sdk-components';
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
13
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
14
- * is totally at your own risk.
12
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
13
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
15
14
  */
16
15
 
17
16
  @Component({
@@ -1,9 +1,8 @@
1
1
  import { Component, OnInit, Input } from '@angular/core';
2
2
 
3
3
  /**
4
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
5
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
6
- * is totally at your own risk.
4
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
5
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
7
6
  */
8
7
 
9
8
  // Right this is a skeleton, as Preview hasn't been implemented
@@ -8,9 +8,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
8
  import { configureBrowserBookmark } from './helper';
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
12
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
13
- * is totally at your own risk.
11
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
12
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
14
13
  */
15
14
 
16
15
  interface ViewContainerProps {
@@ -225,7 +225,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
225
225
  // this.containerName$ = oWorkMeta["name"];
226
226
 
227
227
  if (oWorkData.caseInfo && oWorkData.caseInfo.assignments !== null) {
228
- this.containerName$ = oWorkData.caseInfo.assignments?.[0].name;
228
+ this.containerName$ = oWorkData.caseInfo.assignments?.[0]?.name;
229
229
 
230
230
  // get caseInfo
231
231
  const oCaseInfo = oData.caseInfo;
@@ -6,9 +6,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
6
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
7
7
 
8
8
  /**
9
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
10
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
11
- * is totally at your own risk.
9
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
10
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
12
11
  */
13
12
 
14
13
  @Component({
@@ -1,9 +1,8 @@
1
1
  import { Component } from '@angular/core';
2
2
 
3
3
  /**
4
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
5
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
6
- * is totally at your own risk.
4
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
5
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
7
6
  */
8
7
 
9
8
  @Component({
@@ -11,9 +11,8 @@ import { ModalViewContainerComponent } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
14
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
15
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
16
- * is totally at your own risk.
14
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
15
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
17
16
  */
18
17
 
19
18
  const options = { context: 'app' };
@@ -24,9 +24,8 @@ function isDetailsTemplate(template) {
24
24
  }
25
25
 
26
26
  /**
27
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
28
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
29
- * is totally at your own risk.
27
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
28
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
30
29
  */
31
30
 
32
31
  /**
@@ -28,6 +28,6 @@
28
28
  </div>
29
29
  </div>
30
30
  </div>
31
- <button *ngIf="allowAdd" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">{{ getAddBtnLabel() }}</button>
31
+ <button *ngIf="allowAdd()" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">{{ getAddBtnLabel() }}</button>
32
32
  </ng-template>
33
33
  </div>
@@ -1,5 +1,6 @@
1
1
  .psdk-utility-card-action-svg-icon {
2
2
  width: 1.4rem;
3
+ filter: var(--app-primary-color-filter);
3
4
  }
4
5
 
5
6
  .header-div {
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, signal } from '@angular/core';
1
+ import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, signal, effect } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { MatButtonModule } from '@angular/material/button';
@@ -48,32 +48,26 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
48
48
  referenceListLength = signal<number | null>(null);
49
49
  fieldHeader: any;
50
50
 
51
- allowAdd = true;
52
- allowEdit = true;
51
+ allowAdd = signal(true);
52
+ allowEdit = signal(true);
53
53
  allowDelete = true;
54
54
 
55
55
  constructor(
56
56
  private angularPConnect: AngularPConnectService,
57
57
  private utils: Utils
58
- ) {}
58
+ ) {
59
+ effect(() => {
60
+ const allowAdd = this.allowAdd();
61
+ const allowEdit = this.allowEdit();
62
+ const referenceList = this.configProps$?.referenceList;
63
+ if (referenceList?.length === 0 && (allowAdd || allowEdit)) {
64
+ this.pConn$.getListActions().insert({ classID: this.contextClass }, referenceList.length);
65
+ }
66
+ });
67
+ }
59
68
 
60
69
  ngOnInit(): void {
61
70
  this.menuIconOverride$ = this.utils.getImageSrc('trash', this.utils.getSDKStaticContentUrl());
62
-
63
- const { allowActions, allowTableEdit, referenceList } = this.configProps$;
64
-
65
- if (allowActions && Object.keys(allowActions).length > 0) {
66
- this.allowAdd = allowActions.allowAdd ?? allowTableEdit ?? true;
67
- this.allowEdit = allowActions.allowEdit ?? true;
68
- this.allowDelete = allowActions.allowDelete ?? allowTableEdit ?? true;
69
- } else {
70
- this.allowAdd = allowTableEdit ?? true;
71
- this.allowDelete = allowTableEdit ?? true;
72
- }
73
-
74
- if (referenceList?.length === 0 && (this.allowAdd || this.allowEdit)) {
75
- this.pConn$.getListActions().insert({ classID: this.contextClass }, referenceList.length);
76
- }
77
71
  }
78
72
 
79
73
  ngOnDestroy(): void {
@@ -121,6 +115,17 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
121
115
  const resolvedList = getReferenceList(this.pConn$);
122
116
  this.pConn$.setReferenceList(resolvedList);
123
117
 
118
+ const { allowActions, allowTableEdit } = this.configProps$;
119
+
120
+ if (allowActions && Object.keys(allowActions).length > 0) {
121
+ this.allowAdd.set(allowActions.allowAdd ?? allowTableEdit ?? true);
122
+ this.allowEdit.set(allowActions.allowEdit ?? true);
123
+ this.allowDelete = allowActions.allowDelete ?? allowTableEdit ?? true;
124
+ } else {
125
+ this.allowAdd.set(allowTableEdit ?? true);
126
+ this.allowDelete = allowTableEdit ?? true;
127
+ }
128
+
124
129
  if (this.readonlyMode) {
125
130
  this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
126
131
  }
@@ -176,7 +176,7 @@
176
176
  <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
177
177
  <tr mat-row *matRowDef="let row; columns: displayedColumns$"></tr>
178
178
  </table>
179
- <div *ngIf="repeatListData?.length === 0">
179
+ <div *ngIf="repeatListData.length === 0">
180
180
  <table id="list-view" mat-table [dataSource]="[]">
181
181
  <!-- Define columns for headers -->
182
182
  <ng-container *ngFor="let col of displayedColumns$" [matColumnDef]="col">
@@ -189,7 +189,7 @@
189
189
  <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
190
190
  </table>
191
191
  </div>
192
- <div class="psdk-no-records" *ngIf="repeatListData?.length === 0">
192
+ <div class="psdk-no-records" *ngIf="repeatListData.length === 0">
193
193
  {{ utils.getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.') }}
194
194
  </div>
195
195
  </div>
@@ -1,4 +1,4 @@
1
1
  <div>
2
2
  <h3 style="font-weight: bold; margin: 0">{{ label }}</h3>
3
- <component-mapper name="SimpleTable" [props]="{ pConn$ }"></component-mapper>
3
+ <component-mapper name="SimpleTable" [props]="{ pConn$: newPConn.getPConnect() }"></component-mapper>
4
4
  </div>
@@ -4,6 +4,8 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
5
 
6
6
  interface MultiReferenceReadOnlyProps {
7
+ readonlyContextList: string;
8
+ referenceList: string;
7
9
  label: string;
8
10
  hideLabel: boolean;
9
11
  }
@@ -21,6 +23,7 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
21
23
  angularPConnectData: AngularPConnectData = {};
22
24
  configProps$: MultiReferenceReadOnlyProps;
23
25
  label: string;
26
+ newPConn: any;
24
27
 
25
28
  constructor(private angularPConnect: AngularPConnectService) {}
26
29
 
@@ -49,5 +52,29 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
49
52
  updateSelf() {
50
53
  this.configProps$ = this.pConn$.getConfigProps() as MultiReferenceReadOnlyProps;
51
54
  this.label = this.configProps$.label;
55
+
56
+ const config = (this.pConn$.getMetadata() as any)?.config;
57
+ const { referenceList, readonlyContextList } = config;
58
+ let readonlyContextObject;
59
+ if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
60
+ readonlyContextObject = {
61
+ referenceList: readonlyContextList
62
+ };
63
+ }
64
+ const hideLabel = this.configProps$.hideLabel ?? false;
65
+ this.newPConn = this.pConn$.createComponent(
66
+ {
67
+ type: 'SimpleTable',
68
+ config: {
69
+ ...config,
70
+ ...readonlyContextObject,
71
+ label: this.label,
72
+ hideLabel
73
+ }
74
+ },
75
+ '',
76
+ 0,
77
+ {}
78
+ );
52
79
  }
53
80
  }
@@ -46,7 +46,7 @@ export const getContext = thePConn => {
46
46
  const pageReference = thePConn.getPageReference();
47
47
  const { readonlyContextList, referenceList = readonlyContextList } = thePConn.getStateProps()?.config || thePConn.getStateProps();
48
48
 
49
- const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;
49
+ const pageReferenceForRows = referenceList?.startsWith('.') ? `${pageReference}.${referenceList?.substring(1)}` : referenceList;
50
50
  const viewName = thePConn.viewName;
51
51
 
52
52
  // removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "25.1.10",
3
+ "version": "25.1.12",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"