From f35524375884c2cdbb8ef4e172a887f2c018ded8 Mon Sep 17 00:00:00 2001 From: Cyril Nxumalo Date: Thu, 11 Apr 2024 15:17:41 +0200 Subject: [PATCH] fix: code styling issues for expiry logic --- .../Admin/__snapshots__/Admin.test.jsx.snap | 45 ------------------- src/components/Admin/index.jsx | 4 +- .../BudgetExpiryAlertAndModal/data/utils.js | 4 +- 3 files changed, 3 insertions(+), 50 deletions(-) diff --git a/src/components/Admin/__snapshots__/Admin.test.jsx.snap b/src/components/Admin/__snapshots__/Admin.test.jsx.snap index 3bd82d7d32..86f9a59e99 100644 --- a/src/components/Admin/__snapshots__/Admin.test.jsx.snap +++ b/src/components/Admin/__snapshots__/Admin.test.jsx.snap @@ -20,9 +20,6 @@ exports[` renders correctly calls fetchDashboardAnalytics prop 1`] = ` /> -
@@ -193,9 +190,6 @@ exports[` renders correctly with dashboard analytics data renders # cou />
-
@@ -1065,9 +1059,6 @@ exports[` renders correctly with dashboard analytics data renders # of />
-
@@ -1937,9 +1928,6 @@ exports[` renders correctly with dashboard analytics data renders # of />
-
@@ -2809,9 +2797,6 @@ exports[` renders correctly with dashboard analytics data renders colla />
-
@@ -3681,9 +3666,6 @@ exports[` renders correctly with dashboard analytics data renders full />
-
@@ -4553,9 +4535,6 @@ exports[` renders correctly with dashboard analytics data renders inact />
-
@@ -5425,9 +5404,6 @@ exports[` renders correctly with dashboard analytics data renders inact />
-
@@ -6297,9 +6273,6 @@ exports[` renders correctly with dashboard analytics data renders learn />
-
@@ -7169,9 +7142,6 @@ exports[` renders correctly with dashboard analytics data renders regis />
-
@@ -8041,9 +8011,6 @@ exports[` renders correctly with dashboard analytics data renders top a />
-
@@ -8913,9 +8880,6 @@ exports[` renders correctly with dashboard insights data renders dashbo />
-
@@ -9834,9 +9798,6 @@ exports[` renders correctly with error state 1`] = ` />
-
@@ -9991,9 +9952,6 @@ exports[` renders correctly with loading state 1`] = ` />
-
@@ -10209,9 +10167,6 @@ exports[` renders correctly with no dashboard insights data 1`] = ` />
-
diff --git a/src/components/Admin/index.jsx b/src/components/Admin/index.jsx index 9c9ad2ddda..5fa3f64c5d 100644 --- a/src/components/Admin/index.jsx +++ b/src/components/Admin/index.jsx @@ -309,12 +309,10 @@ class Admin extends React.Component { <> -
- -
+

Overview

diff --git a/src/components/BudgetExpiryAlertAndModal/data/utils.js b/src/components/BudgetExpiryAlertAndModal/data/utils.js index 7c768010ad..dcc5d99be5 100644 --- a/src/components/BudgetExpiryAlertAndModal/data/utils.js +++ b/src/components/BudgetExpiryAlertAndModal/data/utils.js @@ -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, @@ -34,7 +34,7 @@ export const getExpirationMetadata = (endDateStr) => { export const isPlanApproachingExpiry = (endDateStr) => { const { thresholdKey, threshold } = getExpirationMetadata(endDateStr); - if (thresholdKey === null) { + if (!thresholdKey) { return false; }