Commit 26591ffb63e6d48c1461db1e7a23bbde957c9f5a

Authored by ArtemDzhereleiko
1 parent 2608c46c

fix selectedOption value

@@ -112,7 +112,7 @@ @@ -112,7 +112,7 @@
112 (focus)="key.isFocused = true;" 112 (focus)="key.isFocused = true;"
113 (blur)="key.isFocused = false; inputChanged(source, key)"> 113 (blur)="key.isFocused = false; inputChanged(source, key)">
114 <mat-option *ngFor="let option of key.settings.selectOptions" 114 <mat-option *ngFor="let option of key.settings.selectOptions"
115 - [value]="option.value.toLowerCase() !== 'null' ? option.value : null" 115 + [value]="option.value"
116 [disabled]="key.settings.isEditable === 'readonly'"> 116 [disabled]="key.settings.isEditable === 'readonly'">
117 {{ getCustomTranslationText(option.label ? option.label : option.value) }} 117 {{ getCustomTranslationText(option.label ? option.label : option.value) }}
118 </mat-option> 118 </mat-option>
@@ -59,7 +59,7 @@ interface MultipleInputWidgetSettings { @@ -59,7 +59,7 @@ interface MultipleInputWidgetSettings {
59 } 59 }
60 60
61 interface MultipleInputWidgetSelectOption { 61 interface MultipleInputWidgetSelectOption {
62 - value: string; 62 + value: string | null;
63 label: string; 63 label: string;
64 } 64 }
65 65
@@ -253,6 +253,14 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni @@ -253,6 +253,14 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni
253 } 253 }
254 // For backward compatibility 254 // For backward compatibility
255 255
  256 + if (dataKey.settings.dataKeyValueType === 'select') {
  257 + dataKey.settings.selectOptions.forEach((option) => {
  258 + if (option.value.toLowerCase() === 'null') {
  259 + option.value = null;
  260 + }
  261 + });
  262 + }
  263 +
256 source.keys.push(dataKey); 264 source.keys.push(dataKey);
257 }); 265 });
258 } else { 266 } else {
@@ -452,10 +460,6 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni @@ -452,10 +460,6 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni
452 } 460 }
453 461
454 public getCustomTranslationText(value): string { 462 public getCustomTranslationText(value): string {
455 - if (value.toLowerCase() === 'null') {  
456 - return '';  
457 - }  
458 -  
459 return this.utils.customTranslation(value, value); 463 return this.utils.customTranslation(value, value);
460 } 464 }
461 465