Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove gating on learner credit enrollment upgrades from Dashboard #1139

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import { AppContext } from '@edx/frontend-platform/react';
import { camelCaseObject } from '@edx/frontend-platform/utils';
import { logError } from '@edx/frontend-platform/logging';
import { hasFeatureFlagEnabled, sendEnterpriseTrackEventWithDelay } from '@edx/frontend-enterprise-utils';
import { sendEnterpriseTrackEventWithDelay } from '@edx/frontend-enterprise-utils';
import _camelCase from 'lodash.camelcase';
import _cloneDeep from 'lodash.clonedeep';

Expand Down Expand Up @@ -147,17 +147,13 @@ export const useCourseUpgradeData = ({
}) => {
const location = useLocation();
const canUpgradeToVerifiedEnrollment = isEnrollmentUpgradeable({ mode, enrollBy });
const { authenticatedUser } = useContext(AppContext);
const { data: enterpriseCustomer } = useEnterpriseCustomer();
const { data: customerContainsContent } = useEnterpriseCustomerContainsContent([courseRunKey], {
enabled: canUpgradeToVerifiedEnrollment,
});

// TODO: Remove `isLearnerCreditUpgradeEnabled` flag when rolling out ENT-9135
// Metadata required to allow upgrade via applicable learner credit
const isLearnerCreditUpgradeEnabled = authenticatedUser.administrator || hasFeatureFlagEnabled('LEARNER_CREDIT_AUDIT_UPGRADE');
const { data: learnerCreditMetadata } = useCanUpgradeWithLearnerCredit(courseRunKey, {
enabled: isLearnerCreditUpgradeEnabled && canUpgradeToVerifiedEnrollment,
enabled: canUpgradeToVerifiedEnrollment,
});

// Metadata required to allow upgrade via applicable subscription license
Expand Down Expand Up @@ -190,7 +186,7 @@ export const useCourseUpgradeData = ({
});

const { data: enterpriseCourseEnrollments } = useEnterpriseCourseEnrollments({
enabled: isLearnerCreditUpgradeEnabled && canUpgradeToVerifiedEnrollment,
enabled: canUpgradeToVerifiedEnrollment,
});

const { redeem: redeemLearnerCredit } = useStatefulEnroll({
Expand Down
Loading