Feature #1386
Ability to import into KV lookups
Start date:
05/21/2017
Due date:
% Done:
100%
Description
Add the ability to import a CSV into a KV store lookup.
Subtasks
History
#1 Updated by Luke Murphey over 8 years ago
- Will need to ensure that the fields of the CSV match that of the KV store
- If the input includes a _key field, should it be:
- ignored: just make a new entry
- used to overwrite: potentially overwriting existing entries to update them
- used if no conflict: only imported if a row doesn't exist with that _key (preferred)
- make new entries: just make more rows
- If the CSV includes extra fields (more than the ones that the KV store includes), should they be:
- ignored: not imported (preferred)
- imported: imported but won't be shown since not a declared field (preferred, if the KV store import will still accept them)
- cancelled: stopping importation
- If the CSV includes fewer fields, should they be:
- ignored: missing fields will be empty
- cancelled: import stopped (preferred)
- use default: use some field value that the user defines
- If the input includes a _key field, should it be:
#2 Updated by Luke Murphey over 7 years ago
- Target version changed from Plus_1 to 2.7.0
#3 Updated by Luke Murphey over 7 years ago
Sub-tasks:
1) Show import options
2) Validate schema of incoming file
3) Load file into editor
4) Do saves of rows
5) Ignore existing rows with the same _key
#4 Updated by Luke Murphey over 7 years ago
This is a bit difficult with KV store lookups since calling renderLookup() loses the header on KV lookups.
A couple of ways to do this:- iteratively add each row
- pull in all of the rows and then have it save
#5 Updated by Luke Murphey over 7 years ago
A couple of other options:
- Have importer just import each row
- Have Python do the import and reload the lookup when done
- Have JS do the import in the background and reload the lookup when done
#6 Updated by Luke Murphey over 7 years ago
#7 Updated by Luke Murphey over 7 years ago
Some questions:
- Should I use the kvstore.js class?
- Does KV store support a batch import?
#8 Updated by Luke Murphey over 7 years ago
Things still to be done:
- [Done] Save lookups with owner
- [Done] Show a progress dialog
#9 Updated by Luke Murphey over 7 years ago
Here is a primer on the behavior:
- Files can only be imported if they include all of the fields of the lookup.
- Extra columns will cause import to fail.
- _key values in the import will be ignored.
- Missing columns will be silently ignored.
- An error is generated if no columns match
- A progress dialog is displayed during import
- The progress dialog will be shown when a file is dragged unto the editor or when a file is selected.
- The import can be cancelled clicking cancel or by closing the dialog with the "X" button.
#10 Updated by Luke Murphey over 7 years ago
- Status changed from New to Closed