fix: hide Email staff to create course link

- hide Email staff to create course link when DISABLE_COURSE_CREATION is set to True on backend.
  - backend link: 0611c7891a/cms/djangoapps/contentstore/views/course.py (L1734C5-L1735C59).
  - when DISABLE_COURSE_CREATION is set to True, it should not show staff email links.
  - these links should also be disabled by default fr staff users.
This commit is contained in:
Muhammad Faraz Maqsood
2025-06-11 16:56:53 +05:00
parent c1d874f94f
commit 77f2c4bf97
2 changed files with 8 additions and 3 deletions

View File

@@ -22,8 +22,10 @@ const HomeSidebar = () => {
const { home: aboutHomeLink } = useHelpUrls(['home']);
// eslint-disable-next-line max-len
const isShowMailToGetInstruction = courseCreatorStatus === COURSE_CREATOR_STATES.disallowedForThisSite
&& !!studioRequestEmail;
const isShowMailToGetInstruction = ![
COURSE_CREATOR_STATES.disallowedForThisSite,
COURSE_CREATOR_STATES.granted,
].includes(courseCreatorStatus) && !!studioRequestEmail;
const isShowUnrequestedInstruction = courseCreatorStatus === COURSE_CREATOR_STATES.unrequested;
const isShowDeniedInstruction = courseCreatorStatus === COURSE_CREATOR_STATES.denied;

View File

@@ -69,7 +69,10 @@ const useStudioHome = () => {
} = studioHomeData;
const isShowOrganizationDropdown = optimizationEnabled && courseCreatorStatus === COURSE_CREATOR_STATES.granted;
const isShowEmailStaff = courseCreatorStatus === COURSE_CREATOR_STATES.disallowedForThisSite && !!studioRequestEmail;
const isShowEmailStaff = ![
COURSE_CREATOR_STATES.disallowedForThisSite,
COURSE_CREATOR_STATES.granted,
].includes(courseCreatorStatus) && !!studioRequestEmail;
const isShowProcessing = allowCourseReruns && rerunCreatorStatus && inProcessCourseActions?.length > 0;
const hasAbilityToCreateNewCourse = courseCreatorStatus === COURSE_CREATOR_STATES.granted;
const anyQueryIsPending = [deleteNotificationSavingStatus, courseCreatorSavingStatus, savingCreateRerunStatus]