From 0085215000b39621fc9ba6661d629e960808740c Mon Sep 17 00:00:00 2001 From: iOSLife Date: Thu, 16 Nov 2023 09:34:46 -0500 Subject: [PATCH 1/5] add filter to not include hidden categories when adding transaction --- .../src/components/autocomplete/CategoryAutocomplete.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx index 267b657ca1a..9c640491c9e 100644 --- a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx @@ -46,7 +46,7 @@ function CategoryList({ ...(!embedded && { maxHeight: 175 }), }} > - {items.map((item, idx) => { + {items.filter(item => !item.hidden).map((item, idx) => { if (item.id === 'split') { return ( Date: Thu, 16 Nov 2023 09:42:13 -0500 Subject: [PATCH 2/5] adding release notes --- upcoming-release-notes/1914.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 upcoming-release-notes/1914.md diff --git a/upcoming-release-notes/1914.md b/upcoming-release-notes/1914.md new file mode 100644 index 00000000000..b96074f6663 --- /dev/null +++ b/upcoming-release-notes/1914.md @@ -0,0 +1,6 @@ +--- +category: Features +authors: iOSLife +--- + +Adds a filter on the item list in the CategoryAutocomplete component. This will prevent users from accidentally adding a transaction to a hidden category. \ No newline at end of file From c0171dabc0158692ce176966e6024002cc945077 Mon Sep 17 00:00:00 2001 From: iOSLife Date: Thu, 16 Nov 2023 09:47:21 -0500 Subject: [PATCH 3/5] addressing linting failure --- .../src/components/autocomplete/CategoryAutocomplete.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx index 9c640491c9e..b588ed4fb3a 100644 --- a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx @@ -46,7 +46,8 @@ function CategoryList({ ...(!embedded && { maxHeight: 175 }), }} > - {items.filter(item => !item.hidden).map((item, idx) => { + {items.filter(item => !item.hidden) + .map((item, idx) => { if (item.id === 'split') { return ( Date: Thu, 16 Nov 2023 09:47:26 -0500 Subject: [PATCH 4/5] making authors a list --- upcoming-release-notes/1914.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upcoming-release-notes/1914.md b/upcoming-release-notes/1914.md index b96074f6663..f8a9d0f20b7 100644 --- a/upcoming-release-notes/1914.md +++ b/upcoming-release-notes/1914.md @@ -1,6 +1,6 @@ --- category: Features -authors: iOSLife +authors: [iOSLife] --- Adds a filter on the item list in the CategoryAutocomplete component. This will prevent users from accidentally adding a transaction to a hidden category. \ No newline at end of file From e18fd5cc19cd84f7b0362f4371b6787b8b64c86a Mon Sep 17 00:00:00 2001 From: iOSLife Date: Thu, 16 Nov 2023 09:50:54 -0500 Subject: [PATCH 5/5] running yarn eslint --fix --- .../autocomplete/CategoryAutocomplete.tsx | 183 +++++++++--------- 1 file changed, 92 insertions(+), 91 deletions(-) diff --git a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx index b588ed4fb3a..9ab486b8350 100644 --- a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx @@ -46,103 +46,104 @@ function CategoryList({ ...(!embedded && { maxHeight: 175 }), }} > - {items.filter(item => !item.hidden) - .map((item, idx) => { - if (item.id === 'split') { - return ( - - - - - Split Transaction - - ); - } - - const showGroup = item.cat_group !== lastGroup; - lastGroup = item.cat_group; - return ( - - {showGroup && ( -
!item.hidden) + .map((item, idx) => { + if (item.id === 'split') { + return ( + - {`${item.group?.name}`} -
- )} -
- {item.name} -
-
- ); - })} + flexShrink: 0, + flexDirection: 'row', + alignItems: 'center', + fontSize: 11, + fontWeight: 500, + color: theme.noticeTextMenu, + padding: '6px 8px', + ':active': { + backgroundColor: 'rgba(100, 100, 100, .25)', + }, + }} + data-testid="split-transaction-button" + > + + + + Split Transaction +
+ ); + } + + const showGroup = item.cat_group !== lastGroup; + lastGroup = item.cat_group; + return ( + + {showGroup && ( +
+ {`${item.group?.name}`} +
+ )} +
+ {item.name} +
+
+ ); + })}
{footer}