-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: Correctly display expired sidebar card and subscription expiration modal #1074
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1074 +/- ##
==========================================
- Coverage 84.79% 84.70% -0.09%
==========================================
Files 393 393
Lines 8076 8109 +33
Branches 1934 1948 +14
==========================================
+ Hits 6848 6869 +21
- Misses 1171 1180 +9
- Partials 57 60 +3 ☔ View full report in Codecov by Sentry. |
…-portal-enterprise into hu/ent-8609
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with a few tiny nits.
const hasUnexpiredPolicies = unexpiredPolicies.length > 0; | ||
if (hasUnexpiredPolicies) { | ||
return unexpiredPolicies.sort((a, b) => new Date(a.subsidyExpirationDate) - new Date(b.subsidyExpirationDate))[0]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there exists some unexpired policies, we return the soonest expiring policy metadata.
if (hasUnexpiredPolicies) { | ||
return unexpiredPolicies.sort((a, b) => new Date(a.subsidyExpirationDate) - new Date(b.subsidyExpirationDate))[0]; | ||
} | ||
return expiredPolicies.sort((a, b) => new Date(b.subsidyExpirationDate) - new Date(a.subsidyExpirationDate))[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise we display the last expired budget.
Updates the API call to the
learner-licenses
endpoint include the query parametercurrent_plans_only=false
to properly display an expired subscription license.Also reintroduces the use of
hasValidStartExpirationDates
when determining is a subscriptionisCurrent
. This reintroduction handle zero date validation where the day of expiration is also accounted for whendaysUntilExpiration
ordaysUntilExpirationIncludingRenewals
is zero but is within a 24 hour period before expiration.Following up with Joe, language updatedx for expired and expiring courses to the following.
Expired:
We also update the expiry modal to adequately handle singular and plural days/hours/minutes when the current subscription is expiring.
Day and Days:
Hours and Hour:
Minutes and Minute:
984c-15dc0c92fe64)
For all changes
Only if submitting a visual change