Univention Bugzilla – Bug 53843
dynamic syntax choices for select syntaxes with dependency
Last modified: 2023-03-17 10:17:17 CET
We have several comboboxes (selection of choices) which depend on other fields. The dependency mechanism currently only works for UDM_Objects/UDM_Attributes syntaxes. We should implement it also for "select" syntaxes. Examples are: 1. Bug #31857 - Drop-down list for objectclass and attributes → Only show LDAP attributes which are part of the selected objectclass in an extended attribute. 2. Bug #25054 - makes 'options' selectable from a list of options in extended attribute → only show UDM options belonging to the selected UDM module in an extended attribute
A dependency mechanism for syntax choices has been added. The syntax.get_choices(lo, options) may now receive dependencies in `options` like {syntax.depends: value_which_is_set_in_frontend}. So when a dependency changes in the frontend another request to receive new choices is done (depending on syntax.javascript_dependency == False). In case javascript_dependency == True the old javascript logic ('javascript:umc/modules/udm/callbacks:setDynamicValues') is applied. For backwards compatibility when javascript_dependency == False the fallback logic does the same thing as the javascript would do. The mechanism has been enabled for: * the LDAP attributes depending on the selected objectClass in a extended attribute * the UDM options depending on the selected UDM modules in a extended attribute univention-management-console-module-udm.yaml de1a3c8e14f2 | YAML Bug #53843 univention-management-console-module-udm (10.0.1-26) ed10d2529816 | Bug #53843: debian/changelog univention-management-console-module-udm (10.0.1-25) 7588b544a7c1 | Bug #53843: rename $name$ into $depends$ 959160159293 | Bug #53843: add dependency mechanism for choices of "select" syntax classes. univention-directory-manager-modules.yaml de1a3c8e14f2 | YAML Bug #53843 univention-directory-manager-modules (15.0.11-44) ed10d2529816 | Bug #53843: debian/changelog univention-directory-manager-modules (15.0.11-43) f96b9c5be8f6 | Bug #53843: add syntax.javascript_dependency = True to unify code 7588b544a7c1 | Bug #53843: rename $name$ into $depends$ 959160159293 | Bug #53843: add dependency mechanism for choices of "select" syntax classes.
YAML: OK Code review: OK Test for regressions: OK, none found
<https://errata.software-univention.de/#/?erratum=5.0x333> <https://errata.software-univention.de/#/?erratum=5.0x335>