New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datatables View Ext: Null / NoneType Front-End Label Option & Helper #7574
Datatables View Ext: Null / NoneType Front-End Label Option & Helper #7574
Conversation
- Added new config option `ckan.null_label`. - Added new helper `get_null_label`. - Used `get_null_label` in datatables view.
- Added change log file.
- Set return of `get_null_label` helper to blank string.
- Moved all code from core to datatablesview plugin.
@wardi okay the code has been moved to the datatablesview extension exclusively. The config option name has been updated, and the declaration moved. The helper has also been moved into datatablesview ext. The config option has been simplified, so it will just be a string and the helper will now just return the value of the option, put through gettext. If the option is not set, the helper will just return a blank string. |
- Slightly improved return on the `get_helpers` implementation;moved condition into single lambda function.
- Fixed continual line over-indent.
- Updated config option name in change log. - Updated helper name. - Moved helper function from lambda to helpers module. - Added to change log.
- Fixed flake8 reportings.
- Added empty string as default value to `ckan.datatables.null_label` declaration.
- Added encoding to helpers script. - Used `toolkit.blanket.helpers` instead of `plugin.implements`.
- Removed unused imports.
Datatables View Ext: Null / NoneType Front-End Label Option & Helper # Conflicts: # ckanext/datatablesview/blueprint.py # ckanext/datatablesview/config_declaration.yaml # ckanext/datatablesview/plugin.py
feat(frontend): added null label;
ckan.null_label
.get_null_label
.get_null_label
in datatables view.Fixes #
Added a new config option and helper to set labels for NoneType (or null from sql) string labels. This is to be used to display NoneType values on the front-end.
The new config option also supports a dict for i18n labels.
Included is its use in the datatableview plugin to display null datastore values with the label instead of it casting NoneType to the string of
"None"
.Features:
Please [X] all the boxes above that apply