Skip to content

Commit

Permalink
Revert "temp: disable price edits if course has a published run" (#995)
Browse files Browse the repository at this point in the history
* Revert "temp: disable price edits if course has a published run (#994)"

This reverts commit fc63106.

* chore: added back sitewide banner changes

* fix: lint
  • Loading branch information
AfaqShuaib09 authored Jan 7, 2025
1 parent fc63106 commit 8c0be58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 39 deletions.
4 changes: 1 addition & 3 deletions src/components/EditCoursePage/EditCourseForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,9 @@ export class BaseEditCourseForm extends React.Component {
disabled={disabled || !!entitlement.sku}
/>
<PriceList
name="course_price_list"
priceLabels={currentFormValues.type ? priceLabels[currentFormValues.type] : {}}
extraInput={{ onInvalid: this.openCollapsible }}
// temp: Disable price updates if one of runs is published.
disabled={courseStatuses.includes(PUBLISHED) || disabled}
disabled={disabled}
required={isSubmittingForReview}
/>
<FieldLabel
Expand Down
21 changes: 0 additions & 21 deletions src/components/EditCoursePage/EditCourseForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,27 +255,6 @@ describe('BaseEditCourseForm', () => {
expect(disabledFields).toHaveLength(1);
});

it('renders with price disabled if course has Published status among status list', () => {
const component = shallow(<BaseEditCourseForm
handleSubmit={() => null}
title={initialValuesFull.title}
initialValues={initialValuesFull}
currentFormValues={initialValuesFull}
number="Test101x"
entitlement={{ sku: 'ABC1234' }}
courseStatuses={[REVIEWED, PUBLISHED]}
courseInfo={courseInfo}
courseOptions={courseOptions}
courseRunOptions={courseRunOptions}
uuid={initialValuesFull.uuid}
type={initialValuesFull.type}
id="edit-course-form"
/>);

const disabledFields = component.find({ name: 'course_price_list', disabled: true });
expect(disabledFields).toHaveLength(1);
});

it('Check if watchers field is disabled after being reviewed', () => {
const courseInfoWithCourseRunStatuses = {
...courseInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ exports[`BaseEditCourseForm override slug format when IS_NEW_SLUG_FORMAT_ENABLED
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={
{
"verified": "Verified",
Expand Down Expand Up @@ -2184,7 +2183,6 @@ exports[`BaseEditCourseForm renders correctly when submitting for review 1`] = `
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={
{
"verified": "Verified",
Expand Down Expand Up @@ -4032,7 +4030,6 @@ exports[`BaseEditCourseForm renders html correctly while fetching collaborator o
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={{}}
required={false}
/>
Expand Down Expand Up @@ -5418,7 +5415,6 @@ exports[`BaseEditCourseForm renders html correctly while submitting 1`] = `
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={
{
"verified": "Verified",
Expand Down Expand Up @@ -7307,7 +7303,6 @@ exports[`BaseEditCourseForm renders html correctly with administrator being true
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={
{
"verified": "Verified",
Expand Down Expand Up @@ -9502,7 +9497,6 @@ exports[`BaseEditCourseForm renders html correctly with all data present 1`] = `
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={
{
"verified": "Verified",
Expand Down Expand Up @@ -11391,7 +11385,6 @@ exports[`BaseEditCourseForm renders html correctly with minimal data 1`] = `
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={{}}
required={false}
/>
Expand Down Expand Up @@ -12781,7 +12774,6 @@ exports[`BaseEditCourseForm renders html correctly with skills data when skills
"onInvalid": [Function],
}
}
name="course_price_list"
priceLabels={{}}
required={false}
/>
Expand Down
14 changes: 7 additions & 7 deletions src/containers/MainApp/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const MainApp = () => (
<Header />
{/* Only display the banner if there is content to display. */}
{process.env.SITEWIDE_BANNER_CONTENT && (
<SitewideBanner
message={process.env.SITEWIDE_BANNER_CONTENT}
type="warning"
dismissible
cookieName="publisherSiteWideBannerDismissed"
cookieExpiryDays={30}
/>
<SitewideBanner
message={process.env.SITEWIDE_BANNER_CONTENT}
type="warning"
dismissible
cookieName="publisherSiteWideBannerDismissed"
cookieExpiryDays={30}
/>
)}
<main>
<Routes>
Expand Down

0 comments on commit 8c0be58

Please sign in to comment.