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('data').value.multiList) {
|
||||
const originalValue = <string>this.form.get('value').value;
|
||||
let values = (<string>this.form.get('value').value).slice(1, -1).split(', ');
|
||||
if (!originalValue.startsWith('[') && !originalValue.endsWith(']')) {
|
||||
values = undefined;
|
||||
values = [originalValue];
|
||||
if (originalValue !== null && typeof originalValue === 'string') {
|
||||
let values = (<string>this.form.get('value').value).slice(1, -1).split(', ');
|
||||
if (!originalValue.startsWith('[') && !originalValue.endsWith(']')) {
|
||||
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
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.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