mirror of
https://github.com/penpot/penpot.git
synced 2025-05-20 03:26:11 +02:00
🐛 Fix deleted files appear in search results
This commit is contained in:
parent
d0ab0bccb9
commit
91e81823a5
2 changed files with 24 additions and 20 deletions
|
@ -59,7 +59,8 @@
|
||||||
(assert (fn? on-edit) "missing `on-edit` prop")
|
(assert (fn? on-edit) "missing `on-edit` prop")
|
||||||
(assert (fn? on-menu-close) "missing `on-menu-close` prop")
|
(assert (fn? on-menu-close) "missing `on-menu-close` prop")
|
||||||
(assert (boolean? navigate?) "missing `navigate?` prop")
|
(assert (boolean? navigate?) "missing `navigate?` prop")
|
||||||
(let [is-lib-page? (= :libraries origin)
|
(let [is-lib-page? (= :libraries origin)
|
||||||
|
is-search-page? (= :search origin)
|
||||||
top (or top 0)
|
top (or top 0)
|
||||||
left (or left 0)
|
left (or left 0)
|
||||||
|
|
||||||
|
@ -264,28 +265,30 @@
|
||||||
[{:option-name (tr "dashboard.open-in-new-tab")
|
[{:option-name (tr "dashboard.open-in-new-tab")
|
||||||
:id "file-open-new-tab"
|
:id "file-open-new-tab"
|
||||||
:option-handler on-new-tab}
|
:option-handler on-new-tab}
|
||||||
{:option-name (tr "labels.rename")
|
(when (not is-search-page?)
|
||||||
:id "file-rename"
|
{:option-name (tr "labels.rename")
|
||||||
:option-handler on-edit
|
:id "file-rename"
|
||||||
:data-test "file-rename"}
|
:option-handler on-edit
|
||||||
{:option-name (tr "dashboard.duplicate")
|
:data-test "file-rename"}
|
||||||
:id "file-duplicate"
|
{:option-name (tr "dashboard.duplicate")
|
||||||
:option-handler on-duplicate
|
:id "file-duplicate"
|
||||||
:data-test "file-duplicate"}
|
:option-handler on-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")
|
{:option-name (tr "dashboard.move-to")
|
||||||
:id "file-move-to"
|
:id "file-move-to"
|
||||||
:sub-options sub-options
|
:sub-options sub-options
|
||||||
:data-test "file-move-to"})
|
:data-test "file-move-to"})
|
||||||
(if (:is-shared file)
|
(when (not is-search-page?)
|
||||||
{:option-name (tr "dashboard.unpublish-shared")
|
(if (:is-shared file)
|
||||||
:id "file-del-shared"
|
{:option-name (tr "dashboard.unpublish-shared")
|
||||||
:option-handler on-del-shared
|
:id "file-del-shared"
|
||||||
:data-test "file-del-shared"}
|
:option-handler on-del-shared
|
||||||
{:option-name (tr "dashboard.add-shared")
|
:data-test "file-del-shared"}
|
||||||
:id "file-add-shared"
|
{:option-name (tr "dashboard.add-shared")
|
||||||
:option-handler on-add-shared
|
:id "file-add-shared"
|
||||||
:data-test "file-add-shared"})
|
:option-handler on-add-shared
|
||||||
|
:data-test "file-add-shared"}))
|
||||||
{:option-name :separator}
|
{:option-name :separator}
|
||||||
{:option-name (tr "dashboard.download-binary-file")
|
{:option-name (tr "dashboard.download-binary-file")
|
||||||
:id "file-download-binary"
|
:id "file-download-binary"
|
||||||
|
@ -295,7 +298,7 @@
|
||||||
:id "file-download-standard"
|
:id "file-download-standard"
|
||||||
:option-handler on-export-standard-files
|
:option-handler on-export-standard-files
|
||||||
:data-test "download-standard-file"}
|
: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 :separator}
|
||||||
{:option-name (tr "labels.delete")
|
{:option-name (tr "labels.delete")
|
||||||
:id "file-delete"
|
:id "file-delete"
|
||||||
|
|
|
@ -87,4 +87,5 @@
|
||||||
:else
|
:else
|
||||||
[:& grid {:files result
|
[:& grid {:files result
|
||||||
:hide-new? true
|
:hide-new? true
|
||||||
|
:origin :search
|
||||||
:limit limit}])]]))
|
:limit limit}])]]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue