Skip to content

Commit

Permalink
Merge pull request #19990 from code-dot-org/dtl_candidate_3c42bd3f
Browse files Browse the repository at this point in the history
  • Loading branch information
deploy-code-org committed Jan 12, 2018
2 parents a36cc1b + 3c42bd3 commit e366727
Show file tree
Hide file tree
Showing 30 changed files with 873 additions and 28 deletions.
1 change: 1 addition & 0 deletions apps/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ describe('entry tests', () => {
'pd/application/facilitator_application/new': './src/sites/studio/pages/pd/application/facilitator_application/new.js',
'pd/application/teacher_application/new': './src/sites/studio/pages/pd/application/teacher_application/new.js',
'pd/application/principal_approval_application/new': './src/sites/studio/pages/pd/application/principal_approval_application/new.js',
'pd/teachercon1819_registration/new': './src/sites/studio/pages/pd/teachercon1819_registration/new.js',

'pd/professional_learning_landing/index': './src/sites/studio/pages/pd/professional_learning_landing/index.js',
'pd/regional_partner_contact/new': './src/sites/studio/pages/pd/regional_partner_contact/new.js',
Expand Down
9 changes: 9 additions & 0 deletions apps/script/generateSharedConstants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require_relative '../../lib/cdo/shared_constants/pd/facilitator1819_application_constants'
require_relative '../../lib/cdo/shared_constants/pd/teacher1819_application_constants'
require_relative '../../lib/cdo/shared_constants/pd/principal_approval1819_application_constants'
require_relative '../../lib/cdo/shared_constants/pd/teachercon1819_registration_constants'

REPO_DIR = File.expand_path('../../../', __FILE__)

Expand Down Expand Up @@ -105,6 +106,14 @@ def main
),
"#{REPO_DIR}/apps/src/generated/pd/principalApproval1819ApplicationConstants.js"
)
generate_shared_js_file(
generate_multiple_constants(
%w(TEACHER_SEAT_ACCEPTANCE_OPTIONS),
source_module: Teachercon1819RegistrationConstants,
transform_keys: true
),
"#{REPO_DIR}/apps/src/generated/pd/teachercon1819RegistrationConstants.js"
)
end

main
10 changes: 10 additions & 0 deletions apps/src/applab/EventSandboxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ EventSandboxer.prototype.sandboxEvent = function (event) {
}
});

// Pull selectionStart and selectionEnd from the target element, if available,
// and expose them on the sandboxed event object
if (event.target) {
['selectionStart', 'selectionEnd'].forEach((eventTargetPropName) => {
if (event.target[eventTargetPropName] !== undefined) {
newEvent[eventTargetPropName] = event.target[eventTargetPropName];
}
});
}

// Attempt to polyfill DOM element ID properties
// Of our six DOM properties, only three are standard.
var fillProperty = function (to, from) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

const CSD_URL = 'https://code.org/educate/professional-learning/cs-discoveries';
const CSP_URL = 'https://code.org/educate/professional-learning/cs-principles';
const PD_RESOURCES_URL = 'https://support.code.org/hc/en-us/articles/115003865532?flash_digest=4d6f39af640b1d65d4a66a37e7de1f5260f2cf42';
const PD_RESOURCES_URL = 'https://support.code.org/hc/en-us/articles/115003865532';
const CS_TEACHERS_URL = 'https://code.org/educate/community';
const WHICH_PROGRAM_URL = 'https://code.org/files/PL-Program-for-Me.pdf';
const TEACHER_EMAIL = 'teacher@code.org';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class SummaryTable extends React.Component {
href={this.context.router.createHref(`/${this.props.path}_cohort`)}
onClick={this.handleViewCohortClick}
>
View Accepted Cohort
View accepted cohort
</Button>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react';

import {
FormGroup,
} from 'react-bootstrap';

import Teachercon1819FormComponent from './Teachercon1819FormComponent';

export default class Confirmation extends Teachercon1819FormComponent {
static associatedFields = [];

render() {
return (
<FormGroup>
{this.isTeacherApplication() &&
<p>
We're excited you're planning to join the Professional Learning
Program! You will receive more information about travel approximately
six weeks before TeacherCon. In the meantime, please <strong>do not</strong> book your
flight, and make sure to contact <a href="mailto:teacher@code.org">teacher@code.org</a> with any questions.
We look forward to meeting you this summer!
</p>
}

{this.isFacilitatorApplication() &&
<p>
We're excited you're planning to join us this summer! You will
receive more information about travel approximately six weeks before
TeacherCon. In the meantime, please <strong>do not</strong> book your flight, and make
sure to contact <a href="mailto:facilitators@code.org">facilitators@code.org</a> with any questions. We look
forward to meeting you this summer!
</p>
}

{this.isPartnerApplication() &&
<p>
We're excited you're planning to join us this summer! You will
receive more information about travel approximately six weeks before
TeacherCon. In the meantime, please <strong>do not</strong> book your flight, and make
sure to contact your Outreach Regional Manager with any questions. We
look forward to meeting you this summer!
</p>
}
</FormGroup>
);
}
}

103 changes: 103 additions & 0 deletions apps/src/code-studio/pd/teachercon1819_registration/Joining.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import React from 'react';
import {
FormGroup,
ControlLabel
} from 'react-bootstrap';
import Teachercon1819FormComponent from './Teachercon1819FormComponent';
import UsPhoneNumberInput from "../form_components/UsPhoneNumberInput";

import { TeacherSeatAcceptanceOptions } from '@cdo/apps/generated/pd/teachercon1819RegistrationConstants';

export default class Joining extends Teachercon1819FormComponent {
static labels = {
preferredFirstName: "Preferred first name",
lastName: "Last name",
email: "Email",
phone: "Phone number",
teacherAcceptSeat: "Do you want to accept your seat in the Professional Learning Program? (Select one)",
teacherWaitlistExplain: "Optional: Please explain more why you cannot accept your seat in the Professional Learning Program.",
teacherDeclineExplain: "Optional: Please explain more why you cannot accept your seat in the Professional Learning Program.",
}

static associatedFields = Object.keys(Joining.labels)

/**
* @override
*/
static getErrorMessages(data) {
const formatErrors = {};

if (!UsPhoneNumberInput.isValid(data.phone)) {
formatErrors.phone = "Must be a valid phone number including area code";
}

return formatErrors;
}

render() {
return (
<FormGroup>
<h4>Section 1: Are you joining us?</h4>

<FormGroup>
{this.inputFor("preferredFirstName")}
{this.inputFor("lastName")}
{this.inputFor("email", { readOnly: true })}
{this.usPhoneNumberInputFor("phone")}
</FormGroup>
<FormGroup>
<ControlLabel>
Your assigned summer workshop is:
<br />
<strong>
TeacherCon {this.props.city}, {this.props.date}
</strong>
</ControlLabel>
</FormGroup>

{this.isTeacherApplication() &&
<FormGroup>
<p>
As a reminder, all participants in the Professional Learning Program
are expected to:
</p>
<ul>
<li>Attend their assigned summer workshop</li>
<li>Attend their assigned academic year workshops</li>
<li>Teach this curriculum in the 2018-19 school year</li>
</ul>
{this.radioButtonsFor("teacherAcceptSeat")}
{(
this.props.data.teacherAcceptSeat === TeacherSeatAcceptanceOptions.withdrawDate ||
this.props.data.teacherAcceptSeat === TeacherSeatAcceptanceOptions.withdrawOther
) &&
<FormGroup>
<p>
Thank you for letting us know. We will remove your seat in your
assigned summer workshop for now, and add you to our waitlist.
Please complete the rest of this form so we have your information
in our records, and we will contact you if a seat becomes
available for an alternate date.
</p>
{this.inputFor("teacherWaitlistExplain", { required: false })}
</FormGroup>
}

{this.props.data.teacherAcceptSeat === TeacherSeatAcceptanceOptions.decline &&
<FormGroup>
<p>
Thank you for letting us know. You do not need to complete the rest
of this form. We will close your application today, but please feel
free to use all of our free curricula and resources available at
code.org/educate. We hope you consider applying again in 2019!
</p>
{this.inputFor("teacherDeclineExplain", { required: false })}
</FormGroup>
}
</FormGroup>
}

</FormGroup>
);
}
}
67 changes: 67 additions & 0 deletions apps/src/code-studio/pd/teachercon1819_registration/Releases.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';

import {
FormGroup,
ControlLabel
} from 'react-bootstrap';

import Teachercon1819FormComponent from './Teachercon1819FormComponent';

export default class Releases extends Teachercon1819FormComponent {
static associatedFields = [
'photoRelease',
'liabilityWaiver',
'agreeShareContact',
];

static labels = {
photoRelease: "Do you agree to the conditions in the photo release?",
liabilityWaiver: "Do you 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.",
};

render() {
return (
<FormGroup>
<h4>Section 3: Releases</h4>
<FormGroup>
<ControlLabel>
Please read this <a target="_blank" href="https://docs.google.com/document/d/12NVUcqccNRbVukoGMCserwSpg4vfG0vNlEqTxr6oit0/edit">photo release.</a>
</ControlLabel>
{this.selectFor("photoRelease", { placeholder: "--" })}
<ControlLabel>
Please read this <a target="_blank" href="https://docs.google.com/document/d/15N5N1m-BPCU7obQDf7FLLhEt3IComFGB1u3N6kEQR6k/edit">liability waiver.</a>
</ControlLabel>
{this.selectFor("liabilityWaiver", { placeholder: "--" })}
</FormGroup>

{(
this.isTeacherApplication() || this.isFacilitatorApplication()
) &&
<FormGroup>
<ControlLabel>
<strong>
Code.org works closely with local Regional Partners to organize and
deliver the Professional Learning Program. By enrolling in this
program, you are agreeing to allow Code.org to share information on
how you use Code.org and the Professional Learning resources with your
Regional Partner and school district. In order to organize the
workshops and support you, our partners need to know who is attending
and what content is relevant for them. So, we will share your contact
information, which courses/units you are using in your classrooms and
aggregate data about your classes. This includes the number of
students in your classes, the demographic breakdown of your classroom,
and the name of your school and district. We will not share any
information about individual students with our Regional Partners - all
information will be de-identified and aggregated. Our Regional
Partners are contractually obliged to treat this information with the
same level of confidentiality as Code.org.
</strong>
</ControlLabel>
{this.singleCheckboxFor("agreeShareContact")}
</FormGroup>
}
</FormGroup>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import LabeledFormComponent from '../form_components/LabeledFormComponent';

const TEACHER = "Teacher";
const FACILITATOR = "Facilitator";
const PARTNER = "Partner";

export default class Teachercon1819FormComponent extends LabeledFormComponent {

isTeacherApplication() {
return this.props.applicationType === TEACHER;
}

isFacilitatorApplication() {
return this.props.applicationType === FACILITATOR;
}

isPartnerApplication() {
return this.props.applicationType === PARTNER;
}

}

0 comments on commit e366727

Please sign in to comment.