diff --git a/CHANGES.md b/CHANGES.md index 34b9cd52e..92a3e5e5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index eacc98c3a..8bdc4dafe 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -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)) diff --git a/frontend/src/app/main/ui/dashboard/file_menu.cljs b/frontend/src/app/main/ui/dashboard/file_menu.cljs index 27e35dab8..1dead8bf4 100644 --- a/frontend/src/app/main/ui/dashboard/file_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/file_menu.cljs @@ -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