diff --git a/.env.development b/.env.development index 327c9e33ad..e8e6c769f5 100644 --- a/.env.development +++ b/.env.development @@ -46,7 +46,6 @@ FEATURE_ENABLE_AUTO_APPLIED_LICENSES='true' LEARNING_TYPE_FACET='true' LEARNER_SUPPORT_URL='https://support.edx.org/hc/en-us' LEARNER_SUPPORT_SPEND_ENROLLMENT_LIMITS_URL='http://edx.org' -LEARNER_SUPPORT_ABOUT_DEACTIVATION_URL='https://business-support.edx.org/hc/en-us/articles/15254891994391' FEATURE_ENABLE_PATHWAYS='true' FEATURE_ENABLE_COURSE_REVIEW='' FEATURE_ENROLL_WITH_ENTERPRISE_OFFERS='true' diff --git a/src/components/course/CourseMainContent.jsx b/src/components/course/CourseMainContent.jsx index 854722501f..69a21b87df 100644 --- a/src/components/course/CourseMainContent.jsx +++ b/src/components/course/CourseMainContent.jsx @@ -148,8 +148,8 @@ const CourseMainContent = () => { be able to register for this course: Iran, Cuba and the Crimea region of Ukraine. While edX has sought licenses from the U.S. Office of Foreign Assets Control (OFAC) to offer our courses to learners in these countries and regions, the licenses we have - received are not broad enough to allow us to offer this course in all locations. EdX truly regrets that U.S. sanctions prevent us from offering all of our courses to + received are not broad enough to allow us to offer this course in all locations. EdX everyone, no matter where they live.

diff --git a/src/components/course/CoursePage.jsx b/src/components/course/CoursePage.jsx index a3d25f5230..c010c51411 100644 --- a/src/components/course/CoursePage.jsx +++ b/src/components/course/CoursePage.jsx @@ -52,13 +52,8 @@ const CoursePage = () => { couponCodes: { couponCodes }, enterpriseOffers, canEnrollWithEnterpriseOffers, - customerAgreementConfig, } = useContext(UserSubsidyContext); - const { - couponsForSubsidyRequests, - catalogsForSubsidyRequests, - subsidyRequestConfiguration, - } = useContext(SubsidyRequestsContext); + const { catalogsForSubsidyRequests, subsidyRequestConfiguration } = useContext(SubsidyRequestsContext); const { enterpriseCuration: { @@ -198,14 +193,12 @@ const CoursePage = () => { subscriptionLicense, courseService, couponCodes, - couponsForSubsidyRequests, canEnrollWithEnterpriseOffers, enterpriseOffers, onSubscriptionLicenseForCourseValidationError, missingSubsidyAccessPolicyReason, enterpriseAdminUsers, courseListPrice, - customerAgreementConfig, }); const [coursePrice, currency] = useCoursePriceForUserSubsidy({ @@ -243,7 +236,6 @@ const CoursePage = () => { subsidyRequestConfiguration, subsidyRequestCatalogsApplicableToCourse, userSubsidyApplicableToCourse, - couponsForSubsidyRequests, }); if (error) { diff --git a/src/components/course/SubsidyRequestButton.jsx b/src/components/course/SubsidyRequestButton.jsx index 5f3bf55945..830c35fac4 100644 --- a/src/components/course/SubsidyRequestButton.jsx +++ b/src/components/course/SubsidyRequestButton.jsx @@ -10,7 +10,6 @@ import { useUserHasSubsidyRequestForCourse } from './data/hooks'; import { findUserEnrollmentForCourseRun } from './data/utils'; import { ToastsContext } from '../Toasts'; import { postLicenseRequest, postCouponCodeRequest } from '../enterprise-subsidy-requests/data/service'; -import { noAvailableCoupons } from './enrollment/utils'; const props = { labels: { @@ -30,7 +29,6 @@ const SubsidyRequestButton = () => { const { subsidyRequestConfiguration, refreshSubsidyRequests, - couponsForSubsidyRequests, } = useContext(SubsidyRequestsContext); const { state, subsidyRequestCatalogsApplicableToCourse, userSubsidyApplicableToCourse } = useContext(CourseContext); @@ -76,12 +74,11 @@ const SubsidyRequestButton = () => { * - user has a subsidy request for course * OR * - course is in catalog - * - there are available coupons to request * - user not already enrolled in crouse * - user has no subsidy for course */ const hasSubsidyRequestsEnabled = subsidyRequestConfiguration?.subsidyRequestsEnabled; - const showSubsidyRequestButton = hasSubsidyRequestsEnabled && !noAvailableCoupons(couponsForSubsidyRequests) && ( + const showSubsidyRequestButton = hasSubsidyRequestsEnabled && ( userHasSubsidyRequest || ( subsidyRequestCatalogsApplicableToCourse.size > 0 && !isUserEnrolled && !userSubsidyApplicableToCourse ) diff --git a/src/components/course/data/constants.js b/src/components/course/data/constants.js index c28745cc1a..2691864995 100644 --- a/src/components/course/data/constants.js +++ b/src/components/course/data/constants.js @@ -73,8 +73,6 @@ export const REASON_USER_MESSAGES = { ORGANIZATION_NO_FUNDS_NO_ADMINS: "You can't enroll right now because your organization doesn't have enough funds. Contact your administrator to request more.", LEARNER_LIMITS_REACHED: "You can't enroll right now because of limits set by your organization.", CONTENT_NOT_IN_CATALOG: "You can't enroll right now because this course is no longer available in your organization's catalog.", - SUBSCRIPTION_EXPIRED: "You can't enroll right now because your subscription expired.", - SUBSCRIPTION_DEACTIVATED: "You can't enroll right now because your subscription has been deactivated.", }; export const DISABLED_ENROLL_REASON_TYPES = { POLICY_NOT_ACTIVE: 'policy_not_active', @@ -85,9 +83,6 @@ export const DISABLED_ENROLL_REASON_TYPES = { LEARNER_MAX_ENROLLMENTS_REACHED: 'learner_max_enrollments_reached', NO_SUBSIDY: 'no_subsidy', NO_SUBSIDY_NO_ADMINS: 'no_subsidy_no_admin', - NO_ENROLLMENT_CODES_REMAINING: 'no_entrollment_codes_remaining', - SUBSCRIPTION_EXPIRED: 'subscription_expired', - SUBSCRIPTION_DEACTIVATED: 'subscription_deactivated', }; export const DISABLED_ENROLL_USER_MESSAGES = { [DISABLED_ENROLL_REASON_TYPES.CONTENT_NOT_IN_CATALOG]: REASON_USER_MESSAGES.CONTENT_NOT_IN_CATALOG, @@ -96,9 +91,6 @@ export const DISABLED_ENROLL_USER_MESSAGES = { [DISABLED_ENROLL_REASON_TYPES.NOT_ENOUGH_VALUE_IN_SUBSIDY]: REASON_USER_MESSAGES.ORGANIZATION_NO_FUNDS, [DISABLED_ENROLL_REASON_TYPES.LEARNER_MAX_ENROLLMENTS_REACHED]: REASON_USER_MESSAGES.LEARNER_LIMITS_REACHED, [DISABLED_ENROLL_REASON_TYPES.LEARNER_MAX_SPEND_REACHED]: REASON_USER_MESSAGES.LEARNER_LIMITS_REACHED, - [DISABLED_ENROLL_REASON_TYPES.NO_ENROLLMENT_CODES_REMAINING]: REASON_USER_MESSAGES.LEARNER_LIMITS_REACHED, - [DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_EXPIRED]: REASON_USER_MESSAGES.SUBSCRIPTION_EXPIRED, - [DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_DEACTIVATED]: REASON_USER_MESSAGES.SUBSCRIPTION_DEACTIVATED, }; export const DATE_FORMAT = 'MMM D, YYYY'; diff --git a/src/components/course/data/hooks.jsx b/src/components/course/data/hooks.jsx index d52b442233..872459f809 100644 --- a/src/components/course/data/hooks.jsx +++ b/src/components/course/data/hooks.jsx @@ -46,9 +46,8 @@ import { ENTERPRISE_OFFER_SUBSIDY_TYPE, } from './constants'; import { pushEvent, EVENTS } from '../../../utils/optimizely'; -import { getExternalCourseEnrollmentUrl, noAvailableCoupons } from '../enrollment/utils'; +import { getExternalCourseEnrollmentUrl } from '../enrollment/utils'; import { createExecutiveEducationFailureMessage } from '../../executive-education-2u/ExecutiveEducation2UError'; -import { LICENSE_STATUS } from '../../enterprise-user-subsidy/data/constants'; // How long to delay an event, so that we allow enough time for any async analytics event call to resolve const CLICK_DELAY_MS = 300; // 300ms replicates Segment's ``trackLink`` function @@ -659,14 +658,12 @@ export const useUserSubsidyApplicableToCourse = ({ subscriptionLicense, courseService, couponCodes, - couponsForSubsidyRequests, canEnrollWithEnterpriseOffers, enterpriseOffers, onSubscriptionLicenseForCourseValidationError, missingSubsidyAccessPolicyReason, enterpriseAdminUsers: fallbackAdminUsers, courseListPrice, - customerAgreementConfig, }) => { const [userSubsidyApplicableToCourse, setUserSubsidyApplicableToCourse] = useState(); const [missingUserSubsidyReason, setMissingUserSubsidyReason] = useState(); @@ -722,7 +719,6 @@ export const useUserSubsidyApplicableToCourse = ({ onSubscriptionLicenseForCourseValidationError(error); } } - return licenseApplicableToCourse; } const coursePrice = getCourseRunPrice({ courseDetails, @@ -761,19 +757,6 @@ export const useUserSubsidyApplicableToCourse = ({ if (enterpriseAdminUsers?.length > 0) { reasonType = DISABLED_ENROLL_REASON_TYPES.NO_SUBSIDY; } - if (subscriptionLicense?.status === LICENSE_STATUS.REVOKED) { - reasonType = DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_DEACTIVATED; - } - const hasExpiredSubscriptions = customerAgreementConfig?.subscriptions?.every( - (sub) => sub.daysUntilExpiration < 0, - ); - if (hasExpiredSubscriptions) { - reasonType = DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_EXPIRED; - } - const hasNoEnrollmentCodesRemaining = noAvailableCoupons(couponsForSubsidyRequests); - if (hasNoEnrollmentCodesRemaining) { - reasonType = DISABLED_ENROLL_REASON_TYPES.NO_ENROLLMENT_CODES_REMAINING; - } // set reason type as content not in catalog if course is contained // within any of the enterprise customer's catalog(s). if (!containsContentItems) { @@ -860,14 +843,12 @@ export const useUserSubsidyApplicableToCourse = ({ onSubscriptionLicenseForCourseValidationError, subscriptionLicense, couponCodes, - couponsForSubsidyRequests, canEnrollWithEnterpriseOffers, enterpriseOffers, redeemableSubsidyAccessPolicy, isPolicyRedemptionEnabled, missingSubsidyAccessPolicyReason, fallbackAdminUsers, - customerAgreementConfig?.subscriptions, ]); return useMemo(() => ({ diff --git a/src/components/course/data/tests/hooks.test.jsx b/src/components/course/data/tests/hooks.test.jsx index 8324ab8370..58d4ea0ef1 100644 --- a/src/components/course/data/tests/hooks.test.jsx +++ b/src/components/course/data/tests/hooks.test.jsx @@ -51,10 +51,10 @@ import { mockCourseRunKey, mockCanRedeemData, mockSubscriptionLicense, + mockUserLicenseSubsidy, mockRedeemableSubsidyAccessPolicy, mockCanRedeemReason, mockCanRedeemForContentKey, - mockRevokedSubscriptionLicense, } from '../../tests/constants'; import * as optimizelyUtils from '../../../../utils/optimizely'; import { CourseContext } from '../../CourseContextProvider'; @@ -1050,7 +1050,7 @@ describe('useUserSubsidyApplicableToCourse', () => { ...baseArgs, courseData: undefined, }; - const missingUserSubsidyMaxSpendReason = { + const missingUserSubsidyReason = { reason: DISABLED_ENROLL_REASON_TYPES.LEARNER_MAX_SPEND_REACHED, userMessage: REASON_USER_MESSAGES.LEARNER_LIMITS_REACHED, metadata: { enterpriseAdministrators: ['edx@example.com'] }, @@ -1152,7 +1152,7 @@ describe('useUserSubsidyApplicableToCourse', () => { it('does not have redeemable subsidy access policy and has missing subsidy access policy user message', async () => { const args = { ...baseArgs, - missingSubsidyAccessPolicyReason: missingUserSubsidyMaxSpendReason, + missingSubsidyAccessPolicyReason: missingUserSubsidyReason, }; const { result, waitForNextUpdate } = renderHook(() => useUserSubsidyApplicableToCourse(args)); @@ -1176,12 +1176,12 @@ describe('useUserSubsidyApplicableToCourse', () => { expect(mockCourseService.fetchUserLicenseSubsidy).toHaveBeenCalledTimes(1); await waitFor(() => { - expect(result.current).toEqual({ - userSubsidyApplicableToCourse: expect.objectContaining({ - subsidyType: LICENSE_SUBSIDY_TYPE, - }), - missingUserSubsidyReason: undefined, - }); + expect(getSubsidyToApplyForCourse).toHaveBeenCalledTimes(1); + }); + expect(getSubsidyToApplyForCourse).toHaveBeenCalledWith({ + applicableSubscriptionLicense: mockUserLicenseSubsidy, + applicableCouponCode: undefined, + applicableEnterpriseOffer: undefined, }); expect(result.current).toEqual({ @@ -1192,50 +1192,6 @@ describe('useUserSubsidyApplicableToCourse', () => { }); }); - it('reports expired subscription license', async () => { - getSubsidyToApplyForCourse.mockReturnValueOnce(undefined); - const args = { - ...baseArgs, - enterpriseAdminUsers: [{ email: 'admin@test.com' }], - customerAgreementConfig: { subscriptions: [{ daysUntilExpiration: -1 }] }, - }; - const { result, waitForNextUpdate } = renderHook(() => useUserSubsidyApplicableToCourse(args)); - await waitForNextUpdate(); - - const { missingUserSubsidyReason, userSubsidyApplicableToCourse } = result.current; - const actionHtml = JSON.stringify(missingUserSubsidyReason.actions); - expect(userSubsidyApplicableToCourse).toBeUndefined(); - expect(missingUserSubsidyReason.reason).toEqual(DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_EXPIRED); - expect(missingUserSubsidyReason.userMessage).toEqual( - DISABLED_ENROLL_USER_MESSAGES[ - DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_EXPIRED - ], - ); - expect(actionHtml.includes('"destination":"mailto:admin@test.com"')).toBeTruthy(); - expect(actionHtml.includes('Contact admin for help')).toBeTruthy(); - }); - - it('reports revoked subscription license', async () => { - mockCourseService.fetchUserLicenseSubsidy.mockReturnValueOnce(undefined); - const args = { - ...baseArgs, - subscriptionLicense: mockRevokedSubscriptionLicense, - }; - const { result, waitForNextUpdate } = renderHook(() => useUserSubsidyApplicableToCourse(args)); - await waitForNextUpdate(); - - const { missingUserSubsidyReason, userSubsidyApplicableToCourse } = result.current; - const actionHtml = JSON.stringify(missingUserSubsidyReason.actions); - expect(userSubsidyApplicableToCourse).toBeUndefined(); - expect(missingUserSubsidyReason.reason).toEqual(DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_DEACTIVATED); - expect(missingUserSubsidyReason.userMessage).toEqual( - DISABLED_ENROLL_USER_MESSAGES[ - DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_DEACTIVATED - ], - ); - expect(actionHtml.includes('Learn about deactivation')).toBeTruthy(); - }); - it('finds applicable coupon code', async () => { const mockCouponCode = { catalog: mockCatalogUUID, @@ -1273,29 +1229,6 @@ describe('useUserSubsidyApplicableToCourse', () => { }); }); - it('reports no coupon codes remaining', async () => { - getSubsidyToApplyForCourse.mockReturnValueOnce(undefined); - - const args = { - ...baseArgs, - couponsForSubsidyRequests: [{ numUnassigned: 0 }], - }; - const { result, waitForNextUpdate } = renderHook(() => useUserSubsidyApplicableToCourse(args)); - - await waitForNextUpdate(); - - const { missingUserSubsidyReason, userSubsidyApplicableToCourse } = result.current; - const actionHtml = JSON.stringify(missingUserSubsidyReason.actions); - expect(userSubsidyApplicableToCourse).toBeUndefined(); - expect(missingUserSubsidyReason.reason).toEqual(DISABLED_ENROLL_REASON_TYPES.NO_ENROLLMENT_CODES_REMAINING); - expect(missingUserSubsidyReason.userMessage).toEqual( - DISABLED_ENROLL_USER_MESSAGES[ - DISABLED_ENROLL_REASON_TYPES.LEARNER_MAX_ENROLLMENTS_REACHED - ], - ); - expect(actionHtml.includes('Learn about limits')).toBeTruthy(); - }); - it('finds applicable enterprise offer', async () => { const mockEnterpriseOffer = { catalog: mockCatalogUUID, diff --git a/src/components/course/data/tests/utils.test.jsx b/src/components/course/data/tests/utils.test.jsx index 230de9e4b4..e51eb2c2e6 100644 --- a/src/components/course/data/tests/utils.test.jsx +++ b/src/components/course/data/tests/utils.test.jsx @@ -1,5 +1,4 @@ import moment from 'moment'; -import { LICENSE_STATUS } from '../../../enterprise-user-subsidy/data/constants'; import { COUPON_CODE_SUBSIDY_TYPE, COURSE_AVAILABILITY_MAP, ENTERPRISE_OFFER_SUBSIDY_TYPE, LICENSE_SUBSIDY_TYPE, } from '../constants'; @@ -13,7 +12,6 @@ import { linkToCourse, pathContainsCourseTypeSlug, getCourseStartDate, - isActiveSubscriptionLicense, } from '../utils'; jest.mock('@edx/frontend-platform/config', () => ({ @@ -558,10 +556,3 @@ describe('getCourseStartDate tests', () => { expect(startDate).toBe(undefined); }); }); - -describe('isActiveSubscriptionLicense tests', () => { - it('returns true for active subscription license', async () => { - const testSubscriptionLicense = { status: LICENSE_STATUS.ACTIVATED }; - expect(isActiveSubscriptionLicense(testSubscriptionLicense)).toBeTruthy(); - }); -}); diff --git a/src/components/course/data/utils.jsx b/src/components/course/data/utils.jsx index 681d1094cf..22b80c8397 100644 --- a/src/components/course/data/utils.jsx +++ b/src/components/course/data/utils.jsx @@ -22,7 +22,6 @@ import CreditSvgIcon from '../../../assets/icons/credit.svg'; import { PROGRAM_TYPE_MAP } from '../../program/data/constants'; import { programIsMicroMasters, programIsProfessionalCertificate } from '../../program/data/utils'; import { hasValidStartExpirationDates } from '../../../utils/common'; -import { LICENSE_STATUS } from '../../enterprise-user-subsidy/data/constants'; export function hasCourseStarted(start) { const today = new Date(); @@ -358,17 +357,13 @@ export function findHighestLevelSku({ courseEntitlements, seats }) { return findHighestLevelSeatSku(seats) || findHighestLevelEntitlementSku(courseEntitlements); } -export function isActiveSubscriptionLicense(subscriptionLicense) { - return subscriptionLicense?.status === LICENSE_STATUS.ACTIVATED; -} - export function shouldUpgradeUserEnrollment({ userEnrollment, subscriptionLicense, enrollmentUrl, }) { const isAuditEnrollment = userEnrollment?.mode === COURSE_MODES_MAP.AUDIT; - return !!(isAuditEnrollment && isActiveSubscriptionLicense(subscriptionLicense) && enrollmentUrl); + return !!(isAuditEnrollment && subscriptionLicense && enrollmentUrl); } // Truncate a string to less than the maxLength characters without cutting the last word and append suffix at the end @@ -600,45 +595,26 @@ export const getMissingSubsidyReasonActions = ({ const hasLimitsLearnMoreCTA = [ DISABLED_ENROLL_REASON_TYPES.LEARNER_MAX_SPEND_REACHED, DISABLED_ENROLL_REASON_TYPES.LEARNER_MAX_ENROLLMENTS_REACHED, - DISABLED_ENROLL_REASON_TYPES.NO_ENROLLMENT_CODES_REMAINING, - DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_DEACTIVATED, ].includes(reasonType); - const moreInfoCTAConfigs = { - [DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_DEACTIVATED]: { - configUrlKey: 'LEARNER_SUPPORT_ABOUT_DEACTIVATION_URL', - text: 'Learn about deactivation', - }, - default: { - configUrlKey: 'LEARNER_SUPPORT_SPEND_ENROLLMENT_LIMITS_URL', - text: 'Learn about limits', - }, - }; const hasOrganizationNoFundsCTA = [ DISABLED_ENROLL_REASON_TYPES.NO_SUBSIDY, DISABLED_ENROLL_REASON_TYPES.POLICY_NOT_ACTIVE, DISABLED_ENROLL_REASON_TYPES.LEARNER_NOT_IN_ENTERPRISE, DISABLED_ENROLL_REASON_TYPES.CONTENT_NOT_IN_CATALOG, DISABLED_ENROLL_REASON_TYPES.NOT_ENOUGH_VALUE_IN_SUBSIDY, - DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_EXPIRED, ].includes(reasonType); - const emailAdminTextByReason = { - [DISABLED_ENROLL_REASON_TYPES.SUBSCRIPTION_EXPIRED]: 'Contact admin for help', - }; - if (hasLimitsLearnMoreCTA) { - const moreInfoCTAConfig = moreInfoCTAConfigs[reasonType] ?? moreInfoCTAConfigs.default; - ensureConfig([moreInfoCTAConfig.configUrlKey]); - const ctaUrl = getConfig()[moreInfoCTAConfig.configUrlKey]; + ensureConfig(['LEARNER_SUPPORT_SPEND_ENROLLMENT_LIMITS_URL']); return ( ); } @@ -648,7 +624,6 @@ export const getMissingSubsidyReasonActions = ({ return null; } const adminEmails = enterpriseAdminUsers.map(({ email }) => email).join(','); - const noFundsButtonText = emailAdminTextByReason[reasonType] ?? 'Contact administrator'; return ( ); } diff --git a/src/components/course/enrollment/utils.js b/src/components/course/enrollment/utils.js index c08435a135..537c944190 100644 --- a/src/components/course/enrollment/utils.js +++ b/src/components/course/enrollment/utils.js @@ -16,15 +16,6 @@ const { HIDE_BUTTON, } = enrollButtonTypes; -/** - * - * @param {*} couponsForSubsidyRequests Set of coupons - * @returns True if none of the coupons have any remaining applications - */ -export function noAvailableCoupons(couponsForSubsidyRequests) { - return couponsForSubsidyRequests?.every((coupon) => coupon?.numUnassigned === 0); -} - /** * Determines whether a user can request a subsidy for a course, by checking whether * the subsidy request feature is enabled, there are more than 1 subsidy request @@ -43,7 +34,6 @@ export function canUserRequestSubsidyForCourse({ subsidyRequestConfiguration, subsidyRequestCatalogsApplicableToCourse, userSubsidyApplicableToCourse, - couponsForSubsidyRequests, }) { // Hide enroll button if browse and request is turned on and the user has no applicable subsidy if (!subsidyRequestConfiguration || !subsidyRequestCatalogsApplicableToCourse) { @@ -53,7 +43,6 @@ export function canUserRequestSubsidyForCourse({ subsidyRequestConfiguration.subsidyRequestsEnabled && subsidyRequestCatalogsApplicableToCourse.size > 0 && !userSubsidyApplicableToCourse - && !noAvailableCoupons(couponsForSubsidyRequests) ); } diff --git a/src/components/course/tests/__snapshots__/CourseMainContent.test.jsx.snap b/src/components/course/tests/__snapshots__/CourseMainContent.test.jsx.snap index 7382250305..6e3f4b2776 100644 --- a/src/components/course/tests/__snapshots__/CourseMainContent.test.jsx.snap +++ b/src/components/course/tests/__snapshots__/CourseMainContent.test.jsx.snap @@ -174,7 +174,7 @@ Array [ Who can take this course?

- Unfortunately, learners from one or more of the following countries or regions will not be able to register for this course: Iran, Cuba and the Crimea region of Ukraine. While edX has sought licenses from the U.S. Office of Foreign Assets Control (OFAC) to offer our courses to learners in these countries and regions, the licenses we have received are not broad enough to allow us to offer this course in all locations. EdX truly regrets that U.S. sanctions prevent us from offering all of our courses to everyone, no matter where they live. + Unfortunately, learners from one or more of the following countries or regions will not be able to register for this course: Iran, Cuba and the Crimea region of Ukraine. While edX has sought licenses from the U.S. Office of Foreign Assets Control (OFAC) to offer our courses to learners in these countries and regions, the licenses we have truly regrets that U.S. sanctions prevent us from offering all of our courses to received are not broad enough to allow us to offer this course in all locations. EdX everyone, no matter where they live.

, ] diff --git a/src/components/course/tests/constants.js b/src/components/course/tests/constants.js index b28f596379..906066bbf2 100644 --- a/src/components/course/tests/constants.js +++ b/src/components/course/tests/constants.js @@ -1,5 +1,4 @@ -import { LICENSE_STATUS } from '../../enterprise-user-subsidy/data/constants'; -import { DISABLED_ENROLL_REASON_TYPES, LICENSE_SUBSIDY_TYPE, REASON_USER_MESSAGES } from '../data/constants'; +import { DISABLED_ENROLL_REASON_TYPES, REASON_USER_MESSAGES } from '../data/constants'; export const TEST_RECOMMENDATION_DATA = { all_recommendations: [ @@ -159,14 +158,9 @@ export const mockCanRedeemData = [mockCanRedeemForContentKey]; export const mockSubscriptionLicense = { uuid: 'test-subscription-uuid', }; -export const mockRevokedSubscriptionLicense = { - uuid: 'test-subscription-uuid', - status: LICENSE_STATUS.REVOKED, -}; export const mockUserLicenseSubsidy = { discountType: 'percentage', discountValue: 100, - subsidyType: LICENSE_SUBSIDY_TYPE, }; export const mockEnterpriseUUID = 'enterprise-uuid'; diff --git a/src/components/enterprise-subsidy-requests/SubsidyRequestsContextProvider.jsx b/src/components/enterprise-subsidy-requests/SubsidyRequestsContextProvider.jsx index 0960f1b8f5..07ce904463 100644 --- a/src/components/enterprise-subsidy-requests/SubsidyRequestsContextProvider.jsx +++ b/src/components/enterprise-subsidy-requests/SubsidyRequestsContextProvider.jsx @@ -34,7 +34,6 @@ const SubsidyRequestsContextProvider = ({ children }) => { const { customerAgreementConfig } = useContext(UserSubsidyContext); const { - coupons: couponsForSubsidyRequests, catalogs: catalogsForSubsidyRequests, isLoading: isLoadingCatalogsForSubsidyRequests, } = useCatalogsForSubsidyRequests({ @@ -55,13 +54,11 @@ const SubsidyRequestsContextProvider = ({ children }) => { subsidyRequestConfiguration, requestsBySubsidyType, refreshSubsidyRequests, - couponsForSubsidyRequests, catalogsForSubsidyRequests, }), [ subsidyRequestConfiguration, requestsBySubsidyType, refreshSubsidyRequests, - couponsForSubsidyRequests, catalogsForSubsidyRequests, ]); diff --git a/src/components/enterprise-subsidy-requests/data/hooks.js b/src/components/enterprise-subsidy-requests/data/hooks.js index e4e59736aa..e600fdf999 100644 --- a/src/components/enterprise-subsidy-requests/data/hooks.js +++ b/src/components/enterprise-subsidy-requests/data/hooks.js @@ -110,7 +110,6 @@ export const useCatalogsForSubsidyRequests = ({ customerAgreementConfig, }) => { const [catalogs, setCatalogs] = useState([]); - const [coupons, setCoupons] = useState([]); const [isLoading, setIsLoading] = useState(true); useEffect(() => { @@ -121,7 +120,6 @@ export const useCatalogsForSubsidyRequests = ({ { enterpriseId: subsidyRequestConfiguration.enterpriseCustomerUuid }, ); const { results } = camelCaseObject(response.data); - setCoupons([...new Set(results)]); const catalogsFromCoupons = results.map(coupon => coupon.enterpriseCatalogUuid); setCatalogs([...new Set(catalogsFromCoupons)]); } catch (error) { @@ -153,7 +151,6 @@ export const useCatalogsForSubsidyRequests = ({ ]); return { - coupons, catalogs, isLoading, }; diff --git a/src/components/enterprise-user-subsidy/data/hooks.js b/src/components/enterprise-user-subsidy/data/hooks.js index bc16ba4775..1b3c03f9a4 100644 --- a/src/components/enterprise-user-subsidy/data/hooks.js +++ b/src/components/enterprise-user-subsidy/data/hooks.js @@ -40,7 +40,6 @@ const fetchExistingUserLicense = async (enterpriseId) => { const licensesByStatus = { [LICENSE_STATUS.ACTIVATED]: [], [LICENSE_STATUS.ASSIGNED]: [], - [LICENSE_STATUS.REVOKED]: [], }; results.forEach((item) => { licensesByStatus[item.status].push(item); diff --git a/src/components/enterprise-user-subsidy/data/service.js b/src/components/enterprise-user-subsidy/data/service.js index f07541efc6..b411c5a4ab 100644 --- a/src/components/enterprise-user-subsidy/data/service.js +++ b/src/components/enterprise-user-subsidy/data/service.js @@ -5,7 +5,6 @@ import { loginRefresh } from '../../../utils/common'; export function fetchSubscriptionLicensesForUser(enterpriseUUID) { const queryParams = new URLSearchParams({ enterprise_customer_uuid: enterpriseUUID, - include_revoked: true, }); const config = getConfig(); const url = `${config.LICENSE_MANAGER_URL}/api/v1/learner-licenses/?${queryParams.toString()}`; diff --git a/src/index.jsx b/src/index.jsx index 5bf8fb71d1..50b658218f 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -44,7 +44,6 @@ initialize({ ENABLE_NOTICES: process.env.ENABLE_NOTICES || null, LEARNER_SUPPORT_URL: process.env.LEARNER_SUPPORT_URL || null, LEARNER_SUPPORT_SPEND_ENROLLMENT_LIMITS_URL: process.env.LEARNER_SUPPORT_SPEND_ENROLLMENT_LIMITS_URL || null, - LEARNER_SUPPORT_ABOUT_DEACTIVATION_URL: process.env.LEARNER_SUPPORT_ABOUT_DEACTIVATION_URL || null, GETSMARTER_STUDENT_TC_URL: process.env.GETSMARTER_STUDENT_TC_URL || null, GETSMARTER_PRIVACY_POLICY_URL: process.env.GETSMARTER_PRIVACY_POLICY_URL || null, GETSMARTER_LEARNER_DASHBOARD_URL: process.env.GETSMARTER_LEARNER_DASHBOARD_URL || null,