Skip to content

Commit

Permalink
Revert "feat: added dropdown fields to EditCourseForm.jsx (#764)" (#771)
Browse files Browse the repository at this point in the history
This reverts commit 86f73ea.
  • Loading branch information
srwang authored Aug 25, 2022
1 parent 16f8ae8 commit 4b61780
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 1,202 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,68 +35,6 @@ exports[`CreateCourseRunPage renders html correctly 1`] = `
},
],
},
"location_restriction": Object {
"children": Object {
"countries": Object {
"child": Object {
"choices": Array [
Object {
"label": "Afghanistan",
"value": "AF",
},
Object {
"label": "Åland Islands",
"value": "AX",
},
Object {
"label": "Algeria",
"value": "DZ",
},
Object {
"label": "American Samoa",
"value": "AS",
},
Object {
"label": "Andorra",
"value": "AD",
},
],
},
},
"restriction_type": Object {
"choices": Array [
"blocklist",
"allowlist",
],
},
"states": Object {
"child": Object {
"choices": Array [
Object {
"label": "Alabama",
"value": "AL",
},
Object {
"label": "Arizona",
"value": "AZ",
},
Object {
"label": "Arkansas",
"value": "AR",
},
Object {
"label": "California",
"value": "CA",
},
Object {
"label": "Colorado",
"value": "CO",
},
],
},
},
},
},
"subjects": Object {
"child": Object {
"choices": Array [
Expand Down Expand Up @@ -566,68 +504,6 @@ exports[`CreateCourseRunPage renders html correctly with Course Type 1`] = `
},
],
},
"location_restriction": Object {
"children": Object {
"countries": Object {
"child": Object {
"choices": Array [
Object {
"label": "Afghanistan",
"value": "AF",
},
Object {
"label": "Åland Islands",
"value": "AX",
},
Object {
"label": "Algeria",
"value": "DZ",
},
Object {
"label": "American Samoa",
"value": "AS",
},
Object {
"label": "Andorra",
"value": "AD",
},
],
},
},
"restriction_type": Object {
"choices": Array [
"blocklist",
"allowlist",
],
},
"states": Object {
"child": Object {
"choices": Array [
Object {
"label": "Alabama",
"value": "AL",
},
Object {
"label": "Arizona",
"value": "AZ",
},
Object {
"label": "Arkansas",
"value": "AR",
},
Object {
"label": "California",
"value": "CA",
},
Object {
"label": "Colorado",
"value": "CO",
},
],
},
},
},
},
"subjects": Object {
"child": Object {
"choices": Array [
Expand Down
61 changes: 0 additions & 61 deletions src/components/EditCoursePage/EditCourseForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import FieldLabel from '../FieldLabel';
import ImageUpload from '../ImageUpload';
import RenderInputTextField from '../RenderInputTextField';
import RenderSelectField from '../RenderSelectField';
// TODO: remove RenderSelectFieldNew when migrating off deprecated Paragon components,
// i.e. as a part of https://github.com/openedx/frontend-app-publisher/pull/761
import RenderSelectFieldNew from '../RenderSelectField/updated-paragon-component';
import RichEditor from '../RichEditor';
import Pill from '../Pill';
import Collapsible from '../Collapsible';
Expand Down Expand Up @@ -239,12 +236,6 @@ export class BaseEditCourseForm extends React.Component {
&& parseOptions(courseRunOptionsData.content_language.choices));
const programOptions = (courseRunOptionsData
&& parseOptions(courseRunOptionsData.expected_program_type.choices));
const locationCountryOptions = courseOptionsData
&& parseOptions(courseOptionsData.location_restriction.children.countries.child.choices);
const locationRestrictionTypeOptions = courseOptionsData
&& parseOptions(courseOptionsData.location_restriction.children.restriction_type.choices);
const locationStateOptions = courseOptionsData
&& parseOptions(courseOptionsData.location_restriction.children.states.child.choices);

const {
data: {
Expand Down Expand Up @@ -944,53 +935,6 @@ export class BaseEditCourseForm extends React.Component {
disabled={disabled}
optional
/>
{administrator && (
<>
<FieldLabel text="Location Restriction" className="mb-2" />
<Field
name="location_restriction.restriction_type"
component={RenderSelectField}
label={(
<FieldLabel
id="location_restriction.restriction_type.label"
text="Restriction Type"
/>
)}
extraInput={{ onInvalid: this.openCollapsible }}
options={locationRestrictionTypeOptions}
required={false}
disabled={disabled}
/>
<Field
name="location_restriction.countries"
component={RenderSelectFieldNew}
label={(
<FieldLabel
id="location_restriction.countries.label"
text="Countries"
/>
)}
extraInput={{ onInvalid: this.openCollapsible, multiple: true }}
options={locationCountryOptions}
disabled={disabled}
required={false}
/>
<Field
name="location_restriction.states"
component={RenderSelectFieldNew}
label={(
<FieldLabel
id="location_restriction.states.label"
text="States"
/>
)}
extraInput={{ onInvalid: this.openCollapsible, multiple: true }}
options={locationStateOptions}
disabled={disabled}
required={false}
/>
</>
)}
{administrator && (
<>
<Field
Expand Down Expand Up @@ -1117,11 +1061,6 @@ BaseEditCourseForm.propTypes = {
course_type: PropTypes.string,
organization_logo_override_url: PropTypes.string,
organization_short_code_override: PropTypes.string,
location_restriction: PropTypes.shape({
restriction_type: PropTypes.string,
countries: PropTypes.arrayOf(PropTypes.string),
states: PropTypes.arrayOf(PropTypes.string),
}),
}),
}),
courseSubmitInfo: PropTypes.shape({
Expand Down
7 changes: 0 additions & 7 deletions src/components/EditCoursePage/EditCourseForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ describe('BaseEditCourseForm', () => {
skill_names: [],
organization_logo_override: 'http://image.src.small',
organization_short_code_override: 'test short code',
location_restriction: {
restriction_type: 'allowlist',
countries: [
'AF', 'AX',
],
states: ['CO'],
},
in_year_value: {
per_click_usa: 100,
per_click_international: 100,
Expand Down
28 changes: 0 additions & 28 deletions src/components/EditCoursePage/EditCoursePage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ describe('EditCoursePage', () => {
skill_names: [],
organization_logo_override_url: 'http://image.src.small',
organization_short_code_override: 'test short code',
location_restriction: {
restriction_type: 'allowlist',
countries: [
'AF', 'AX',
],
states: ['AL'],
},
},
showCreateStatusAlert: false,
isFetching: false,
Expand Down Expand Up @@ -364,13 +357,6 @@ describe('EditCoursePage', () => {
imageSrc: 'http://image.jpg',
learner_testimonials: '<p>I learned stuff!</p>',
level_type: 'Basic',
location_restriction: {
restriction_type: 'allowlist',
countries: [
'AF', 'AX',
],
states: ['AL'],
},
organization_logo_override_url: 'http://image.src.small',
organization_short_code_override: 'test short code',
outcome: '<p>Stuff</p>',
Expand Down Expand Up @@ -399,13 +385,6 @@ describe('EditCoursePage', () => {
key: 'edX+Test101x',
learner_testimonials: '<p>I learned stuff!</p>',
level_type: 'Basic',
location_restriction: {
restriction_type: 'allowlist',
countries: [
'AF', 'AX',
],
states: ['AL'],
},
organization_logo_override: 'http://image.src.small',
organization_short_code_override: 'test short code',
outcome: '<p>Stuff</p>',
Expand Down Expand Up @@ -929,13 +908,6 @@ describe('EditCoursePage', () => {
key: 'edX+Test101x',
learner_testimonials: '<p>I learned stuff!</p>',
level_type: 'Basic',
location_restriction: {
restriction_type: 'allowlist',
countries: [
'AF', 'AX',
],
states: ['AL'],
},
organization_logo_override: 'http://image.src.small',
organization_short_code_override: 'test short code',
outcome: '<p>Stuff</p>',
Expand Down
Loading

0 comments on commit 4b61780

Please sign in to comment.