From bf6bf49afb40a08ca774b82b6ea1fda0c0aa41aa Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Wed, 25 Dec 2024 19:15:48 +0100 Subject: [PATCH 01/15] fix: Calling for transfer tx with nullish argument --- src/composable/data-queries/opposite-tx-record.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/composable/data-queries/opposite-tx-record.ts b/src/composable/data-queries/opposite-tx-record.ts index 53ab1e1..a9c9cdb 100644 --- a/src/composable/data-queries/opposite-tx-record.ts +++ b/src/composable/data-queries/opposite-tx-record.ts @@ -16,6 +16,7 @@ export function useOppositeTxRecord(transaction) { const { data: oppositeTransferTransaction } = useQuery({ queryKey: [BASE_QUERY_KEY, transaction.id, transaction.transferId], queryFn: async () => { + if (!transaction.transferId) return null; const transactions = await loadTransactionsByTransferId(transaction.transferId); if (!transactions) return null; return transactions.find((item) => item.id !== transaction.id) || null; From 3358228dc48694f1870c5ff520e1fb288ad83cd5 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Wed, 25 Dec 2024 19:25:57 +0100 Subject: [PATCH 02/15] fix: Set `maxDate` on tx creation date selector --- backend | 2 +- .../dialogs/manage-transaction/dialog-content.vue | 3 +++ src/components/lib/ui/calendar/Calendar.vue | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/backend b/backend index d7c9979..7fb1535 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit d7c997976c4c420102d6644512e1945487694f4c +Subproject commit 7fb15358489a627452885dd822b1031cf5995d48 diff --git a/src/components/dialogs/manage-transaction/dialog-content.vue b/src/components/dialogs/manage-transaction/dialog-content.vue index 7163427..6cfd0a9 100644 --- a/src/components/dialogs/manage-transaction/dialog-content.vue +++ b/src/components/dialogs/manage-transaction/dialog-content.vue @@ -503,6 +503,9 @@ onUnmounted(() => { v-model="form.time" :disabled="isFormFieldsDisabled || isRecordExternal" label="Datetime" + :calendar-options="{ + maxDate: new Date(), + }" /> diff --git a/src/components/lib/ui/calendar/Calendar.vue b/src/components/lib/ui/calendar/Calendar.vue index dc5fd76..115cea6 100644 --- a/src/components/lib/ui/calendar/Calendar.vue +++ b/src/components/lib/ui/calendar/Calendar.vue @@ -181,6 +181,13 @@ const vCalendarSlots = computed(() => .calendar .vc-day-content:not(.vc-highlight-content-light) { @apply rounded-md; } +.calendar .vc-day-content.vc-disabled { + @apply cursor-not-allowed; +} +.calendar .vc-day-content.vc-disabled:hover { + // prevent hover state for disabled item + @apply bg-transparent opacity-50 text-muted-foreground; +} .calendar .is-not-in-month:not(:has(.vc-highlight-content-solid)):not( :has(.vc-highlight-content-light) From 9a90ce173cc63ab477412cd2ea8cbb5a17008af8 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Mon, 30 Dec 2024 22:15:25 +0100 Subject: [PATCH 03/15] fix: Improve subcategories settings displaying --- src/pages/settings/subpages/categories/index.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/settings/subpages/categories/index.vue b/src/pages/settings/subpages/categories/index.vue index 5a042bf..eb2e641 100644 --- a/src/pages/settings/subpages/categories/index.vue +++ b/src/pages/settings/subpages/categories/index.vue @@ -44,7 +44,7 @@ @@ -116,6 +119,7 @@ defineOptions({ name: "settings-categories", }); const categoriesStore = useCategoriesStore(); +const MAX_CATEGORIES_NESTING = 3; const { addErrorNotification, addSuccessNotification } = useNotificationCenter(); const { formattedCategories } = storeToRefs(categoriesStore); @@ -186,7 +190,7 @@ const applyChanges = async () => { } }; const selectCategory = (category: FormattedCategory) => { - if (categoryLevelCount.value === 2) return; + if (categoryLevelCount.value >= MAX_CATEGORIES_NESTING - 1) return; closeForm(); selectedCategory.value = category; From a01be46c3517f7c8af19d3029a0d435edfe29435 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Mon, 30 Dec 2024 22:15:34 +0100 Subject: [PATCH 04/15] chore: bump backend --- backend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend b/backend index 7fb1535..c05dc58 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 7fb15358489a627452885dd822b1031cf5995d48 +Subproject commit c05dc580f578c5604fa0d71fe029093dfa8d5bd4 From 545e210bb64f9c9508764b30ebd30b79ece856b3 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Mon, 30 Dec 2024 22:26:55 +0100 Subject: [PATCH 05/15] feat: Add Sheet component --- src/components/lib/ui/sheet/Sheet.vue | 19 ++++++ src/components/lib/ui/sheet/SheetClose.vue | 11 ++++ src/components/lib/ui/sheet/SheetContent.vue | 61 +++++++++++++++++++ .../lib/ui/sheet/SheetDescription.vue | 23 +++++++ src/components/lib/ui/sheet/SheetFooter.vue | 12 ++++ src/components/lib/ui/sheet/SheetHeader.vue | 12 ++++ src/components/lib/ui/sheet/SheetTitle.vue | 23 +++++++ src/components/lib/ui/sheet/SheetTrigger.vue | 11 ++++ src/components/lib/ui/sheet/index.ts | 31 ++++++++++ 9 files changed, 203 insertions(+) create mode 100644 src/components/lib/ui/sheet/Sheet.vue create mode 100644 src/components/lib/ui/sheet/SheetClose.vue create mode 100644 src/components/lib/ui/sheet/SheetContent.vue create mode 100644 src/components/lib/ui/sheet/SheetDescription.vue create mode 100644 src/components/lib/ui/sheet/SheetFooter.vue create mode 100644 src/components/lib/ui/sheet/SheetHeader.vue create mode 100644 src/components/lib/ui/sheet/SheetTitle.vue create mode 100644 src/components/lib/ui/sheet/SheetTrigger.vue create mode 100644 src/components/lib/ui/sheet/index.ts diff --git a/src/components/lib/ui/sheet/Sheet.vue b/src/components/lib/ui/sheet/Sheet.vue new file mode 100644 index 0000000..014bccb --- /dev/null +++ b/src/components/lib/ui/sheet/Sheet.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetClose.vue b/src/components/lib/ui/sheet/SheetClose.vue new file mode 100644 index 0000000..bc3b70a --- /dev/null +++ b/src/components/lib/ui/sheet/SheetClose.vue @@ -0,0 +1,11 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetContent.vue b/src/components/lib/ui/sheet/SheetContent.vue new file mode 100644 index 0000000..f4777e5 --- /dev/null +++ b/src/components/lib/ui/sheet/SheetContent.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetDescription.vue b/src/components/lib/ui/sheet/SheetDescription.vue new file mode 100644 index 0000000..b8c6aeb --- /dev/null +++ b/src/components/lib/ui/sheet/SheetDescription.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetFooter.vue b/src/components/lib/ui/sheet/SheetFooter.vue new file mode 100644 index 0000000..715026a --- /dev/null +++ b/src/components/lib/ui/sheet/SheetFooter.vue @@ -0,0 +1,12 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetHeader.vue b/src/components/lib/ui/sheet/SheetHeader.vue new file mode 100644 index 0000000..6f0fbd6 --- /dev/null +++ b/src/components/lib/ui/sheet/SheetHeader.vue @@ -0,0 +1,12 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetTitle.vue b/src/components/lib/ui/sheet/SheetTitle.vue new file mode 100644 index 0000000..fbcbf3d --- /dev/null +++ b/src/components/lib/ui/sheet/SheetTitle.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/components/lib/ui/sheet/SheetTrigger.vue b/src/components/lib/ui/sheet/SheetTrigger.vue new file mode 100644 index 0000000..7872f1c --- /dev/null +++ b/src/components/lib/ui/sheet/SheetTrigger.vue @@ -0,0 +1,11 @@ + + + diff --git a/src/components/lib/ui/sheet/index.ts b/src/components/lib/ui/sheet/index.ts new file mode 100644 index 0000000..c0908dc --- /dev/null +++ b/src/components/lib/ui/sheet/index.ts @@ -0,0 +1,31 @@ +import { cva, type VariantProps } from "class-variance-authority"; + +export { default as Sheet } from "./Sheet.vue"; +export { default as SheetClose } from "./SheetClose.vue"; +export { default as SheetContent } from "./SheetContent.vue"; +export { default as SheetDescription } from "./SheetDescription.vue"; +export { default as SheetFooter } from "./SheetFooter.vue"; +export { default as SheetHeader } from "./SheetHeader.vue"; +export { default as SheetTitle } from "./SheetTitle.vue"; +export { default as SheetTrigger } from "./SheetTrigger.vue"; + +export const sheetVariants = cva( + "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", + { + variants: { + side: { + top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", + bottom: + "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", + left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", + right: + "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", + }, + }, + defaultVariants: { + side: "right", + }, + }, +); + +export type SheetVariants = VariantProps; From fb3abcbfe3719152bdcfc7e3f60879b065c03f45 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Mon, 30 Dec 2024 22:53:13 +0100 Subject: [PATCH 06/15] feat: Add response to opened account creation popover --- src/components/sidebar/accounts-view/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/sidebar/accounts-view/index.vue b/src/components/sidebar/accounts-view/index.vue index 53580a1..9f6882b 100644 --- a/src/components/sidebar/accounts-view/index.vue +++ b/src/components/sidebar/accounts-view/index.vue @@ -64,7 +64,7 @@ const isPopoverOpen = ref(false); From ef8c056d0091aad49ffb82f6a888b494c82bf572 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Mon, 30 Dec 2024 23:25:22 +0100 Subject: [PATCH 07/15] feat: Add sheet for mobile view on dashboard --- .../dialogs/create-account-dialog.vue | 2 + src/components/lib/ui/sheet/SheetContent.vue | 16 +++- .../sidebar/accounts-view/index.vue | 2 +- src/components/sidebar/index.vue | 6 +- src/components/sidebar/navigation-links.vue | 2 +- src/components/ui-header.vue | 83 ++++++++++++++----- src/composable/global-state/mobile-sheet.ts | 3 + src/layouts/dashboard.vue | 10 ++- src/stores/auth.ts | 2 + 9 files changed, 94 insertions(+), 32 deletions(-) create mode 100644 src/composable/global-state/mobile-sheet.ts diff --git a/src/components/dialogs/create-account-dialog.vue b/src/components/dialogs/create-account-dialog.vue index 443e463..3ae3aa2 100644 --- a/src/components/dialogs/create-account-dialog.vue +++ b/src/components/dialogs/create-account-dialog.vue @@ -1,6 +1,7 @@ diff --git a/src/components/lib/ui/sheet/SheetContent.vue b/src/components/lib/ui/sheet/SheetContent.vue index f4777e5..0f23a83 100644 --- a/src/components/lib/ui/sheet/SheetContent.vue +++ b/src/components/lib/ui/sheet/SheetContent.vue @@ -1,6 +1,6 @@