Commit 26591ffb63e6d48c1461db1e7a23bbde957c9f5a

Authored by ArtemDzhereleiko
1 parent 2608c46c

fix selectedOption value

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