Skip to content

Conversation

@CarolineDenis
Copy link
Contributor

@CarolineDenis CarolineDenis commented Mar 8, 2024

Fixes #1959

Notes:
Code was lost during a merge. Feature added in d52aee9

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

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.

@CarolineDenis CarolineDenis added this to the 7.9.4 milestone Mar 8, 2024
@CarolineDenis CarolineDenis requested review from a team and maxpatiiuk March 8, 2024 16:06
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.

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:
Screenshot 2024-03-08 at 12 29 28 PM

The arrow is misleading, the user will think it's a specific field or value.

image

If we made it so the list was in a small menu like in the WB:
image

grantfitzsimmons

This comment was marked as outdated.

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.

Almost perfect. Thank you for your patience!

Issues:

  1. 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:
    image

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

  2. 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 as HerbAdmin in herbarium_catalog collection

    Screen.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.
    image

  3. Hovering over the gear should not make it orange, it should remain black.

    image
  4. The hover text says "Choose fromatter", but it should say "Choose formatter"

  5. 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

Not an issue:
image

Basic queries also work with this feature, neat! 😊

Otherwise, we're almost there. Thank you @CarolineDenis for your hard work on this!

@maxpatiiuk
Copy link
Member

image

It seems like the background is applied to a wrong element?
(it needs to be on the parent of this element?) or is the element missing w-full?

@grantfitzsimmons
Copy link
Member

It seems like the background is applied to a wrong element?
(it needs to be on the parent of this element?) or is the element missing w-full?

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.

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

  • 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)

@grantfitzsimmons grantfitzsimmons requested a review from a team March 9, 2024 15:49
Copy link
Contributor

@pashiav pashiav 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

  • 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.

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.

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.

Screenshot 2024-03-11 at 10 09 15 AM

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
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

  • 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!

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.

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

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.

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!

@CarolineDenis CarolineDenis dismissed stale reviews from melton-jason and bronwyncombs March 13, 2024 13:59

fixed

@CarolineDenis CarolineDenis merged commit 4020614 into production Mar 13, 2024
@CarolineDenis CarolineDenis deleted the issue-1959 branch March 13, 2024 14:00
Copy link
Member

@maxpatiiuk maxpatiiuk left a 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)

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.

Add support for explicitly choosing a formatter in Query Builder

8 participants