From c2dfa9be83523a0615a82cf2cb5b64ef49e61c03 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 11 Apr 2024 00:45:47 +0200
Subject: [PATCH 01/20] Proof of concept for image preview
---
.../components/tasks/partials/attachments.vue | 28 +++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index 7aeabd531..03c6994c6 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -67,6 +67,12 @@
{{ a.file.mime }}
+
+
+
\ No newline at end of file
From 2ab6894542dd3d03a2dbca85ef2f85f2c88063c9 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 9 May 2024 11:51:54 +0200
Subject: [PATCH 03/20] Replace table with grid
---
.../components/tasks/partials/attachments.vue | 172 +++++++++---------
1 file changed, 88 insertions(+), 84 deletions(-)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index 36137d0be..dc21ac9c8 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -27,91 +27,89 @@
v-if="attachments.length > 0"
class="files"
>
-
-
-
-
- |
-
-
- {{ a.file.name }}
-
+
+
+
+
+
+ {{ a.file.name }}
+
+ {{ $t('task.attachment.usedAsCover') }}
+
+
+
+
+
- {{ $t('task.attachment.usedAsCover') }}
+
+ {{ formatDateSince(a.created) }}
+
+
+
+
+ {{ getHumanSize(a.file.size) }}
-
-
-
-
-
- {{ formatDateSince(a.created) }}
-
-
-
-
- {{ getHumanSize(a.file.size) }}
-
-
- {{ a.file.mime }}
-
-
-
-
- {{ $t('misc.download') }}
-
-
- {{ $t('task.attachment.copyUrl') }}
-
-
- {{ $t('misc.delete') }}
-
-
- {{
- task.coverImageAttachmentId === a.id
- ? $t('task.attachment.unsetAsCover')
- : $t('task.attachment.setAsCover')
- }}
-
-
-
- |
-
-
+
+ {{ a.file.mime }}
+
+
+
+
+ {{ $t('misc.download') }}
+
+
+ {{ $t('task.attachment.copyUrl') }}
+
+
+ {{ $t('misc.delete') }}
+
+
+ {{
+ task.coverImageAttachmentId === a.id
+ ? $t('task.attachment.unsetAsCover')
+ : $t('task.attachment.setAsCover')
+ }}
+
+
+
+
+
Date: Thu, 9 May 2024 12:29:27 +0200
Subject: [PATCH 04/20] Adjust file preview style
---
frontend/src/components/tasks/partials/file-preview.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/frontend/src/components/tasks/partials/file-preview.vue b/frontend/src/components/tasks/partials/file-preview.vue
index 5d15b9db4..6377cf028 100644
--- a/frontend/src/components/tasks/partials/file-preview.vue
+++ b/frontend/src/components/tasks/partials/file-preview.vue
@@ -2,6 +2,7 @@
@@ -29,6 +30,6 @@ watchEffect(async () => {
\ No newline at end of file
From 6fa15d30ad5d59940abf471f5fa1d72ae6680b0a Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Wed, 15 May 2024 23:55:26 +0200
Subject: [PATCH 05/20] Replace px with rem
---
frontend/src/components/tasks/partials/attachments.vue | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index dc21ac9c8..56e434745 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -446,11 +446,11 @@ async function setCoverImage(attachment: IAttachment | null) {
}
.preview-column {
- max-width: 125px;
+ max-width: 8rem;
}
.attachment-preview {
- max-height: 75px;
+ max-height: 4rem;
}
.clickable {
@@ -459,7 +459,7 @@ async function setCoverImage(attachment: IAttachment | null) {
.grid-item {
display: grid;
- grid-template-columns: 140px 1fr;
+ grid-template-columns: 9rem 1fr;
align-items: center;
}
From 2d3bf4c210de71ccf8348df8f8c97940a7aad895 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 16 May 2024 14:32:15 +0200
Subject: [PATCH 06/20] Move object-fit to styles
---
frontend/src/components/tasks/partials/file-preview.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/components/tasks/partials/file-preview.vue b/frontend/src/components/tasks/partials/file-preview.vue
index 6377cf028..0638dd75e 100644
--- a/frontend/src/components/tasks/partials/file-preview.vue
+++ b/frontend/src/components/tasks/partials/file-preview.vue
@@ -2,7 +2,6 @@
@@ -31,5 +30,6 @@ watchEffect(async () => {
\ No newline at end of file
From 4b4c7840e2dadaeabf1ebff939207329caca86d3 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 16 May 2024 14:32:29 +0200
Subject: [PATCH 07/20] Rename grid-item class to attachment
---
frontend/src/components/tasks/partials/attachments.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index 56e434745..38c511aa7 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -30,7 +30,7 @@
@@ -457,7 +457,7 @@ async function setCoverImage(attachment: IAttachment | null) {
cursor: pointer;
}
-.grid-item {
+.attachment {
display: grid;
grid-template-columns: 9rem 1fr;
align-items: center;
From 230fef3559dfd543c1030e2b4ac8fd762e88997e Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 16 May 2024 14:36:41 +0200
Subject: [PATCH 08/20] Attempt to fix attachment verification
---
frontend/cypress/e2e/task/task.spec.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/cypress/e2e/task/task.spec.ts b/frontend/cypress/e2e/task/task.spec.ts
index 5b6a4db03..de1a61c25 100644
--- a/frontend/cypress/e2e/task/task.spec.ts
+++ b/frontend/cypress/e2e/task/task.spec.ts
@@ -42,7 +42,7 @@ function uploadAttachmentAndVerify(taskId: number) {
.selectFile('cypress/fixtures/image.jpg', {force: true}) // The input is not visible, but on purpose
cy.wait('@uploadAttachment')
- cy.get('.attachments .attachments .files a.attachment')
+ cy.get('.attachments .attachments .files div.attachment')
.should('exist')
}
From 7664534618eb3b9f87021ec60eefd130aee3e784 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 16 May 2024 19:29:40 +0200
Subject: [PATCH 09/20] Change attachment div to button
---
.../components/tasks/partials/attachments.vue | 29 +++++++++----------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index 38c511aa7..392636c9f 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -27,10 +27,10 @@
v-if="attachments.length > 0"
class="files"
>
-
-
+
Date: Thu, 23 May 2024 10:26:15 +0200
Subject: [PATCH 10/20] Fix test again
---
frontend/cypress/e2e/task/task.spec.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/cypress/e2e/task/task.spec.ts b/frontend/cypress/e2e/task/task.spec.ts
index de1a61c25..2988ebb4f 100644
--- a/frontend/cypress/e2e/task/task.spec.ts
+++ b/frontend/cypress/e2e/task/task.spec.ts
@@ -42,7 +42,7 @@ function uploadAttachmentAndVerify(taskId: number) {
.selectFile('cypress/fixtures/image.jpg', {force: true}) // The input is not visible, but on purpose
cy.wait('@uploadAttachment')
- cy.get('.attachments .attachments .files div.attachment')
+ cy.get('.attachments .attachments .files button.attachment')
.should('exist')
}
From c80d77ca6982e4cdd55db9a4db7b81bffb0cc414 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Thu, 23 May 2024 10:26:42 +0200
Subject: [PATCH 11/20] Add width: 100%
---
frontend/src/components/tasks/partials/file-preview.vue | 1 +
1 file changed, 1 insertion(+)
diff --git a/frontend/src/components/tasks/partials/file-preview.vue b/frontend/src/components/tasks/partials/file-preview.vue
index 0638dd75e..ee2dc8d26 100644
--- a/frontend/src/components/tasks/partials/file-preview.vue
+++ b/frontend/src/components/tasks/partials/file-preview.vue
@@ -29,6 +29,7 @@ watchEffect(async () => {
\ No newline at end of file
From c2fc444bc002b8836968102592f13a3aa1adfec8 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Sat, 25 May 2024 11:40:00 +0200
Subject: [PATCH 17/20] Use file fallback icon
---
frontend/src/components/misc/Icon.ts | 2 ++
frontend/src/components/tasks/partials/file-preview.vue | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/frontend/src/components/misc/Icon.ts b/frontend/src/components/misc/Icon.ts
index 4e185f849..b105e271b 100644
--- a/frontend/src/components/misc/Icon.ts
+++ b/frontend/src/components/misc/Icon.ts
@@ -31,6 +31,7 @@ import {
faExclamation,
faEye,
faEyeSlash,
+ faFile,
faFileImage,
faFillDrip,
faFilter,
@@ -104,6 +105,7 @@ library.add(faUnlink)
library.add(faParagraph)
library.add(faSquareCheck)
library.add(faTable)
+library.add(faFile)
library.add(faFileImage)
library.add(faCheckSquare)
library.add(faStrikethrough)
diff --git a/frontend/src/components/tasks/partials/file-preview.vue b/frontend/src/components/tasks/partials/file-preview.vue
index 1512f3dd3..7e2fd9a63 100644
--- a/frontend/src/components/tasks/partials/file-preview.vue
+++ b/frontend/src/components/tasks/partials/file-preview.vue
@@ -13,7 +13,7 @@
>
From 8b066bf0e93eebba1539472f9a13a6bd2781af1f Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Sat, 25 May 2024 11:43:32 +0200
Subject: [PATCH 18/20] Add cover tooltips
---
frontend/src/components/tasks/partials/attachments.vue | 3 +++
1 file changed, 3 insertions(+)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index 042a444cc..ff2a25305 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -96,6 +96,9 @@
From 4eb0df256c389b5e40da31c1777952c26071e640 Mon Sep 17 00:00:00 2001
From: Elscrux
Date: Sat, 25 May 2024 12:06:23 +0200
Subject: [PATCH 19/20] Improve preview spacing
---
.../src/components/tasks/partials/attachments.vue | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index ff2a25305..9cbed8eb9 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -39,7 +39,7 @@
:model-value="a"
/>
-
+
{{ a.file.name }}
Date: Sat, 25 May 2024 13:45:26 +0200
Subject: [PATCH 20/20] Set attachment width to 100%
---
frontend/src/components/tasks/partials/attachments.vue | 1 +
1 file changed, 1 insertion(+)
diff --git a/frontend/src/components/tasks/partials/attachments.vue b/frontend/src/components/tasks/partials/attachments.vue
index 9cbed8eb9..5c6be0fe8 100644
--- a/frontend/src/components/tasks/partials/attachments.vue
+++ b/frontend/src/components/tasks/partials/attachments.vue
@@ -310,6 +310,7 @@ async function setCoverImage(attachment: IAttachment | null) {
display: grid;
grid-template-columns: 9rem 1fr;
align-items: center;
+ width: 100%;
padding: .5rem;