Skip to content

Improve DataObjFormatters Handling for New Tables#6324

Merged
Areyes42 merged 10 commits into
productionfrom
issue-6243
Apr 30, 2025
Merged

Improve DataObjFormatters Handling for New Tables#6324
Areyes42 merged 10 commits into
productionfrom
issue-6243

Conversation

@Areyes42

@Areyes42 Areyes42 commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

Fixes #6243

Refer to the original issue for more detailed context, but essentially this PR implements a fallback mechanism for DataObjFormatters that allows users with custom configurations to merge with default presets. This change should let users with custom DataObjFormatters now automatically access new table formatters added to the system without needing to manually update their configs.

Specifically affected tables include:

  • specifyuser
  • collectionobjectgroup
  • collectionobjecttype
  • collectionobjectgrouptype
  • tectonicunit
  • tectonicunittreedef
  • tectonicunittreedefitem

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 relevant documentation (Tester - Dev)
  • Add automated tests

Testing instructions

  1. Navigate to App Resources → Record Formatters
  2. Make a backup of the current DataObjFormatters
  3. Remove a table formatter from the custom DataObjFormatters
  4. Open a query on one of the table formatters that you deleted
  5. Run the query with '(formatted)' selected
    • Verify the records are displayed with proper formatting
    • Repeat these steps with all the affected tables
  6. Navigate to a form that has a query combo box for the affected tables
    • Verify records are properly formatted when using the search button in the query combo box
  7. Go back to the record formatters and define a new custom table formatter
    • Verify the new custom formatter overrides the system formatter

@Areyes42
Areyes42 marked this pull request as ready for review April 11, 2025 19:28
@Areyes42
Areyes42 requested review from a team April 11, 2025 19:28
Triggered by ea75ff1 on branch refs/heads/issue-6243
@Areyes42 Areyes42 self-assigned this Apr 11, 2025

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Verify the records are displayed with proper formatting
  • Repeat these steps with all the affected tables
  • Verify records are properly formatted when using the search button in the query combo box
  • Verify the new custom formatter overrides the system formatter

TectonicUnitTreeDef and TectonicUnitTreeDefItem don't have a default format, everything else looks good!

image

@github-project-automation github-project-automation Bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Apr 11, 2025
@Areyes42
Areyes42 requested review from a team and emenslin April 16, 2025 16:32
@Areyes42

Copy link
Copy Markdown
Contributor Author
  • Repeat these steps with all the affected tables

TectonicUnitTreeDef and TectonicUnitTreeDefItem don't have a default format, everything else looks good!

I added those two tables to the default dataobj formatters, so they should be good now.

@sharadsw sharadsw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the changes here look good! My comments are just for discussion on trying to generalize fallback for all app resources instead of having different logic for different ones

Comment thread specifyweb/context/app_resource.py
Comment thread specifyweb/context/app_resource.py
Comment thread specifyweb/context/app_resource.py
@sharadsw
sharadsw requested a review from a team April 16, 2025 17:33

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Verify the records are displayed with proper formatting
  • Repeat these steps with all the affected tables
  • Verify records are properly formatted when using the search button in the query combo box
  • Verify the new custom formatter overrides the system formatter

Looks good, tectonic unit issue is fixed!
image

@emenslin
emenslin requested a review from a team April 18, 2025 14:18
@CarolineDenis CarolineDenis added this to the 7.10.3 milestone Apr 23, 2025

@pashiav pashiav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Verify the records are displayed with proper formatting
  • Repeat these steps with all the affected tables
  • Verify records are properly formatted when using the search button in the query combo box
  • Verify the new custom formatter overrides the system formatter

Looks good! Working as expected.

@Areyes42
Areyes42 merged commit 9ca0c13 into production Apr 30, 2025
@Areyes42
Areyes42 deleted the issue-6243 branch April 30, 2025 16:42
@github-project-automation github-project-automation Bot moved this from Dev Attention Needed to ✅Done in General Tester Board Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Support Default DataObjFormatters Alongside Custom Configurations

6 participants