-
Notifications
You must be signed in to change notification settings - Fork 41
Add support for explicitly choose a formatter in QB #4615
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
Conversation
Triggered by 231ac56 on branch refs/heads/issue-1959
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.
Screen.Recording.2024-03-08.at.12.14.58.PM.mov
https://umherb11024-issue-1959.test.specifysystems.org/specify/query/1196/
User is csiro, herbarium_catalog collection
I don't see the list of table formats/aggregation to choose from in the query when there is only one format defined. If there is only one format, it should just show one item in the list.
When there are multiple formats, I see two arrows before the format:

The arrow is misleading, the user will think it's a specific field or value.
If we made it so the list was in a small menu like in the WB:

…g on default value
Triggered by dd2c4cd on branch refs/heads/issue-1959
grantfitzsimmons
left a comment
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.
Almost perfect. Thank you for your patience!
Issues:
-
The gear has no background but it should have a white background, and it also isn't the same height as the query item:
issue-1959:

See how it should look in the WorkBench (link):

-
Adding a new (formatted) field makes the gear yellow even without any customization. It should only be highlighted if a specific format is selected
Query URL asHerbAdmininherbarium_catalogcollectionScreen.Recording.2024-03-08.at.3.16.43.PM.mov
In this case, it should be gray since it should be using the default format
When the selection is "blank", it uses the default formatter. Because of this, I think that if this is blank it should not be highlighted, but if any format is selected it should be highlighted.

-
Hovering over the gear should not make it orange, it should remain black.
-
The hover text says "Choose fromatter", but it should say "Choose formatter"
-
Instead of automatically hiding the custom selected table format, can we have it display until the next time the user loads the page? It can always be hidden by default, but it should show after the user sets it to a value so they can verify the change
Screen.Recording.2024-03-08.at.3.22.59.PM.mov
Basic queries also work with this feature, neat! 😊
Otherwise, we're almost there. Thank you @CarolineDenis for your hard work on this!
specifyweb/frontend/js_src/lib/components/QueryBuilder/Formatter.tsx
Outdated
Show resolved
Hide resolved
This is how the basic query items look when they are selected. I'd prefer to have it show on the entire line, but at the time it was said to be too difficult. |
grantfitzsimmons
left a comment
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
-
Navigate to the Query Builder (QB).
-
Select a table that you know has one or several formatters (To check, go to app resources, navigate to Record Formatter, choose the table, and verify the list of formatter names available).
-
Choose "formatted."
-
Verify that in the query line, after selecting the "formatted" field box, a drop-down appears with a list of formatter choices (corresponding to the list in app resources).
-
Verify that changing the formatter changes the way the field is displayed in the results table.
Great work adding this back (and much better than before)
Triggered by 3d12120 on branch refs/heads/issue-1959
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
-
Navigate to the Query Builder (QB).
-
Select a table that you know has one or several formatters (To check, go to app resources, navigate to Record Formatter, choose the table, and verify the list of formatter names available).
-
Choose "formatted."
-
Verify that in the query line, after selecting the "formatted" field box, a drop-down appears with a list of formatter choices (corresponding to the list in app resources).
-
Verify that changing the formatter changes the way the field is displayed in the results table.
bronwyncombs
left a comment
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.
When query line is selected and you click the gear, the picklist for selecting a format is hidden except for the little ⌄ arrow. This field should display the same as the other fields in the query line when highlighted.
Also, once the gear is highlighted brown, it doesn't revert back even if format is unselected and it's set to the blank default option.
Screen.Recording.2024-03-11.at.10.12.18.AM.mov
Other than those two things, adding a tool tip for the gear button that says "select format" or something would be great
I'm excited for this feature!
Triggered by db3b3ce on branch refs/heads/issue-1959
specifyweb/frontend/js_src/lib/components/QueryBuilder/Line.tsx
Outdated
Show resolved
Hide resolved
Triggered by 4c348ff on branch refs/heads/issue-1959
grantfitzsimmons
left a comment
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
-
Navigate to the Query Builder (QB).
-
Select a table that you know has one or several formatters (To check, go to app resources, navigate to Record Formatter, choose the table, and verify the list of formatter names available).
-
Choose "formatted."
-
Verify that in the query line, after selecting the "formatted" field box, a drop-down appears with a list of formatter choices (corresponding to the list in app resources).
-
Verify that changing the formatter changes the way the field is displayed in the results table.
-
Select a table that you know has one or several aggregators (To check, go to app resources, navigate to Record Aggregators, choose the table, and verify the list of aggregators names available).
-
Choose "aggregated"
-
Verify that in the query line, after selecting the "aggregated" field box, a drop-down appears with a list of aggregated choices (corresponding to the list in app resources).
-
Verify that changing the aggregator changes the way the field is displayed in the results table.
Wow. Even better. It looks great & works great. Tested using an older version of Specify 7 and it didn't break the queries either. 💯 Thank you!
emenslin
left a comment
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
-
Navigate to the Query Builder (QB).
-
Select a table that you know has one or several formatters (To check, go to app resources, navigate to Record Formatter, choose the table, and verify the list of formatter names available).
-
Choose "formatted."
-
Verify that in the query line, after selecting the "formatted" field box, a drop-down appears with a list of formatter choices (corresponding to the list in app resources).
-
Verify that changing the formatter changes the way the field is displayed in the results table.
-
Select a table that you know has one or several aggregators (To check, go to app resources, navigate to Record Aggregators, choose the table, and verify the list of aggregators names available).
-
Choose "aggregated"
-
Verify that in the query line, after selecting the "aggregated" field box, a drop-down appears with a list of aggregated choices (corresponding to the list in app resources).
-
Verify that changing the aggregator changes the way the field is displayed in the results table.
Can select the different aggregations but both give the result of the default format.
uJT0JUGjnW.mp4
emenslin
left a comment
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
-
Navigate to the Query Builder (QB).
-
Select a table that you know has one or several formatters (To check, go to app resources, navigate to Record Formatter, choose the table, and verify the list of formatter names available).
-
Choose "formatted."
-
Verify that in the query line, after selecting the "formatted" field box, a drop-down appears with a list of formatter choices (corresponding to the list in app resources).
-
Verify that changing the formatter changes the way the field is displayed in the results table.
Looks good!
maxpatiiuk
left a comment
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.
sorry, I got distracted and forgot to submit my review comments before this PR got merged
my comments don't have anything major, just small refactoring. @CarolineDenis could you please incorporate these small changes in some other PR or a small follow-up PR?
thanks)


Fixes #1959
Notes:
Code was lost during a merge. Feature added in d52aee9
Checklist
and self-explanatory (or properly documented)
Testing instructions
Navigate to the Query Builder (QB).
Select a table that you know has one or several formatters (To check, go to app resources, navigate to Record Formatter, choose the table, and verify the list of formatter names available).
Choose "formatted."
Verify that in the query line, after selecting the "formatted" field box, a drop-down appears with a list of formatter choices (corresponding to the list in app resources).
Verify that changing the formatter changes the way the field is displayed in the results table.