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

PL: Regional partner search gets info about priority deadline dates #27924

Merged

Conversation

breville
Copy link
Member

@breville breville commented Apr 8, 2019

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

Upcoming priority deadline date

Screenshot 2019-04-09 12 01 11

No upcoming priority deadline date

Screenshot 2019-04-09 12 06 04

Button still working when linking to external partner site

Screenshot 2019-04-09 12 06 40

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.
@agealy
Copy link

agealy commented Apr 8, 2019

@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 ?
Notification- With Button
Group 2 (68)

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

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?

Copy link
Member Author

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}

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!

dashboard/test/factories/pd_factories.rb Outdated Show resolved Hide resolved
@breville breville merged commit ac324d0 into staging Apr 9, 2019
@breville breville deleted the pl-priority-deadline-info-on-regional-partner-search branch April 9, 2019 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants