Skip to content

Conversation

acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Oct 1, 2025

Fixes #7449

This solution converts the localization_dump field labels to a list of tuples rather than a dictionary. This is to avoid field key collisions in batch edit field labels. The code is made a little cleaner with the definitions of the BatchEditMetaTables, TableFieldLabels, and FieldLabel classes. Also, match QueryField objects to their given captions in order to better disambiguate batch edit columns.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list

Testing instructions

  • Create a collection object saved query where at least two fields point to the same table and field name. For example Cataloger -> GUID and Determinations -> Determiner -> GUID, in this example both resolve to Agent -> GUID.
  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit. Note that Batch Edit has logic that will reorder and add columns in some cases, so compare the data in the batch edit data in the main branch, and make sure this PR has the same data, but with the corrected column names.
image image image image

@acwhite211 acwhite211 added this to the 7.12.0 milestone Oct 1, 2025
@acwhite211 acwhite211 self-assigned this Oct 1, 2025
@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Oct 1, 2025
@acwhite211 acwhite211 marked this pull request as ready for review October 3, 2025 20:54
@acwhite211 acwhite211 requested review from a team October 3, 2025 20:55
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.

When I query with cataloger and collector (agent1) and press batch edit the values get switched. Seems like it has something to do with collector specifically, when I tried with cataloger and determiner it worked fine.

Cataloger and collector:

10-03_16.42.mp4

Cataloger and determiner:

10-03_16.46.mp4

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Oct 3, 2025
@acwhite211
Copy link
Member Author

Made some more changes to handle the case of the batch edit field labels not matching the data.

image image

In this test case, the data and the field labels are paired correctly. The last two guid fields in this test case on swapped from the QB view to the BE view, but that seems to the correct behavior that's also in the main branch.

@acwhite211 acwhite211 requested a review from emenslin October 6, 2025 18:34
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.

Looks good, names and values are correct in batch edit!

@emenslin emenslin requested a review from a team October 7, 2025 14:46
Copy link

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
  • [ x] Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.

Nice work so far!

Bugs:

1. When swapping the ordering in the columns in the QB and and then clicking run. The order is unchanged after the batch edit . Clearing cache did not address this issue

Batch edit:
https://calvertmarinemuseum20250909-issue-7449.test.specifysystems.org/specify/workbench/64
image

Query:
https://calvertmarinemuseum20250909-issue-7449.test.specifysystems.org/specify/query/39/

image

Copy link

@kwhuber kwhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
Screen.Recording.2025-10-08.at.3.16.24.PM.mov
  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.

After swapping, Cataloger incorrectly appears in the third column.

Screen.Recording.2025-10-08.at.3.19.49.PM.mov

@acwhite211
Copy link
Member Author

@Iwantexpresso @kwhuber Batch Edit has logic that will reorder and add columns in some cases. The import part of this PR is that the column captions in the Batch Edit Workbench are corrected. For this PR, compare the behavior to the main branch. This branch should have the same data as the main branch, but with the correct column names. So the testing examples mentioned in the screen shots look good. I updated the testing instructions to avoid the confusion.

  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit. Note that Batch Edit has logic that will reorder and add columns in some cases, so compare the data in the batch edit data in the main branch, and make sure this PR has the same data, but with the corrected column names.

on main:
https://naturkundemuseum20250909-main.test.specifysystems.org/specify/workbench/679
image

on issue-7449:
https://naturkundemuseum20250909-issue-7449.test.specifysystems.org/specify/workbench/677
image

@acwhite211 acwhite211 requested a review from kwhuber October 8, 2025 22:06
Copy link

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.

  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit. Note that Batch Edit has logic that will reorder and add columns in some cases, so compare the data in the batch edit data in the main branch, and make sure this PR has the same data, but with the corrected column names.

After reviewing these changes with the clarification it looks good. The labels are and the values are correct. and again thank you for the clarification

Copy link

@kwhuber kwhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Run 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
  • Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit. Note that Batch Edit has logic that will reorder and add columns in some cases, so compare the data in the batch edit data in the main branch, and make sure this PR has the same data, but with the corrected column names.

pr-7466:

Screenshot 2025-10-10 at 1 46 41 PM Screenshot 2025-10-10 at 1 47 47 PM

Switching order:
Screenshot 2025-10-10 at 1 49 33 PM

Screenshot 2025-10-10 at 1 56 08 PM

main:

Screenshot 2025-10-10 at 1 52 44 PM

Switching order:
Screenshot 2025-10-10 at 1 53 24 PM

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Dev Attention Needed

Development

Successfully merging this pull request may close these issues.

Agent fields have incorrect headings in batch edit

5 participants