From 4356f8ccc3ea44be111fb410f96b8f940f4c2779 Mon Sep 17 00:00:00 2001 From: Anthea Yur Date: Mon, 26 Feb 2024 09:26:34 -0600 Subject: [PATCH 1/4] Adjustment to amountRemaining data for 0.00 exact --- src/components/Budget/Budget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Budget/Budget.js b/src/components/Budget/Budget.js index c687ac0b..b9628ceb 100644 --- a/src/components/Budget/Budget.js +++ b/src/components/Budget/Budget.js @@ -31,9 +31,9 @@ const Budget = () => { console.error("Error fetching data:", error); } console.log("Fetched budgetData:", budgetsData); - const pctRemaining = Math.round(budgetsData?.budgets[0]?.pctRemaining) < 0 ? 0 : Math.round(budgetsData?.budgets[0]?.pctRemaining) || 'Loading...'; + const pctRemaining = Math.round(budgetsData?.budgets[0]?.pctRemaining) <= 0 ? 0 : Math.round(budgetsData?.budgets[0]?.pctRemaining) || 'Loading...'; const amount = budgetsData?.budgets[0]?.amount || 'Loading...'; - const amountRemaining = Math.round(budgetsData?.budgets[0]?.amountRemaining) || 'Loading...'; + const amountRemaining = Math.round(budgetsData?.budgets[0]?.amountRemaining) === 0 ? 0 : Math.round(budgetsData?.budgets[0]?.amountRemaining) || 'Loading...'; // State to manage dropdown visibility const [isDropdownVisible, setIsDropdownVisible] = useState(false); From fd86ddcc1dbbf6aeb6a3fe33cc7ec5ea837cea8f Mon Sep 17 00:00:00 2001 From: Anthea Yur Date: Mon, 26 Feb 2024 09:45:53 -0600 Subject: [PATCH 2/4] Include category into the transactions display with titleize --- src/components/TransactionsTable/TransactionsTable.js | 2 ++ src/components/apollo-client/queries/getTransactions.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src/components/TransactionsTable/TransactionsTable.js b/src/components/TransactionsTable/TransactionsTable.js index cca1d9b3..d8d8af57 100644 --- a/src/components/TransactionsTable/TransactionsTable.js +++ b/src/components/TransactionsTable/TransactionsTable.js @@ -19,6 +19,7 @@ const TransactionsTable = ({ transactions }) => { return ( {titleize(transaction.vendor)} + {titleize(transaction.category)} {transaction.date} {(transaction.amount / 100).toLocaleString('en-US', { style: 'currency', currency: 'USD' })} {titleize(transaction.status)} @@ -46,6 +47,7 @@ const TransactionsTable = ({ transactions }) => { Name + Category Date Amount Status diff --git a/src/components/apollo-client/queries/getTransactions.js b/src/components/apollo-client/queries/getTransactions.js index 38662402..cc5b9e02 100644 --- a/src/components/apollo-client/queries/getTransactions.js +++ b/src/components/apollo-client/queries/getTransactions.js @@ -8,6 +8,7 @@ query getTransactions($email: String!) { id amount date + category vendor status } From ebb9bd7302a481d427482cbe9b8ef1397a766506 Mon Sep 17 00:00:00 2001 From: Anthea Yur Date: Mon, 26 Feb 2024 10:02:51 -0600 Subject: [PATCH 3/4] Error handling for new Income with category --- src/components/TransactionsTable/TransactionsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TransactionsTable/TransactionsTable.js b/src/components/TransactionsTable/TransactionsTable.js index d8d8af57..879c26a0 100644 --- a/src/components/TransactionsTable/TransactionsTable.js +++ b/src/components/TransactionsTable/TransactionsTable.js @@ -19,7 +19,7 @@ const TransactionsTable = ({ transactions }) => { return ( {titleize(transaction.vendor)} - {titleize(transaction.category)} + {titleize(transaction.category || "Income")} {transaction.date} {(transaction.amount / 100).toLocaleString('en-US', { style: 'currency', currency: 'USD' })} {titleize(transaction.status)} From 7bc861344dd023a923209172c2ec861992df528c Mon Sep 17 00:00:00 2001 From: Anthea Yur Date: Mon, 26 Feb 2024 10:08:34 -0600 Subject: [PATCH 4/4] Add plural s to Income and Expense in Cashflow --- src/components/CashFlow/CashFlow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CashFlow/CashFlow.js b/src/components/CashFlow/CashFlow.js index 6fd81c4d..4f32fd86 100644 --- a/src/components/CashFlow/CashFlow.js +++ b/src/components/CashFlow/CashFlow.js @@ -12,11 +12,11 @@ const CashFlow = ({ cashFlow }) => {

Cash Flow

purple ellipse -

Income

+

Incomes

purple ellipse -

Expense

+

Expenses