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

2nd round of bug bash feedback for FiT and Teachercon registration forms #20702

Merged
merged 3 commits into from
Feb 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export default class Releases extends LabeledFormComponent {
];

static labels = {
photoRelease: "Do you agree to the conditions in the photo release?",
liabilityWaiver: "Do you agree to the conditions in the liability waiver?",
photoRelease: "I agree to the conditions in the photo release",
liabilityWaiver: "I agree to the conditions in the liability waiver",
agreeShareContact: "By submitting this application, I agree to share my contact information and registration with Code.org's Regional Partners.",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default class Joining extends Teachercon1819FormComponent {
Congratulations on your acceptance to Code.org's Professional Learning Program
for {this.props.course}! Please complete this form
<strong> within two weeks</strong> to let us know if you will be joining us
this year, and contact <a href="mailto:teacher@code.org">teacher@code.org</a>
&nbsp;with any questions.
this year, and contact <a href="mailto:teacher@code.org">teacher@code.org</a> with
any questions.
</p>
);
} else if (this.isFacilitatorApplication()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,22 @@ export default class Teachercon1819Registration extends FormController {
* @override
*/
getPageComponents() {
const pageComponents = [
Joining,
TravelPlans,
];
if (this.state.data.teacherAcceptSeat === TeacherSeatAcceptanceOptions['decline']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also consider this.state.data.ableToAttend === "No"?

return [Joining];
} else {
const pageComponents = [
Joining,
TravelPlans,
];

if (this.props.applicationType === "Teacher") {
pageComponents.push(CoursePlans);
}
if (this.props.applicationType === "Teacher") {
pageComponents.push(CoursePlans);
}

pageComponents.push(Releases);
pageComponents.push(Releases);

return pageComponents;
return pageComponents;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ControlLabel
} from 'react-bootstrap';

import {TextFields} from '@cdo/apps/generated/pd/teachercon1819RegistrationConstants';
import UsPhoneNumberInput from "../form_components/UsPhoneNumberInput";
import {isZipCode} from '@cdo/apps/util/formatValidation';

Expand Down Expand Up @@ -75,6 +74,10 @@ export default class TravelPlans extends Teachercon1819FormComponent {
);
}

if (data.dietaryNeeds && data.dietaryNeeds.includes('Food Allergy')) {
requiredFields.push('foodAllergyDetails');
}

if (data.needHotel === 'Yes') {
requiredFields.push("needAda");
}
Expand All @@ -99,9 +102,12 @@ export default class TravelPlans extends Teachercon1819FormComponent {
</FormGroup>

<FormGroup>
{this.checkBoxesWithAdditionalTextFieldsFor("dietaryNeeds", {
[TextFields.foodAllergy]: "food_allergy_details"
})}
{this.checkBoxesFor("dietaryNeeds")}
{
this.props.data.dietaryNeeds &&
this.props.data.dietaryNeeds.includes('Food Allergy') &&
this.largeInputFor("dietaryNeedsDetails")
}
</FormGroup>

<FormGroup>
Expand All @@ -126,7 +132,9 @@ export default class TravelPlans extends Teachercon1819FormComponent {
</FormGroup>

<FormGroup>
{this.radioButtonsFor("howTraveling")}
{this.radioButtonsWithAdditionalTextFieldsFor("howTraveling", {
'I will carpool with another TeacherCon attendee (Please note who)': 'carpooling_with_attendee'
})}
{this.radioButtonsFor("needHotel")}
{
this.props.data.needHotel === 'Yes' &&
Expand Down Expand Up @@ -155,6 +163,10 @@ export default class TravelPlans extends Teachercon1819FormComponent {
data.explainAda = undefined;
}

if (data.dietaryNeeds && !data.dietaryNeeds.includes('Food Allergy')) {
changes.dietaryNeedsDetails = undefined;
}

return changes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def new
return
end

unless @application.locked? && @application.status == 'accepted'
unless @application.locked? && ['accepted', 'withdrawn'].include?(@application.status)
render :invalid
return
end
Expand Down
8 changes: 7 additions & 1 deletion dashboard/app/models/pd/teachercon1819_registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def self.options
address_state: get_all_states_with_dc.to_h.values,
how_traveling: [
'I will drive by myself',
'I will carpool with another TeacherCon attendee',
'I will carpool with another TeacherCon attendee (Please note who)',
'Flying',
'Amtrak or regional train service',
'Public transit (e.g., city bus or light rail)',
Expand Down Expand Up @@ -192,6 +192,12 @@ def dynamic_required_fields(hash)
]
end

if hash[:dietary_needs].try(:include?, 'Food Allergy')
requireds.concat [
:dietary_needs_details
]
end

return requireds
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
= stylesheet_link_tag 'css/pd', media: 'all'

%p
This Code.org account is not linked to a current facilitator. If you are a
facilitator who has been accepted to a FiT Weekend, please confirm that you're
using the same Code.org account you used to submit your facilitator
application. Please
email <a href="mailto:facilitators@code.org">facilitators@code.org</a> for
support.
If you are a facilitator who has been accepted to a FiT Weekend, please sign in with the
same Code.org account you used to submit your facilitator application. Please
email <a href="mailto:facilitators@code.org">facilitators@code.org</a> for support.
2 changes: 1 addition & 1 deletion dashboard/test/factories/pd_factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@
contact_phone "1597534862"
contact_relationship "it's complicated"
dietary_needs "Food Allergy"
dietary_needs_food_allergy_details "memories"
dietary_needs_details "memories"
how_traveling "Amtrak or regional train service"
liability_waiver "Yes"
live_far_away "Yes"
Expand Down