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

Upgrade frontend libraries #2295

Merged
merged 8 commits into from
May 23, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/app/__test__/setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropTypes } from 'react';
import PropTypes from 'prop-types';
import { IntlProvider, intlShape } from 'react-intl';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import injectTapEventPlugin from 'lib/injectTapEventPlugin';
Expand Down
3 changes: 2 additions & 1 deletion client/app/__test__/utils/__test__/shallowUntil.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import shallowUntil from '../shallowUntil';

describe('#shallowUntil', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table';
import Subheader from 'material-ui/Subheader';
Expand Down Expand Up @@ -93,7 +94,7 @@ class ConditionList extends React.Component {
renderConditionRows() {
return (
this.props.conditions.map(condition =>
<TableRow key={condition.edit_url}>
(<TableRow key={condition.edit_url}>
<TableRowColumn colSpan="1">{condition.type}</TableRowColumn>
<TableRowColumn colSpan="3">{condition.description}</TableRowColumn>
<TableRowColumn colSpan="2" style={styles.alignRight}>
Expand All @@ -109,7 +110,7 @@ class ConditionList extends React.Component {
<DeleteIcon />
</IconButton>
</TableRowColumn>
</TableRow>
</TableRow>)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { reduxForm, Field, Form, formValueSelector, change } from 'redux-form';
import { connect } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ const translations = defineMessages({
},
showPrivateHint: {
id: 'course.assessment.form.showPrivateHint',
defaultMessage: 'Show private tests to students after the submission is graded and published (For programming questions)',
defaultMessage:
'Show private tests to students after the submission is graded and published (For programming questions)',
},
showEvaluation: {
id: 'course.assessment.form.showEvaluation',
defaultMessage: 'Show evaluation tests',
},
showEvaluationHint: {
id: 'course.assessment.form.showEvaluationHint',
defaultMessage: 'Show evaluation tests to students after the submission is graded and published (For programming questions)',
defaultMessage:
'Show evaluation tests to students after the submission is graded and published (For programming questions)',
},
published: {
id: 'course.assessment.form.published',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, defineMessages } from 'react-intl';
import { formatLongDateTime } from 'lib/moment';
import IconButton from 'material-ui/IconButton';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { List } from 'material-ui/List';
import Subheader from 'material-ui/Subheader';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import CourseAPI from 'api/course';
import MaterialList from './MaterialList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { submit } from 'redux-form';
import { injectIntl, FormattedMessage, intlShape } from 'react-intl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-addons-test-utils';
import ReactTestUtils from 'react-dom/test-utils';
import { mount } from 'enzyme';
import ProviderWrapper from 'lib/components/ProviderWrapper';
import storeCreator from '../../../store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { submit, isPristine } from 'redux-form';
import { injectIntl, FormattedMessage, intlShape } from 'react-intl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import Immutable from 'immutable';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Immutable from 'immutable';

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, intlShape } from 'react-intl';

const translations = defineMessages({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Immutable from 'immutable';

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import OnlineEditorPythonView, { validation as pythonValidation } from './OnlineEditorPythonView';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Immutable from 'immutable';

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import AceEditor from 'react-ace';
import { injectIntl, FormattedMessage, intlShape } from 'react-intl';
import { Card, CardHeader, CardText } from 'material-ui/Card';
Expand All @@ -24,7 +25,7 @@ const MAX_TEST_CASES = 99;
const propTypes = {
data: PropTypes.instanceOf(Immutable.Map).isRequired,
dataFiles: PropTypes.instanceOf(Immutable.Map).isRequired,
actions: React.PropTypes.shape({
actions: PropTypes.shape({
updatePythonCodeBlock: PropTypes.func.isRequired,
createPythonTestCase: PropTypes.func.isRequired,
updatePythonTestCase: PropTypes.func.isRequired,
Expand All @@ -39,7 +40,7 @@ const propTypes = {
};

const contextTypes = {
muiTheme: React.PropTypes.object.isRequired,
muiTheme: PropTypes.object.isRequired,
};

export function validation(data, pathOfKeysToData, intl) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable react/no-array-index-key */
import Immutable from 'immutable';

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from 'react-intl';
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
Expand All @@ -23,7 +24,7 @@ import translations from './ProgrammingQuestionForm.intl';

const propTypes = {
data: PropTypes.instanceOf(Immutable.Map).isRequired,
actions: React.PropTypes.shape({
actions: PropTypes.shape({
submitForm: PropTypes.func.isRequired,
updateProgrammingQuestion: PropTypes.func.isRequired,
updateSkills: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Immutable from 'immutable';

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { Card } from 'material-ui/Card';
import { Tabs, Tab } from 'material-ui/Tabs';
import { cyan500, grey300 } from 'material-ui/styles/colors';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import { Card, CardHeader } from 'material-ui/Card';
import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Immutable from 'immutable';

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import UploadedPackageTemplateView from './UploadedPackageTemplateView';
import UploadedPackageTestCaseView from './UploadedPackageTestCaseView';
Expand All @@ -23,27 +24,25 @@ const propTypes = {
intl: intlShape.isRequired,
};

class UploadedPackageView extends React.Component {
render() {
const { data, intl } = this.props;
const packageUI = data.get('package_ui');
const templates = packageUI.get('templates');
const testCases = packageUI.get('test_cases');

if (data.get('question').get('package')) {
return (
<div className="template-package-container">
<h3>{intl.formatMessage(translations.templateHeader)}</h3>
<UploadedPackageTemplateView {...{ templates }} />
<h3>{intl.formatMessage(translations.testCasesHeader)}</h3>
<UploadedPackageTestCaseView {...{ testCases }} />
</div>
);
}

return null;
const UploadedPackageView = (props) => {
const { data, intl } = props;
const packageUI = data.get('package_ui');
const templates = packageUI.get('templates');
const testCases = packageUI.get('test_cases');

if (data.get('question').get('package')) {
return (
<div className="template-package-container">
<h3>{intl.formatMessage(translations.templateHeader)}</h3>
<UploadedPackageTemplateView {...{ templates }} />
<h3>{intl.formatMessage(translations.testCasesHeader)}</h3>
<UploadedPackageTestCaseView {...{ testCases }} />
</div>
);
}
}

return null;
};

UploadedPackageView.propTypes = propTypes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import moment from 'lib/moment';
import Snackbar from 'material-ui/Snackbar';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import RaisedButton from 'material-ui/RaisedButton';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { Element } from 'react-scroll';
import Paper from 'material-ui/Paper';
Expand All @@ -13,10 +14,10 @@ const LessonPlanGroup = ({ milestone, items }) => {
<Paper>
{
items.map(item =>
<LessonPlanItem
(<LessonPlanItem
key={componentKey(item)}
{...{ item }}
/>
/>)
)
}
</Paper>
Expand All @@ -27,7 +28,7 @@ const LessonPlanGroup = ({ milestone, items }) => {
LessonPlanGroup.propTypes = {
milestone: PropTypes.instanceOf(Immutable.Map).isRequired,
items: PropTypes.arrayOf(
React.PropTypes.instanceOf(Immutable.Map).isRequired
PropTypes.instanceOf(Immutable.Map).isRequired
).isRequired,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { scroller } from 'react-scroll';
import styles from './LessonPlanIndex.scss';
Expand Down Expand Up @@ -47,11 +48,11 @@ class LessonPlanIndex extends React.Component {
<div className={styles.mainPanel}>
{
milestoneGroups.map(group =>
<LessonPlanGroup
(<LessonPlanGroup
key={group.milestone.get('id')}
milestone={group.milestone}
items={group.items}
/>
/>)
)
}
<div className={styles.navContainer}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import moment, { shortDateTime, shortTime } from 'lib/moment';
Expand Down Expand Up @@ -238,12 +239,12 @@ class LessonPlanItem extends React.Component {
<div style={styles.attachments}>
{
item.get('materials').map(material =>
<div key={material.get('name')} style={styles.attachment}>
(<div key={material.get('name')} style={styles.attachment}>
<Description style={styles.attachmentIcon} color={grey700} />
<a href={material.get('url')}>
{ material.get('name') }
</a>
</div>
</div>)
)
}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import moment from 'lib/moment';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import moment, { longDate } from 'lib/moment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import RaisedButton from 'material-ui/RaisedButton';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { connect } from 'react-redux';
import { Route, Switch } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
Expand Down
3 changes: 2 additions & 1 deletion client/app/bundles/course/survey/components/AddButton.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import FloatingActionButton from 'material-ui/FloatingActionButton';
import ContentAdd from 'material-ui/svg-icons/content/add';

Expand Down
3 changes: 2 additions & 1 deletion client/app/bundles/course/survey/components/FormDialogue.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from 'react-intl';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { Card, CardText } from 'material-ui/Card';
import Thumbnail from './Thumbnail';

Expand Down
3 changes: 2 additions & 1 deletion client/app/bundles/course/survey/components/Thumbnail.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
Expand Down
Loading