Skip to content

Commit

Permalink
enhancement(TransactionImport): don't show unwanted keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Dec 10, 2024
1 parent d33b3b3 commit f2f7f35
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { isEmpty, startCase } from 'lodash';
import { isEmpty, omit, startCase } from 'lodash';
import { ExternalLink } from 'lucide-react';
import { isURL } from 'validator';

Expand Down Expand Up @@ -64,15 +64,19 @@ const filterEmptyValues = value => {
return Object.fromEntries(
Object.entries(value)
.map(([key, value]) => [key, filterEmptyValues(value)])
.filter(([, value]) => !isEmpty(value)),
.filter(([value]) => !isEmpty(value)),
);
}

return value;
};

const removeUnwantedKeys = value => {
return omit(value, ['personal_finance_category_icon_url']);
};

export const TransactionsImportRowDataLine = ({ value, labelKey, level = 0 }) => {
const cleanValue = React.useMemo(() => filterEmptyValues(value), [value]);
const cleanValue = React.useMemo(() => filterEmptyValues(removeUnwantedKeys(value)), [value]);
if (!cleanValue) {
return null;
}
Expand Down

0 comments on commit f2f7f35

Please sign in to comment.