diff --git a/backend/src/app/srepl/components_v2.clj b/backend/src/app/srepl/components_v2.clj index 1c14e15d5..092290493 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") diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 2823bf3e2..8ba085780 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 ce01fb0cb..48d620adf 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"} diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index d3a00953d..941b3ffc2 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