diff --git a/src/components/course/routes/ExternalCourseEnrollment.jsx b/src/components/course/routes/ExternalCourseEnrollment.jsx index 00d2739ad..3d38f9913 100644 --- a/src/components/course/routes/ExternalCourseEnrollment.jsx +++ b/src/components/course/routes/ExternalCourseEnrollment.jsx @@ -12,8 +12,10 @@ import { CourseContext } from '../CourseContextProvider'; import CourseSummaryCard from '../../executive-education-2u/components/CourseSummaryCard'; import RegistrationSummaryCard from '../../executive-education-2u/components/RegistrationSummaryCard'; import UserEnrollmentForm from '../../executive-education-2u/UserEnrollmentForm'; -import { useExternalEnrollmentFailureReason, useMinimalCourseMetadata } from '../data/hooks'; +import { useExternalEnrollmentFailureReason, useIsCourseAssigned, useMinimalCourseMetadata } from '../data/hooks'; import ErrorPageContent from '../../executive-education-2u/components/ErrorPageContent'; +import { UserSubsidyContext } from '../../enterprise-user-subsidy'; +import { features } from '../../../config'; const ExternalCourseEnrollment = () => { const config = getConfig(); @@ -22,14 +24,19 @@ const ExternalCourseEnrollment = () => { state: { activeCourseRun, courseEntitlementProductSku, + course, }, userSubsidyApplicableToCourse, hasSuccessfulRedemption, externalCourseFormSubmissionError, } = useContext(CourseContext); + const { + redeemableLearnerCreditPolicies, + } = useContext(UserSubsidyContext); const { enterpriseConfig: { authOrgId }, } = useContext(AppContext); + const isCourseAssigned = useIsCourseAssigned(redeemableLearnerCreditPolicies, course?.key); const courseMetadata = useMinimalCourseMetadata(); @@ -106,7 +113,9 @@ const ExternalCourseEnrollment = () => {   Please ensure that the course details below are correct and confirm using Learner Credit with a "Confirm registration" button. - Your Learner Credit funds will be redeemed at this point. + {(features.FEATURE_ENABLE_TOP_DOWN_ASSIGNMENT && isCourseAssigned) + ? 'Your learning administrator already allocated funds towards this registration.' + : 'Your Learner Credit funds will be redeemed at this point.'}

)} diff --git a/src/components/course/routes/ExternalCourseEnrollmentConfirmation.jsx b/src/components/course/routes/ExternalCourseEnrollmentConfirmation.jsx index 4bcd1f61e..d63c47f0e 100644 --- a/src/components/course/routes/ExternalCourseEnrollmentConfirmation.jsx +++ b/src/components/course/routes/ExternalCourseEnrollmentConfirmation.jsx @@ -1,13 +1,19 @@ -import React from 'react'; +import { React, useContext } from 'react'; import { Container } from '@edx/paragon'; import { useExternalEnrollmentFailureReason, useMinimalCourseMetadata } from '../data/hooks'; import CourseSummaryCard from '../../executive-education-2u/components/CourseSummaryCard'; import EnrollmentCompletedSummaryCard from '../../executive-education-2u/components/EnrollmentCompletedSummaryCard'; import ErrorPageContent from '../../executive-education-2u/components/ErrorPageContent'; +import { CourseContext } from '../CourseContextProvider'; const ExternalCourseEnrollmentConfirmation = () => { const courseMetadata = useMinimalCourseMetadata(); + const { + state: { + course, + }, + } = useContext(CourseContext); const { failureReason, failureMessage, @@ -28,7 +34,7 @@ const ExternalCourseEnrollmentConfirmation = () => { courseMetadata={courseMetadata} enrollmentCompleted /> - + )} diff --git a/src/components/course/routes/tests/ExternalCourseEnrollment.test.jsx b/src/components/course/routes/tests/ExternalCourseEnrollment.test.jsx index 6c14cc8e3..d2cc4fd74 100644 --- a/src/components/course/routes/tests/ExternalCourseEnrollment.test.jsx +++ b/src/components/course/routes/tests/ExternalCourseEnrollment.test.jsx @@ -8,6 +8,7 @@ import UserEnrollmentForm from '../../../executive-education-2u/UserEnrollmentFo import ExternalCourseEnrollment from '../ExternalCourseEnrollment'; import { CourseContext } from '../../CourseContextProvider'; import { DISABLED_ENROLL_REASON_TYPES, LEARNER_CREDIT_SUBSIDY_TYPE } from '../../data/constants'; +import { UserSubsidyContext } from '../../../enterprise-user-subsidy'; const mockHistoryPush = jest.fn(); jest.mock('react-router-dom', () => ({ @@ -74,12 +75,15 @@ const baseAppContextValue = { const ExternalCourseEnrollmentWrapper = ({ courseContextValue = baseCourseContextValue, appContextValue = baseAppContextValue, + initialUserSubsidyState = {}, }) => ( - - - + + + + + );