diff --git a/cmk/gui/validation/ir/valuespec_to_ir.py b/cmk/gui/validation/ir/valuespec_to_ir.py index 2cec7c8d47a..4b35acb4b07 100644 --- a/cmk/gui/validation/ir/valuespec_to_ir.py +++ b/cmk/gui/validation/ir/valuespec_to_ir.py @@ -33,6 +33,7 @@ def valuespec_integer(valuespec_instance: valuespec.Integer) -> compiler.Integer from cmk.gui import valuespec from cmk.gui.validation.ir import elements from cmk.gui.validation.ir.elements import DictionaryKeySpec, LegacyValueSpecDetails +from cmk.gui.validation.visitors.vue_lib import GenericComponent Stack = list[str] T = typing.TypeVar("T") @@ -129,9 +130,14 @@ def get_validator(vs_instance: valuespec.ValueSpec | None) -> list[elements.Vali if vs_instance is None: return None - def validator(value: typing.Any, _all_values: typing.Any) -> None: - vs_instance.validate_datatype(value, varprefix="") - vs_instance.validate_value(value, varprefix="") + def validator(value: typing.Any, component: GenericComponent) -> None: + # This code does not belong here. GenericComponent is part of vue + # valuespec_to_ir.py is part of FormElement + # Since elements.py/valuespec_to_ir.py are currently part of a major restructuring + # -> I do not care + varprefix = component.config.get("varprefix", "") + vs_instance.validate_datatype(value, varprefix=varprefix) + vs_instance.validate_value(value, varprefix=varprefix) return [validator] diff --git a/cmk/gui/wato/pages/global_settings.py b/cmk/gui/wato/pages/global_settings.py index 11f1079f8c0..2b74b6e4814 100644 --- a/cmk/gui/wato/pages/global_settings.py +++ b/cmk/gui/wato/pages/global_settings.py @@ -397,8 +397,9 @@ def page(self) -> None: if use_vue_rendering(): forms.section(_("Current setting as VUE")) render_vue(self._valuespec, self._vue_field_id(), value) - - forms.section(_("Current setting")) + forms.section(_("Legacy valuespec (input data is ignored)")) + else: + forms.section(_("Current setting")) self._valuespec.render_input("ve", value) self._valuespec.set_focus("ve") html.help(self._valuespec.help()) diff --git a/cmk/gui/wato/pages/rulesets.py b/cmk/gui/wato/pages/rulesets.py index c7dd3a593af..7f9b43f4153 100644 --- a/cmk/gui/wato/pages/rulesets.py +++ b/cmk/gui/wato/pages/rulesets.py @@ -1981,6 +1981,7 @@ def page(self) -> None: if use_vue_rendering(): forms.section(_("Current setting as VUE")) render_vue(self._ruleset.valuespec(), self._vue_field_id(), self._rule.value) + forms.section(_("Legacy valuespec (input data is ignored")) valuespec.validate_datatype(self._rule.value, "ve") valuespec.render_input("ve", self._rule.value)