Univention Bugzilla – Full Text Bug Listing |
Description
Florian Best
2015-06-24 16:00:46 CEST
*** Bug 29868 has been marked as a duplicate of this bug. *** *** Bug 34313 has been marked as a duplicate of this bug. *** A basis for this has been implemented in Bug #50047, which introduces a type-interface, which should be extended. Created attachment 10939 [details]
53843_compare.py
QA: attached is a script which compares the previous with the new values of all syntax classes.
A short overview about the current functions: widget(): → defines type and options (given as parameters) for the widget → only used in `udm/properties` (and self-service) choices(): → only adds additional information for `widget()` and is named wrong. → real choices are retrieved via `read_syntax_choices()` info_syntax_choices(): → used by `udm/syntax/choices/info` → checks if the size limit when getting choices is reached. If yes, the UDM frontend shows different widgets (no ComboBox) and performs a restricted search. → happens only for subclasses of `UDM_Objects`. So the request is only triggered by that syntax class. → This is a bad workaround we should drop in the future and replace with some intelligent mechanism (LDAP pagination, ...). read_syntax_choices(): → returns all dynamic choices of the specified syntax → is used directly by `udm/syntax/choices` → also used by `get_default_values()` via `udm/values` if the syntax wants it → also used by `udm/properties` to set a default value for syntaxes which wants a non-empty default value (so the first value of the choices is selected) → also used by `get_policy_references()` with a `LDAP_Search` instance to get all policy backreferences → via `udm/get` as `$references$` to list all objects/policies which reference this object (via a `LinkList` widget). → via UDM REST API to add dynamic reference information to all kind of objects and link between them via certain relations → also used by `search_syntax_choices_by_key()` (see below) search_syntax_choices_by_key(): → used by `udm/syntax/choices/key`: if size limit is reached for a widget with choices (e.g. ComboBox) returns only the currently set value so that the Javascript widget shows that value as valid. → better approach would be to do this via Javascript only The UDM syntax classes have been extended by: > @classmethod > def get_widget(cls, prop): → returning the widget as string, depending on the property > def get_widget_options(self, udm_property): including: > def get_widget_choices_options(self, udm_property): → returning the type and initialization options for that widget > @classmethod > def get_choices(cls, lo, options): → returning a sorted list of (value, label) tuples of possible choices for this syntax class > @classmethod > def get_object_property_filter(cls, object_property, object_property_value, allow_asterisks=True): → get a LDAP filter suitable for searching for the specified property and value. > widget_default_search_pattern = '*' → the search pattern which is used by default > def parse_command_line(self, value): → further string manipulation of arguments passed via CLI. univention-self-service.yaml a7412dcaf781 | YAML Bug #38762 univention-self-service (5.0.1-25) 26ad44d94747 | Bug #38762: debian/changelog 57c23f66218b | Bug #38762: move widget() definition/options into UDM syntax classes univention-management-console-module-udm.yaml a7412dcaf781 | YAML Bug #38762 univention-management-console-module-udm (10.0.1-25) 26ad44d94747 | Bug #38762: debian/changelog 0f03da8f44b3 | Bug #38762: also search for non-substring values when searching for non specific property ed1d263e87e9 | Bug #38762: move LDAP filter escaping into syntax classes 559ba27d5ab4 | Bug #38762: move get_object_property_filter() into UDM syntax classes 57c23f66218b | Bug #38762: move widget() definition/options into UDM syntax classes 02618757042e | Bug #38762: replace LDAP_Search of policy references syntax with raw LDAP search 9b1927d95ab4 | Bug #38762: improove performance by getting object directly d283eac48af4 | Bug #38762: move get_choices() into UDM syntax classes 2e32067b5d37 | Bug #38762: unify common widget options into default_syntax_definition() 13f5e4bf118a | Bug #38762: move UCR variable definitions into other package 3bfb1b2d2edd | Bug #38762: move widget<>syntax mapping into UDM syntax classes univention-directory-manager-rest.yaml a7412dcaf781 | YAML Bug #38762 univention-directory-manager-rest (10.0.2-11) 26ad44d94747 | Bug #38762: debian/changelog 559ba27d5ab4 | Bug #38762: move get_object_property_filter() into UDM syntax classes d283eac48af4 | Bug #38762: move get_choices() into UDM syntax classes univention-directory-manager-modules.yaml a7412dcaf781 | YAML Bug #38762 univention-directory-manager-modules (15.0.11-43) 26ad44d94747 | Bug #38762: debian/changelog a601f5b048fa | Bug #38762: move sorting into common method sort_choices() f97c09773606 | Bug #38762: move special code for select, MultiSelect and SambaLogonHours into Isyntax.get_widget_choices_options() dd9ac1745eb1 | Bug #38762: move parse_command_line() handling into UDM syntax class 42c76995c60f | Bug #38762: move _parse_complex_syntax_input() into UDM syntax class ed1d263e87e9 | Bug #38762: move LDAP filter escaping into syntax classes 5e00baebfc96 | Bug #38762: adjust sizes of extended attribute checkboxes 559ba27d5ab4 | Bug #38762: move get_object_property_filter() into UDM syntax classes 57c23f66218b | Bug #38762: move widget() definition/options into UDM syntax classes 3c6d8402e0e8 | Bug #38762: LDAP_Search: transform instances into classes d283eac48af4 | Bug #38762: move get_choices() into UDM syntax classes 13f5e4bf118a | Bug #38762: move UCR variable definitions into other package 85e1fbe70fdc | Bug #38762: simplify widget assignment on inheritance 3bfb1b2d2edd | Bug #38762: move widget<>syntax mapping into UDM syntax classes 850802aedc0d | Bug #38762: replace deprecated LDAP_Search syntax with UDM_Attribute 8337fe524d92 | Bug #38762: replace deprecated MailDomain LDAP_Search syntax with UDM_Attribute bde21b2a5e16 | Bug #38762: remove unused module_search_filter Tests green except for: * 86_selenium.150_udm_create_modify_delete_objects.master091 * 60_umc.80_udm_license.master091 https://univention-dist-jenkins.k8s.knut.univention.de/job/UCS-5.0/job/UCS-5.0-1/job/AutotestJoin/35/testReport/ I'll look into them closely. (In reply to Florian Best from comment #9) > Tests green except for: > * 86_selenium.150_udm_create_modify_delete_objects.master091 This was caused by a broken LDAP filter, which has been fixed by: 6b009e669a fixup! Bug #38762: move get_object_property_filter() into UDM syntax classes > * 60_umc.80_udm_license.master091 The LDAP-Server has been down during license import. I guess this was just flakyness. I also added a commit which added the "lookup_filter" to various UDM modules lacking this nice functionality. 7a2371fc16 Bug #38762: add missing lookup_filter definition for various UDM modules Another related change has been added: The widget which is displayed a search-box is now also configurable via the syntax classes and the default value for the widget as well: > syntax.search_widget = 'TextBox' > syntax.widget_default_search_pattern = '*' I originally planned to merge this at Bug #54467 but it better fits here. commit 2696e248f2fdd44b6cf7595bf6dd0207ed6bb05a Author: Florian Best <best@univention.de> Date: Fri Feb 18 20:45:28 2022 +0100 Bug #38762: move search widget and its default value into UDM syntax classes * get rid of udm/values: it is either not required as we can put the same information into "udm/properties" and the request delivers the same meta information as udm/syntax/choices. * adapt MixedInput so that is capable of every widget not only TextBox, ComboBox and CheckBox. This change allows e.g. to render date syntaxes as DateBox instead of a simple TextBox: diff --git management/univention-directory-manager-modules/modules/univention/admin/syntax.py management/univention-directory-manager-modules/modules/univention/admin/syntax.py index 55cb738396..86ce0f367a 100644 --- management/univention-directory-manager-modules/modules/univention/admin/syntax.py +++ management/univention-directory-manager-modules/modules/univention/admin/syntax.py @@ -2717,6 +2717,7 @@ class iso8601Date(simple): error_message = _('The given date does not conform to iso8601, example: "2009-01-01".') widget = 'DateBox' + search_widget = 'DateBox' widget_default_search_pattern = '1970-01-01' type_class = univention.admin.types.DateType @@ -2793,6 +2794,7 @@ class date(simple): _re_de = re.compile(r'^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]+$') widget = 'DateBox' + search_widget = 'DateBox' widget_default_search_pattern = '1970-01-01' type_class = univention.admin.types.DateType univention-management-console-module-udm (10.0.1-26) 2696e248f2fd | Bug #38762: move search widget and its default value into UDM syntax classes univention-directory-manager-modules (15.0.11-44) 2696e248f2fd | Bug #38762: move search widget and its default value into UDM syntax classes univention-web.yaml 361ee9fae143 | YAML Bug #38762 univention-web (4.0.2-50) 2696e248f2fd | Bug #38762: move search widget and its default value into UDM syntax classes univention-directory-manager-rest (10.0.2-11) 3c0ebed1ba78 | Bug #38762: remove unused misleading DefaultValue endpoint *** Bug 54644 has been marked as a duplicate of this bug. *** Two additional fixes have been added: 1. MultiObjectSelect filtering for properties did not work 2. LDAP filter escaping is done for every value, even python string interpolated ones. univention-management-console-module-udm (10.0.1-26) fd835042be5e | fixup! Bug #38762: add additional handling for MultiObjectSelect 802fceb7d1f5 | Bug #38762: add additional handling for MultiObjectSelect univention-directory-manager-modules (15.0.11-49) 5f3bda89c63f | Bug #38762: escape string interpolated LDAP filters fd835042be5e | fixup! Bug #38762: add additional handling for MultiObjectSelect YAML: OK Code review: OK Test for regressions: OK, none found |