Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 7784d59664df57b09259821309c7934312f3fb8e
https://github.com/tribe29/checkmk/commit/7784d59664df57b09259821309c793431…
Author: Óscar Nájera <oscar.najera(a)tribe29.com>
Date: 2021-01-21 (Thu, 21 Jan 2021)
Changed paths:
M web/htdocs/js/modules/valuespecs.js
M web/htdocs/themes/facelift/scss/_main.scss
Log Message:
-----------
Remove text autocomplete
CMK-6935
Change-Id: Ic64972eb3ea4713ee6e84794dc5851eb24b2f5ee
Commit: d69d522031a05ea4904e106ae8d9d610fd635808
https://github.com/tribe29/checkmk/commit/d69d522031a05ea4904e106ae8d9d610f…
Author: Óscar Nájera <oscar.najera(a)tribe29.com>
Date: 2021-01-21 (Thu, 21 Jan 2021)
Changed paths:
M cmk/gui/htmllib.py
M cmk/gui/plugins/metrics/utils.py
M cmk/gui/plugins/visuals/filters.py
M cmk/gui/plugins/wato/utils/__init__.py
M cmk/gui/valuespec.py
M cmk/gui/wato/pages/rulesets.py
M web/htdocs/js/modules/forms.js
M web/htdocs/js/modules/valuespecs.js
Log Message:
-----------
Change text autocompletions by select2dropdown
Text autocompletion was originally only prepared for monitored hostnames
and configured hostnames. The text field had the property of allowing user
to enter any value and return to edit. Additionally pasting a string with
particular characters(independent of autocomplete), would split it in the
case of listofstring valuespec and create new fields.
The text autocomplete suffered a options availability bug. Sometimes the
request would block and no new options would be fetched. Sometimes the
workaround of clearing the field, changing focus and returning would
restart the query. Sometimes worse in the case of configured hostnames, it
was necessary to exit the page.
Here the adhoc select2 dialog on top of the html.input is exchanged for a
clean drop-down, managed by select2 with ajax calls to request data.
This allows for separated concerns, the python valuespec does not need to
inject JS to place hooks to query the webapi. It also fixes the data
availability bug.
Old autocomplete valuespecs are moved after dropdown so they can inherit
from it instead of text ascii.
- Monitored Hostname. Now has regex input validation. User custom input is permitted
- Configured Hostname. Now has regex input validation. User custom input is permitted
- Monitored Service. Now has regex input validation. User custom input is permitted
- Metric name. Now has input validation, metric name is strictly bound to known metrics
- Hostname and service filters. Display directly the dropdown as filters
don't yet use the valuespecs.
- Configured Hostname, can be embedded in listofstrings. List of strings is
extended to expand on text input and text paste when the underlying
datatype is a dropdown. It works as before.
Only one bug left to hunt. The last empty dropdown when the page is cleanly
reloaded, looses all it select2 features after the user selects a value and
the next dropdown is created. This field becomes un-editable. All other
fields can be changed, and new fields can be created. The new fields
created in succession don't suffer from this bug. Saving the Rule and
editing again works around the bug, yet it creates a new last empty
dropdown which will have the bug.
CMK-6935
Change-Id: Ia1fb2ce5cee7352185498613a194e54e4f1f5958
Compare:
https://github.com/tribe29/checkmk/compare/8584f0d2de37...d69d522031a0