Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Alejandro Alonso 2025-02-26 18:00:51 +01:00
commit 7885f413b8
13 changed files with 107 additions and 80 deletions

View file

@ -92,7 +92,6 @@
(update :comments-local assoc :open id))
(update :comments-local assoc :options nil)
(update :comments-local dissoc :draft)
(update :workspace-drawing dissoc :comment)
(update-in [:comments id] assoc (:id comment) comment))))
ptk/WatchEvent
@ -148,7 +147,6 @@
(update :comments-local assoc :open id)
(update :comments-local assoc :options nil)
(update :comments-local dissoc :draft)
(update :workspace-drawing dissoc :comment)
(update-in [:comments id] assoc (:id comment) comment))))
ptk/WatchEvent
@ -417,8 +415,8 @@
(->> (rp/cmd! :get-comment-threads {:file-id file-id :share-id share-id})
(rx/map comment-threads-fetched))
;; Refresh team members
(rx/of (dtm/fetch-members)))))))
(when (:workspace-local state)
(rx/of (dtm/fetch-members))))))))
(defn retrieve-comments
[thread-id]
@ -496,7 +494,7 @@
(-> state
(update :comments-local assoc :open id)
(update :comments-local assoc :options nil)
(update :workspace-drawing dissoc :comment)))))
(update :comments-local dissoc :draft)))))
(defn close-thread
[]
@ -504,8 +502,7 @@
ptk/UpdateEvent
(update [_ state]
(-> state
(update :comments-local dissoc :open :draft :options)
(update :workspace-drawing dissoc :comment)))))
(update :comments-local dissoc :open :draft :options)))))
(defn update-filters
[{:keys [mode show list] :as params}]
@ -546,7 +543,6 @@
ptk/UpdateEvent
(update [_ state]
(-> state
(update :workspace-drawing assoc :comment params)
(update :comments-local assoc :draft params)))))
(defn update-draft-thread
@ -555,7 +551,6 @@
ptk/UpdateEvent
(update [_ state]
(-> state
(d/update-in-when [:workspace-drawing :comment] merge data)
(d/update-in-when [:comments-local :draft] merge data)))))
(defn toggle-comment-options

View file

@ -171,7 +171,7 @@
(declare go-to-frame-auto)
(defn bundle-fetched
[{:keys [project file share-links libraries users permissions thumbnails] :as bundle}]
[{:keys [project file team share-links libraries users permissions thumbnails] :as bundle}]
(let [pages (->> (dm/get-in file [:data :pages])
(map (fn [page-id]
(let [data (get-in file [:data :pages-index page-id])]
@ -183,15 +183,19 @@
(ptk/reify ::bundle-fetched
ptk/UpdateEvent
(update [_ state]
(-> state
(assoc :share-links share-links)
(assoc :viewer {:libraries (d/index-by :id libraries)
:users (d/index-by :id users)
:permissions permissions
:project project
:pages pages
:thumbnails thumbnails
:file file})))
(let [team-id (:id team)
team {:members users}]
(-> state
(assoc :share-links share-links)
(assoc :current-team-id team-id)
(assoc :teams {team-id team})
(assoc :viewer {:libraries (d/index-by :id libraries)
:users (d/index-by :id users)
:permissions permissions
:project project
:pages pages
:thumbnails thumbnails
:file file}))))
ptk/WatchEvent
(watch [_ state _]

View file

@ -132,10 +132,11 @@
(defn- blank-content?
[content]
(or (str/blank? content)
(str/empty? content)
;; If only one char and it's the zero-width whitespace
(and (= 1 (count content)) (= (first content) zero-width-space))))
(let [content (str/trim content)]
(or (str/blank? content)
(str/empty? content)
(and (= (count content) 1)
(= (first content) zero-width-space)))))
;; Component that renders the component content
(mf/defc comment-content*

View file

@ -304,8 +304,7 @@
:page-id page-id
:file-id file-id
:vport vport
:zoom zoom
:drawing drawing}])
:zoom zoom}])
(when picking-color?
[:& pixel-overlay/pixel-overlay {:vport vport

View file

@ -16,7 +16,7 @@
[rumext.v2 :as mf]))
(mf/defc comments-layer*
[{:keys [vbox vport zoom drawing file-id page-id]}]
[{:keys [vbox vport zoom file-id page-id]}]
(let [vbox-x (dm/get-prop vbox :x)
vbox-y (dm/get-prop vbox :y)
vport-w (dm/get-prop vport :width)
@ -73,7 +73,7 @@
:viewport viewport
:zoom zoom}])))
(when-let [draft (:comment drawing)]
(when-let [draft (:draft local)]
[:> cmt/comment-floating-thread-draft*
{:draft draft
:on-cancel on-draft-cancel

View file

@ -345,8 +345,7 @@
[:> comments/comments-layer* {:vbox vbox
:page-id page-id
:vport vport
:zoom zoom
:drawing drawing}])
:zoom zoom}])
(when picking-color?
[:& pixel-overlay/pixel-overlay {:vport vport