@pega/angular-sdk-overrides 0.242.8 → 0.242.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.
@@ -11,7 +11,6 @@
11
11
  [placeholder]="placeholder"
12
12
  [formControl]="fieldControl"
13
13
  [attr.data-test-id]="testId"
14
- [value]="value$"
15
14
  [required]="bRequired$"
16
15
  [matAutocomplete]="auto"
17
16
  (input)="fieldOnChange($event)"
@@ -14,6 +14,10 @@ import { DatapageService } from '@pega/angular-sdk-components';
14
14
  import { handleEvent } from '@pega/angular-sdk-components';
15
15
  import { PConnFieldProps } from '@pega/angular-sdk-components';
16
16
 
17
+ interface IOption {
18
+ key: string;
19
+ value: string;
20
+ }
17
21
  interface AutoCompleteProps extends PConnFieldProps {
18
22
  // If any, enter additional props that only exist on AutoComplete here
19
23
  deferDatasource?: boolean;
@@ -108,6 +112,13 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
108
112
  );
109
113
  }
110
114
 
115
+ setOptions(options: IOption[]) {
116
+ this.options$ = options;
117
+ const index = this.options$?.findIndex(element => element.key === this.configProps$.value);
118
+ this.value$ = index > -1 ? this.options$[index].value : this.configProps$.value;
119
+ this.fieldControl.setValue(this.value$);
120
+ }
121
+
111
122
  ngOnDestroy(): void {
112
123
  if (this.formGroup$) {
113
124
  this.formGroup$.removeControl(this.controlName$);
@@ -149,6 +160,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
149
160
  if (this.configProps$.value != undefined) {
150
161
  const index = this.options$?.findIndex(element => element.key === this.configProps$.value);
151
162
  this.value$ = index > -1 ? this.options$[index].value : this.configProps$.value;
163
+ this.fieldControl.setValue(this.value$);
152
164
  }
153
165
 
154
166
  this.setPropertyValuesFromProps();
@@ -191,7 +203,8 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
191
203
 
192
204
  this.componentReference = this.pConn$.getStateProps().value;
193
205
  if (this.listType === 'associated') {
194
- this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject('')); // 1st arg empty string until typedef marked correctly
206
+ const optionsList = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject('')); // 1st arg empty string until typedef marked correctly
207
+ this.setOptions(optionsList);
195
208
  }
196
209
 
197
210
  if (!this.displayMode$ && this.listType !== 'associated') {
@@ -263,7 +276,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
263
276
  };
264
277
  optionsData.push(obj);
265
278
  });
266
- this.options$ = optionsData;
279
+ this.setOptions(optionsData);
267
280
  }
268
281
 
269
282
  flattenParameters(params = {}) {
@@ -121,7 +121,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
121
121
  // call updateSelf when initializing
122
122
  this.checkAndUpdate();
123
123
  // this should get called afer checkAndUpdate
124
- this.getDatapageData();
125
124
 
126
125
  if (this.formGroup$) {
127
126
  // add control to formGroup
@@ -253,7 +252,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
253
252
  );
254
253
 
255
254
  this.localizedValue = this.options$?.find(opt => opt.key === this.value$)?.value || this.localizedValue;
256
-
255
+ this.getDatapageData();
257
256
  // trigger display of error message with field control
258
257
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
259
258
  const timer = interval(100).subscribe(() => {
@@ -31,10 +31,11 @@ export class ListViewActionButtonsComponent {
31
31
  this.pConn$
32
32
  .getActionsApi()
33
33
  .submitEmbeddedDataModal(this.context$)
34
- .then(() => {})
34
+ .then(() => {
35
+ this.closeActionsDialog.emit();
36
+ })
35
37
  .finally(() => {
36
38
  this.isDisabled = false;
37
39
  });
38
- this.closeActionsDialog.emit();
39
40
  }
40
41
  }
@@ -3,6 +3,6 @@
3
3
  "label": "Phone",
4
4
  "description": "Phone",
5
5
  "type": "Field",
6
- "subtype": "DATA_CAPTURE",
6
+ "subtype": "Text-Phone",
7
7
  "properties": []
8
8
  }
@@ -168,7 +168,11 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
168
168
  this.placeholder = placeholder || '';
169
169
  this.displayMode$ = displayMode;
170
170
 
171
- this.value$ = value && typeof value === 'object' && value.userName ? value.userName : (value ?? '');
171
+ if (value && typeof value === 'object') {
172
+ this.value$ = value.userName ? value.userName : '';
173
+ } else {
174
+ this.value$ = value || '';
175
+ }
172
176
 
173
177
  const { readOnly, required } = props;
174
178
  [this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
@@ -171,9 +171,9 @@ export class RootContainerComponent implements OnInit, OnDestroy {
171
171
 
172
172
  async configureModalContainer() {
173
173
  const sdkConfig = await this.scService.getSdkConfig();
174
- const showModalsInEmbedMode = sdkConfig.serverConfig.showModalsInEmbedMode;
174
+ const showModalsInEmbeddedMode = sdkConfig.serverConfig.showModalsInEmbeddedMode;
175
175
 
176
- if (!this.displayOnlyFA$ || showModalsInEmbedMode) {
176
+ if (!this.displayOnlyFA$ || showModalsInEmbeddedMode) {
177
177
  const configObjModal = PCore.createPConnect({
178
178
  meta: {
179
179
  type: 'ModalViewContainer',
@@ -14,7 +14,7 @@
14
14
  <button mat-raised-button color="primary" (click)="onConfirmViewClose()">Done</button>
15
15
  </div>
16
16
  </div>
17
- <div *ngIf="toDoList?.length > 0">
17
+ <div *ngIf="!showConfirmView && toDoList?.length > 0">
18
18
  <component-mapper
19
19
  name="Todo"
20
20
  [props]="{ pConn$, datasource$: { source: toDoList }, headerText$: 'Tasks', type$: CONSTS.TODO, isConfirm: true }"
@@ -5,6 +5,10 @@
5
5
  margin-top: 0.5rem;
6
6
  margin-bottom: 0.5rem;
7
7
  overflow-y: auto;
8
+ box-shadow:
9
+ 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
10
+ 0px 1px 1px 0px rgba(0, 0, 0, 0.14),
11
+ 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
8
12
  }
9
13
 
10
14
  table {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.242.8",
3
+ "version": "0.242.10",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"