Skip to content

Commit

Permalink
Remove all nonNulls
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Oct 14, 2024
1 parent feeffb8 commit d4e8b81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type FinancialAccountEntry {
currency: String
code: String
description: String
entryDate: ISO8601Date!
entryDate: ISO8601Date
type: String
category: FinancialAccountCategory!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ interface TransactionRow {
currency?: Maybe<string>;
expenseAmount?: Maybe<string>;
incomeAmount?: Maybe<string>;
entryDate: DateTime<boolean>;
entryDate: DateTime<boolean> | string;
}

const createTransactionRow = (
Expand All @@ -86,7 +86,9 @@ const createTransactionRow = (
...amounts,
categoryName: entry.category.name ?? entry.category.code ?? '',
categoryCode: entry.category.code ?? '',
entryDate: DateTime.fromISO(entry.entryDate),
entryDate: entry.entryDate
? DateTime.fromISO(entry.entryDate)
: 'No entry date',

Check warning on line 91 in src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactionTable/AccountTransactionTable.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactionTable/AccountTransactionTable.tsx#L90-L91

Added lines #L90 - L91 were not covered by tests
};
};

Expand Down Expand Up @@ -187,7 +189,11 @@ export const AccountTransactionTable: React.FC<TableProps> = ({
}, [entries, currency, openingBalance, closingBalance, activeFilters]);

const Date: RenderCell = ({ row }) => (
<Typography>{dateFormatShort(row.entryDate, locale)}</Typography>
<Typography>

Check warning on line 192 in src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactionTable/AccountTransactionTable.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactionTable/AccountTransactionTable.tsx#L192

Added line #L192 was not covered by tests
{typeof row.entryDate === 'string'
? row.entryDate
: dateFormatShort(row.entryDate, locale)}

Check warning on line 195 in src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactionTable/AccountTransactionTable.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactionTable/AccountTransactionTable.tsx#L194-L195

Added lines #L194 - L195 were not covered by tests
</Typography>
);
const Category: RenderCell = ({ row }) => (
<Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export const AccountTransactions: React.FC = () => {
];
const convertDataToArray = data.financialAccountEntries.entries.map(
(entry) => [
dateFormatShort(DateTime.fromISO(entry.entryDate), locale),
entry.entryDate
? dateFormatShort(DateTime.fromISO(entry.entryDate), locale)
: 'No entry date',

Check warning on line 125 in src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactions.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Reports/FinancialAccountsReport/AccountTransactions/AccountTransactions.tsx#L124-L125

Added lines #L124 - L125 were not covered by tests
entry.description ?? '',
entry.category?.name ?? entry.category?.code ?? '',
entry.type === FinancialAccountEntryTypeEnum.Debit
Expand Down

0 comments on commit d4e8b81

Please sign in to comment.