Skip to content
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

fix(Formatters): correctly detect main table fields #4516

Merged
merged 3 commits into from
Feb 12, 2024

Conversation

maxpatiiuk
Copy link
Member

Fixes #4512

Checklist

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

Testing instructions

Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

Testing instructions

I can't say I completely understand the logic that determines this list, but it seems to be more logical? Some don't make much sense to me (some tables have a series of generic text fields as the 'main fields') but it behaves as I'd expect in the application. I'd like another UX tester to verify the behavior is consistent across a number of QCBXes with production.

@grantfitzsimmons grantfitzsimmons requested a review from a team February 11, 2024 18:19
Copy link

@bronwyncombs bronwyncombs left a comment

Choose a reason for hiding this comment

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

The issue of new agents filling firstName field has been resolved, the qcbx correctly fills the lastName field on the form again.

I'd like another UX tester to verify the behavior is consistent across a number of QCBXes with production.

I also don't fully understand this list, but things appear to be mostly correct and logical.
I tested various parts of the application including Geography, Repository Agreement, Storage, etc.

@CarolineDenis CarolineDenis merged commit 9584db7 into production Feb 12, 2024
9 checks passed
@CarolineDenis CarolineDenis deleted the issue-4512 branch February 12, 2024 19:17
@maxpatiiuk
Copy link
Member Author

For future reference, here is a human-readable translation of the algorithm that determines the main table fields:

  1. For a given table, pick all string fields that are not read-only, AND that are either required or not hidden
  2. Sort the given fields according to the following:
    • if field name includes name, put those first
    • else, if field is required
    • else, field that is not virtual, and does not have "read-only" or "hidden" front-end overrides (front-end overrides are a concept, mainly applicable to workbench that hides fields or modifies schema, on top of the settings in the schema configuration)
    • else, sort by name

The result is a sorted list of fields from most important to least.
Than, any place that needs X most important fields, can pick X top items from the resulting list.

In the case of query combo box, it picks the first "main field" that is specified in the searchfields attribute in the typesearches.xml
Other places might pick first 2-3 main fields (for example, front-end has capability to generate record formatter on the fly if it's missing)

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.

When creating a record using a query combo box the entered value is deposited in the wrong field
4 participants