Skip to content

Commit

Permalink
Merge pull request #1198 from zwidekalanga/zwidekalanga/ux-changes-ex…
Browse files Browse the repository at this point in the history
…piry-logic

fix: code styling issues for expiry logic
  • Loading branch information
macdiesel authored Apr 18, 2024
2 parents 99d093d + ce3ecf3 commit 83b8906
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 50 deletions.
45 changes: 0 additions & 45 deletions src/components/Admin/__snapshots__/Admin.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ exports[`<Admin /> renders correctly calls fetchDashboardAnalytics prop 1`] = `
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -193,9 +190,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders # cou
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -1065,9 +1059,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders # of
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -1937,9 +1928,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders # of
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -2809,9 +2797,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders colla
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -3681,9 +3666,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders full
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -4553,9 +4535,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders inact
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -5425,9 +5404,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders inact
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -6297,9 +6273,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders learn
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -7169,9 +7142,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders regis
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -8041,9 +8011,6 @@ exports[`<Admin /> renders correctly with dashboard analytics data renders top a
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -8913,9 +8880,6 @@ exports[`<Admin /> renders correctly with dashboard insights data renders dashbo
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -9834,9 +9798,6 @@ exports[`<Admin /> renders correctly with error state 1`] = `
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -9991,9 +9952,6 @@ exports[`<Admin /> renders correctly with loading state 1`] = `
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down Expand Up @@ -10209,9 +10167,6 @@ exports[`<Admin /> renders correctly with no dashboard insights data 1`] = `
/>
</div>
</div>
<div
className="mt-4"
/>
<div
className="container-fluid"
>
Expand Down
4 changes: 1 addition & 3 deletions src/components/Admin/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,10 @@ class Admin extends React.Component {
<>
<Helmet title="Learner Progress Report" />
<Hero title="Learner Progress Report" />
<div className="mt-4">
<BudgetExpiryAlertAndModal />
</div>
<div className="container-fluid">
<div className="row mt-4">
<div className="col">
<BudgetExpiryAlertAndModal />
<h2>Overview</h2>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/BudgetExpiryAlertAndModal/data/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getExpirationMetadata = (endDateStr) => {
const thresholdKeys = Object.keys(ExpiryThresholds).sort((a, b) => a - b);
const thresholdKey = thresholdKeys.find((key) => durationDiff.asDays() <= key);

if (thresholdKey === undefined) {
if (!thresholdKey) {
return {
thresholdKey: null,
threshold: null,
Expand All @@ -34,7 +34,7 @@ export const getExpirationMetadata = (endDateStr) => {
export const isPlanApproachingExpiry = (endDateStr) => {
const { thresholdKey, threshold } = getExpirationMetadata(endDateStr);

if (thresholdKey === null) {
if (!thresholdKey) {
return false;
}

Expand Down

0 comments on commit 83b8906

Please sign in to comment.