Skip to content
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

Input Widget for Dynamic Addition to a List #3729

Open
esurface opened this issue Sep 9, 2024 · 1 comment
Open

Input Widget for Dynamic Addition to a List #3729

esurface opened this issue Sep 9, 2024 · 1 comment
Labels

Comments

@esurface
Copy link
Contributor

esurface commented Sep 9, 2024

The Location List widget is useful in scenarios for selecting from a static hierarchy. In many cases, a dynamic list is preferable. We will create a new input widget called "Dynamic List" which can be used to dynamically updating an existing "List". One of the big changes will be renaming "location-list" to "list" or "list-item".

The (eventual) process for creating a dynamic list will be:

  1. The "List" must be defined first on the server UI, including set up of levels and metadata.
  2. Optionally add items to the list in the server UI
  3. The list creator chooses whether the list is dynamic (or not)
  4. The form editor adds the List to a form and configures it to be dynamic (or not)
  5. During the form response entry:
    • The list appears with the levels available for selection
    • The lowest-level is searchable
    • The lowest-level can take entry of a "new" item, with metadata
  6. Items created on a tablet will sync up to the server
  7. The Editor shows warning if the same list-item appears in the same hierarchy on the lowest-level

Database Updates

There is a significant change required to the way lists are stored to make this possible. Lists are currently stored as a static json doc. This needs to change to be stored as couchdb docs.

Requirements:

  1. Keep the "levels" and "metadata" definitions in the json doc and rename them from "location-list.json" to "list-xyz.json"
  2. Move the "locations" definitions from the json doc into couchdb -- each "location" will be renamed to "list-item"
  3. Use smart doc IDs for the the list docs -- for example: "_id": "list-xzy-<item-id>"
    • The best solution will not require any indexes in couchdb
    • Each list item will have a unique id
    • The list-item label should be in the _id, sanitized and searchable
    • Sanitized metadata could possibly be searchable as well

Caveats

  1. The default List will be the "location-list.json" and it will not change (for now)
  2. This feature is only for v4+
@esurface
Copy link
Contributor Author

@evansdianga

  1. Helps with versioning (based on revs) to allow list-items to be more flexible
  2. Reconciliation (like google docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant