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

feat: display upgrade panel when audit trial is expired #76

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

alangsto
Copy link
Member

COSMO-573

When a learner is eligible for upgrade, and their audit trial is expired, an upgrade panel should be shown with a button that takes a learner to the purchase page. Different value props will be shown on the upgrade panel depending on whether or not the course has FBE enabled. The definition for whether or not FBE is enabled has been duplicated from frontend-plugin-advertisements (see https://github.com/edx/frontend-plugin-advertisements/blob/7eac0c8caf701c17a2aba1f1dbb5c942aea8c290/src/upgrade-modal/DefaultUpgradeModal.jsx#L71).

Upgrade panel with FBE:
Screenshot 2024-12-17 at 11 40 08 AM

Upgrade without FBE:
Screenshot 2024-12-17 at 11 40 35 AM

@@ -119,7 +119,7 @@ exports[`<TrialDisclosure /> When trial upgrade being shown should match snapsho
</small>
</div>
<a
class="trial-upgrade mt-3 btn btn-primary btn-block"
class="trial-upgrade mt-3 btn btn-brand btn-block"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@rijuma rijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

auditTrialDaysRemaining = Math.ceil((auditTrialExpirationDate - Date.now()) / millisecondsInOneDay);

auditTrialExpired = auditTrialDaysRemaining < 0;
}

const isFBE = !!accessExpiration && !!datesBannerInfo?.contentTypeGatingEnabled;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: If you want to make sure you are returning a boolean on an expression like this, you can just do:

const isFBE = Boolean(accessExpiration && datesBannerInfo?.contentTypeGatingEnabled);

@alangsto alangsto merged commit 38de6a3 into main Dec 17, 2024
4 checks passed
@alangsto alangsto deleted the alangsto/add_upgrade_screen branch December 17, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants