🐛 Fix deleted files appear in search results

This commit is contained in:
Alejandro Alonso 2023-03-24 09:15:09 +01:00 committed by Alonso Torres
parent d0ab0bccb9
commit 91e81823a5
2 changed files with 24 additions and 20 deletions

View file

@ -60,6 +60,7 @@
(assert (fn? on-menu-close) "missing `on-menu-close` prop")
(assert (boolean? navigate?) "missing `navigate?` prop")
(let [is-lib-page? (= :libraries origin)
is-search-page? (= :search origin)
top (or top 0)
left (or left 0)
@ -264,6 +265,7 @@
[{:option-name (tr "dashboard.open-in-new-tab")
:id "file-open-new-tab"
:option-handler on-new-tab}
(when (not is-search-page?)
{:option-name (tr "labels.rename")
:id "file-rename"
:option-handler on-edit
@ -271,12 +273,13 @@
{:option-name (tr "dashboard.duplicate")
:id "file-duplicate"
:option-handler on-duplicate
:data-test "file-duplicate"}
(when (and (not is-lib-page?) (or (seq current-projects) (seq other-teams)))
:data-test "file-duplicate"})
(when (and (not is-lib-page?) (not is-search-page?) (or (seq current-projects) (seq other-teams)))
{:option-name (tr "dashboard.move-to")
:id "file-move-to"
:sub-options sub-options
:data-test "file-move-to"})
(when (not is-search-page?)
(if (:is-shared file)
{:option-name (tr "dashboard.unpublish-shared")
:id "file-del-shared"
@ -285,7 +288,7 @@
{:option-name (tr "dashboard.add-shared")
:id "file-add-shared"
:option-handler on-add-shared
:data-test "file-add-shared"})
:data-test "file-add-shared"}))
{:option-name :separator}
{:option-name (tr "dashboard.download-binary-file")
:id "file-download-binary"
@ -295,7 +298,7 @@
:id "file-download-standard"
:option-handler on-export-standard-files
:data-test "download-standard-file"}
(when (not is-lib-page?)
(when (and (not is-lib-page?) (not is-search-page?))
{:option-name :separator}
{:option-name (tr "labels.delete")
:id "file-delete"

View file

@ -87,4 +87,5 @@
:else
[:& grid {:files result
:hide-new? true
:origin :search
:limit limit}])]]))