From befc21744d00ff65001cf5edac891e094e6a2ffe Mon Sep 17 00:00:00 2001 From: Pontus Abrahamsson Date: Tue, 19 Dec 2023 10:16:21 +0100 Subject: [PATCH] Inbox --- .../[locale]/@dashboard/(root)/inbox/page.tsx | 20 ++++++++++++++ .../(root)/vault/[[...folders]]/page.tsx | 4 +-- .../dashboard/src/components/command-menu.tsx | 10 +++---- apps/dashboard/src/components/file-icon.tsx | 8 ------ apps/dashboard/src/components/main-menu.tsx | 5 ++++ .../tables/vault/data-table-row.tsx | 8 +----- .../components/tables/vault/empty-table.tsx | 27 ------------------- .../components/tables/vault/upload-zone.tsx | 2 +- apps/dashboard/src/locales/en.ts | 2 -- apps/dashboard/src/locales/sv.ts | 2 -- packages/supabase/src/queries/index.ts | 7 +---- packages/ui/src/components/icons.tsx | 2 ++ 12 files changed, 36 insertions(+), 61 deletions(-) create mode 100644 apps/dashboard/src/app/[locale]/@dashboard/(root)/inbox/page.tsx diff --git a/apps/dashboard/src/app/[locale]/@dashboard/(root)/inbox/page.tsx b/apps/dashboard/src/app/[locale]/@dashboard/(root)/inbox/page.tsx new file mode 100644 index 0000000000..e0b9d34ea0 --- /dev/null +++ b/apps/dashboard/src/app/[locale]/@dashboard/(root)/inbox/page.tsx @@ -0,0 +1,20 @@ +import { Icons } from "@midday/ui/icons"; + +export default function Inbox() { + return ( +
+
+ +
+

Work in progress

+

+ Nunc sit amet lectus quis mi vehicula lacinia nec +
non purus. Aliquam id rutrum magna. Duis +
convallis orci odio, sit amet vehicula tortor +
tincidunt quis. +

+
+
+
+ ); +} diff --git a/apps/dashboard/src/app/[locale]/@dashboard/(root)/vault/[[...folders]]/page.tsx b/apps/dashboard/src/app/[locale]/@dashboard/(root)/vault/[[...folders]]/page.tsx index f34efa6a57..dbc37cbc35 100644 --- a/apps/dashboard/src/app/[locale]/@dashboard/(root)/vault/[[...folders]]/page.tsx +++ b/apps/dashboard/src/app/[locale]/@dashboard/(root)/vault/[[...folders]]/page.tsx @@ -6,9 +6,7 @@ export const metadata: Metadata = { }; export default function Vault({ params }) { - const disableActions = ["transactions", "inbox", "exports"].includes( - params?.folders?.at(0) - ); + const disableActions = ["exports"].includes(params?.folders?.at(0)); return ; } diff --git a/apps/dashboard/src/components/command-menu.tsx b/apps/dashboard/src/components/command-menu.tsx index bd03ae8a9f..96cf8f39bf 100644 --- a/apps/dashboard/src/components/command-menu.tsx +++ b/apps/dashboard/src/components/command-menu.tsx @@ -25,6 +25,11 @@ const navigation = [ path: "/", icon: Icons.Overview, }, + { + name: "Inbox", + path: "/inbox", + icon: Icons.Inbox2, + }, { name: "Transactions", path: "/transactions", @@ -45,11 +50,6 @@ const navigation = [ path: "/vault", icon: Icons.Files, }, - { - name: "Inbox", - path: "/vault/inbox", - icon: Icons.FolderSpecial, - }, { name: "Exports", path: "/vault/exports", diff --git a/apps/dashboard/src/components/file-icon.tsx b/apps/dashboard/src/components/file-icon.tsx index 6252d66692..78cff36488 100644 --- a/apps/dashboard/src/components/file-icon.tsx +++ b/apps/dashboard/src/components/file-icon.tsx @@ -5,14 +5,6 @@ export function FileIcon({ mimetype, name, isFolder }) { return ; } - if (name === "inbox") { - return ; - } - - if (name === "transactions") { - return ; - } - if (mimetype?.startsWith("image")) { return ; } diff --git a/apps/dashboard/src/components/main-menu.tsx b/apps/dashboard/src/components/main-menu.tsx index 67d2adc956..1e16d71cc7 100644 --- a/apps/dashboard/src/components/main-menu.tsx +++ b/apps/dashboard/src/components/main-menu.tsx @@ -15,6 +15,11 @@ export function MainMenu() { name: "Overview", icon: () => , }, + { + path: "/inbox", + name: "Inbox", + icon: () => , + }, { path: "/transactions", name: "Transactions", diff --git a/apps/dashboard/src/components/tables/vault/data-table-row.tsx b/apps/dashboard/src/components/tables/vault/data-table-row.tsx index 3115d8ff60..962180b34d 100644 --- a/apps/dashboard/src/components/tables/vault/data-table-row.tsx +++ b/apps/dashboard/src/components/tables/vault/data-table-row.tsx @@ -59,10 +59,6 @@ export const translatedFolderName = (t: any, folder: string) => { switch (folder) { case "all": return t("folders.all"); - case "inbox": - return t("folders.inbox"); - case "transactions": - return t("folders.transactions"); case "exports": return t("folders.exports"); default: @@ -123,9 +119,7 @@ export function DataTableRow({ data, teamId }) { const { deleteItem, createFolder } = useVaultContext((s) => s); const folders = params?.folders ?? []; - const isDefaultFolder = ["inbox", "exports", "transactions"].includes( - data.name - ); + const isDefaultFolder = ["exports"].includes(data.name); const disableActions = ["transactions"].includes(folders?.at(0)); const folderPath = folders.join("/"); diff --git a/apps/dashboard/src/components/tables/vault/empty-table.tsx b/apps/dashboard/src/components/tables/vault/empty-table.tsx index d6bcb44ac0..1098c8c0cd 100644 --- a/apps/dashboard/src/components/tables/vault/empty-table.tsx +++ b/apps/dashboard/src/components/tables/vault/empty-table.tsx @@ -4,19 +4,6 @@ type Props = { export function EmptyTable({ type }: Props) { switch (type) { - case "inbox": - return ( -
-
-

This is your inbox

-

- Everything that will be sent to your
- Midday email will end up here. -

-
-
- ); - case "exports": return (
@@ -30,20 +17,6 @@ export function EmptyTable({ type }: Props) {
); - case "transactions": - return ( -
-
-

Transactions

-

- This is where your attachments for -
- transactions will end up. -

-
-
- ); - default: return (
diff --git a/apps/dashboard/src/components/tables/vault/upload-zone.tsx b/apps/dashboard/src/components/tables/vault/upload-zone.tsx index a1e9a518fb..70d2457e93 100644 --- a/apps/dashboard/src/components/tables/vault/upload-zone.tsx +++ b/apps/dashboard/src/components/tables/vault/upload-zone.tsx @@ -28,7 +28,7 @@ export function UploadZone({ children }) { const { toast, dismiss, update } = useToast(); const { createFolder } = useVaultContext((s) => s); - const isDefaultFolder = ["inbox", "exports"].includes(folders.at(0)); + const isDefaultFolder = ["exports"].includes(folders.at(0)); useEffect(() => { if (!toastId && showProgress) { diff --git a/apps/dashboard/src/locales/en.ts b/apps/dashboard/src/locales/en.ts index d8f4f806d4..8e3463e7c8 100644 --- a/apps/dashboard/src/locales/en.ts +++ b/apps/dashboard/src/locales/en.ts @@ -49,8 +49,6 @@ export default { folders: { all: "All", exports: "Exports", - inbox: "Inbox", - transactions: "Transactions", }, mfa_status: { verified: "Verified", diff --git a/apps/dashboard/src/locales/sv.ts b/apps/dashboard/src/locales/sv.ts index d98487ef47..9a7bca958b 100644 --- a/apps/dashboard/src/locales/sv.ts +++ b/apps/dashboard/src/locales/sv.ts @@ -49,8 +49,6 @@ export default { folders: { all: "Alla", exports: "Exporteringar", - inbox: "Inbox", - transactions: "Transaktioner", }, mfa_status: { verified: "Verifierad", diff --git a/packages/supabase/src/queries/index.ts b/packages/supabase/src/queries/index.ts index 92995229bf..4ffa186c2c 100644 --- a/packages/supabase/src/queries/index.ts +++ b/packages/supabase/src/queries/index.ts @@ -508,12 +508,7 @@ type GetVaultParams = { export async function getVaultQuery(supabase: Client, params: GetVaultParams) { const { teamId, path } = params; - const defaultFolders = path - ? [] - : [ - { name: "inbox", isFolder: true }, - { name: "exports", isFolder: true }, - ]; + const defaultFolders = path ? [] : [{ name: "exports", isFolder: true }]; let basePath = teamId; diff --git a/packages/ui/src/components/icons.tsx b/packages/ui/src/components/icons.tsx index 0c5cd855f8..e5e78fb9e7 100644 --- a/packages/ui/src/components/icons.tsx +++ b/packages/ui/src/components/icons.tsx @@ -31,6 +31,7 @@ import { MdOutlineDifference, MdOutlineFileDownload, MdOutlineHandyman, + MdOutlineInbox, MdOutlineInsertPhoto, MdOutlineIntegrationInstructions, MdOutlineInventory2, @@ -139,6 +140,7 @@ export const Icons = { ), Settings: MdOutlineTune, Inbox: ArchiveIcon, + Inbox2: MdOutlineInbox, Check: (props: any) => (