From b05421755ffbb511697f2137a222e41a6d657337 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 22 Feb 2024 10:45:54 +0100 Subject: [PATCH 1/3] :bug: Fix srepl report query --- backend/src/app/srepl/components_v2.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/app/srepl/components_v2.clj b/backend/src/app/srepl/components_v2.clj index 1c14e15d5c..0922904938 100644 --- a/backend/src/app/srepl/components_v2.clj +++ b/backend/src/app/srepl/components_v2.clj @@ -143,10 +143,10 @@ (def ^:private sql:get-files-by-report "WITH files AS ( - SELECT t.id t.features, mr.name + SELECT f.id, f.features, mr.label FROM migration_file_report AS mr - JOIN file AS t ON (t.id = mr.file_id) - WHERE t.deleted_at IS NULL + JOIN file AS f ON (f.id = mr.file_id) + WHERE f.deleted_at IS NULL AND mr.error IS NOT NULL ORDER BY mr.created_at ) SELECT id, features FROM files %(pred)s") From dec622600d4ae8db6df26d4df35ab83fa20ccd4f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 22 Feb 2024 10:46:23 +0100 Subject: [PATCH 2/3] :bug: Fix incorrect selrect calcultation from shape path --- common/src/app/common/geom/shapes/path.cljc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index d3a00953d2..941b3ffc2f 100644 --- a/common/src/app/common/geom/shapes/path.cljc +++ b/common/src/app/common/geom/shapes/path.cljc @@ -7,6 +7,7 @@ (ns app.common.geom.shapes.path (:require [app.common.data :as d] + [app.common.data.macros :as dm] [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] [app.common.geom.rect :as grc] @@ -975,7 +976,7 @@ flip-y (gmt/scale (gpt/point 1 -1)) :always (gmt/multiply (:transform-inverse shape (gmt/matrix)))) - center (or (gco/shape->center shape) + center (or (some-> (dm/get-prop shape :selrect) grc/rect->center) (content-center content)) base-content (transform-content From 0999ecb2a9e6adf7c56190d7e45df04a75256dc3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 22 Feb 2024 13:01:43 +0100 Subject: [PATCH 3/3] :bug: Fix idempotency problem on fdata migration 25 --- common/src/app/common/files/migrations.cljc | 8 +++++--- common/src/app/common/geom/rect.cljc | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 2823bf3e21..8ba0857802 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -492,9 +492,11 @@ [data] (some-> cfeat/*new* (swap! conj "fdata/shape-data-type")) (letfn [(update-object [object] - (-> object - (d/update-when :selrect grc/make-rect) - (cts/map->Shape))) + (if (cfh/root? object) + object + (-> object + (update :selrect grc/make-rect) + (cts/map->Shape)))) (update-container [container] (d/update-when container :objects update-vals update-object))] (-> data diff --git a/common/src/app/common/geom/rect.cljc b/common/src/app/common/geom/rect.cljc index ce01fb0cb1..48d620adfc 100644 --- a/common/src/app/common/geom/rect.cljc +++ b/common/src/app/common/geom/rect.cljc @@ -63,10 +63,11 @@ (make-rect x1 y1 (- x2 x1) (- y2 y1)))) ([x y width height] - (when (d/num? x y width height) + (if (d/num? x y width height) (let [w (mth/max width 0.01) h (mth/max height 0.01)] - (pos->Rect x y w h x y (+ x w) (+ y h)))))) + (pos->Rect x y w h x y (+ x w) (+ y h))) + (make-rect)))) (def ^:private schema:rect-attrs [:map {:title "RectAttrs"}