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
PL: Regional partner search gets info about priority deadline dates #27924
PL: Regional partner search gets info about priority deadline dates #27924
Conversation
The regional partner search UI now gets an info box above each "start application" button related to a regional partner's upcoming regional priority deadline date. If there is such a date coming up, the viewer is told about it. If there is no such date, there is a fallback message. Because of the number of places in this code that we can show the "start application" button, it's now been factored out into a standalone stateless/functional React component.
@breville , Mark had some feedback on the new notifications and gave a new mock example with red lines. Notable changes are rounding, button formatting, and button moved to within notification. Can you change as mocked ? |
As well as code review feedback, this change unit tests the new priority deadline date field. It was interesting to discover that the unit tests failed when the local machine had its time zone set to something other than PST, and it turns out to be a known issue discussed at travisjeffery/timecop#182. The solution is to use `Date.current` rather than `Date.today`. A bunch of factories were also updated to use the yyyy-mm-dd date format that it turns out we're storing, as described in #27895
@@ -262,6 +262,8 @@ class RegionalPartnerTest < ActiveSupport::TestCase | |||
assert_equal WORKSHOP_APPLICATION_STATES[:currently_open], regional_partner.summer_workshops_application_state | |||
assert_equal "September 25, 2018", regional_partner.summer_workshops_earliest_apps_open_date | |||
assert_nil regional_partner.link_to_partner_application | |||
|
|||
assert_equal "October 2, 2018", regional_partner.upcoming_priority_deadline_date |
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.
is the extra space in there intentional?
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.
Good question. Yes, the use of the blank-padded day of the month (%e
) goes back a couple years and we've just continued using it here.
@@ -1017,10 +1017,10 @@ | |||
contact_name "Contact Name" | |||
contact_email "contact@code.org" | |||
group 1 | |||
apps_open_date_csp_teacher {Date.today - 1.day} |
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.
thanks for investigating and fixing all these tests!
The regional partner search UI now gets an info box above each "start application" button related to a regional partner's upcoming regional priority deadline date. If there is such a date coming up, the viewer is told about it. If there is no such date, there is a fallback message.
Because of the number of places in this code that we can show the "start application" button, it's now been factored out into a standalone stateless/functional React component.
It was interesting to discover that the unit tests failed when the local machine had its time zone set to something other than PST, and it turns out to be a known issue discussed at travisjeffery/timecop#182. The solution is to use
Date.current
rather thanDate.today
.A bunch of factories were also updated to use the yyyy-mm-dd date format that it turns out we're storing, as described in #27895
Upcoming priority deadline date
No upcoming priority deadline date
Button still working when linking to external partner site