Skip to content

Commit

Permalink
fix: fix failing tests and linting errors and update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
zawan-ila committed Dec 19, 2022
1 parent 17a6421 commit 7513e46
Show file tree
Hide file tree
Showing 9 changed files with 317 additions and 125 deletions.
33 changes: 16 additions & 17 deletions src/components/CreateCoursePage/CreateCourseForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import PriceList from '../PriceList';
import {
DATE_INPUT_PATTERN,
} from '../../data/constants';
import {
clearCourseInfoErrors, clearCreateCourseStatus
import {
clearCourseInfoErrors, clearCreateCourseStatus,
} from '../../data/actions/courseInfo';

import {
Expand All @@ -26,11 +26,10 @@ import {
isSafari, localTimeZone, getDateWithDashes, getOptionsData, parseCourseTypeOptions, parseOptions,
} from '../../utils';

import {
handleCourseCreateFail, requiredValidate, dateTimeValidate, courseRunKeyValidate
import {
handleCourseCreateFail, requiredValidate, dateTimeValidate, courseRunKeyValidate,
} from '../../utils/validation';


class BaseCreateCourseForm extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -116,7 +115,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderSelectField}
props={
{
name: 'org'
name: 'org',
}
}
options={this.processOrganizations(organizations)}
Expand All @@ -129,7 +128,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderInputTextField}
props={
{
name: 'title'
name: 'title',
}
}
type="text"
Expand All @@ -150,7 +149,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderInputTextField}
props={
{
name: 'number'
name: 'number',
}
}
type="text"
Expand Down Expand Up @@ -195,7 +194,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderSelectField}
props={
{
name: 'type'
name: 'type',
}
}
options={courseTypeOptions}
Expand All @@ -222,7 +221,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderInputTextField}
props={
{
name: 'courseRunKey'
name: 'courseRunKey',
}
}
type="text"
Expand All @@ -249,7 +248,7 @@ class BaseCreateCourseForm extends React.Component {
component={DateTimeField}
props={
{
name: 'start'
name: 'start',
}
}
dateLabel="Start date"
Expand All @@ -267,7 +266,7 @@ class BaseCreateCourseForm extends React.Component {
component={DateTimeField}
props={
{
name: 'end'
name: 'end',
}
}
dateLabel="End date"
Expand All @@ -290,7 +289,7 @@ class BaseCreateCourseForm extends React.Component {
component={DateTimeField}
props={
{
name: 'start'
name: 'start',
}
}
dateLabel="Start date"
Expand All @@ -306,7 +305,7 @@ class BaseCreateCourseForm extends React.Component {
component={DateTimeField}
props={
{
name: 'end'
name: 'end',
}
}
dateLabel="End date"
Expand All @@ -323,7 +322,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderSelectField}
props={
{
name: 'run_type'
name: 'run_type',
}
}
options={currentFormValues.type ? courseRunTypeOptions[currentFormValues.type] : [{ label: 'Select Course enrollment track first', value: '' }]}
Expand All @@ -344,7 +343,7 @@ class BaseCreateCourseForm extends React.Component {
component={RenderSelectField}
props={
{
name: 'pacing_type'
name: 'pacing_type',
}
}
options={pacingTypeOptions}
Expand Down Expand Up @@ -426,6 +425,6 @@ BaseCreateCourseForm.propTypes = {

export default reduxForm({
form: 'create-course-form',
onSubmitFail: handleCourseCreateFail
onSubmitFail: handleCourseCreateFail,
})(BaseCreateCourseForm);
export { BaseCreateCourseForm };
Loading

0 comments on commit 7513e46

Please sign in to comment.