mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
🐛 Fix navigation on dashboard when file is moved to other team.
This commit is contained in:
parent
231a133f23
commit
376d0663c2
3 changed files with 25 additions and 16 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
- Remove unnecesary redirect from history when user goes to workspace from dashboard [Taiga 1820](https://tree.taiga.io/project/penpot/issue/1820).
|
||||
- Fix tooltip position on view application [Taiga 1819](https://tree.taiga.io/project/penpot/issue/1819).
|
||||
- Fix dashboard navigation on moving file to other team [Taiga 1817](https://tree.taiga.io/project/penpot/issue/1817).
|
||||
|
||||
### :arrow_up: Deps updates
|
||||
### :boom: Breaking changes
|
||||
|
|
|
@ -688,13 +688,19 @@
|
|||
|
||||
|
||||
(defn go-to-files
|
||||
[project-id]
|
||||
(ptk/reify ::go-to-files
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(let [team-id (:current-team-id state)]
|
||||
(rx/of (rt/nav :dashboard-files {:team-id team-id
|
||||
:project-id project-id}))))))
|
||||
([project-id]
|
||||
(ptk/reify ::go-to-files
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(let [team-id (:current-team-id state)]
|
||||
(rx/of (rt/nav :dashboard-files {:team-id team-id
|
||||
:project-id project-id}))))))
|
||||
([team-id project-id]
|
||||
(ptk/reify ::go-to-files
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(rx/of (rt/nav :dashboard-files {:team-id team-id
|
||||
:project-id project-id}))))))
|
||||
|
||||
(defn go-to-search
|
||||
([] (go-to-search nil))
|
||||
|
|
|
@ -72,19 +72,19 @@
|
|||
(:projects current-team))
|
||||
|
||||
on-new-tab
|
||||
(fn [event]
|
||||
(fn [_]
|
||||
(let [pparams {:project-id (:project-id file)
|
||||
:file-id (:id file)}
|
||||
qparams {:page-id (first (get-in file [:data :pages]))}]
|
||||
(st/emit! (rt/nav-new-window :workspace pparams qparams))))
|
||||
|
||||
on-duplicate
|
||||
(fn [event]
|
||||
(fn [_]
|
||||
(apply st/emit! (map dd/duplicate-file files))
|
||||
(st/emit! (dm/success (tr "dashboard.success-duplicate-file"))))
|
||||
|
||||
delete-fn
|
||||
(fn [event]
|
||||
(fn [_]
|
||||
(apply st/emit! (map dd/delete-file files))
|
||||
(st/emit! (dm/success (tr "dashboard.success-delete-file"))))
|
||||
|
||||
|
@ -111,16 +111,18 @@
|
|||
(st/emit! (dm/success (tr "dashboard.success-move-files")))
|
||||
(st/emit! (dm/success (tr "dashboard.success-move-file"))))
|
||||
(if (or navigate? (not= team-id current-team-id))
|
||||
(st/emit! (dd/go-to-files project-id))
|
||||
(st/emit! (dd/go-to-files team-id project-id))
|
||||
(st/emit! (dd/fetch-recent-files)
|
||||
(dd/clear-selected-files))))
|
||||
|
||||
on-move
|
||||
(fn [team-id project-id]
|
||||
(let [data {:ids (set (map :id files))
|
||||
:project-id project-id}
|
||||
mdata {:on-success #(on-move-success team-id project-id)}]
|
||||
(st/emitf (dd/move-files (with-meta data mdata)))))
|
||||
(let [params {:ids (set (map :id files))
|
||||
:project-id project-id}]
|
||||
(fn []
|
||||
(st/emit! (dd/move-files
|
||||
(with-meta params
|
||||
{:on-success #(on-move-success team-id project-id)}))))))
|
||||
|
||||
add-shared
|
||||
(st/emitf (dd/set-file-shared (assoc file :is-shared true)))
|
||||
|
@ -155,7 +157,7 @@
|
|||
:on-accept del-shared})))
|
||||
|
||||
on-export-files
|
||||
(fn [event]
|
||||
(fn [_]
|
||||
(->> (uw/ask-many!
|
||||
{:cmd :export-file
|
||||
:team-id current-team-id
|
||||
|
|
Loading…
Reference in a new issue