diff --git a/src/studio-home/tabs-section/courses-tab/courses-filters/courses-filter-menu/index.jsx b/src/studio-home/tabs-section/courses-tab/courses-filters/courses-filter-menu/index.jsx index b1afafbdae..9dd27d4493 100644 --- a/src/studio-home/tabs-section/courses-tab/courses-filters/courses-filter-menu/index.jsx +++ b/src/studio-home/tabs-section/courses-tab/courses-filters/courses-filter-menu/index.jsx @@ -10,6 +10,7 @@ const CoursesFilterMenu = ({ menuItems, onItemMenuSelected, defaultItemSelectedText, + menuType }) => { const [itemMenuSelected, setItemMenuSelected] = useState(defaultItemSelectedText); const { cleanFilters } = useSelector(getStudioHomeCoursesParams); @@ -26,6 +27,9 @@ const CoursesFilterMenu = ({ if (cleanFilters) { setItemMenuSelected(defaultItemSelectedText); } + if (menuType !== 'courseTypes') { + return; + } const defaultItem = menuItems.find(item => item.name === defaultItemSelectedText); if (defaultItem) { onItemMenuSelected(defaultItem.value); @@ -61,6 +65,7 @@ const CoursesFilterMenu = ({ CoursesFilterMenu.defaultProps = { defaultItemSelectedText: '', menuItems: [], + menuType: '', }; CoursesFilterMenu.propTypes = { @@ -74,6 +79,7 @@ CoursesFilterMenu.propTypes = { value: PropTypes.string.isRequired, }), ), + menuType: PropTypes.string, }; export default CoursesFilterMenu; diff --git a/src/studio-home/tabs-section/courses-tab/courses-filters/courses-order-filter-menu/index.jsx b/src/studio-home/tabs-section/courses-tab/courses-filters/courses-order-filter-menu/index.jsx index 837d11dca9..3c02fa55c9 100644 --- a/src/studio-home/tabs-section/courses-tab/courses-filters/courses-order-filter-menu/index.jsx +++ b/src/studio-home/tabs-section/courses-tab/courses-filters/courses-order-filter-menu/index.jsx @@ -45,6 +45,7 @@ const CoursesOrderFilterMenu = ({ onItemMenuSelected }) => { menuItems={courseOrders} onItemMenuSelected={handleCourseTypeSelected} defaultItemSelectedText={intl.formatMessage(messages.coursesOrderFilterMenuAscendantCurses)} + menuType="courseOrders" /> ); }; diff --git a/src/studio-home/tabs-section/courses-tab/courses-filters/courses-types-filter-menu/index.jsx b/src/studio-home/tabs-section/courses-tab/courses-filters/courses-types-filter-menu/index.jsx index f668a577b4..f655d47a58 100644 --- a/src/studio-home/tabs-section/courses-tab/courses-filters/courses-types-filter-menu/index.jsx +++ b/src/studio-home/tabs-section/courses-tab/courses-filters/courses-types-filter-menu/index.jsx @@ -40,6 +40,7 @@ const CoursesTypesFilterMenu = ({ onItemMenuSelected }) => { menuItems={courseTypes} onItemMenuSelected={handleCourseTypeSelected} defaultItemSelectedText={intl.formatMessage(messages.coursesTypesFilterMenuActiveCurses)} + menuType="courseTypes" /> ); };