-
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) |
Triggered by 34b0a91 on branch refs/heads/issue-5413
@emenslin Cannot reproduce the interactions dialog and app resource error locally on the same db and also other dbs. Can you try making a new copy of the original db for testing? The agent title error should now be fixed and there should be a validation error for records that don't belong to its picklist. However, there might be cases where a agent title record has the same |
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
- Verify values were rolled back to original
Didn't get to the regression test since I was testing other fields.
I wasn't able to recreate this issue a second time for some reason, but I had a case in which batch edit edited a preparation count above the amount it had available.
i.e.: Used a prep record which had a count of 3 with only 2 available preps. A gift preparation record was created, and the quantity of this gift preparation was 2. Opening this in batch edit, I was able to set the quantity on the gift preparation to 5 and save with no warning.
Checking the previous records, the quantity on the gift prep was 5, and then the original preparation record now had a count of 5. Rolling back the batch edit did not fix the preparation record.
Here's the audit log for that, though the old and new values are not displayed I know for sure that it was 3 before that batch edit, and there shouldn't have been two edits; just one from adding gift preps.
Link to the prep record: https://sdnhmherps2824batch2-issue-5413.test.specifysystems.org/specify/view/preparation/80361/
Relating to the latlong issue, I know you said you already wrote up an issue for it but is there anyway it could be fixed in this pr or at least in the same release as batch edit? I know no values were actually changed but I feel like this could be very confusing and concerning to users. Although I used a simple example in the video this still happens if you were to make one change to the data set, the users would have no way of really knowing if they made a change or if it just looked like they did. |
@emenslin Yeah we can do it in the same release/PR. My guess is that the problem exists in other places as well (even for non-decimal values) and we need a more nuanced way to compare old and new values. Will add it to this PR if it's a small fix |
Correct, but we already do (for API)! See specify7/specifyweb/specify/api.py Lines 536 to 544 in 1b2ab81
Should just be a mechanical change to use it here. Also, specify7/specifyweb/specify/api.py Line 961 in 1b2ab81
EDIT: I just saw you pushed 4814f11. Would still recommend change from api.py (to make things consistent) There is actually a separate bug here in general. Previously, Elizabeth mentioned this error in 4929 review: #4929 (review). That is, some localities were flagged as new. This happens because, when parsing longitude and latitude fields, we also artificially set long1text and fields. That is, you'd observe that if we do a workbench upload but just set latitude1 and longitude1 fields, long1text and latitude1text will also be set. Relevant code is here: specify7/specifyweb/specify/parse.py Lines 201 to 216 in 1b2ab81
Generically, parsing 1 field can result in multiple new fields. This is why Relevant code: specify7/specifyweb/workbench/upload/upload_table.py Lines 559 to 563 in 1b2ab81
Using the above, you might think "Oh, if we add extra lat1text and long1text, then doesn't this mean we would fail to match existing localities which have those fields set as null". That is, say specify7/specifyweb/workbench/upload/parsing.py Lines 284 to 304 in 4dbb95a
I'd encourage you, trace that code out from the v7.9.0 (and see how it is just added to the filter part) --- this is also the reason why we have separate All the above is precursor to the bug (in batch-edit): When you have latitude1 and/or longitude1, the relevant text will also be edited -- but, the user would not know that it did (since we report that). I'm not sure about the best way to fix this. Can this be discussed internally and determined if this needs to be fixed at all? I'm neutral on it:
//////////////////////// Now, for the bug in #4929 (review). You can probably see what the source of Elizabeth's bug was. IIRC, it was definitely because lat1text and long1text was empty (but we were matching with artificially added values -- which were not null). Can this be tested again when batch-edit supports relationships? So, in conclusion, three bugs are related to locality.
|
@combs-a I'm not able to recreate it. I run into a validation error if I try to set the preparation quantity greater than the count or the availability: What I did was:
|
@realVinayak Doesn't look like specify7/specifyweb/specify/api.py Lines 536 to 544 in 1b2ab81
Made a note of the lat/long text issues in #6126, thanks! |
@specify/testing The lat/long decimal issue should now be fixed. The lat/long text update + matching issues is added to #6126 and will be tested when we enable relationships. |
Ah yes, you're right -- it's more involved than I thought, sorry for wasting your time. I assumed that the previous code is bug-free, but it is not (I tested this on sp7demofish, and latitude are always considered to be changed when saving a locality form -- that's another, unrelated to batch edit, bug). I agree, just keep what you have in that case. Probably also need to document the lat/long text update (plus other fields that get updated, refer to the code for it). Maybe the discourse documentation is enough, or if there should be a warning when you use locality as the base table. Just for reference (no changes needed):
Can replace |
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.
@sharadsw I've tried to recreate my issue again a few times, and wasn't able to as well--it should be kept in mind, but it might've just been something very specific.
- 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
Regression tests
LatLon has been kind of fixed, but there are also potentially integers; ints are being converted to floats and that marks them as updated cells when they shouldn't be.
Also, I tried out COs that use COTs with the AlphaNumByYear type, and batch edit flagged the correct format as invalid, and incorrect formats as valid. Is fixing this within the scope of the PR? Wanted to check since the same thing works fine in the Workbench.
The incorrect format is AAAAAA, which was the default catno format before I changed it for FunnyTurtles.
@combs-a Catalog number validation is broken because relationships are disabled and so the value gets validated with the collection's default formatter. I created a new issue for it (#6248) but it will be fixed when relationships are enabled in #6126 About the lat/long issue, I'm not sure how we can reliably handle all cases there. The underlying cause for that row being updated is the issue Vinny mentioned where We could potentially parse the values similar to the frontend so that any integer values pretending to be floats get converted to integers (ie. Another potential solution could be to have comments on the cell in the frontend when lat/long text values update indicating the reason behind the row being shown as updated. Similar to how we have comments on validation error cells. Unfortunately, we don't have a way to do that right now but could be considered in future. Either way I have created a separate issue for the underlying cause which will have to be looked at in a later milestone #6251 |
Triggered by 38a632d on branch refs/heads/issue-5413
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
Regression tests
All tests passed, good work!
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
- Retest Support COT catalog number format configuration in WorkBench #5489
I didn't run into any new issues but since this is such a big PR I would like if we could get another testing review just to make sure nothing was missed.
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
Regression tests
Looks good, nice job!
Fixes #5413
Fixes #6209
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