@pega/angular-sdk-overrides 0.24.2 → 0.24.4

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 (42) hide show
  1. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
  2. package/lib/field/currency/currency.component.html +12 -3
  3. package/lib/field/currency/currency.component.ts +7 -1
  4. package/lib/field/decimal/decimal.component.html +1 -0
  5. package/lib/field/decimal/decimal.component.ts +1 -0
  6. package/lib/field/dropdown/dropdown.component.ts +0 -3
  7. package/lib/field/percentage/percentage.component.html +12 -2
  8. package/lib/field/percentage/percentage.component.ts +6 -1
  9. package/lib/field/radio-buttons/radio-buttons.component.ts +0 -3
  10. package/lib/field/scalar-list/scalar-list.component.ts +2 -1
  11. package/lib/field/text-area/text-area.component.ts +0 -2
  12. package/lib/infra/Containers/flow-container/flow-container.component.html +2 -1
  13. package/lib/infra/Containers/flow-container/flow-container.component.ts +0 -12
  14. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +0 -1
  15. package/lib/infra/Containers/view-container/view-container.component.ts +0 -1
  16. package/lib/infra/assignment/assignment.component.ts +1 -6
  17. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  18. package/lib/infra/defer-load/defer-load.component.ts +5 -8
  19. package/lib/infra/navbar/navbar.component.ts +0 -1
  20. package/lib/template/case-view/case-view.component.html +2 -2
  21. package/lib/template/case-view/case-view.component.scss +2 -0
  22. package/lib/template/case-view/case-view.component.ts +0 -6
  23. package/lib/template/data-reference/data-reference.component.ts +1 -3
  24. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +0 -1
  25. package/lib/template/field-group-template/field-group-template.component.ts +4 -12
  26. package/lib/template/list-view/list-view.component.html +2 -2
  27. package/lib/template/list-view/list-view.component.ts +15 -4
  28. package/lib/template/list-view/listViewHelpers.ts +0 -1
  29. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  30. package/lib/template/simple-table/simple-table.component.ts +0 -2
  31. package/lib/template/simple-table-manual/simple-table-manual.component.ts +5 -10
  32. package/lib/template/simple-table-select/simple-table-select.component.ts +2 -4
  33. package/lib/widget/attachment/attachment.component.html +50 -34
  34. package/lib/widget/attachment/attachment.component.scss +118 -0
  35. package/lib/widget/attachment/attachment.component.ts +252 -500
  36. package/lib/widget/case-history/case-history.component.ts +0 -1
  37. package/lib/widget/feed-container/feed-container.component.ts +0 -4
  38. package/lib/widget/file-utility/file-utility.component.ts +0 -4
  39. package/lib/widget/quick-create/quick-create.component.ts +1 -1
  40. package/lib/widget/todo/todo.component.html +1 -1
  41. package/lib/widget/todo/todo.component.ts +6 -5
  42. package/package.json +1 -1
@@ -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,
@@ -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
  }
@@ -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') {
@@ -249,10 +249,8 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
249
249
  let { contextClass } = this.configProps$;
250
250
  this.referenceList = referenceList;
251
251
  if (!contextClass) {
252
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
253
252
  let listName = this.pConn$.getComponentConfig().referenceList;
254
253
  listName = PCore.getAnnotationUtils().getPropertyName(listName);
255
- // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'
256
254
  contextClass = this.pConn$.getFieldMetadata(listName)?.pageClass;
257
255
  }
258
256
  this.contextClass = contextClass;
@@ -357,12 +355,13 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
357
355
  if (this.isInitialized) {
358
356
  this.isInitialized = false;
359
357
  if (this.allowEditingInModal) {
358
+ // @ts-ignore - An argument for 'uniqueField' was not provided.
360
359
  this.pConn$.getListActions().initDefaultPageInstructions(
361
360
  this.pConn$.getReferenceList(),
362
361
  this.fieldDefs.filter(item => item.name).map(item => item.name)
363
362
  );
364
363
  } else {
365
- // @ts-ignore - An argument for 'fields' was not provided
364
+ // @ts-ignore - An argument for 'propertyNames' was not provided.
366
365
  this.pConn$.getListActions().initDefaultPageInstructions(this.pConn$.getReferenceList());
367
366
  }
368
367
  }
@@ -370,7 +369,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
370
369
 
371
370
  getResultsText() {
372
371
  const recordsCount = this.readOnlyMode ? this.rowData?.data.length : this.referenceList?.length;
373
- return `${recordsCount} result${recordsCount > 1 ? 's' : ''}`;
372
+ return `${recordsCount || 0} result${recordsCount > 1 ? 's' : ''}`;
374
373
  }
375
374
 
376
375
  sortCompare(a, b): number {
@@ -949,12 +948,8 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
949
948
  }
950
949
 
951
950
  deleteRecord(index) {
952
- if (PCore.getPCoreVersion()?.includes('8.7')) {
953
- this.pConn$.getListActions().deleteEntry(index, this.pageReference);
954
- } else {
955
- // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
956
- this.pConn$.getListActions().deleteEntry(index);
957
- }
951
+ // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
952
+ this.pConn$.getListActions().deleteEntry(index);
958
953
  }
959
954
 
960
955
  buildElementsForTable() {
@@ -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
 
@@ -1,39 +1,55 @@
1
- <div class="psdk-label-infix-readonly" *ngIf="bVisible$">
2
- <span class="psdk-label-wrapper-readonly">
3
- <label [ngClass]="{ 'psdk-label-readonly': true, 'label-required': bRequired$ === true }" [htmlFor]="att_valueRef">{{ label$ }}</label>
4
- </span>
5
- <div
6
- [ngClass]="{ 'psdk-modal-file-selector': status !== 'error', 'psdk-modal-file-selector-error': status === 'error' }"
7
- id="attachment-container"
8
- *ngIf="bShowSelector$"
9
- >
10
- <mat-spinner *ngIf="bLoading$" class="progress-spinner" diameter="40"></mat-spinner>
11
- <input hidden type="file" [required]="bRequired$" #uploader [id]="att_valueRef" [multiple]="allowMultiple$" (change)="uploadMyFiles($event)" />
12
-
13
- <button mat-stroked-button color="primary" [disabled]="bDisabled$" (click)="uploader.click()">
14
- {{
15
- allowMultiple$
16
- ? uploadMultipleFilesLabel === 'file_upload_text_multiple'
17
- ? 'Choose files'
18
- : uploadMultipleFilesLabel
19
- : uploadSingleFileLabel === 'file_upload_text_one'
20
- ? 'Choose a file'
21
- : uploadSingleFileLabel
22
- }}
23
- </button>
1
+ <div class="file-upload-container" *ngIf="bVisible$">
2
+ <span class="attachment-label" [ngClass]="{ 'file-label': bRequired$ }">{{ label$ }}</span>
3
+ <div *ngIf="(files.length === 0 && !allowMultiple$) || allowMultiple$">
4
+ <div
5
+ style="margin-bottom: 10px"
6
+ id="attachment-container"
7
+ [ngClass]="validateMessage ? 'psdk-modal-file-selector-error' : 'psdk-modal-file-selector'"
8
+ >
9
+ <div [hidden]="true" id="attachment-ID">
10
+ {{ valueRef }}
11
+ </div>
12
+ <input hidden type="file" [required]="bRequired$" #uploader [id]="valueRef" [multiple]="allowMultiple$" (change)="onFileAdded($event)" />
13
+ <button mat-stroked-button color="primary" [disabled]="bDisabled$" (click)="uploader.click()">
14
+ {{
15
+ allowMultiple$
16
+ ? uploadMultipleFilesLabel === 'file_upload_text_multiple'
17
+ ? 'Choose files'
18
+ : uploadMultipleFilesLabel
19
+ : uploadSingleFileLabel === 'file_upload_text_one'
20
+ ? 'Choose a file'
21
+ : uploadSingleFileLabel
22
+ }}
23
+ </button>
24
+ </div>
24
25
  </div>
25
26
  <span *ngIf="validateMessage" class="file-error">{{ validateMessage }}</span>
26
-
27
- <div class="psdk-attachment-list" *ngIf="arFileList$ != null && arFileList$.length > 0">
28
- <div *ngFor="let attachment of arFileList$">
29
- <component-mapper
30
- *ngIf="attachment.noDeleteIcon !== true; else showfull"
31
- name="SummaryItem"
32
- [props]="{ item$: attachment, menuIconOverride$: 'trash', menuIconOverrideAction$: removeFileFromList$ }"
33
- ></component-mapper>
34
- <ng-template #showfull>
35
- <component-mapper name="SummaryItem" [props]="{ item$: attachment, menuIconOverrideAction$: removeFileFromList$ }"></component-mapper>
36
- </ng-template>
27
+ <div *ngIf="files && files.length > 0">
28
+ <div *ngFor="let file of files">
29
+ <div class="psdk-attachment-card">
30
+ <div className="psdk-utility-card-icon">
31
+ <img *ngIf="!file.inProgress" class="psdk-attachment-card-svg-icon" src="{{ srcImg }}" />
32
+ <mat-spinner *ngIf="file.inProgress" class="progress-spinner" diameter="40"></mat-spinner>
33
+ </div>
34
+ <div class="psdk-attachment-card-main">
35
+ <div class="psdk-attachment-card-main-primary-label">{{ file.props.name }}</div>
36
+ <div *ngIf="file.props.meta" [ngStyle]="{ color: file.props.error ? 'red' : null }">{{ file.props.meta }}</div>
37
+ </div>
38
+ <div class="psdk-attachment-action">
39
+ <button id="delete-attachment" *ngIf="file.ID" class="psdk-utility-button" (click)="deleteFile(file)">
40
+ <img class="psdk-utility-card-action-svg-icon" src="{{ deleteIcon }}" />
41
+ </button>
42
+ <div *ngIf="!file.ID">
43
+ <button id="setting-button" mat-icon-button [matMenuTriggerFor]="actionMenu">
44
+ <mat-icon>more_vert</mat-icon>
45
+ </button>
46
+ <mat-menu #actionMenu="matMenu">
47
+ <button mat-menu-item (click)="downloadFile(file.responseProps ? file.responseProps : {})">Download</button>
48
+ <button mat-menu-item (click)="deleteFile(file)">Delete</button>
49
+ </mat-menu>
50
+ </div>
51
+ </div>
52
+ </div>
37
53
  </div>
38
54
  </div>
39
55
  </div>
@@ -53,3 +53,121 @@
53
53
  ::ng-deep .mat-mdc-form-field-infix {
54
54
  width: auto;
55
55
  }
56
+ .psdk-modal-file-selector {
57
+ border: 1px dashed var(--app-neutral-dark-color);
58
+ padding: 0.5rem;
59
+ text-align: center;
60
+ position: relative;
61
+ }
62
+
63
+ .label-required::after {
64
+ display: inline;
65
+ content: ' *';
66
+ vertical-align: top;
67
+ color: var(--app-neutral-dark-color);
68
+ }
69
+
70
+ .file-error {
71
+ color: var(--app-error-light-color);
72
+ }
73
+
74
+ .psdk-modal-file-selector-error {
75
+ border: 1px dashed var(--app-error-light-color);
76
+ padding: 0.5rem;
77
+ text-align: center;
78
+ position: relative;
79
+ }
80
+
81
+ .psdk-full-width {
82
+ width: 100%;
83
+ }
84
+
85
+ .psdk-label-readonly {
86
+ opacity: 54%;
87
+ font-size: 0.8rem;
88
+ font-weight: 400;
89
+ }
90
+
91
+ .psdk-data-readonly {
92
+ padding-top: 0.625rem;
93
+ width: 100%;
94
+ }
95
+
96
+ .psdk-attachment-list {
97
+ border: 1px solid var(--app-neutral-color);
98
+ }
99
+
100
+ ::ng-deep .mat-mdc-form-field-infix {
101
+ width: auto;
102
+ }
103
+
104
+ .psdk-attachment-card {
105
+ display: flex;
106
+ align-items: center;
107
+ border: 0.0625rem solid rgb(207, 207, 207);
108
+ border-radius: calc(0.25rem);
109
+ padding: 0.25rem 0rem 0.25rem 0.25rem;
110
+ min-height: 3rem;
111
+ margin-bottom: 0.5rem;
112
+ }
113
+
114
+ .psdk-attachment-card-main-primary-label {
115
+ font-weight: 500;
116
+ text-overflow: ellipsis;
117
+ overflow: hidden;
118
+ white-space: normal;
119
+ }
120
+
121
+ .psdk-attachment-card-main {
122
+ flex-grow: 2;
123
+ margin-left: 5px;
124
+ }
125
+
126
+ .psdk-attachment-action {
127
+ flex-grow: 1;
128
+ text-align: right;
129
+ }
130
+
131
+ .psdk-attachment-card-svg-icon {
132
+ width: 2.5rem;
133
+ }
134
+
135
+ .psdk-utility-button {
136
+ background: none;
137
+ border: none;
138
+ margin-right: 0.5rem;
139
+ cursor: pointer;
140
+ }
141
+
142
+ .psdk-utility-card-action-svg-icon {
143
+ width: 1.4rem;
144
+ display: inline-block;
145
+ }
146
+
147
+ .file-div {
148
+ border: 1px dashed var(--app-neutral-dark-color);
149
+ width: 100%;
150
+ padding: 0.5rem;
151
+ text-align: center;
152
+ position: relative;
153
+ }
154
+
155
+ .file-div-error {
156
+ border: 1px dashed var(--app-error-light-color);
157
+ width: 100%;
158
+ padding: 0.5rem;
159
+ text-align: center;
160
+ position: relative;
161
+ }
162
+
163
+ .attachment-label {
164
+ display: block;
165
+ margin-bottom: 10px;
166
+ }
167
+
168
+ .file-label::after {
169
+ display: inline;
170
+ content: ' *';
171
+ vertical-align: top;
172
+ color: var(--app-neutral-dark-color);
173
+ }