Fixed issue with visible rules when using multiple world list
This commit is contained in:
parent
71deb5f473
commit
fed426e64b
|
@ -96,12 +96,17 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
|
||||||
if (this.form.get('viewStyle').value.renderStyle === DatasetProfileFieldViewStyle.ComboBox && this.form.get('data').value.type === DatasetProfileComboBoxType.WordList) {
|
if (this.form.get('viewStyle').value.renderStyle === DatasetProfileFieldViewStyle.ComboBox && this.form.get('data').value.type === DatasetProfileComboBoxType.WordList) {
|
||||||
if (this.form.get('data').value.multiList) {
|
if (this.form.get('data').value.multiList) {
|
||||||
const originalValue = <string>this.form.get('value').value;
|
const originalValue = <string>this.form.get('value').value;
|
||||||
let values = (<string>this.form.get('value').value).slice(1, -1).split(', ');
|
if (originalValue !== null && typeof originalValue === 'string') {
|
||||||
if (!originalValue.startsWith('[') && !originalValue.endsWith(']')) {
|
let values = (<string>this.form.get('value').value).slice(1, -1).split(', ');
|
||||||
values = undefined;
|
if (!originalValue.startsWith('[') && !originalValue.endsWith(']')) {
|
||||||
values = [originalValue];
|
values = undefined;
|
||||||
|
values = [originalValue];
|
||||||
|
}
|
||||||
|
this.form.patchValue({ 'value': values });
|
||||||
|
values.forEach(element => {
|
||||||
|
this.visibilityRulesService.updateValueAndVisibility(this.form.get('id').value, element);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.form.patchValue({ 'value': values });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +238,14 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
|
||||||
this.form.get('value').valueChanges
|
this.form.get('value').valueChanges
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(item => {
|
.subscribe(item => {
|
||||||
this.visibilityRulesService.updateValueAndVisibility(this.form.get('id').value, item);
|
if (this.form.get('viewStyle').value.renderStyle === DatasetProfileFieldViewStyle.ComboBox && this.form.get('data').value.type === DatasetProfileComboBoxType.WordList && this.form.get('data').value.multiList) {
|
||||||
|
item.forEach(element => {
|
||||||
|
this.visibilityRulesService.updateValueAndVisibility(this.form.get('id').value, element);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.visibilityRulesService.updateValueAndVisibility(this.form.get('id').value, item);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue