From 192fb07ef1a253297f873b4844d015730d063e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 14 Oct 2021 14:32:58 +0200 Subject: [PATCH] :bug: Fix broken references on duplicate file --- CHANGES.md | 57 ++++++++++---------- backend/src/app/rpc/mutations/management.clj | 14 ++++- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2d51f8099..19efdd1aa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,40 +4,41 @@ ### :boom: Breaking changes -- Some stroke-caps can change behaviour -- Text display bug fix could potentialy make some texts jump a line +- Some stroke-caps can change behaviour. +- Text display bug fix could potentialy make some texts jump a line. ### :sparkles: New features - Add boolean shapes: intersections, unions, difference and exclusions. - Add advanced prototyping [#244](https://tree.taiga.io/project/penpot/us/244). -- Change order of the teams menu so it's in the joined time order +- Change order of the teams menu so it's in the joined time order. ### :bug: Bugs fixed -- Fix problem with overflow dropdown on stroke-cap [#1216](https://github.com/penpot/penpot/issues/1216) -- Fix menu context for single element nested in components [#1186](https://github.com/penpot/penpot/issues/1186) -- Fix error screen when operations over comments fail [#1219](https://github.com/penpot/penpot/issues/1219) -- Fix undo problem when changing typography/color from library [#1230](https://github.com/penpot/penpot/issues/1230) -- Fix problem with text margin while rendering [#1231](https://github.com/penpot/penpot/issues/1231) -- Fix problem with masked texts on exporting [Taiga #2116](https://tree.taiga.io/project/penpot/issue/2116) -- Fix text editor enter behaviour with centered texts [Taiga #2126](https://tree.taiga.io/project/penpot/issue/2126) -- Fix residual stroke on imported svg [Taiga #2125](https://tree.taiga.io/project/penpot/issue/2125) -- Add links for terms of service and privacy policy in register checkbox [Taiga #2020](https://tree.taiga.io/project/penpot/issue/2020) -- Allow three character hex and web colors in color picker hex input [#1184](https://github.com/penpot/penpot/issues/1184) -- Allow lowercase search for fonts [#1180](https://github.com/penpot/penpot/issues/1180) -- Fix group renaming problem [Taiga #1969](https://tree.taiga.io/project/penpot/issue/1969) -- Fix export group with shadows on children [Taiga #2036](https://tree.taiga.io/project/penpot/issue/2036) -- Fix zoom context menu in viewer [Taiga #2041](https://tree.taiga.io/project/penpot/issue/2041) -- Fix stroke caps adjustments in relation with stroke size [Taiga #2123](https://tree.taiga.io/project/penpot/issue/2123) -- Fix problem duplicating paths [Taiga #2147](https://tree.taiga.io/project/penpot/issue/2147) -- Fix problem inheriting attributes from SVG root when importing [Taiga #2124](https://tree.taiga.io/project/penpot/issue/2124) -- Fix problem with lines and inside/outside stroke [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146) -- Add stroke width in selection calculation [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146) -- Fix shift+wheel to horizontal scrolling in MacOS [#1217](https://github.com/penpot/penpot/issues/1217) -- Fix path stroke is not working properly with high thickness [Taiga #2154](https://tree.taiga.io/project/penpot/issue/2154) -- Fix bug with transformation operations [Taiga #2155](https://tree.taiga.io/project/penpot/issue/2155) -- Fix bug in firefox when a text box is inside a mask [Taiga #2152](https://tree.taiga.io/project/penpot/issue/2152) +- Fix color and typographies refs lost when duplicated file [Taiga #2165](https://tree.taiga.io/project/penpot/issue/2165). +- Fix problem with overflow dropdown on stroke-cap [#1216](https://github.com/penpot/penpot/issues/1216). +- Fix menu context for single element nested in components [#1186](https://github.com/penpot/penpot/issues/1186). +- Fix error screen when operations over comments fail [#1219](https://github.com/penpot/penpot/issues/1219). +- Fix undo problem when changing typography/color from library [#1230](https://github.com/penpot/penpot/issues/1230). +- Fix problem with text margin while rendering [#1231](https://github.com/penpot/penpot/issues/1231). +- Fix problem with masked texts on exporting [Taiga #2116](https://tree.taiga.io/project/penpot/issue/2116). +- Fix text editor enter behaviour with centered texts [Taiga #2126](https://tree.taiga.io/project/penpot/issue/2126). +- Fix residual stroke on imported svg [Taiga #2125](https://tree.taiga.io/project/penpot/issue/2125). +- Add links for terms of service and privacy policy in register checkbox [Taiga #2020](https://tree.taiga.io/project/penpot/issue/2020). +- Allow three character hex and web colors in color picker hex input [#1184](https://github.com/penpot/penpot/issues/1184). +- Allow lowercase search for fonts [#1180](https://github.com/penpot/penpot/issues/1180). +- Fix group renaming problem [Taiga #1969](https://tree.taiga.io/project/penpot/issue/1969). +- Fix export group with shadows on children [Taiga #2036](https://tree.taiga.io/project/penpot/issue/2036). +- Fix zoom context menu in viewer [Taiga #2041](https://tree.taiga.io/project/penpot/issue/2041). +- Fix stroke caps adjustments in relation with stroke size [Taiga #2123](https://tree.taiga.io/project/penpot/issue/2123). +- Fix problem duplicating paths [Taiga #2147](https://tree.taiga.io/project/penpot/issue/2147). +- Fix problem inheriting attributes from SVG root when importing [Taiga #2124](https://tree.taiga.io/project/penpot/issue/2124). +- Fix problem with lines and inside/outside stroke [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146). +- Add stroke width in selection calculation [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146). +- Fix shift+wheel to horizontal scrolling in MacOS [#1217](https://github.com/penpot/penpot/issues/1217). +- Fix path stroke is not working properly with high thickness [Taiga #2154](https://tree.taiga.io/project/penpot/issue/2154). +- Fix bug with transformation operations [Taiga #2155](https://tree.taiga.io/project/penpot/issue/2155). +- Fix bug in firefox when a text box is inside a mask [Taiga #2152](https://tree.taiga.io/project/penpot/issue/2152). ### :arrow_up: Deps updates @@ -47,13 +48,13 @@ ### :bug: Bugs fixed -- Fix problem importing components [Taiga #2151](https://tree.taiga.io/project/penpot/issue/2151) +- Fix problem importing components [Taiga #2151](https://tree.taiga.io/project/penpot/issue/2151). ## 1.8.3-alpha ### :sparkles: New features -- Adds progress report to importing process +- Adds progress report to importing process. ## 1.8.2-alpha diff --git a/backend/src/app/rpc/mutations/management.clj b/backend/src/app/rpc/mutations/management.clj index 1cf111729..76d997fee 100644 --- a/backend/src/app/rpc/mutations/management.clj +++ b/backend/src/app/rpc/mutations/management.clj @@ -39,11 +39,23 @@ [file index] (letfn [(process-form [form] (cond-> form - ;; Relink Components + ;; Relink library items (and (map? form) (uuid? (:component-file form))) (update :component-file #(get index % %)) + (and (map? form) + (uuid? (:fill-color-ref-file form))) + (update :fill-color-ref-file #(get index % %)) + + (and (map? form) + (uuid? (:stroke-color-ref-file form))) + (update :stroke-color-ref-file #(get index % %)) + + (and (map? form) + (uuid? (:typography-ref-file form))) + (update :typography-ref-file #(get index % %)) + ;; Relink Image Shapes (and (map? form) (map? (:metadata form))