-
Notifications
You must be signed in to change notification settings - Fork 44
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
Implement Circular Archive date range search frontend with new DateSelectorButton #1482
Implement Circular Archive date range search frontend with new DateSelectorButton #1482
Conversation
…. This will be a new PR due to previous PR being stale
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1482 +/- ##
========================================
- Coverage 5.37% 5.27% -0.11%
========================================
Files 118 119 +1
Lines 2733 2789 +56
Branches 285 292 +7
========================================
Hits 147 147
- Misses 2584 2640 +56
Partials 2 2
☔ View full report in Codecov by Sentry. |
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.
Can you auto-submit the form if any of the fuzzy date radio buttons are clicked?
I agree. I think that we may handle this by displaying the dropdown content as a block element on mobile and as a dropdown on desktop. But don't worry about that now; we can fix that in a future PR. |
BTW, this looks very nice! |
So that was the original intent when I was originally using buttons rather than radios, but I was encountering a weird error where the Parameters were delayed in being set by one cycle (eg if on submission 1, I set the params to time A, the url would still be blank, but upon trying to set them to time B on submission 2, the url params would be set to time A). @Courey and I were unable to debug that when we initially tried, which is why I added the submit button |
Co-authored-by: Leo Singer <[email protected]>
…ylerbarna/gcn.nasa.gov into circulars-date-search-frontend
Alright, we can tackle that in a future PR. |
setting button group to z-top index fixes issues regarding index for both other buttons and the footer
Co-authored-by: Leo Singer <[email protected]>
no longer have undefined label, will now display All Time instead
removed radio button class that was not a uswds search component, removed commented out code, fixed card className, made the date range button match the labels for the radio buttons, made it so the date range filter dropdown is hidden upon submission
the radio button selected by the user will persist upon submission. Accomplished using a useEffect (thanks to Courey for the advice)
useEffect will check through the buttons and set the correct one to be checked. however, the date range div will not be expanded
@tylerbarna, I have played around with this locally and I see the z-ordering glitches in the date selector that you were describing. I haven't come up with a way to fix that. I'd really like to wrap this up and free you to work on something new. Could you pare this down to a PR that just supports the fuzzy date ranges and no custom date ranges? |
@lpsinger oh, apologies for not including this in a message, but @Courey was actually able to resolve the z-order issues I was referring to by setting the z-index to z-top for the button group. Are you referring to a different index issue? |
Oh, I see! Very nice. |
This refactoring will make it simpler to add SEO metadata to routes because it will avoid having to merge meta function outputs. According to https://remix.run/docs/en/main/route/meta#global-meta: > Nearly every app will have global meta like the viewport and > charSet. We recommend using normal <meta> tags inside the root > route instead of the meta export, so you simply don't have to > deal with merging.
- Redirect from /docs/schema to /docs/schema/stable, from /docs/schema/stable to /docs/schema/<latest>, and from /docs/schema/$version to /docs/schema/$version/gcn/notices. - The loader for /docs/schema can now be safely cached because its return value does not depend on the dynamic portions of the path from its child routes. - The /docs/schema/<version> index route, which was only ever used as a component import, is gone.
- The USWDS breadcrumb component only shows the link to the parent on mobile. However, our paths are never long enough that we need to do that. Create a new breadcrumb component that always shows all parts of the path. - Remove all conditional rendering depending on screen size. - Factor the version picker out into a separate component.
the two map calls are now one. Also removed an empty className in the submit button.
Right. So for those radio buttons for which you do not want to show a custom date range, set their value to an empty string ( |
Ah, I see |
going from a fuzzy date to a custom date where just the end date is set no longer has the issue of the start date still being set to the fuzzy date. Also added labels to the date range selector so that instances of selecting just a start date or just an end date will look better.
I think the component now meets most of the specifications we were aiming for |
Please rebase. There are now merge conflicts due to #1524. |
should be rebased now! |
Co-authored-by: Leo Singer <[email protected]>
Co-authored-by: Leo Singer <[email protected]>
Co-authored-by: Leo Singer <[email protected]>
This is a PR to replace #1265 to bring it to a more recent commit and also to make use of the recent Date selector button added by @lpsinger in #1471. The appearance is now as such:
Known issues:
Date dropdown menu remains expanded after page is reloaded following a selection and submission of one of the date options. However, the div that contains the date range selector element is collapsed upon page submission and reloading.
Radio buttons are misaligned when viewed on mobile or when a desktop window is made sufficiently narrow
Selecting an option, submitting and then switching back to the all time option before submitting again results in the button label being listed as 'undefined-now' rather than the default 'filter by date'
When selecting a custom date range, if the start date is set, the results are cleared from the page due to the
clean
variable being set to false (related: clean variable in circulars index causing issues with displaying results #1110, Footer draws over floating elements #1366), resulting in the footer obscuring the end date and submit buttonsThe buttons to download circulars as a tarball are set to a higher z-index than the date range dropdown
On mobile, most of the vertical space is occupied by the date range menu when the custom range option is selected (example is an iPhone 12 Pro)
On mobile, smaller screens may not be able to use the date selector for the end date due to screen height limitations. This might be an issue with the DateRangeSelector element. (example is an iPhone SE)
start and end date values are not shown in input fields after setting them and submitting them (they are set as parameters, but they are not visually shown in the input fields). Having a UseEffect set the values of the inputs results in the dates not changing visually after selecting a new date
setting a custom date range and then submitting will result in custom range radio button being selected but the showDateRange div not being expanded
selecting a fuzzy date (eg last year), submitting, and then switching to only submitting a custom end date will result in the startDate parameter persisting as the prior value when it should be undefined