Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Support custom autocompletions in a textarea. The use case is to improve the user experience of users typing out input files that need to have specific values in specific formats.
Immediate use case is https://models.earth.indiana.edu/supcrtbl2.php
The source of autocompletions for SUPCRTBL2 is a database query. If possible, it would be nice to be able to use configuration to specify the query to execute to get completion options. The database password could be added to the Django settings file so it isn't exposed in the input metadata.
So the idea is that configuring such an editor would involve input metadata something like:
{ "editor": { "ui-component-id": "autocomplete-textarea-input-editor", "config": { "completions": { "source": { "type": "sql-query", "query": "select text as completion from completions_table where text like :substring", "database-type": "mysql", "database-hostname": "...", "database-port": "...", "database-name": "...", "database-username": "...", "database-password": "settings:MY_DB_PASSWORD", } } } } }
Implementation ideas:
- use codemirror's autocompletions support: https://codemirror.net/doc/manual.html#addon_show-hint
- https://github.com/surmon-china/vue-codemirror ?