mirror of
https://github.com/penpot/penpot.git
synced 2026-08-26 14:48:43 +00:00
🐛 Fix grid item date tooltip showing deletion text on non-deleted files (#11161)
The grid-item-metadata* component always used :will-be-deleted-at (falling back to :modified-at) and always showed the "Will be deleted %s" tooltip, even for files in the Recent tab that have no deletion date. Now the component branches on the presence of :will-be-deleted-at: - Deleted files: show the deletion timeago with the existing "Will be deleted %s" tooltip. - Regular files: show :modified-at timeago with a new "Last modified %s" tooltip key (dashboard.grid.last-modified-at). Closes #10873 Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
7f2dc66e86
commit
b4bc3dfe6a
@ -239,12 +239,18 @@
|
|||||||
(mf/defc grid-item-metadata*
|
(mf/defc grid-item-metadata*
|
||||||
{::mf/private true}
|
{::mf/private true}
|
||||||
[{:keys [file layout]}]
|
[{:keys [file layout]}]
|
||||||
(let [time (ct/timeago (or (:will-be-deleted-at file)
|
(let [deleted-at (:will-be-deleted-at file)
|
||||||
(:modified-at file)))]
|
date-class (stl/css-case :grid-item-date (= layout :grid)
|
||||||
[:span {:class (stl/css-case :grid-item-date (= layout :grid)
|
:list-item-date (= layout :list))]
|
||||||
:list-item-date (= layout :list))
|
(if deleted-at
|
||||||
:title (tr "dashboard.deleted.will-be-deleted-at" time)}
|
(let [time (ct/timeago deleted-at)]
|
||||||
time]))
|
[:span {:class date-class
|
||||||
|
:title (tr "dashboard.deleted.will-be-deleted-at" time)}
|
||||||
|
time])
|
||||||
|
(let [time (ct/timeago (:modified-at file))]
|
||||||
|
[:span {:class date-class
|
||||||
|
:title (tr "dashboard.grid.last-modified-at" time)}
|
||||||
|
time]))))
|
||||||
|
|
||||||
(defn create-counter-element
|
(defn create-counter-element
|
||||||
[_element file-count]
|
[_element file-count]
|
||||||
|
|||||||
@ -453,10 +453,14 @@ msgstr "Delete team"
|
|||||||
msgid "dashboard.deleted.empty-state-description"
|
msgid "dashboard.deleted.empty-state-description"
|
||||||
msgstr "Your trash is empty. Deleted files and projects will appear here."
|
msgstr "Your trash is empty. Deleted files and projects will appear here."
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/grid.cljs:247
|
#: src/app/main/ui/dashboard/grid.cljs:252
|
||||||
msgid "dashboard.deleted.will-be-deleted-at"
|
msgid "dashboard.deleted.will-be-deleted-at"
|
||||||
msgstr "Will be deleted %s"
|
msgstr "Will be deleted %s"
|
||||||
|
|
||||||
|
#: src/app/main/ui/dashboard/grid.cljs:256
|
||||||
|
msgid "dashboard.grid.last-modified-at"
|
||||||
|
msgstr "Last modified %s"
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/file_menu.cljs:329, src/app/main/ui/workspace/main_menu.cljs:732
|
#: src/app/main/ui/dashboard/file_menu.cljs:329, src/app/main/ui/workspace/main_menu.cljs:732
|
||||||
msgid "dashboard.download-binary-file"
|
msgid "dashboard.download-binary-file"
|
||||||
msgstr "Download Penpot file (.penpot)"
|
msgstr "Download Penpot file (.penpot)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user