0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

Backport and merge migrations from staging (#5681)

This commit is contained in:
Andrey Antukh 2025-01-24 19:11:03 +01:00 committed by GitHub
parent 48132711b6
commit 71560c0a53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 64 additions and 19 deletions

View file

@ -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!)

View file

@ -6,4 +6,4 @@
(ns app.common.files.defaults)
(def version 61)
(def version 64)

View file

@ -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}])

View file

@ -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");
});

View file

@ -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

View file

@ -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}