diff --git a/CHANGES.md b/CHANGES.md index a20cde5c6e..c989db3f22 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,7 +29,8 @@ - Fix errors from editable select on measures menu [Taiga #9888](https://tree.taiga.io/project/penpot/issue/9888) - Fix exception on importing some templates from templates slider - +- Consolidate adding share button to workspace +- Fix problem when pasting text [Taiga #9929](https://tree.taiga.io/project/penpot/issue/9929) ## 2.4.2 @@ -61,12 +62,12 @@ (penpot). Because of that, the default NGINX listen port is now 8080 instead of 80, so you will have to modify your infrastructure to apply this change. -- Redis 7.2 is explicitly pinned in our example docker-compose.yml file. This is done because, - starting with the next versions, Redis is no longer distributed under an open-source license. - On-premise users are obviously free to upgrade to the version they are using or a more modern one. - Keep in mind that if you were using a version other than 7.2, you may have to recreate the volume - associated with the Redis container because the 7.2 storage format may not be compatible with what - you already have stored on the volume, and Redis may not start. In the near future, we will evaluate +- Redis 7.2 is explicitly pinned in our example docker-compose.yml file. This is done because, + starting with the next versions, Redis is no longer distributed under an open-source license. + On-premise users are obviously free to upgrade to the version they are using or a more modern one. + Keep in mind that if you were using a version other than 7.2, you may have to recreate the volume + associated with the Redis container because the 7.2 storage format may not be compatible with what + you already have stored on the volume, and Redis may not start. In the near future, we will evaluate whether to move to an open-source version of Redis (such as https://valkey.io/). ### :heart: Community contributions (Thank you!) diff --git a/common/src/app/common/files/defaults.cljc b/common/src/app/common/files/defaults.cljc index a66b70dab7..0a7463b4d3 100644 --- a/common/src/app/common/files/defaults.cljc +++ b/common/src/app/common/files/defaults.cljc @@ -6,4 +6,4 @@ (ns app.common.files.defaults) -(def version 61) +(def version 64) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index f7878cf2bb..8e70826190 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -25,6 +25,7 @@ [app.common.text :as txt] [app.common.types.color :as ctc] [app.common.types.component :as ctk] + [app.common.types.container :as ctn] [app.common.types.file :as ctf] [app.common.types.shape :as cts] [app.common.types.shape.shadow :as ctss] @@ -1145,7 +1146,40 @@ (update :pages-index update-vals update-container) (update :components update-vals update-container)))) -(defn migrate-up-60 +(defn migrate-up-62 + [data] + (let [xform-cycles-ids + (comp (filter #(= (:id %) (:shape-ref %))) + (map :id)) + + remove-cycles + (fn [objects] + (let [cycles-ids (into #{} xform-cycles-ids (vals objects)) + to-detach (->> cycles-ids + (map #(get objects %)) + (map #(ctn/get-head-shape objects %)) + (map :id) + distinct + (mapcat #(ctn/get-children-in-instance objects %)) + (map :id) + set)] + + (reduce-kv (fn [objects id shape] + (if (contains? to-detach id) + (assoc objects id (ctk/detach-shape shape)) + objects)) + objects + objects))) + + update-component + (fn [component] + ;; we only have encounter this on deleted components, + ;; so the relevant objects are inside the component + (d/update-when component :objects remove-cycles))] + + (update data :components update-vals update-component))) + +(defn migrate-up-63 [data] (letfn [(update-object [object] (if (and (:rx object) (not (:r1 object))) @@ -1163,7 +1197,7 @@ (update :pages-index update-vals update-container) (update :components update-vals update-container)))) -(defn migrate-up-61 +(defn migrate-up-64 [data] (letfn [(update-object [object] (d/update-when object :shadow #(into [] (reverse %)))) @@ -1225,6 +1259,6 @@ {:id 56 :migrate-up migrate-up-56} {:id 57 :migrate-up migrate-up-57} {:id 59 :migrate-up migrate-up-59} - {:id 60 :migrate-up migrate-up-60} - {:id 61 :migrate-up migrate-up-61}]) - + {:id 62 :migrate-up migrate-up-62} + {:id 63 :migrate-up migrate-up-63} + {:id 64 :migrate-up migrate-up-64}]) diff --git a/frontend/playwright/ui/specs/workspace.spec.js b/frontend/playwright/ui/specs/workspace.spec.js index 81b073455d..bb3dcffe8f 100644 --- a/frontend/playwright/ui/specs/workspace.spec.js +++ b/frontend/playwright/ui/specs/workspace.spec.js @@ -307,3 +307,16 @@ test("Copy/paste properties", async ({ page, context }) => { await page.getByText("Copy/Paste as").hover(); await page.getByText("Paste properties").click(); }); + +test("[Taiga #9929] Paste text in workspace", async ({ page, context }) => { + const workspacePage = new WorkspacePage(page); + await workspacePage.setupEmptyFile(page); + await workspacePage.goToWorkspace(); + await context.grantPermissions(["clipboard-read", "clipboard-write"]); + await page.evaluate(() => navigator.clipboard.writeText("Lorem ipsum dolor")); + await workspacePage.viewport.click({ button: "right" }); + await page.getByText("PasteCtrlV").click(); + await workspacePage.viewport + .getByRole("textbox") + .getByText("Lorem ipsum dolor"); +}); diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index d1ce7c94c3..8231dd0a16 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1506,10 +1506,10 @@ (coll? transit-data) (rx/of (paste-transit-shapes (assoc transit-data :in-viewport in-viewport?))) - (string? html-data) + (and (string? html-data) (d/not-empty? html-data)) (rx/of (paste-html-text html-data text-data)) - (string? text-data) + (and (string? text-data) (d/not-empty? text-data)) (rx/of (paste-text text-data)) :else diff --git a/frontend/src/app/main/ui/workspace/right_header.cljs b/frontend/src/app/main/ui/workspace/right_header.cljs index 432dcde824..63af366b85 100644 --- a/frontend/src/app/main/ui/workspace/right_header.cljs +++ b/frontend/src/app/main/ui/workspace/right_header.cljs @@ -7,7 +7,6 @@ (ns app.main.ui.workspace.right-header (:require-macros [app.main.style :as stl]) (:require - [app.config :as cf] [app.main.data.common :as dcm] [app.main.data.event :as ev] [app.main.data.modal :as modal] @@ -251,9 +250,7 @@ :on-click toggle-history} i/history]]) - (when (and - (not (:is-default team)) - (cf/external-feature-flag "share-01" "test")) + (when (not (:is-default team)) [:a {:class (stl/css :viewer-btn) :title (tr "workspace.header.share") :on-click open-share-dialog}