From 13cb186c7037c895175aa4022ce45c3926b4a2f9 Mon Sep 17 00:00:00 2001 From: Eva Date: Thu, 13 Oct 2022 12:24:48 +0200 Subject: [PATCH 01/13] :lipstick: Update action icon --- frontend/resources/images/icons/actions.svg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/resources/images/icons/actions.svg b/frontend/resources/images/icons/actions.svg index 7e71052a5b..30eedf85b4 100644 --- a/frontend/resources/images/icons/actions.svg +++ b/frontend/resources/images/icons/actions.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + From ea15735372698b71158ca7e255f20ed37cd9a082 Mon Sep 17 00:00:00 2001 From: Eva Date: Tue, 11 Oct 2022 10:05:42 +0200 Subject: [PATCH 02/13] :bug: Fix loading placeholder --- .../resources/styles/main/partials/dashboard-grid.scss | 8 ++++++++ frontend/src/app/main/ui/dashboard/libraries.cljs | 7 ++++--- frontend/src/app/main/ui/dashboard/placeholder.cljs | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/resources/styles/main/partials/dashboard-grid.scss b/frontend/resources/styles/main/partials/dashboard-grid.scss index 0b3e344176..64341c9bb3 100644 --- a/frontend/resources/styles/main/partials/dashboard-grid.scss +++ b/frontend/resources/styles/main/partials/dashboard-grid.scss @@ -420,6 +420,14 @@ background-color: rgba(227, 227, 227, 0.3); padding: 13px; margin-right: 13px; + &.loader { + justify-items: center; + } + .icon { + display: flex; + align-items: center; + justify-content: center; + } &.libs { background-image: url(/images/ph-left.svg), url(/images/ph-right.svg); background-position: 15% bottom, 85% top; diff --git a/frontend/src/app/main/ui/dashboard/libraries.cljs b/frontend/src/app/main/ui/dashboard/libraries.cljs index a2590d53e4..73f33447e3 100644 --- a/frontend/src/app/main/ui/dashboard/libraries.cljs +++ b/frontend/src/app/main/ui/dashboard/libraries.cljs @@ -24,10 +24,11 @@ (let [files-map (mf/deref refs/dashboard-shared-files) projects (mf/deref refs/dashboard-projects) default-project (->> projects vals (d/seek :is-default)) - files (->> (vals files-map) + files (if (nil? files-map) + nil + (->> (vals files-map) (sort-by :modified-at) - (reverse) - (not-empty)) + (reverse))) components-v2 (features/use-feature :components-v2) diff --git a/frontend/src/app/main/ui/dashboard/placeholder.cljs b/frontend/src/app/main/ui/dashboard/placeholder.cljs index 6ea8f2a096..1f093d7d78 100644 --- a/frontend/src/app/main/ui/dashboard/placeholder.cljs +++ b/frontend/src/app/main/ui/dashboard/placeholder.cljs @@ -35,7 +35,7 @@ (mf/defc loading-placeholder [] - [:div.grid-empty-placeholder + [:div.grid-empty-placeholder.loader [:div.icon i/loader] [:div.text (tr "dashboard.loading-files")]]) From 00180f4fba47ede530c5e59e607dd2c97b20223a Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Thu, 13 Oct 2022 13:44:39 +0200 Subject: [PATCH 03/13] :bug: Fix boards grouped shouldn't show the title --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/viewport/widgets.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 32263914d1..d224681a48 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -41,6 +41,7 @@ - Fix ungroup does not work for typographies [Taiga #4195](https://tree.taiga.io/project/penpot/issue/4195) - Fix inviting to non existing users can fail [Taiga #4108](https://tree.taiga.io/project/penpot/issue/4108) - Fix components marked as touched when moved [Taiga #4061](https://tree.taiga.io/project/penpot/task/4061) +- Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs index 9b0447b0ac..1d85295f6e 100644 --- a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs @@ -167,7 +167,7 @@ [:g.frame-titles (for [frame frames] - (when (= (:frame-id frame) uuid/zero) + (when (= (:parent-id frame) uuid/zero) [:& frame-title {:key (dm/str "frame-title-" (:id frame)) :frame frame :selected? (contains? selected (:id frame)) From 1e07c16633ed0e8c643d1d8588330c4c0816c500 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Thu, 13 Oct 2022 12:55:32 +0200 Subject: [PATCH 04/13] :bug: Fix gradient handlers are under resize handlers --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/viewport.cljs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d224681a48..bccfd6bdb5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,7 @@ - Fix inviting to non existing users can fail [Taiga #4108](https://tree.taiga.io/project/penpot/issue/4108) - Fix components marked as touched when moved [Taiga #4061](https://tree.taiga.io/project/penpot/task/4061) - Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) +- Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 46ad6bdb9c..7a99dac295 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -337,11 +337,6 @@ :on-frame-leave on-frame-leave :on-frame-select on-frame-select}]) - (when show-gradient-handlers? - [:& gradients/gradient-handlers - {:id (first selected) - :zoom zoom}]) - (when show-draw-area? [:& drawarea/draw-area {:shape drawing-obj @@ -441,4 +436,9 @@ :zoom zoom :objects objects-modified :current-transform transform - :hover-disabled? hover-disabled?}])])]]])) + :hover-disabled? hover-disabled?}])]) + + (when show-gradient-handlers? + [:& gradients/gradient-handlers + {:id (first selected) + :zoom zoom}])]]])) From c690a71b3e5ff5e6a1ef04f70ffc3537dc06ef40 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 14 Oct 2022 12:26:59 +0200 Subject: [PATCH 05/13] :bug: Fix notification for newsletter shown in all cases --- CHANGES.md | 1 + frontend/src/app/main/ui/onboarding/newsletter.cljs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bccfd6bdb5..1a8aec34cd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -56,6 +56,7 @@ - Fix artboard border radius [Taiga #4291](https://tree.taiga.io/project/penpot/issue/4291) - Fix copied & pasted layer is not visible [Taiga #4283](https://tree.taiga.io/project/penpot/issue/4283) +- Fix notification to newsletter is shown in all cases [Taiga #4367](https://tree.taiga.io/project/penpot/issue/4367) ## 1.15.4-beta diff --git a/frontend/src/app/main/ui/onboarding/newsletter.cljs b/frontend/src/app/main/ui/onboarding/newsletter.cljs index 358ab0783a..27dd432ae1 100644 --- a/frontend/src/app/main/ui/onboarding/newsletter.cljs +++ b/frontend/src/app/main/ui/onboarding/newsletter.cljs @@ -30,9 +30,10 @@ (mf/use-callback (mf/deps @newsletter-updates @newsletter-news) (fn [] - (st/emit! (dm/success message) - (modal/show {:type :onboarding-team}) - (du/update-profile-props {:newsletter-updates @newsletter-updates :newsletter-news @newsletter-news}))))] + (st/emit! (when (or @newsletter-updates @newsletter-news) + (dm/success message)) + (modal/show {:type :onboarding-team}) + (du/update-profile-props {:newsletter-updates @newsletter-updates :newsletter-news @newsletter-news}))))] [:div.modal-overlay [:div.modal-container.onboarding.newsletter.animated.fadeInDown From 3395fcb697b33981ddc7c6fb734b40d14a628da7 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 14 Oct 2022 13:40:10 +0200 Subject: [PATCH 06/13] :tada: Show spinner while loading viewer file --- frontend/resources/styles/main/partials/viewer.scss | 6 ++++++ frontend/src/app/main/ui/viewer.cljs | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/resources/styles/main/partials/viewer.scss b/frontend/resources/styles/main/partials/viewer.scss index 784141c4b3..97d6c77d08 100644 --- a/frontend/resources/styles/main/partials/viewer.scss +++ b/frontend/resources/styles/main/partials/viewer.scss @@ -25,6 +25,12 @@ } } +.viewer-loader { + svg#loader-pencil { + fill: $color-gray-50; + } +} + .viewer-section { height: calc(100vh - 48px); grid-row: 1 / span 2; diff --git a/frontend/src/app/main/ui/viewer.cljs b/frontend/src/app/main/ui/viewer.cljs index 99762cf733..ce5eb322ad 100644 --- a/frontend/src/app/main/ui/viewer.cljs +++ b/frontend/src/app/main/ui/viewer.cljs @@ -534,9 +534,11 @@ (fn [] (st/emit! (dv/finalize props))))) - (when-let [data (mf/deref refs/viewer-data)] + (if-let [data (mf/deref refs/viewer-data)] (let [key (str (get-in data [:file :id]))] - [:& viewer {:params props :data data :key key}]))) + [:& viewer {:params props :data data :key key}]) + [:div.loader-content.viewer-loader + i/loader-pencil])) (mf/defc breaking-change-notice [] From 563a6da83c7249431aafa4382868f93891e2a055 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 14 Oct 2022 14:50:40 +0200 Subject: [PATCH 07/13] :bug: Fix partially missing english translation --- frontend/translations/en.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index a9cf81c1cf..4fa332b6cc 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -337,7 +337,7 @@ msgstr "Export Penpot %s files" #: src/app/main/ui/export.cljs msgid "dashboard.export-multiple.selected" -msgstr "%s de %s elements selected" +msgstr "%s of %s elements selected" #: src/app/main/ui/workspace/header.cljs msgid "dashboard.export-shapes" From 41f5fb9621f71abcdf2855a31cd9ea6b5f3083a0 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 14 Oct 2022 10:30:11 +0200 Subject: [PATCH 08/13] :bug: Fix comments section not scrolling --- CHANGES.md | 2 +- frontend/src/app/main/ui/workspace/viewport.cljs | 5 ++--- frontend/src/app/main/ui/workspace/viewport/actions.cljs | 6 ++---- frontend/src/app/main/ui/workspace/viewport/hooks.cljs | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1a8aec34cd..7e3de720b9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -57,7 +57,7 @@ - Fix artboard border radius [Taiga #4291](https://tree.taiga.io/project/penpot/issue/4291) - Fix copied & pasted layer is not visible [Taiga #4283](https://tree.taiga.io/project/penpot/issue/4283) - Fix notification to newsletter is shown in all cases [Taiga #4367](https://tree.taiga.io/project/penpot/issue/4367) - +- Fix comments section is not scrolling by mouse wheel [Taiga #4305](https://tree.taiga.io/project/penpot/issue/4305) ## 1.15.4-beta ### :bug: Bugs fixed diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 7a99dac295..2d2be20f9a 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -96,7 +96,6 @@ ;; REFS viewport-ref (mf/use-ref nil) - overlays-ref (mf/use-ref nil) ;; VARS disable-paste (mf/use-var false) @@ -184,7 +183,7 @@ disabled-guides? (or drawing-tool transform)] - (hooks/setup-dom-events viewport-ref overlays-ref zoom disable-paste in-viewport?) + (hooks/setup-dom-events viewport-ref zoom disable-paste in-viewport?) (hooks/setup-viewport-size viewport-ref) (hooks/setup-cursor cursor alt? mod? space? panning drawing-tool drawing-path? node-editing?) (hooks/setup-keyboard alt? mod? space?) @@ -194,7 +193,7 @@ (hooks/setup-active-frames base-objects hover-ids selected active-frames zoom transform vbox) [:div.viewport - [:div.viewport-overlays {:ref overlays-ref} + [:div.viewport-overlays ;; The behaviour inside a foreign object is a bit different that in plain HTML so we wrap ;; inside a foreign object "dummy" so this awkward behaviour is take into account [:svg {:style {:top 0 :left 0 :position "fixed" :width "100%" :height "100%" :opacity 0}} diff --git a/frontend/src/app/main/ui/workspace/viewport/actions.cljs b/frontend/src/app/main/ui/workspace/viewport/actions.cljs index f0a5658cdd..bbf0c740b3 100644 --- a/frontend/src/app/main/ui/workspace/viewport/actions.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/actions.cljs @@ -359,18 +359,16 @@ pt (utils/translate-point-to-viewport viewport zoom raw-pt)] (rx/push! move-stream pt))))) -(defn on-mouse-wheel [viewport-ref overlays-ref zoom] +(defn on-mouse-wheel [viewport-ref zoom] (mf/use-callback (mf/deps zoom) (fn [event] (let [viewport (mf/ref-val viewport-ref) - overlays (mf/ref-val overlays-ref) event (.getBrowserEvent ^js event) target (dom/get-target event) mod? (kbd/mod? event)] - (when (or (dom/is-child? viewport target) - (dom/is-child? overlays target)) + (when (dom/is-child? viewport target) (dom/prevent-default event) (dom/stop-propagation event) (let [pt (->> (dom/get-client-position event) diff --git a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs index 4d28abb2a6..c9071afc80 100644 --- a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs @@ -31,11 +31,11 @@ [rumext.v2 :as mf]) (:import goog.events.EventType)) -(defn setup-dom-events [viewport-ref overlays-ref zoom disable-paste in-viewport?] +(defn setup-dom-events [viewport-ref zoom disable-paste in-viewport?] (let [on-key-down (actions/on-key-down) on-key-up (actions/on-key-up) on-mouse-move (actions/on-mouse-move viewport-ref zoom) - on-mouse-wheel (actions/on-mouse-wheel viewport-ref overlays-ref zoom) + on-mouse-wheel (actions/on-mouse-wheel viewport-ref zoom) on-paste (actions/on-paste disable-paste in-viewport?)] (mf/use-layout-effect (mf/deps on-key-down on-key-up on-mouse-move on-mouse-wheel on-paste) From 87d323bb4c03fd20de513c5debf4bea9689a853b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 13 Oct 2022 13:04:46 +0200 Subject: [PATCH 09/13] :bug: Fix grid not syncing in multi user --- CHANGES.md | 1 + .../app/main/data/workspace/persistence.cljs | 26 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7e3de720b9..6fcf5d7aa9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -43,6 +43,7 @@ - Fix components marked as touched when moved [Taiga #4061](https://tree.taiga.io/project/penpot/task/4061) - Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) - Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298) +- Fix grid not syncing immediately in multiuser [Taiga #4339](https://tree.taiga.io/project/penpot/issue/4339) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/data/workspace/persistence.cljs b/frontend/src/app/main/data/workspace/persistence.cljs index 62ea1c2245..ba00a8777d 100644 --- a/frontend/src/app/main/data/workspace/persistence.cljs +++ b/frontend/src/app/main/data/workspace/persistence.cljs @@ -12,6 +12,7 @@ [app.common.pages.changes-spec :as pcs] [app.common.spec :as us] [app.common.types.file :as ctf] + [app.common.types.shape-tree :as ctst] [app.common.uuid :as uuid] [app.config :as cf] [app.main.data.dashboard :as dd] @@ -219,14 +220,23 @@ (ptk/reify ::changes-persisted ptk/UpdateEvent (update [_ state] - (if (= file-id (:current-file-id state)) - (-> state - (update-in [:workspace-file :revn] max revn) - (update :workspace-data cp/process-changes changes)) - (-> state - (update-in [:workspace-libraries file-id :revn] max revn) - (update-in [:workspace-libraries file-id :data] - cp/process-changes changes)))))) + (let [changes (group-by :page-id changes)] + (if (= file-id (:current-file-id state)) + (-> state + (update-in [:workspace-file :revn] max revn) + (update :workspace-data (fn [file] + (loop [fdata file + entries (seq changes)] + (if-let [[page-id changes] (first entries)] + (recur (-> fdata + (cp/process-changes changes) + (ctst/update-object-indices page-id)) + (rest entries)) + fdata))))) + (-> state + (update-in [:workspace-libraries file-id :revn] max revn) + (update-in [:workspace-libraries file-id :data] + cp/process-changes changes))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From c670d81a208aa7645d71aa857a357f6e66b5a0bf Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 14 Oct 2022 11:13:24 +0200 Subject: [PATCH 10/13] :bug: Fix assertion error trying to move board if path tool selected --- CHANGES.md | 2 ++ frontend/src/app/main/data/workspace/path/edition.cljs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 6fcf5d7aa9..c35c9e4f92 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,7 @@ - Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) - Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298) - Fix grid not syncing immediately in multiuser [Taiga #4339](https://tree.taiga.io/project/penpot/issue/4339) +- Fix assertions error when trying to move board if Path tool selected [Taiga #4248](https://tree.taiga.io/project/penpot/issue/4248) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) @@ -59,6 +60,7 @@ - Fix copied & pasted layer is not visible [Taiga #4283](https://tree.taiga.io/project/penpot/issue/4283) - Fix notification to newsletter is shown in all cases [Taiga #4367](https://tree.taiga.io/project/penpot/issue/4367) - Fix comments section is not scrolling by mouse wheel [Taiga #4305](https://tree.taiga.io/project/penpot/issue/4305) + ## 1.15.4-beta ### :bug: Bugs fixed diff --git a/frontend/src/app/main/data/workspace/path/edition.cljs b/frontend/src/app/main/data/workspace/path/edition.cljs index 46617ec06e..7ecf800c8f 100644 --- a/frontend/src/app/main/data/workspace/path/edition.cljs +++ b/frontend/src/app/main/data/workspace/path/edition.cljs @@ -204,7 +204,8 @@ (watch [_ state stream] (let [id (get-in state [:workspace-local :edition]) current-move (get-in state [:workspace-local :edit-path id :current-move])] - (if (= same-event current-move) + ;; id can be null if we just selected the tool but we didn't start drawing + (if (and id (= same-event current-move)) (let [points (get-in state [:workspace-local :edit-path id :selected-points] #{}) move-events (->> stream From a8150e1b0555d8e58c534012cc5dffde6297e8fc Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 17 Oct 2022 07:02:00 +0200 Subject: [PATCH 11/13] :tada: Remove imported and updated extra words --- CHANGES.md | 1 - backend/src/app/rpc/commands/binfile.clj | 2 +- frontend/resources/styles/main/partials/dashboard-grid.scss | 3 +++ frontend/src/app/main/ui/dashboard/grid.cljs | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c35c9e4f92..00b2767098 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,7 +44,6 @@ - Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) - Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298) - Fix grid not syncing immediately in multiuser [Taiga #4339](https://tree.taiga.io/project/penpot/issue/4339) -- Fix assertions error when trying to move board if Path tool selected [Taiga #4248](https://tree.taiga.io/project/penpot/issue/4248) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/backend/src/app/rpc/commands/binfile.clj b/backend/src/app/rpc/commands/binfile.clj index 522dfffeef..d012db8f65 100644 --- a/backend/src/app/rpc/commands/binfile.clj +++ b/backend/src/app/rpc/commands/binfile.clj @@ -634,7 +634,7 @@ params {:id file-id' :project-id project-id - :name (str "Imported: " (:name file)) + :name (:name file) :revn (:revn file) :is-shared (:is-shared file) :data (blob/encode data) diff --git a/frontend/resources/styles/main/partials/dashboard-grid.scss b/frontend/resources/styles/main/partials/dashboard-grid.scss index 64341c9bb3..130acb1bf2 100644 --- a/frontend/resources/styles/main/partials/dashboard-grid.scss +++ b/frontend/resources/styles/main/partials/dashboard-grid.scss @@ -127,6 +127,9 @@ width: 100%; white-space: nowrap; max-width: 260px; + &::first-letter { + text-transform: capitalize; + } @media #{$bp-max-1366} { max-width: 230px; } diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index 83df572260..916547ecca 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -163,7 +163,7 @@ (let [locale (mf/deref i18n/locale) time (dt/timeago modified-at {:locale locale})] [:span.date - (str (tr "ds.updated-at" time))])) + time])) (defn create-counter-element [_element file-count] From 88cd19d21a1e7a7e38e7353aadd755c5657af2a1 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Thu, 6 Oct 2022 09:55:51 +0200 Subject: [PATCH 12/13] :bug: Fix custom font upload fails silently for unsupported formats --- CHANGES.md | 1 + frontend/src/app/main/data/fonts.cljs | 37 +++++++++++++++---- frontend/src/app/main/ui/dashboard/fonts.cljs | 3 +- frontend/translations/en.po | 7 ++++ frontend/translations/es.po | 6 +++ 5 files changed, 44 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 00b2767098..07ba381d18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,7 @@ - Fix boards grouped shouldn't show the title [Taiga #4251](https://tree.taiga.io/project/penpot/issue/4251) - Fix gradient handlers are under resize handlers[Taiga #4298](https://tree.taiga.io/project/penpot/issue/4298) - Fix grid not syncing immediately in multiuser [Taiga #4339](https://tree.taiga.io/project/penpot/issue/4339) +- Fix custom font upload fails silently for unsupported formats [Taiga #4279](https://tree.taiga.io/project/penpot/issue/4280) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/data/fonts.cljs b/frontend/src/app/main/data/fonts.cljs index 17003e5f87..68e5bc0a1b 100644 --- a/frontend/src/app/main/data/fonts.cljs +++ b/frontend/src/app/main/data/fonts.cljs @@ -12,8 +12,11 @@ [app.common.media :as cm] [app.common.spec :as us] [app.common.uuid :as uuid] + [app.main.data.messages :as dm] [app.main.fonts :as fonts] [app.main.repo :as rp] + [app.main.store :as st] + [app.util.i18n :refer [tr]] [app.util.storage :refer [storage]] [app.util.webapi :as wa] [beicon.core :as rx] @@ -133,17 +136,35 @@ {:data data :name (.-name blob) :type (parse-mtype data)})) - (rx/mapcat (fn [{:keys [type] :as font}] - (if type + (rx/catch (fn [] + (rx/of {:error (.-name blob)}))) + (rx/mapcat (fn [{:keys [type, error] :as font}] + (if (or type error) (rx/of font) (rx/empty))))))] - (->> (rx/from blobs) - (rx/mapcat read-blob) - (rx/map parse-font) - (rx/filter some?) - (rx/map prepare) - (rx/reduce join {})))) + (let [fonts (->> (rx/from blobs) + (rx/mapcat read-blob)) + errors (->> fonts + (rx/filter #(some? (:error %))) + (rx/reduce (fn [acc font] + (conj acc (str "'" (:error font) "'"))) + []))] + + (rx/subscribe errors + #(when + (not-empty %) + (st/emit! + (dm/error + (if (> (count %) 1) + (tr "errors.bad-font-plural" (str/join ", " %)) + (tr "errors.bad-font" (first %))))))) + (->> fonts + (rx/filter #(nil? (:error %))) + (rx/map parse-font) + (rx/filter some?) + (rx/map prepare) + (rx/reduce join {}))))) (defn- calculate-family-to-id-mapping [existing] diff --git a/frontend/src/app/main/ui/dashboard/fonts.cljs b/frontend/src/app/main/ui/dashboard/fonts.cljs index 2862242085..80e05287b6 100644 --- a/frontend/src/app/main/ui/dashboard/fonts.cljs +++ b/frontend/src/app/main/ui/dashboard/fonts.cljs @@ -303,8 +303,7 @@ [:div.table-field.search-input [:input {:placeholder (tr "labels.search-font") :default-value "" - :on-change on-change - }]]] + :on-change on-change}]]] (cond (seq fonts) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 4fa332b6cc..c3422c650e 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -4558,3 +4558,10 @@ msgstr "Click to close the path" msgid "errors.profile-blocked" msgstr "The profile is blocked" + +msgid "errors.bad-font" +msgstr "The font %s could not be loaded" + +msgid "errors.bad-font-plural" +msgstr "The fonts %s could not be loaded" + diff --git a/frontend/translations/es.po b/frontend/translations/es.po index c3923cc235..529eb38ca4 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -4765,3 +4765,9 @@ msgstr "Pulsar para cerrar la ruta" msgid "errors.profile-blocked" msgstr "El perfil esta blockeado" + +msgid "errors.bad-font" +msgstr "No se ha podido cargar la fuente %s" + +msgid "errors.bad-font-plural" +msgstr "No se han podido cargar las fuentes %s" From 0765587373e96dca0c026f27712f17c0205a9676 Mon Sep 17 00:00:00 2001 From: Eva Date: Tue, 11 Oct 2022 08:44:45 +0200 Subject: [PATCH 13/13] :bug: Fix draggin projects css --- .../resources/styles/main/partials/dashboard-grid.scss | 7 +++++++ frontend/src/app/main/ui/dashboard/grid.cljs | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/resources/styles/main/partials/dashboard-grid.scss b/frontend/resources/styles/main/partials/dashboard-grid.scss index 130acb1bf2..367531338e 100644 --- a/frontend/resources/styles/main/partials/dashboard-grid.scss +++ b/frontend/resources/styles/main/partials/dashboard-grid.scss @@ -43,6 +43,13 @@ text-align: initial; } + &.dragged { + border-radius: $br-small; + border: 2px solid lighten($color-gray-20, 15%); + text-align: initial; + max-height: 160px; + } + &.placeholder { min-width: 115px; max-width: 115px; diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index 916547ecca..0a5c23994f 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -390,12 +390,13 @@ (mf/defc line-grid-row [{:keys [files selected-files dragging? limit] :as props}] - (let [limit (if dragging? (dec limit) limit)] + (let [elements limit + limit (if dragging? (dec limit) limit)] [:div.grid-row.no-wrap - {:style {:grid-template-columns (dm/str "repeat(" limit ", 1fr)")}} + {:style {:grid-template-columns (dm/str "repeat(" elements ", 1fr)")}} (when dragging? - [:div.grid-item]) + [:div.grid-item.dragged]) (for [item (take limit files)] [:& grid-item {:id (:id item)