From 089750ea3181f3c60a6a4ba701fb616311d42316 Mon Sep 17 00:00:00 2001 From: Delemangi Date: Sun, 16 Jun 2024 13:48:15 +0200 Subject: [PATCH 1/6] Refactor Signed-off-by: Delemangi --- .../src/lib/components/user/FileRow.svelte | 15 ++++++--- frontend/src/routes/+page.svelte | 2 +- frontend/src/routes/auth/login/+page.svelte | 28 +++++++++++++---- .../src/routes/auth/register/+page.svelte | 31 ++++++++++++++++--- frontend/src/routes/download/+page.svelte | 14 +++++++-- frontend/src/routes/user/2fa/+page.svelte | 14 ++++++--- frontend/src/routes/user/home/+page.svelte | 7 +++-- .../src/routes/user/webhooks/+page.svelte | 6 ++-- 8 files changed, 89 insertions(+), 28 deletions(-) diff --git a/frontend/src/lib/components/user/FileRow.svelte b/frontend/src/lib/components/user/FileRow.svelte index 36bbc38..b52f896 100644 --- a/frontend/src/lib/components/user/FileRow.svelte +++ b/frontend/src/lib/components/user/FileRow.svelte @@ -61,8 +61,14 @@ }); const downloadFile = () => { - if (file.encrypted) isDownloadWindowVisible = true; - else getFile(); + if (file.encrypted) { + isDownloadWindowVisible = true; + window.scrollTo(0, 0); + + return; + } + + getFile(); }; const getFile = async () => { @@ -308,7 +314,7 @@ {/if}
- + @@ -332,9 +338,10 @@ name="filepassword" bind:value={downloadFilePassword} placeholder="Password..." + required /> - diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 85b7e9f..916a49e 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,7 +1,7 @@ @@ -294,10 +301,39 @@ Share File + + + + + {#if currentUsername === usernameShare} + You cannot share files with yourself. + {/if} + + + + + + + + +
+ + Shared With {#if file.shared_people.length > 0} {#each file.shared_people as share} - - + + {share.username} @@ -312,17 +348,6 @@ {:else} This file is not yet shared with anyone. {/if} -
- - - - - - -
- - -
From 2021858b29c3acb581ce69c7f948be340ead6628 Mon Sep 17 00:00:00 2001 From: Delemangi Date: Sun, 16 Jun 2024 14:14:13 +0200 Subject: [PATCH 4/6] Truncate text Signed-off-by: Delemangi --- frontend/src/lib/components/user/WebhookRow.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/user/WebhookRow.svelte b/frontend/src/lib/components/user/WebhookRow.svelte index 35cbc82..7dba60c 100644 --- a/frontend/src/lib/components/user/WebhookRow.svelte +++ b/frontend/src/lib/components/user/WebhookRow.svelte @@ -59,10 +59,10 @@ - {webhook.platform} + {webhook.platform.length > 50 ? `${webhook.platform.slice(0, 50)}...` : webhook.platform} - {webhook.url} + {webhook.url.length > 50 ? `${webhook.url.slice(0, 50)}...` : webhook.url} From 8a1c14e2b58eba4bdcdf8a56952ac3272ad1cf10 Mon Sep 17 00:00:00 2001 From: Delemangi Date: Sun, 16 Jun 2024 14:14:25 +0200 Subject: [PATCH 5/6] Add padding Signed-off-by: Delemangi --- frontend/src/routes/download/+page.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/download/+page.svelte b/frontend/src/routes/download/+page.svelte index 278e98c..4d44fb4 100644 --- a/frontend/src/routes/download/+page.svelte +++ b/frontend/src/routes/download/+page.svelte @@ -165,6 +165,7 @@ bind:value={downloadFilePassword} required /> +
{/if}