You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "Marcus Christie (Jira)" <ji...@apache.org> on 2020/06/19 21:22:00 UTC

[jira] [Created] (AIRAVATA-3345) Custom input editor: textarea with autocompletions

Marcus Christie created AIRAVATA-3345:
-----------------------------------------

             Summary: Custom input editor: textarea with autocompletions
                 Key: AIRAVATA-3345
                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3345
             Project: Airavata
          Issue Type: Bug
          Components: Django Portal
            Reporter: Marcus Christie
            Assignee: Marcus Christie


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:
{code}
{
    "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-hostname": "...",
                "database-port": "...",
                "database-username": "...",
                "database-password": "settings:MY_DB_PASSWORD",
              }
            }
        }
    }
}
{code}

Implementation ideas:
- use codemirror's autocompletions support: https://codemirror.net/doc/manual.html#addon_show-hint
- https://github.com/surmon-china/vue-codemirror ?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)