Skip to content

Commit

Permalink
fix: tiny mce button find error (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 authored May 17, 2023
1 parent e5733c3 commit 120fdff
Show file tree
Hide file tree
Showing 2 changed files with 426 additions and 1,228 deletions.
12 changes: 10 additions & 2 deletions src/components/EditCoursePage/EditCourseForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,16 @@ export class BaseEditCourseForm extends React.Component {
runTypeModes,
} = parsedTypeOptions;
const disabled = courseInReview || !editable;
const showMarketingFields = !currentFormValues.type || !courseTypes[currentFormValues.type]
|| courseTypes[currentFormValues.type].course_run_types.some((crt) => crt.is_marketable);

function isMarketingFieldsVisible(currentFormValuesType, courseTypesDict) {
/**
* Check if the course type is defined in the courseTypes object and if any of the course run types are marketable
*/
return (currentFormValuesType && courseTypesDict[currentFormValuesType]) === undefined ? false
: courseTypesDict[currentFormValuesType].course_run_types.some((crt) => crt.is_marketable);
}

const showMarketingFields = isMarketingFieldsVisible(currentFormValues.type, courseTypes);

const courseIsPristine = isPristine(initialValues, currentFormValues);
const publishedContentChanged = initialValues.course_runs
Expand Down
Loading

0 comments on commit 120fdff

Please sign in to comment.