-
Notifications
You must be signed in to change notification settings - Fork 36
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
Batch Edit: Support for editing basic fields #5417
base: production
Are you sure you want to change the base?
Conversation
POTENTIAL IMPROVEMENTS?
|
Nice observation. My fault for keeping a hidden feature secret: Another, use for data mapper is to control “ignore when blank”-type behavior per field basis. That’s actually supported in that PR ( even for batch edit data mapper, you can modify this per-field setting. Ask grant for more context ) the only things not read only are
search for usages of “readonlyspec”. For purposes of this PR, you can theoretically not add data mapper (you also don’t need batch edit prefs, they don’t do anything when there are no relationships) |
@specify/ux-testing Thanks for testing! Summary of the changes:
I updated the testing instructions to retest #5489 since this PR refactors code written in that PR |
Ah, for the rollback, I thought I wrote up a comment about it, looks like I forgot to publish it. For elizabeth's recent rollback case, it failed because the row was a new row (that is also why it is colored blue). While the upload logic is generic, I forgot to account for this case (rollbacks in a batch-edit dataset for a new row). We currently shouldn't allow adding a new row in a batch-edit dataset. So, it is actually two bugs:
So, it needs to be fixed on both sides for it:
Side note I also noticed another bug (related to UX). On commit success, it should be readonly, but it is not. Like once you upload in workbench, the entire sheet becomes readonly. Same thing should happen here after commit. Currently it is not, because HOT is a bit pesky. If you add readonly property at cell level, it always takes that (and overrides "global" properties from the top). Replace this:
By
EDIT: A significantly more cleaner way (for the side note) will be Replacing just this:
By
|
Triggered by d2b8ffd on branch refs/heads/issue-5413
specifyweb/frontend/js_src/lib/components/WorkBench/WbSpreadsheet.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice so far!
Some more user issues that I remember:
- Currently, there is no way to select specific rows and batch edit just them. This might be a requirement, maybe not. There is a work around to do so. The current implementation supports batch edit out of a record set. So, the user can:
- Make a query.
- Select the records, make record set out of it.
- Query out of the record set, and batch edit on those results.
Quite a lot of steps. Check if that's acceptable for now, I've no clue if there have been any new expectations regarding BE. I think a decent implementation for this will be to follow the implementation in #5300 (I actually left a similar comment on there).
-
Data sorting. Currently, if you have one table (so no relationships), sorting should always (of multiple columns) be respected (UX guys: test this). If you have relationships, and you also sort on some of the relationship's columns, it's essentially arbitrary (no guarantees regarding what user sees). From the code perspective, it is not arbitrary (see if you can figure those places out). I know that we don't support relationships, but this point actually applies regardless, since the same procedure is applied, just that we ignore relationships in upload plan. This might UX issue, a way to work around will be to sort in the workbench instead (in the spreadsheet).
-
Potential performance issues, as mentioned in a below comment in stored_queries/views.py. IIRC, I once tried batch editing andy's entire voucher collection (45k CO records with determination and cataloger) and it took 1.2 minutes to construct the dataset (I think that's too slow - I deferred profiling it for later, maybe need to that).
EDIT: All the points are really optional, but would definitely recommend testing the performance and seeing if usability needs to be improved.
@realVinayak Thank you! I have made notes of your points in different issues |
Fixes #5413
Uses code from #4929
This PR pretty much has the same code as #4929 but updated to production. To minimize the scope for testing, batch edit for relationships is disabled in this PR and will be enabled in the follow up PR - batch edit for relationships. There are still some merge conflicts resulting from some newer code in prod which will be resolved in the next PR.
Checklist
and self-explanatory (or properly documented)
Testing instructions
Regression tests