@pega/angular-sdk-overrides 23.1.10 → 24.1.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 (85) hide show
  1. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +7 -4
  2. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
  3. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
  4. package/lib/designSystemExtension/operator/operator.component.ts +10 -5
  5. package/lib/field/auto-complete/auto-complete.component.ts +1 -1
  6. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
  7. package/lib/field/check-box/check-box.component.html +16 -15
  8. package/lib/field/check-box/check-box.component.scss +14 -1
  9. package/lib/field/check-box/check-box.component.ts +126 -44
  10. package/lib/field/currency/currency.component.html +15 -6
  11. package/lib/field/currency/currency.component.ts +36 -18
  12. package/lib/field/date-time/date-time.component.html +5 -5
  13. package/lib/field/date-time/date-time.component.ts +15 -37
  14. package/lib/field/decimal/decimal.component.html +14 -4
  15. package/lib/field/decimal/decimal.component.ts +42 -5
  16. package/lib/field/dropdown/dropdown.component.ts +0 -3
  17. package/lib/field/group/group.component.html +1 -1
  18. package/lib/field/group/group.component.ts +4 -0
  19. package/lib/field/multiselect/multiselect.component.html +33 -0
  20. package/lib/field/multiselect/multiselect.component.scss +7 -0
  21. package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
  22. package/lib/field/multiselect/multiselect.component.ts +359 -0
  23. package/lib/field/multiselect/utils.ts +209 -0
  24. package/lib/field/percentage/percentage.component.html +15 -4
  25. package/lib/field/percentage/percentage.component.ts +29 -5
  26. package/lib/field/radio-buttons/radio-buttons.component.ts +0 -3
  27. package/lib/field/rich-text/config-ext.json +10 -0
  28. package/lib/field/rich-text/rich-text.component.html +1 -1
  29. package/lib/field/scalar-list/scalar-list.component.ts +2 -1
  30. package/lib/field/text-area/text-area.component.ts +0 -2
  31. package/lib/field/time/time.component.html +1 -0
  32. package/lib/field/time/time.component.ts +2 -0
  33. package/lib/field/url/url.component.html +1 -0
  34. package/lib/field/url/url.component.ts +2 -0
  35. package/lib/field/user-reference/user-reference.component.html +50 -45
  36. package/lib/field/user-reference/user-reference.component.ts +33 -15
  37. package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
  38. package/lib/infra/Containers/base-components/helper.ts +89 -0
  39. package/lib/infra/Containers/flow-container/flow-container.component.html +8 -3
  40. package/lib/infra/Containers/flow-container/flow-container.component.ts +30 -29
  41. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +40 -8
  42. package/lib/infra/Containers/view-container/view-container.component.ts +0 -1
  43. package/lib/infra/assignment/assignment.component.ts +38 -39
  44. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  45. package/lib/infra/defer-load/defer-load.component.ts +5 -8
  46. package/lib/infra/multi-step/multi-step.component.html +1 -1
  47. package/lib/infra/multi-step/multi-step.component.scss +1 -0
  48. package/lib/infra/navbar/navbar.component.html +4 -4
  49. package/lib/infra/navbar/navbar.component.ts +6 -3
  50. package/lib/infra/view/view.component.ts +1 -1
  51. package/lib/template/banner-page/config-ext.json +9 -0
  52. package/lib/template/case-summary/case-summary.component.ts +37 -3
  53. package/lib/template/case-view/case-view.component.html +3 -3
  54. package/lib/template/case-view/case-view.component.scss +2 -0
  55. package/lib/template/case-view/case-view.component.ts +0 -6
  56. package/lib/template/data-reference/data-reference.component.ts +1 -3
  57. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +0 -1
  58. package/lib/template/field-group-template/field-group-template.component.ts +4 -12
  59. package/lib/template/field-value-list/field-value-list.component.html +7 -2
  60. package/lib/template/field-value-list/field-value-list.component.ts +1 -0
  61. package/lib/template/inline-dashboard-page/config-ext.json +9 -0
  62. package/lib/template/list-view/list-view.component.html +6 -6
  63. package/lib/template/list-view/list-view.component.ts +36 -28
  64. package/lib/template/list-view/listViewHelpers.ts +0 -1
  65. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  66. package/lib/template/simple-table/simple-table.component.ts +0 -2
  67. package/lib/template/simple-table-manual/helpers.ts +1 -1
  68. package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
  69. package/lib/template/simple-table-manual/simple-table-manual.component.ts +49 -19
  70. package/lib/template/simple-table-select/simple-table-select.component.ts +2 -4
  71. package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
  72. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +2 -1
  73. package/lib/widget/attachment/attachment.component.html +50 -26
  74. package/lib/widget/attachment/attachment.component.scss +118 -0
  75. package/lib/widget/attachment/attachment.component.ts +256 -501
  76. package/lib/widget/case-history/case-history.component.ts +1 -2
  77. package/lib/widget/feed-container/feed-container.component.ts +0 -4
  78. package/lib/widget/file-utility/file-utility.component.html +2 -2
  79. package/lib/widget/file-utility/file-utility.component.ts +13 -17
  80. package/lib/widget/list-utility/list-utility.component.html +1 -1
  81. package/lib/widget/quick-create/config-ext.json +9 -0
  82. package/lib/widget/quick-create/quick-create.component.ts +1 -1
  83. package/lib/widget/todo/todo.component.html +6 -5
  84. package/lib/widget/todo/todo.component.ts +7 -6
  85. package/package.json +1 -1
@@ -6,11 +6,11 @@
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>
@@ -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
  }
@@ -106,9 +106,7 @@ export class CaseViewComponent implements OnInit, OnDestroy {
106
106
  }
107
107
 
108
108
  hasCaseIDChanged(): boolean {
109
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
110
109
  if (this.currentCaseID !== this.pConn$.getDataObject().caseInfo.ID) {
111
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
112
110
  this.currentCaseID = this.pConn$.getDataObject().caseInfo.ID;
113
111
  return true;
114
112
  }
@@ -117,13 +115,11 @@ export class CaseViewComponent implements OnInit, OnDestroy {
117
115
 
118
116
  updateHeaderAndSummary() {
119
117
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseViewProps;
120
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
121
118
  const hasNewAttachments = this.pConn$.getDataObject().caseInfo?.hasNewAttachments;
122
119
 
123
120
  if (hasNewAttachments !== this.bHasNewAttachments) {
124
121
  this.bHasNewAttachments = hasNewAttachments;
125
122
  if (this.bHasNewAttachments) {
126
- // @ts-ignore - Argument of type 'boolean' is not assignable to parameter of type 'object'
127
123
  PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
128
124
  }
129
125
  }
@@ -142,7 +138,6 @@ export class CaseViewComponent implements OnInit, OnDestroy {
142
138
 
143
139
  this.heading$ = PCore.getLocaleUtils().getLocaleValue(this.configProps$.header, '', this.localeKey);
144
140
  this.id$ = this.configProps$.subheader;
145
- // @ts-ignore - second parameter pageReference for getValue method should be optional
146
141
  this.status$ = this.pConn$.getValue('.pyStatusWork');
147
142
  });
148
143
  }
@@ -158,7 +153,6 @@ export class CaseViewComponent implements OnInit, OnDestroy {
158
153
 
159
154
  this.arChildren$ = this.pConn$.getChildren() as any[];
160
155
 
161
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
162
156
  const caseInfo = this.pConn$.getDataObject().caseInfo;
163
157
  this.currentCaseID = caseInfo.ID;
164
158
  this.arAvailableActions$ = caseInfo?.availableActions ? caseInfo.availableActions : [];
@@ -176,10 +176,8 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
176
176
  handleSelection(event) {
177
177
  const caseKey = this.pConn$.getCaseInfo().getKey();
178
178
  const refreshOptions = { autoDetectRefresh: true };
179
- // @ts-ignore - second parameter pageReference for getValue method should be optional
180
179
  if (this.canBeChangedInReviewMode && this.pConn$.getValue('__currentPageTabViewName')) {
181
- // @ts-ignore - second parameter pageReference for getValue method should be optional
182
- this.pConn$.getActionsApi().refreshCaseView(caseKey, this.pConn$.getValue('__currentPageTabViewName'), null, refreshOptions);
180
+ this.pConn$.getActionsApi().refreshCaseView(caseKey, this.pConn$.getValue('__currentPageTabViewName'), '', refreshOptions);
183
181
  PCore.getDeferLoadManager().refreshActiveComponents(this.pConn$.getContextName());
184
182
  } else {
185
183
  const pgRef = this.pConn$.getPageReference().replace('caseInfo.content', '');
@@ -56,7 +56,6 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
56
56
  updateSelf() {
57
57
  const { referenceList } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
58
58
 
59
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
60
59
  const { tablabel } = this.pConn$.getComponentConfig();
61
60
  const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
62
61
 
@@ -149,20 +149,12 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
149
149
  };
150
150
 
151
151
  addFieldGroupItem() {
152
- if (PCore.getPCoreVersion()?.includes('8.7')) {
153
- this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length, this.pageReference);
154
- } else {
155
- // @ts-ignore - second parameter "pageRef" is optional for insert method
156
- this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
157
- }
152
+ // @ts-ignore - second parameter "pageRef" is optional for insert method
153
+ this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
158
154
  }
159
155
 
160
156
  deleteFieldGroupItem(index) {
161
- if (PCore.getPCoreVersion()?.includes('8.7')) {
162
- this.pConn$.getListActions().deleteEntry(index, this.pageReference);
163
- } else {
164
- // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
165
- this.pConn$.getListActions().deleteEntry(index);
166
- }
157
+ // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
158
+ this.pConn$.getListActions().deleteEntry(index);
167
159
  }
168
160
  }
@@ -1,7 +1,7 @@
1
1
  <div *ngIf="displayMode$ === 'LABELS_LEFT'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
2
2
  <div class="psdk-grid-label">{{ label$ }}</div>
3
3
  <div class="psdk-val-labels-left">
4
- {{ value$ || '---' }}
4
+ <ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
5
5
  </div>
6
6
  </div>
7
7
 
@@ -9,7 +9,12 @@
9
9
  <div *ngIf="displayMode$ === 'STACKED_LARGE_VAL'" class="psdk-container-stacked-large-val">
10
10
  <div class="psdk-grid-label">{{ label$ }}</div>
11
11
  <div class="psdk-val-stacked">
12
- {{ value$ || '---' }}
12
+ <ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
13
13
  </div>
14
14
  </div>
15
15
  </ng-template>
16
+
17
+ <ng-template #valueTemplate>
18
+ <div *ngIf="isHtml$; else valueOnly" id="instruction-text" [innerHTML]="value$ || '---'"></div>
19
+ <ng-template #valueOnly>{{ value$ || '---' }}</ng-template>
20
+ </ng-template>
@@ -12,4 +12,5 @@ export class FieldValueListComponent {
12
12
  @Input() label$: any;
13
13
  @Input() value$: any;
14
14
  @Input() displayMode$: any;
15
+ @Input() isHtml$ = false;
15
16
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "InlineDashboardPage",
3
+ "label": "Inline Dashboard",
4
+ "description": "Inline Dashboard Page Template",
5
+ "type": "Template",
6
+ "subtype": "PAGE",
7
+ "icon": "InlineDashboardPage.svg",
8
+ "properties": []
9
+ }
@@ -50,7 +50,7 @@
50
50
  color="primary"
51
51
  (click)="_listViewClick(dCol.config, element)"
52
52
  >
53
- {{ element[dCol.config.name] }}
53
+ {{ element[dCol.config.name] || '---' }}
54
54
  </button>
55
55
  <ng-template #regular>
56
56
  {{ element[dCol.config.name] || '---' }}
@@ -114,10 +114,10 @@
114
114
  color="primary"
115
115
  (click)="_listViewClick(dCol.config, element)"
116
116
  >
117
- {{ element[dCol.config.name] }}
117
+ {{ element[dCol.config.name] || '---' }}
118
118
  </button>
119
119
  <ng-template #regular>
120
- {{ element[dCol.config.name] }}
120
+ {{ element[dCol.config.name] || '---' }}
121
121
  </ng-template>
122
122
  </td>
123
123
  </ng-container>
@@ -150,20 +150,20 @@
150
150
  <ng-container *ngIf="singleSelectionMode" matColumnDef="select">
151
151
  <th mat-header-cell *matHeaderCellDef></th>
152
152
  <td mat-cell *matCellDef="let row">
153
- <mat-radio-button [value]="row[rowID]" (change)="fieldOnChange(row)"></mat-radio-button>
153
+ <mat-radio-button [value]="row[rowID]" [checked]="row[rowID] === checkBoxValue" (change)="fieldOnChange(row)"></mat-radio-button>
154
154
  </td>
155
155
  </ng-container>
156
156
  <ng-container *ngIf="multiSelectionMode" matColumnDef="select">
157
157
  <th mat-header-cell *matHeaderCellDef></th>
158
158
  <td mat-cell *matCellDef="let row">
159
- <mat-checkbox [value]="row[rowID]" (change)="onCheckboxClick(row, $event)"></mat-checkbox>
159
+ <mat-checkbox [value]="row[rowID]" [checked]="isChecked(row)" (change)="onCheckboxClick(row, $event)"></mat-checkbox>
160
160
  </td>
161
161
  </ng-container>
162
162
  <ng-container *ngFor="let dCol of fields$" [matColumnDef]="dCol.config.name">
163
163
  <th mat-header-cell *matHeaderCellDef mat-sort-header (click)="_headerSortClick($event, dCol)" arrowPosition="before">
164
164
  {{ dCol.config.label }}
165
165
  </th>
166
- <td mat-cell *matCellDef="let element">{{ element[dCol.config.name] }}</td>
166
+ <td mat-cell *matCellDef="let element">{{ element[dCol.config.name] || '---' }}</td>
167
167
  </ng-container>
168
168
 
169
169
  <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
@@ -40,6 +40,8 @@ interface ListViewProps {
40
40
  presets?: any;
41
41
  reorderFields: string | boolean;
42
42
  grouping: string | boolean;
43
+ value: any;
44
+ readonlyContextList: any;
43
45
  }
44
46
 
45
47
  export class Group {
@@ -156,6 +158,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
156
158
  fieldDefs: any;
157
159
  xRayApis = PCore.getDebugger().getXRayRuntime();
158
160
  xRayUid = this.xRayApis.startXRay();
161
+ checkBoxValue: string;
159
162
 
160
163
  constructor(
161
164
  private psService: ProgressSpinnerService,
@@ -169,7 +172,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
169
172
  /** If compositeKeys is defined, use dynamic value, else fallback to pyID or pyGUID. */
170
173
  this.compositeKeys = this.configProps$?.compositeKeys;
171
174
  this.rowID = this.compositeKeys && this.compositeKeys?.length === 1 ? this.compositeKeys[0] : defRowID;
172
- this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$.globalSearch ? this.configProps$.globalSearch : this.payload.globalSearch);
175
+ this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$?.globalSearch ? this.configProps$.globalSearch : this.payload?.globalSearch);
173
176
  this.bColumnReorder$ = this.utils.getBooleanValue(this.configProps$.reorderFields);
174
177
  this.bGrouping$ = this.utils.getBooleanValue(this.configProps$.grouping);
175
178
  this.showDynamicFields = this.configProps$?.showDynamicFields;
@@ -184,6 +187,8 @@ export class ListViewComponent implements OnInit, OnDestroy {
184
187
 
185
188
  this.selectionMode = this.configProps$.selectionMode;
186
189
 
190
+ this.checkBoxValue = this.configProps$.value;
191
+
187
192
  this.arFilterMainButtons$.push({ actionID: 'submit', jsAction: 'submit', name: 'Submit' });
188
193
  this.arFilterSecondaryButtons$.push({ actionID: 'cancel', jsAction: 'cancel', name: 'Cancel' });
189
194
 
@@ -353,7 +358,6 @@ export class ListViewComponent implements OnInit, OnDestroy {
353
358
  }
354
359
 
355
360
  getListData() {
356
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
357
361
  const componentConfig = this.pConn$.getComponentConfig();
358
362
  if (this.configProps$) {
359
363
  this.preparePayload();
@@ -364,8 +368,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
364
368
  const dataViewParameters = this.payload.parameters;
365
369
 
366
370
  const workListDataPromise = !this.bInForm$
367
- ? // @ts-ignore - 3rd parameter "context" should be optional in getData method
368
- PCore.getDataApiUtils().getData(refList, payload)
371
+ ? PCore.getDataApiUtils().getData(refList, payload)
369
372
  : PCore.getDataPageUtils().getDataAsync(
370
373
  refList,
371
374
  this.pConn$.getContextName(),
@@ -505,6 +508,13 @@ export class ListViewComponent implements OnInit, OnDestroy {
505
508
  }
506
509
  }
507
510
 
511
+ isChecked(rowIn): any {
512
+ const initialVal = false;
513
+ return this.configProps$?.readonlyContextList?.reduce((acc, currRow) => {
514
+ return acc || rowIn[this.rowID] === currRow[this.rowID];
515
+ }, initialVal);
516
+ }
517
+
508
518
  fieldOnChange(row) {
509
519
  const value = row[this.rowID];
510
520
  const reqObj = {};
@@ -517,6 +527,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
517
527
  } else {
518
528
  reqObj[this.rowID] = value;
519
529
  }
530
+ this.checkBoxValue = value;
520
531
  this.pConn$?.getListActions?.()?.setSelectedRows([reqObj]);
521
532
  }
522
533
 
@@ -601,7 +612,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
601
612
  this.pConn$.getActionsApi().openAssignment(pzInsKey, pxObjClass, {
602
613
  containerName: 'primary',
603
614
  channelName: ''
604
- });
615
+ } as any);
605
616
  } else {
606
617
  this.pConn$.getActionsApi().openWorkByHandle(pzInsKey, pxObjClass);
607
618
  }
@@ -619,10 +630,6 @@ export class ListViewComponent implements OnInit, OnDestroy {
619
630
  }
620
631
  }
621
632
 
622
- compare(a: number | string, b: number | string, isAsc: boolean) {
623
- return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
624
- }
625
-
626
633
  _headerSortClick(event, columnData) {
627
634
  // images 0 - filter, 1 - arrow, 2 - more
628
635
 
@@ -655,21 +662,22 @@ export class ListViewComponent implements OnInit, OnDestroy {
655
662
  this.filterSortGroupBy();
656
663
  }
657
664
 
658
- clearOutArrows(event, columnData) {
659
- const arImages = event.srcElement.parentElement.getElementsByTagName('img');
660
-
661
- for (const theImage of arImages) {
662
- // let theImage = arImages[i]
663
- const arrow = theImage.getAttribute('arrow');
664
- if (arrow) {
665
- const arrowId = theImage.getAttribute('arrowid');
666
- if (arrow != 'none' && arrowId != columnData.config.name) {
667
- theImage.setAttribute('arrow', 'none');
668
- theImage.src = '';
669
- }
670
- }
671
- }
672
- }
665
+ // Commenting below method, since the code which is using it, is already commented
666
+ // clearOutArrows(event, columnData) {
667
+ // const arImages = event.srcElement.parentElement.getElementsByTagName('img');
668
+
669
+ // for (const theImage of arImages) {
670
+ // // let theImage = arImages[i]
671
+ // const arrow = theImage.getAttribute('arrow');
672
+ // if (arrow) {
673
+ // const arrowId = theImage.getAttribute('arrowid');
674
+ // if (arrow != 'none' && arrowId != columnData.config.name) {
675
+ // theImage.setAttribute('arrow', 'none');
676
+ // theImage.src = '';
677
+ // }
678
+ // }
679
+ // }
680
+ // }
673
681
 
674
682
  sortCompare(a, b): number {
675
683
  let aValue = a[this.compareRef];
@@ -689,18 +697,18 @@ export class ListViewComponent implements OnInit, OnDestroy {
689
697
 
690
698
  switch (this.arrowDirection) {
691
699
  case 'up':
692
- if (aValue < bValue) {
700
+ if (!aValue || aValue < bValue) {
693
701
  return -1;
694
702
  }
695
- if (aValue > bValue) {
703
+ if (!bValue || aValue > bValue) {
696
704
  return 1;
697
705
  }
698
706
  break;
699
707
  case 'down':
700
- if (aValue > bValue) {
708
+ if (!bValue || aValue > bValue) {
701
709
  return -1;
702
710
  }
703
- if (aValue < bValue) {
711
+ if (!aValue || aValue < bValue) {
704
712
  return 1;
705
713
  }
706
714
  break;
@@ -25,7 +25,6 @@ export function useInit(props) {
25
25
  let selectionCountThreshold;
26
26
 
27
27
  // promise to fetch metadata
28
- // @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
29
28
  const metaDataPromise = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
30
29
 
31
30
  const promisesArray = [metaDataPromise];
@@ -41,8 +41,7 @@ export class RepeatingStructuresComponent implements OnInit, AfterViewInit {
41
41
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
42
42
  this.fields$ = this.initializeColumns(componentConfig.fields);
43
43
 
44
- const refList = this.configProps$.referenceList;
45
- // @ts-ignore - second parameter pageReference for getValue method should be optional
44
+ const refList: any = this.configProps$.referenceList;
46
45
  const tableDataResults = JSON.parse(JSON.stringify(this.pConn$.getValue(refList)));
47
46
 
48
47
  // update elements like date format
@@ -87,10 +87,8 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
87
87
  const { multiRecordDisplayAs } = this.configProps$;
88
88
  let { contextClass } = this.configProps$;
89
89
  if (!contextClass) {
90
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
91
90
  let listName = this.pConn$.getComponentConfig().referenceList;
92
91
  listName = PCore.getAnnotationUtils().getPropertyName(listName);
93
- // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'
94
92
  contextClass = this.pConn$.getFieldMetadata(listName)?.pageClass;
95
93
  }
96
94
  if (multiRecordDisplayAs === 'fieldGroup') {
@@ -130,7 +130,7 @@ export const buildFieldsForTable = (configFields, fields, showDeleteButton) => {
130
130
  type: 'text',
131
131
  label: fields[index].config.label || fields[index].config.caption,
132
132
  fillAvailableSpace: !!field.config.fillAvailableSpace,
133
- id: index,
133
+ id: `${index}`,
134
134
  name: field.config.value.substr(4),
135
135
  cellRenderer: TABLE_CELL,
136
136
  sort: false,
@@ -27,7 +27,7 @@
27
27
  </mat-menu>
28
28
  </div>
29
29
  </th>
30
- <td mat-cell *matCellDef="let element">{{ element[dCol.config.name] }}</td>
30
+ <td mat-cell *matCellDef="let element">{{ element[dCol.config.name] || '---' }}</td>
31
31
  </ng-container>
32
32
  <ng-container matColumnDef="DeleteIcon">
33
33
  <div *ngIf="allowEditingInModal">
@@ -157,6 +157,8 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
157
157
  editView: any;
158
158
  settingsSvgIcon$: string;
159
159
 
160
+ isInitialized = false;
161
+
160
162
  constructor(
161
163
  private angularPConnect: AngularPConnectService,
162
164
  private utils: Utils,
@@ -164,6 +166,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
164
166
  ) {}
165
167
 
166
168
  ngOnInit(): void {
169
+ this.isInitialized = true;
167
170
  // First thing in initialization is registering and subscribing to the AngularPConnect service
168
171
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
169
172
  this.configProps$ = this.pConn$.getConfigProps() as SimpleTableManualProps;
@@ -246,10 +249,8 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
246
249
  let { contextClass } = this.configProps$;
247
250
  this.referenceList = referenceList;
248
251
  if (!contextClass) {
249
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
250
252
  let listName = this.pConn$.getComponentConfig().referenceList;
251
253
  listName = PCore.getAnnotationUtils().getPropertyName(listName);
252
- // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'
253
254
  contextClass = this.pConn$.getFieldMetadata(listName)?.pageClass;
254
255
  }
255
256
  this.contextClass = contextClass;
@@ -300,6 +301,8 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
300
301
  // Nebula and we may not end up using it all.
301
302
  this.fieldDefs = buildFieldsForTable(rawFields, resolvedFields, showDeleteButton);
302
303
 
304
+ this.initializeDefaultPageInstructions();
305
+
303
306
  // end of from Nebula
304
307
 
305
308
  // Here, we use the "name" field in fieldDefs since that has the assoicated property
@@ -348,9 +351,25 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
348
351
  // ties the 3 data structures together.
349
352
  }
350
353
 
354
+ initializeDefaultPageInstructions() {
355
+ if (this.isInitialized) {
356
+ this.isInitialized = false;
357
+ if (this.allowEditingInModal) {
358
+ // @ts-ignore - An argument for 'uniqueField' was not provided.
359
+ this.pConn$.getListActions().initDefaultPageInstructions(
360
+ this.pConn$.getReferenceList(),
361
+ this.fieldDefs.filter(item => item.name).map(item => item.name)
362
+ );
363
+ } else {
364
+ // @ts-ignore - An argument for 'propertyNames' was not provided.
365
+ this.pConn$.getListActions().initDefaultPageInstructions(this.pConn$.getReferenceList());
366
+ }
367
+ }
368
+ }
369
+
351
370
  getResultsText() {
352
371
  const recordsCount = this.readOnlyMode ? this.rowData?.data.length : this.referenceList?.length;
353
- return `${recordsCount} result${recordsCount > 1 ? 's' : ''}`;
372
+ return `${recordsCount || 0} result${recordsCount > 1 ? 's' : ''}`;
354
373
  }
355
374
 
356
375
  sortCompare(a, b): number {
@@ -369,13 +388,28 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
369
388
  }
370
389
  }
371
390
 
372
- if (aValue === bValue) {
373
- return 0;
391
+ //
392
+ switch (this.arrowDirection) {
393
+ case 'up':
394
+ if (!aValue || aValue < bValue) {
395
+ return -1;
396
+ }
397
+ if (!bValue || aValue > bValue) {
398
+ return 1;
399
+ }
400
+ break;
401
+ case 'down':
402
+ if (!bValue || aValue > bValue) {
403
+ return -1;
404
+ }
405
+ if (!aValue || aValue < bValue) {
406
+ return 1;
407
+ }
408
+ break;
409
+ default:
410
+ break;
374
411
  }
375
412
 
376
- if (this.arrowDirection === 'up') return aValue - bValue;
377
- if (this.arrowDirection === 'down') return bValue - aValue;
378
-
379
413
  return 0;
380
414
  }
381
415
 
@@ -889,12 +923,14 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
889
923
  this.referenceList.length,
890
924
  PCore.getConstants().RESOURCE_STATUS.CREATE
891
925
  );
892
- } else if (PCore.getPCoreVersion()?.includes('8.7')) {
893
- this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length, this.pageReference);
894
926
  } else {
895
927
  // @ts-ignore - second parameter "pageRef" is optional for insert method
896
928
  this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
897
929
  }
930
+
931
+ this.pConn$.clearErrorMessages({
932
+ property: (this.pConn$.getStateProps() as any)?.referenceList?.substring(1)
933
+ } as any);
898
934
  }
899
935
 
900
936
  editRecord(data, index) {
@@ -912,12 +948,8 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
912
948
  }
913
949
 
914
950
  deleteRecord(index) {
915
- if (PCore.getPCoreVersion()?.includes('8.7')) {
916
- this.pConn$.getListActions().deleteEntry(index, this.pageReference);
917
- } else {
918
- // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
919
- this.pConn$.getListActions().deleteEntry(index);
920
- }
951
+ // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
952
+ this.pConn$.getListActions().deleteEntry(index);
921
953
  }
922
954
 
923
955
  buildElementsForTable() {
@@ -928,9 +960,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
928
960
  this.rawFields?.forEach(item => {
929
961
  const referenceListData = getReferenceList(this.pConn$);
930
962
  const isDatapage = referenceListData.startsWith('D_');
931
- const pageReferenceValue = isDatapage
932
- ? `${referenceListData}[${index}]`
933
- : `${this.pConn$.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
963
+ const pageReferenceValue = isDatapage ? `${referenceListData}[${index}]` : `${this.pConn$.getPageReference()}${referenceListData}[${index}]`;
934
964
  const config = {
935
965
  meta: item,
936
966
  options: {
@@ -85,10 +85,8 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy {
85
85
  contextPageReference = pageReference.concat('.').concat(referenceProp);
86
86
  }
87
87
  const metadata = isMultiSelectMode
88
- ? // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'
89
- this.pConn$.getFieldMetadata(`@P .${referenceProp}`)
90
- : // @ts-ignore - Property 'getCurrentPageFieldMetadata' is private and only accessible within class 'C11nEnv'
91
- this.pConn$.getCurrentPageFieldMetadata(contextPageReference);
88
+ ? this.pConn$.getFieldMetadata(`@P .${referenceProp}`)
89
+ : this.pConn$.getCurrentPageFieldMetadata(contextPageReference);
92
90
 
93
91
  const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = metadata;
94
92
 
@@ -25,7 +25,7 @@
25
25
  </mat-list-item>
26
26
  <mat-menu #menu="matMenu">
27
27
  <button mat-menu-item>Profile</button>
28
- <button mat-menu-item (click)="navPanelLogoutClick()">Logoff</button>
28
+ <button mat-menu-item (click)="navPanelLogoutClick()">{{ localizedVal('Log off', localeCategory) }}</button>
29
29
  </mat-menu>
30
30
  </mat-list>
31
31
  </mat-toolbar-row>
@@ -50,7 +50,8 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
50
50
  logout: any;
51
51
 
52
52
  navIcon$: string;
53
-
53
+ localizedVal = PCore.getLocaleUtils().getLocaleValue;
54
+ localeCategory = 'AppShell';
54
55
  constructor(
55
56
  private angularPConnect: AngularPConnectService,
56
57
  private cdRef: ChangeDetectorRef,