-
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) |
@lexiclevenger Thanks! Age should be readonly now and tree queries hopefully shouldn't have any crashes |
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.
- Verify changed values are highlighted as updated cells
- Re-run the original query and verify the values changed as expected
- Verify values were rolled back to original
I feel like this shouldn't have 'workbench' in it and should just say 'Batch Edit Data Sets'
Search and replace can edit readonly fields. If you upload the changes don't carry over, however, the values do appear to be changed in the data set.
sleDTBw1iN.mp4
Results aren't showing up correctly
I didn't make any changes so I'm not sure why this roll back failed but when a rollback fails it gives an error but then shows a sucess dialog
ywSOdTzZmr.mp4
Also, the rollback success dialog should say "it cannot be edited." instead of "it cannot be edit."
Can't batch edit for taxon as it requires you to add rank -> name but you can't do that (see #5935) and on top of that it requires you to add every single rank so if you have multiple taxon trees it wants every rank from every tree. Based on this pr and what it is supposed to cover it might be worth it to just disable the batch edit button when a tree is the base table.
I'm not sure if this happens elsewhere but in this example on the accession table I had a valid pick list valueIn Process
but when I clicked batch edit, in the grid it became inprocess
an invalid value
PWNTOImZTg.mp4
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.
Testing instructions
- Create a query
- Click on Batch Edit. This will create a new Batch Edit dataset with columns involving relationships disabled (readonly)
- Change values you wish to edit
- Click Validate
- Verify changed values are highlighted as updated cells
- Click Commit. This will apply your changes
- Re-run the original query and verify the values changed as expected
- Click rollback
- Verify values were rolled back to original
Agree with @emenslin on the text changes, disabling the batch edit button for taxon for now.
About the rollback not being allowed when you didn't make changes, it might've been something along the lines of a required field being edited from previously having nothing. Not sure why it was missing a required field but 🤷
I was able to recreate the issue with the picklists. Looks like it's pulling from the value field and not the title field for Picklist items.
Also able to recreate the search and replace.
This is where it happens:
I think what you could do, just to debug this, would be to set a breakpoint here
Then, just find what row has the failure. Me and Grant talked about making the better. Technically, we know exactly what went wrong. Heck, for debugging, can you just add json of failed rows (or first failed row) -- that is, json of upload result -- to the exception it raises (don't do any fancy, just string addition)? The next lines are needed. Basically, when you have relationships, you could have uploaded a record that you don't need anymore, so you can pretty cutely just run original workbench rollback after this special batch edit rollback. Another thing I wanted to do (as indicated in "cannot be edited") was to make it readonly after one rollback. Do it simply by removing the backer, and if the batch edit (isupdate = true), just make it readonly (add a flag from the backend?). Theoretically, this is not needed, as the process is idempotent, fancy,
Also, don't straight up disable in case of taxon. Only do that if there is a rank also selected. It differentiates between the two cases. I'd recommend going back to original PR and maybe ask Grant, if he has time, on how it differentiates them. There's a somewhat generic logic for it, shouldn't be hard to find, in the BatchEdit/index.tsx file.
Specifically, after 4929, you can format agent type as actual text (needed for batch edit). Just add similar code for picklists too (with a prop for "format_picklist"). Lmk if you got a better implementation. You could, theoretically, do it at parsing later on. But, I'd recommend it doing it here. I'm sorry for putting you through the last one, completely my fault. I really thought that picklist worked. |
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