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

DTL (Test > Levelbuilder): 7bc5e393 #23560

Merged
merged 125 commits into from Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
74817fb
PD: international opt-in form
breville Jun 21, 2018
12feb46
PD: International opt-in work
breville Jun 22, 2018
ded35b6
PD: international opt-in form gets loc'ed labels
breville Jun 23, 2018
1359b0a
PD: international opt-in gets loc'ed options
breville Jun 25, 2018
caaa78e
PD: international opt-in, some validation & testing
breville Jun 25, 2018
ce89358
PD: international opt-in gets date picker
breville Jun 26, 2018
bcc3ecc
Merge branch 'staging' into international-optin-pd-form
breville Jun 26, 2018
1dbfa5d
Merge pull request #23378 from code-dot-org/dtp_candidate_0d44816a
sureshc Jun 27, 2018
2c31c22
Merge pull request #23389 from code-dot-org/dtp_candidate_a361af41
ewjordan Jun 28, 2018
a93d3ec
PD: some international opt-in code review feedback
breville Jun 28, 2018
9a4189e
Merge pull request #23400 from code-dot-org/dtp_candidate_be964b56
aoby Jun 28, 2018
40187b9
Merge pull request #23409 from code-dot-org/dtp_candidate_ab4e8800
aoby Jun 28, 2018
2cc9ec8
Merge pull request #23417 from code-dot-org/dtp_candidate_12ec0825
aoby Jun 29, 2018
5369d99
PD: international opt-in has better handing for "Other:" options
breville Jun 29, 2018
89b42d6
Make authenticationOptions and userType available in ManageLinkedAcco…
maddiedierker Jun 29, 2018
5e3b101
Merge pull request #23434 from code-dot-org/dtp_candidate_10b398b4
Jun 29, 2018
0c10657
Add connectToGoogle to test /users/auth/google_oauth2/connect
maddiedierker Jun 29, 2018
98bd3fb
Navigate to /connect instead of AJAX request
maddiedierker Jun 29, 2018
fbcc1e4
PD: international opt-in naming: Optin->OptIn, optin -> opt_in
breville Jul 2, 2018
bcadab5
PD: international opt-in gets more strings & loc
breville Jul 2, 2018
48f93f1
PD: international opt-in URL now /pd/international_workshop
breville Jul 2, 2018
e99bc13
Merge branch 'add-disconnect-endpoint' into manage-linked-accounts-ho…
maddiedierker Jul 2, 2018
2db70d8
Merge pull request #23471 from code-dot-org/dtp_candidate_b2fc53be
Erin007 Jul 2, 2018
f44b731
PD: international opt-in gets email & legal opt-ins
breville Jul 3, 2018
7da127e
Multi-auth: fix silent takeover
ewjordan Jul 3, 2018
f74ef81
Throw exception if save fails
ewjordan Jul 3, 2018
457f2e2
Add tests for connecting with identical email addresses but different…
ewjordan Jul 3, 2018
e229605
Merge branch 'staging' into manage-linked-accounts-hookup
maddiedierker Jul 3, 2018
1ac8483
Revert "Revert "Use commit-specific sources directory on test environ…
davidsbailey Jun 29, 2018
e67b3c2
Hook up all providers to toggleProviderConnection
maddiedierker Jul 3, 2018
7de237b
replace 'sources_test' with CDO.sources_s3_directory
davidsbailey Jul 3, 2018
97a7dda
Refactor connect/disconnect into ManageLinkedAccountsController
maddiedierker Jul 3, 2018
3df6c25
Add set width for table columns
maddiedierker Jul 3, 2018
25039a4
Handle errors, rename for clarity
maddiedierker Jul 3, 2018
8ce51b8
Add ManageLinkedAccountsController tests
maddiedierker Jul 3, 2018
5ca3735
Add unit tests for ManageLinkedAccounts
maddiedierker Jul 3, 2018
3de62c8
Merge pull request #23506 from code-dot-org/dtp_candidate_535db871
mehalshah Jul 3, 2018
3f077ed
New way of rendering survey results in tables
mehalshah Jun 26, 2018
f72174b
Revert "Add 2018 courses to k5_course? helper"
Hamms Jul 4, 2018
9536cb6
Merge pull request #23511 from code-dot-org/hotfix-congrats-500
Hamms Jul 4, 2018
d1abafc
Fix bad merge
mehalshah Jul 4, 2018
000fa06
display message when there is no answer text entered for a free respo…
nkiruka Jul 4, 2018
22d5e6a
Find and iterate over production front end servers, logging their upt…
sureshc Jul 5, 2018
49b9f49
Add logic to SSH into each front end server and restart pegasus/dashb…
sureshc Jul 5, 2018
ff308ce
Add function to calculate opacity for the answer cells
nkiruka Jul 5, 2018
09f33c3
ES6ify CodeWorkspace
islemaster Jul 5, 2018
a429cb2
answer column styles updated and the render function of multiple choi…
nkiruka Jul 5, 2018
e4b57e8
Set the real restart command.
sureshc Jul 5, 2018
a51d70e
style answer and not answered cells
nkiruka Jul 5, 2018
9d3e927
/users/set_age returns 403 unless signed in
islemaster Jul 5, 2018
8a64b37
Summarize authentication_options to avoid passing oauth tokens to client
maddiedierker Jul 5, 2018
b2595de
Fix storybook errors, add more stories
maddiedierker Jul 5, 2018
fbb569b
Set student Id action in section assessments redux
caleybrock Jul 5, 2018
b86aced
Adjust the margins on the div that contains the percent value and che…
nkiruka Jul 5, 2018
c077236
Add student filter dropdown
caleybrock Jul 5, 2018
2cc6da5
stub commit hash out of sources_s3_directory in ruby unit tests
davidsbailey Jul 5, 2018
ceaf60e
Restore sinon.fakeServer after tests
maddiedierker Jul 5, 2018
c5e1ea4
Filter status table by student
caleybrock Jul 5, 2018
11298b4
Hide mc overview if not 'all student' filter
caleybrock Jul 5, 2018
d9beaeb
Filter free response qs by student id
caleybrock Jul 5, 2018
6b77994
Add to crontab, add error handling, and add logic to copy ssh config …
sureshc Jul 5, 2018
f6f4e8b
Filter individual MC responses by student id
caleybrock Jul 5, 2018
91c7d1b
Discard environment change
mehalshah Jul 5, 2018
14cae04
Remove some debugging code
mehalshah Jul 5, 2018
4a0c47b
Restore navigateToHref stub to avoid breaking other tests
maddiedierker Jul 5, 2018
fc86a27
Add padding to the checkmark icon
nkiruka Jul 5, 2018
f2ce39a
PR feedback
ewjordan Jul 5, 2018
77cc5e3
No need to loop through an array of one object
caleybrock Jul 5, 2018
7838338
Only show mc responses when current student hass responded
caleybrock Jul 5, 2018
662da51
PR feedback
mehalshah Jul 5, 2018
051b38b
Merge pull request #23525 from code-dot-org/production
islemaster Jul 5, 2018
e0e9633
Better assertion that student age is unchanged in second test
islemaster Jul 5, 2018
fa7defb
Merge pull request #23489 from code-dot-org/multi-auth-silent-takeover
ewjordan Jul 5, 2018
ee12e1e
Merge pull request #23505 from code-dot-org/manage-linked-accounts-ho…
Jul 5, 2018
8c60d90
Add google_classroom_student? and clever_student?
maddiedierker Jul 5, 2018
fcea978
Implement cannotDisconnect for all providers
maddiedierker Jul 5, 2018
270461d
Merge pull request #23427 from code-dot-org/revert-22195-revert-22097…
davidsbailey Jul 5, 2018
ccccefb
Merge pull request #23536 from code-dot-org/staging
deploy-code-org Jul 5, 2018
09f9c91
Force mc tables to re-render when new props passed
caleybrock Jul 5, 2018
84ba26a
Remove requires that are no longer required
caleybrock Jul 5, 2018
1fd17cd
New connection tests expect to redirect to edit
islemaster Jul 5, 2018
7cfa65d
Merge pull request #23538 from code-dot-org/connect-provider-test-fix
islemaster Jul 5, 2018
6b84e7c
Don't show free responses when current student has not started
caleybrock Jul 5, 2018
bd9b27f
Merge pull request #23523 from code-dot-org/es6-something
islemaster Jul 5, 2018
f29ff8d
Merge pull request #23539 from code-dot-org/staging
deploy-code-org Jul 5, 2018
5d60f7c
Test google_classroom_student? and clever_student? helpers
maddiedierker Jul 5, 2018
a77c099
Move all disconnect logic into cannotDisconnect method
maddiedierker Jul 5, 2018
c78d146
Update selector styles
caleybrock Jul 5, 2018
0cfe950
Localize all student dropdown
caleybrock Jul 5, 2018
a1b0ce9
Add new constructor arguments for ManageLinkedAccountsController to t…
maddiedierker Jul 5, 2018
cf2d0a8
Fix redux tests for getStudentMCResponsesForCurrentAssessment
caleybrock Jul 5, 2018
bff4709
Test selector FR for a specific student
caleybrock Jul 5, 2018
094ca4d
Write comment for new helper function
caleybrock Jul 5, 2018
91cb53f
Test mc selector for specific student
caleybrock Jul 5, 2018
368a5fe
Merge pull request #23474 from code-dot-org/integrate_new_controls_wi…
mehalshah Jul 6, 2018
98dc3ae
Merge pull request #23541 from code-dot-org/staging
deploy-code-org Jul 6, 2018
469c531
PD: international opt-in code review feedback
breville Jul 6, 2018
7b01a12
Return false from cannotDisconnect if user isn't connected to provider
maddiedierker Jul 6, 2018
d946317
Test logic for disabling disconnect button
maddiedierker Jul 6, 2018
ba939b7
Cleanup cannotDisconnect method
maddiedierker Jul 6, 2018
e0b902a
Merge pull request #23526 from code-dot-org/hb-38478052
islemaster Jul 6, 2018
f80862e
Merge pull request #23543 from code-dot-org/staging
deploy-code-org Jul 6, 2018
a8e947e
PD: international opt-in gets comment about people lists
breville Jul 6, 2018
8f3bf9b
Fix storybook errors
maddiedierker Jul 6, 2018
1fe79e3
Update project list tests
caleybrock Jul 6, 2018
a63392e
Merge pull request #23522 from code-dot-org/restart-high-memory-front…
sureshc Jul 6, 2018
883a329
Updated cookbook versions
deploy-code-org Jul 6, 2018
145ce18
Merge pull request #23546 from code-dot-org/staging
deploy-code-org Jul 6, 2018
90cbf1f
Move function that calculates opacity from multiple choice overview c…
nkiruka Jul 6, 2018
774fa51
Resize checkmark icon and refactor opacity calculation
nkiruka Jul 6, 2018
b30a86f
Merge pull request #23235 from code-dot-org/international-optin-pd-form
breville Jul 6, 2018
bf0f14a
Make consistent height
nkiruka Jul 6, 2018
5615d6e
Justify checkmark with css
caleybrock Jul 6, 2018
b281e28
Merge pull request #23547 from code-dot-org/staging
deploy-code-org Jul 6, 2018
4d6ca81
Merge pull request #23540 from code-dot-org/student-filter
caleybrock Jul 6, 2018
e22aeb0
Update schema cache dump after schema changes.
deploy-code-org Jul 6, 2018
6e4780d
Merge branch 'staging' of github.com:code-dot-org/code-dot-org into s…
deploy-code-org Jul 6, 2018
0e51ba1
staging content changes (-)
deploy-code-org Jul 6, 2018
13f00cd
Merge pull request #23549 from code-dot-org/staging
deploy-code-org Jul 6, 2018
feb9faa
Merge pull request #23520 from code-dot-org/empty-state-free-responses
nkiruka Jul 6, 2018
6207947
Merge pull request #23532 from code-dot-org/add-color-assessments-table
nkiruka Jul 6, 2018
6dbb287
Merge pull request #23542 from code-dot-org/linked-accounts-disable-d…
Jul 6, 2018
6e8d8a1
Revert "Assessments: Add color to multiple choice assessments table"
caleybrock Jul 6, 2018
36c1753
Merge pull request #23552 from code-dot-org/revert-23532-add-color-as…
caleybrock Jul 6, 2018
7bc5e39
Merge pull request #23556 from code-dot-org/staging
deploy-code-org Jul 6, 2018
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
2 changes: 2 additions & 0 deletions apps/Gruntfile.js
Expand Up @@ -513,6 +513,8 @@ describe('entry tests', () => {
'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',

'pd/international_opt_in/new': './src/sites/studio/pages/pd/international_opt_in/new.js',

'peer_reviews/dashboard': './src/sites/studio/pages/peer_reviews/dashboard.js',

'code.org/public/teacher-dashboard/index': './src/sites/code.org/pages/public/teacher-dashboard/index.js',
Expand Down
7 changes: 7 additions & 0 deletions apps/i18n/common/en_us.json
Expand Up @@ -29,6 +29,7 @@
"allStudents": "All",
"allowEditing": "Allow editing",
"allowEditingInstructions": "\"Allow editing\" while students should be taking the assessment.",
"allStudents": "All students",
"and": "and",
"animationMode": "Animation",
"announcements": "Announcements",
Expand Down Expand Up @@ -479,6 +480,7 @@
"emptyBlockInVariable": "The variable {name} has an unfilled input.",
"emptyBlocksErrorMsg": "The \"Repeat\" or \"If\" block needs to have other blocks inside it to work. Make sure the inner block fits properly inside the containing block.",
"emptyExampleBlockErrorMsg": "You need at least two examples in function {functionName}. Make sure each example has a call and a result.",
"emptyFreeResponse": "No response given for this question",
"emptyFunctionBlocksErrorMsg": "The function block needs to have other blocks inside it to work.",
"emptyFunctionalBlock": "You have a block with an unfilled input.",
"emptySurveyOverviewTable": "Because this survey is anonymous, we can only show aggregated results once there are at least 5 submissions.",
Expand All @@ -493,6 +495,7 @@
"enableMakerDialogDescription": "Maker Toolkit is a feature used in the Computer Science Discoveries curriculum. See the setup page for more details:",
"enableMakerDialogSetupPageLinkText": "Maker Toolkit Setup",
"enablePairProgramming": "Enable Pair Programming",
"encrypted": "encrypted",
"end": "end",
"englishOnlyWarning": "Sorry! This stage is not available in your language. The puzzles in this stage use a mix of English words and characters that can’t be translated right now. You can move on to Stage {nextStage}.",
"enterSectionCode": "Enter section code",
Expand Down Expand Up @@ -543,6 +546,8 @@
"findLocalClassDescription": "Find a local after-school program, summer camp, or school to learn in person.",
"findLocalClassButton": "Find a class",
"finish": "Finish",
"formErrorsBelow": "Please correct the errors below.",
"formServerError": "Something went wrong on our end; please try again later.",
"forTeachersOnly": "For Teachers Only",
"fromWhen": "(From {when}):",
"gdprDialogHeader": "Do you agree to using a website based in the United States?",
Expand Down Expand Up @@ -1019,7 +1024,9 @@
"secret": "Secret",
"seeAllTutorials": "See all tutorials",
"selectACourse": "Select a course or unit",
"selectAnOption": "Please select an option...",
"selectAssessment": "Select an assessment or survey",
"selectStudent": "Filter by student",
"selectGoogleClassroom": "Select a Google Classroom",
"selectCleverSection": "Select a Clever section",
"selectSection": "Select Section",
Expand Down
7 changes: 4 additions & 3 deletions apps/src/code-studio/pd/form_components/FormController.jsx
Expand Up @@ -6,6 +6,7 @@ import {
FormGroup,
Pagination,
} from 'react-bootstrap';
import i18n from '@cdo/locale';

const styles = {
pageButtons: {
Expand Down Expand Up @@ -211,14 +212,14 @@ export default class FormController extends React.Component {
// and display the generic error header
this.setState({
errors: data.responseJSON.errors.form_data,
errorHeader: "Please correct the errors below."
errorHeader: i18n.formErrorsBelow()
});
}
} else {
// Otherwise, something unknown went wrong on the server
this.setState({
globalError: true,
errorHeader: "Something went wrong on our end; please try again later."
errorHeader: i18n.formServerError()
});
}
this.setState({
Expand Down Expand Up @@ -405,7 +406,7 @@ export default class FormController extends React.Component {
shouldShowSubmit() {
return this.state.currentPage === this.getPageComponents().length - 1;
}
static submitButtonText = "Submit";
static submitButtonText = i18n.submit();

/**
* @returns {Element}
Expand Down
268 changes: 268 additions & 0 deletions apps/src/code-studio/pd/international_opt_in/InternationalOptIn.jsx
@@ -0,0 +1,268 @@
import React, {PropTypes} from 'react';
import FormController from '../form_components/FormController';
import FormComponent from '../form_components/FormComponent';
import DatePicker from '../workshop_dashboard/components/date_picker';
import moment from 'moment';
import {DATE_FORMAT} from '../workshop_dashboard/workshopConstants';
import {
Row,
Col,
ControlLabel,
FormGroup
} from 'react-bootstrap';
import i18n from '@cdo/locale';

export default class InternationalOptIn extends FormController {
static propTypes = {
accountEmail: PropTypes.string.isRequired,
labels: PropTypes.object.isRequired
};

/**
* @override
*/
onSuccessfulSubmit(data) {
window.location = `/pd/international_workshop/${data.id}/thanks`;
}

/**
* @override
*/
serializeFormData() {
const formData = super.serializeFormData();
formData.form_data.email = this.props.accountEmail;
return formData;
}

/**
* @override
*/
getPageComponents() {
return [
InternationalOptInComponent
];
}

/**
* @override
*/
getPageProps() {
return {
...super.getPageProps(),
accountEmail: this.props.accountEmail,
labels: this.props.labels
};
}
}


class InternationalOptInComponent extends FormComponent {
static propTypes = {
accountEmail: PropTypes.string.isRequired
};

handleDateChange = (date) => {
// Don't allow null. If the date is cleared, default again to today.
date = date || moment();
super.handleChange({date: date.format(DATE_FORMAT)});
};

render() {
const labels = this.props.labels;
const date = (this.props.data && this.props.data.date) ?
moment(this.props.data.date, DATE_FORMAT) : moment();

const lastSubjectsKey = this.props.options.subjects.slice(-1)[0];
const textFieldMapSubjects = {[lastSubjectsKey]: "other"};

const lastResourcesKey = this.props.options.resources.slice(-1)[0];
const textFieldMapResources = {[lastResourcesKey]: "other"};

const lastRoboticsKey = this.props.options.robotics.slice(-1)[0];
const textFieldMapRobotics = {[lastRoboticsKey]: "other"};

return (
<FormGroup>
{
this.buildFieldGroup({
name: 'firstName',
label: labels.firstName,
type: 'text',
required: true
})
}
{
this.buildFieldGroup({
name: 'firstNamePreferred',
label: labels.firstNamePreferred,
type: 'text',
required: false
})
}
{
this.buildFieldGroup({
name: 'lastName',
label: labels.lastName,
type: 'text',
required: true
})
}
{
this.buildFieldGroup({
name: 'email',
label: labels.email,
type: 'text',
value: this.props.accountEmail,
readOnly: true
})
}
{
this.buildFieldGroup({
name: 'emailAlternate',
label: labels.emailAlternate,
type: 'text'
})
}
{
this.buildButtonsFromOptions({
name: 'gender',
label: labels.gender,
type: 'radio',
required: true
})
}
{
this.buildFieldGroup({
name: 'schoolName',
label: labels.schoolName,
type: 'text',
required: true
})
}
{
this.buildFieldGroup({
name: 'schoolCity',
label: labels.schoolCity,
type: 'text',
required: true
})
}
{
this.buildButtonsFromOptions({
name: 'schoolCountry',
label: labels.schoolCountry,
type: 'radio',
required: true
})
}
{
this.buildButtonsFromOptions({
name: 'ages',
label: labels.ages,
type: 'check',
required: true
})
}
{
this.buildButtonsWithAdditionalTextFieldsFromOptions({
name: 'subjects',
label: labels.subjects,
type: 'check',
required: true,
textFieldMap: textFieldMapSubjects
})
}
{
this.buildButtonsWithAdditionalTextFieldsFromOptions({
name: 'resources',
label: labels.resources,
type: 'check',
required: false,
textFieldMap: textFieldMapResources
})
}
{
this.buildButtonsWithAdditionalTextFieldsFromOptions({
name: 'robotics',
label: labels.robotics,
type: 'check',
required: false,
textFieldMap: textFieldMapRobotics
})
}

<FormGroup
id="date"
controlId="date"
validationState={this.getValidationState("date")}
>
<Row>
<Col md={6}>
<ControlLabel>
Date
<span style={{color: 'red'}}> *</span>
</ControlLabel>
</Col>
</Row>
<Row>
<Col md={6}>
<DatePicker
date={date}
minDate={moment()}
onChange={this.handleDateChange}
readOnly={false}
/>
</Col>
</Row>
</FormGroup>
{
this.buildSelectFieldGroupFromOptions({
name: 'workshopOrganizer',
label: labels.workshopOrganizer,
required: true,
placeholder: i18n.selectAnOption()
})
}
{
this.buildSelectFieldGroupFromOptions({
name: 'workshopFacilitator',
label: labels.workshopFacilitator,
required: true,
placeholder: i18n.selectAnOption()
})
}
{
this.buildSelectFieldGroupFromOptions({
name: 'workshopCourse',
label: labels.workshopCourse,
required: true,
placeholder: i18n.selectAnOption()
})
}
{
this.buildButtonsFromOptions({
name: 'emailOptIn',
label: labels.emailOptIn,
type: 'radio',
required: true,
placeholder: i18n.selectAnOption()
})
}
{
this.buildSingleCheckbox({
name: 'legalOptIn',
label: labels.legalOptIn,
required: true
})
}
</FormGroup>
);
}
}

InternationalOptInComponent.associatedFields = [
'firstName', 'firstNamePreferred', 'lastName', 'email', 'emailAlternate', 'gender',
'schoolName', 'schoolCity', 'schoolCountry', 'ages', 'subjects', 'resources',
'robotics', 'workshopOrganizer', 'workshopFacilitator', 'workshopCourse',
'emailOptIn', 'legalOptIn'
];
Expand Up @@ -45,10 +45,10 @@ export default class SingleChoiceResponses extends React.Component {
}
</td>
<td style={{paddingLeft: '20px'}}>
{possibleAnswer}
{count}
</td>
<td style={{paddingLeft: '20px'}}>
{count}
{possibleAnswer}
</td>
</tr>
);
Expand Down
@@ -1,6 +1,7 @@
import React, {PropTypes} from 'react';
import {Well} from 'react-bootstrap';
import _ from 'lodash';
import he from 'he';

export default class TextResponses extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -64,7 +65,7 @@ export default class TextResponses extends React.Component {
}

renderBullet(text, key) {
const trimmedText = _.trim(text);
const trimmedText = _.trim(he.decode(text));
if (trimmedText) {
return (
<li key={key}>
Expand Down