From 1470f7c18b71e95e8ce1230390ceebcbeb067082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Valderrama?= Date: Fri, 9 Jan 2026 11:50:25 +0100 Subject: [PATCH 1/2] :bug: Fix empty state message in trash page --- .../src/app/main/ui/dashboard/deleted.cljs | 60 ++++++++++--------- frontend/translations/en.po | 3 + frontend/translations/es.po | 3 + 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/frontend/src/app/main/ui/dashboard/deleted.cljs b/frontend/src/app/main/ui/dashboard/deleted.cljs index cd261fe748..cc3a3f5776 100644 --- a/frontend/src/app/main/ui/dashboard/deleted.cljs +++ b/frontend/src/app/main/ui/dashboard/deleted.cljs @@ -290,31 +290,37 @@ [:> menu* {:team-id team-id :section :dashboard-deleted}] - [:div {:class (stl/css :deleted-info-content)} - [:p {:class (stl/css :deleted-info)} - (tr "dashboard.trash-info-text-part1") - [:span {:class (stl/css :info-text-highlight)} - (tr "dashboard.trash-info-text-part2" deletion-days)] - (tr "dashboard.trash-info-text-part3") - [:br] - (tr "dashboard.trash-info-text-part4")] - [:div {:class (stl/css :deleted-options)} - [:> button* {:variant "ghost" - :type "button" - :on-click on-restore-all} - (tr "dashboard.restore-all-deleted-button")] - [:> button* {:variant "destructive" - :type "button" - :icon "delete" - :on-click on-delete-all} - (tr "dashboard.clear-trash-button")]]] + (if (seq projects) + [:* + [:div {:class (stl/css :deleted-info-content)} + [:p {:class (stl/css :deleted-info)} + (tr "dashboard.trash-info-text-part1") + [:span {:class (stl/css :info-text-highlight)} + (tr "dashboard.trash-info-text-part2" deletion-days)] + (tr "dashboard.trash-info-text-part3") + [:br] + (tr "dashboard.trash-info-text-part4")] + [:div {:class (stl/css :deleted-options)} + [:> button* {:variant "ghost" + :type "button" + :on-click on-restore-all} + (tr "dashboard.restore-all-deleted-button")] + [:> button* {:variant "destructive" + :type "button" + :icon "delete" + :on-click on-delete-all} + (tr "dashboard.clear-trash-button")]]] - (when projects - (for [{:keys [id] :as project} projects] - (let [files (when deleted-map - (->> (vals deleted-map) - (filterv #(= id (:project-id %))) - (sort-by :modified-at #(compare %2 %1))))] - [:> deleted-project-item* {:project project - :files files - :key id}])))]]]])) + (for [{:keys [id] :as project} projects] + (let [files (when deleted-map + (->> (vals deleted-map) + (filterv #(= id (:project-id %))) + (sort-by :modified-at #(compare %2 %1))))] + [:> deleted-project-item* {:project project + :files files + :key id}]))] + + ;; when no deleted projects + [:div {:class (stl/css :deleted-info-content)} + [:p {:class (stl/css :deleted-info)} + (tr "dashboard.trash-info-text-no-projects")]])]]]])) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 4d7822cbec..5376109045 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -8489,6 +8489,9 @@ msgstr "Restore project" msgid "dashboard.delete-project-button" msgstr "Delete project" +msgid "dashboard.trash-info-text-no-projects" +msgstr "Your trash is empty. Deleted files and projects will appear here." + msgid "dashboard.trash-info-text-part1" msgstr "Deleted files will remain in the trash for" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 3aa83e1bac..739065502e 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -8342,6 +8342,9 @@ msgstr "Restaurar proyecto" msgid "dashboard.delete-project-button" msgstr "Eliminar proyecto" +msgid "dashboard.trash-info-text-no-projects" +msgstr "Tu papelera está vacía. Los archivos y proyectos eliminados aparecerán aquí." + msgid "dashboard.trash-info-text-part1" msgstr "Los archivos eliminados permanecerán en la papelera durante" From c5341c0378255d65a2d293be4e3b0fd79bf095af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Valderrama?= Date: Fri, 9 Jan 2026 15:01:18 +0100 Subject: [PATCH 2/2] :paperclip: Update test --- frontend/playwright/ui/specs/dashboard-deleted.spec.js | 9 ++------- frontend/src/app/main/ui/dashboard/deleted.cljs | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/playwright/ui/specs/dashboard-deleted.spec.js b/frontend/playwright/ui/specs/dashboard-deleted.spec.js index 6963eac0d5..bacf85ae75 100644 --- a/frontend/playwright/ui/specs/dashboard-deleted.spec.js +++ b/frontend/playwright/ui/specs/dashboard-deleted.spec.js @@ -20,12 +20,7 @@ test.describe("Dashboard Deleted Page", () => { // Navigate directly to deleted page await dashboardPage.goToDeleted(); - // Check for the restore all and clear trash buttons - await expect( - page.getByRole("button", { name: "Restore All" }), - ).toBeVisible(); - await expect( - page.getByRole("button", { name: "Clear trash" }), - ).toBeVisible(); + // Check for the delete-page-section element + await expect(page.getByTestId("deleted-page-section")).toBeVisible(); }); }); diff --git a/frontend/src/app/main/ui/dashboard/deleted.cljs b/frontend/src/app/main/ui/dashboard/deleted.cljs index cc3a3f5776..91901f8770 100644 --- a/frontend/src/app/main/ui/dashboard/deleted.cljs +++ b/frontend/src/app/main/ui/dashboard/deleted.cljs @@ -284,7 +284,8 @@ [:* [:> header* {:team team}] - [:section {:class (stl/css :dashboard-container :no-bg)} + [:section {:class (stl/css :dashboard-container :no-bg) + :data-testid "deleted-page-section"} [:* [:div {:class (stl/css :no-bg)}