From 5d01a0e24c38a9d180ac6f0fe4b0c18a1bdfe6d8 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 22 Sep 2022 14:04:00 +0200 Subject: [PATCH 1/5] :bug: Fix import files with unexpected format or invalid content --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/import.cljs | 7 ++++--- frontend/src/app/worker/import.cljs | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2b75de8ad..fff4250c8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ - Fix change opacity in colorpicker cause bugged color [Taiga #4154](https://tree.taiga.io/project/penpot/issue/4154) - Fix gradient colors don't arrive in recent colors palette (https://tree.taiga.io/project/penpot/issue/4155) - Fix selected colors allow gradients in shadows [Taiga #4156](https://tree.taiga.io/project/penpot/issue/4156) +- Fix import files with unexpected format or invalid content [Taiga #4136](https://tree.taiga.io/project/penpot/issue/4136) ## 1.15.3-beta diff --git a/frontend/src/app/main/ui/dashboard/import.cljs b/frontend/src/app/main/ui/dashboard/import.cljs index 565dda8fb..bde0f44f3 100644 --- a/frontend/src/app/main/ui/dashboard/import.cljs +++ b/frontend/src/app/main/ui/dashboard/import.cljs @@ -304,7 +304,8 @@ success-files (->> @state :files (filter #(and (= (:status %) :import-finish) (empty? (:errors %)))) count) pending-analysis? (> (->> @state :files (filter #(= (:status %) :analyzing)) count) 0) pending-import? (> (->> @state :files (filter #(= (:status %) :importing)) count) 0) - files (->> (:files @state) (filterv (comp not :deleted?)))] + files (->> (:files @state) (filterv (comp not :deleted?))) + valid-files? (> (->> files (filterv (fn [x] (not= (:status x) :analyze-error))) count) 0)] (mf/use-effect (fn [] @@ -359,7 +360,7 @@ {:class "primary" :type "button" :value (tr "labels.continue") - :disabled pending-analysis? + :disabled (or pending-analysis? (not valid-files?)) :on-click handle-continue}]) (when (= :importing (:status @state)) @@ -367,5 +368,5 @@ {:class "primary" :type "button" :value (tr "labels.accept") - :disabled pending-import? + :disabled (or pending-import? (not valid-files?)) :on-click handle-accept}])]]]])) diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index aff53ab5b..a1538e4b4 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -19,6 +19,7 @@ [app.common.uuid :as uuid] [app.main.repo :as rp] [app.util.http :as http] + [app.util.i18n :as i18n :refer [tr]] [app.util.import.parser :as cip] [app.util.json :as json] [app.util.webapi :as wapi] @@ -526,7 +527,8 @@ sg (areduce u8 i ret "" (str ret (if (zero? i) "" " ") (.toString (aget u8 i) 8)))] (case sg "120 113 3 4" "application/zip" - "application/octet-stream"))) + "1 13 32 206" "application/octet-stream" + "other"))) (defmethod impl/handler :analyze-import [{:keys [files]}] @@ -560,8 +562,15 @@ :file-id file-id :files {file-id {:name (:name file)}} :status :ready} - :type "application/octet-stream"}))))) - (rx/catch #(rx/of {:uri (:uri file) :error (.-message %)})))))))) + :type "application/octet-stream"})))) + (->> st + (rx/filter (fn [data] (= "other" (:type data)))) + (rx/map (fn [_] + {:uri (:uri file) + :error (tr "dashboard.import.analyze-error")})))) + (rx/catch (fn [data] + (let [error (or (.-message data) (tr "dashboard.import.analyze-error"))] + (rx/of {:uri (:uri file) :error error})))))))))) (defmethod impl/handler :import-files [{:keys [project-id files]}] From 441e9627b5da1286478171e837519726ac33a8d5 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 22 Sep 2022 15:56:48 +0200 Subject: [PATCH 2/5] :bug: Fix Wrong shortcut button tip of Delete function --- CHANGES.md | 1 + frontend/src/app/main/data/shortcuts.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index fff4250c8..1ac9d5ae5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,7 @@ - Fix gradient colors don't arrive in recent colors palette (https://tree.taiga.io/project/penpot/issue/4155) - Fix selected colors allow gradients in shadows [Taiga #4156](https://tree.taiga.io/project/penpot/issue/4156) - Fix import files with unexpected format or invalid content [Taiga #4136](https://tree.taiga.io/project/penpot/issue/4136) +- Fix wrong shortcut button tip of "Delete" function [Taiga #4162](https://tree.taiga.io/project/penpot/issue/4162) ## 1.15.3-beta diff --git a/frontend/src/app/main/data/shortcuts.cljs b/frontend/src/app/main/data/shortcuts.cljs index 0494f9913..a30bba898 100644 --- a/frontend/src/app/main/data/shortcuts.cljs +++ b/frontend/src/app/main/data/shortcuts.cljs @@ -93,7 +93,7 @@ [] (if (cf/check-platform? :macos) mac-delete - "Supr")) + "Del")) (defn esc [] From 1ef4d42b28e930fbd53facc7fdc96af6a7b6356d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 23 Sep 2022 08:16:18 +0200 Subject: [PATCH 3/5] :bug: Fix error after user drags layers in search functionality --- CHANGES.md | 1 + .../app/main/ui/workspace/sidebar/layers.cljs | 32 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1ac9d5ae5..06c1c20c2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ - Fix selected colors allow gradients in shadows [Taiga #4156](https://tree.taiga.io/project/penpot/issue/4156) - Fix import files with unexpected format or invalid content [Taiga #4136](https://tree.taiga.io/project/penpot/issue/4136) - Fix wrong shortcut button tip of "Delete" function [Taiga #4162](https://tree.taiga.io/project/penpot/issue/4162) +- Fix error after user drags any layer in search functionality [Taiga #4161](https://tree.taiga.io/project/penpot/issue/4161) ## 1.15.3-beta diff --git a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs index 05ad9bdfd..87265242d 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs @@ -90,7 +90,7 @@ (l/derived refs/workspace-local))) (mf/defc layer-item - [{:keys [index item selected objects] :as props}] + [{:keys [index item selected objects sortable?] :as props}] (let [id (:id item) selected? (contains? selected id) container? (or (cph/frame-shape? item) @@ -170,16 +170,17 @@ (when-not expanded? (st/emit! (dwc/toggle-collapse (:id item))))) - [dprops dref] (hooks/use-sortable - :data-type "penpot/layer" - :on-drop on-drop - :on-drag on-drag - :on-hold on-hold - :disabled @disable-drag - :detect-center? container? - :data {:id (:id item) - :index index - :name (:name item)}) + [dprops dref] (when sortable? + (hooks/use-sortable + :data-type "penpot/layer" + :on-drop on-drop + :on-drag on-drag + :on-hold on-hold + :disabled @disable-drag + :detect-center? container? + :data {:id (:id item) + :index index + :name (:name item)})) ref (mf/use-ref)] @@ -276,13 +277,15 @@ :selected selected :index index :objects objects - :key id}] + :key id + :sortable? true}] [:& layer-item {:item obj :selected selected :index index :objects objects - :key id}])))]])) + :key id + :sortable? true}])))]])) (mf/defc filters-tree {::mf/wrap [#(mf/memo % =) @@ -299,7 +302,8 @@ :selected selected :index index :objects objects - :key id}]))])) + :key id + :sortable? false}]))])) (defn calc-reparented-objects From 944cfd0fc4a2c396afc9203c5c6696808fc161ae Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 23 Sep 2022 08:23:27 +0200 Subject: [PATCH 4/5] :bug: Fix font search works only with lowercase letters --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/fonts.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 06c1c20c2..dfd0a30cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ - Fix import files with unexpected format or invalid content [Taiga #4136](https://tree.taiga.io/project/penpot/issue/4136) - Fix wrong shortcut button tip of "Delete" function [Taiga #4162](https://tree.taiga.io/project/penpot/issue/4162) - Fix error after user drags any layer in search functionality [Taiga #4161](https://tree.taiga.io/project/penpot/issue/4161) +- Fix font search works only with lowercase letters [Taiga #4140](https://tree.taiga.io/project/penpot/issue/4140) ## 1.15.3-beta diff --git a/frontend/src/app/main/ui/dashboard/fonts.cljs b/frontend/src/app/main/ui/dashboard/fonts.cljs index 732aa0e4a..e5f42a86c 100644 --- a/frontend/src/app/main/ui/dashboard/fonts.cljs +++ b/frontend/src/app/main/ui/dashboard/fonts.cljs @@ -292,7 +292,7 @@ (mf/use-callback (fn [event] (let [val (dom/get-target-val event)] - (reset! sterm val))))] + (reset! sterm (str/lower val)))))] [:div.dashboard-installed-fonts [:h3 (tr "labels.installed-fonts")] From a9e8f4eb676c7a85b07059e5386108762abfb318 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 23 Sep 2022 09:17:59 +0200 Subject: [PATCH 5/5] :bug: Fix Terms and Privacy links overlapping --- CHANGES.md | 1 + frontend/resources/styles/main/layouts/login.scss | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index dfd0a30cb..d86a920e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ - Fix wrong shortcut button tip of "Delete" function [Taiga #4162](https://tree.taiga.io/project/penpot/issue/4162) - Fix error after user drags any layer in search functionality [Taiga #4161](https://tree.taiga.io/project/penpot/issue/4161) - Fix font search works only with lowercase letters [Taiga #4140](https://tree.taiga.io/project/penpot/issue/4140) +- Fix Terms and Privacy links overlapping [Taiga #4137](https://tree.taiga.io/project/penpot/issue/4137) ## 1.15.3-beta diff --git a/frontend/resources/styles/main/layouts/login.scss b/frontend/resources/styles/main/layouts/login.scss index 574343485..b092b7e23 100644 --- a/frontend/resources/styles/main/layouts/login.scss +++ b/frontend/resources/styles/main/layouts/login.scss @@ -11,6 +11,8 @@ display: grid; grid-template-rows: auto; grid-template-columns: 33% auto; + height: 100vh; + overflow-y: scroll; } .auth-sidebar { @@ -53,6 +55,7 @@ height: 100vh; justify-content: center; position: relative; + min-height: 48rem; input { margin-bottom: 0px;