diff --git a/CHANGES.md b/CHANGES.md index e13fb4fb16..6685bf3b97 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # CHANGELOG -## 2.8.0 (Next / Unreleased) +## 2.8.0 ### :rocket: Epics and highlights @@ -15,8 +15,8 @@ on [its own changelog](library/CHANGES.md) **Penpot migrate from Redis to Valkey** As [Valkey](https://valkey.io/) is an opne-souce fork of [Redis](https://redis.io/) -version 7.2.4, this version of Penpot will be compatible with Redis but may diverge -in future versions. Therefore, **migration from Redis to ValKey is recommended for all +version 7.2.4, this version of Penpot will be compatible with Redis but may diverge +in future versions. Therefore, **migration from Redis to ValKey is recommended for all on-premises instances** that want to keep up to date. ### :heart: Community contributions (Thank you!) diff --git a/backend/src/app/rpc/commands/teams.clj b/backend/src/app/rpc/commands/teams.clj index b77885c059..b0b21cc2fe 100644 --- a/backend/src/app/rpc/commands/teams.clj +++ b/backend/src/app/rpc/commands/teams.clj @@ -139,7 +139,8 @@ '~:status', CASE COALESCE(p.props->'~:subscription'->>'~:type', 'professional') WHEN 'professional' THEN 'active' ELSE COALESCE(p.props->'~:subscription'->>'~:status', 'incomplete') - END + END, + '~:seats', p.props->'~:quantity' ) AS subscription FROM team_profile_rel AS tp JOIN team AS t ON (t.id = tp.team_id) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 04c6ea8c11..3cb3e8daf2 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -1019,8 +1019,8 @@ [data _] (let [update-colors (fn [colors] - (into {} (filter #(-> % val types.color/valid-color?) colors)))] - (update data :colors update-colors))) + (into {} (filter #(-> % val types.color/valid-library-color?) colors)))] + (d/update-when data :colors update-colors))) (defmethod migrate-data "legacy-52" [data _] @@ -1034,7 +1034,6 @@ (update data :pages-index d/update-vals update-page))) - (defmethod migrate-data "legacy-53" [data _] (migrate-data data "legacy-26")) @@ -1517,6 +1516,17 @@ (d/update-when data :colors d/update-vals clear-color))) +(defmethod migrate-data "0009-clean-library-colors" + [data _] + (d/update-when data :colors + (fn [colors] + (reduce-kv (fn [colors id color] + (if (types.color/valid-library-color? color) + colors + (dissoc colors id))) + colors + colors)))) + (def available-migrations (into (d/ordered-set) ["legacy-2" @@ -1580,4 +1590,5 @@ "0005-deprecate-image-type" "0006-fix-old-texts-fills" "0007-clear-invalid-strokes-and-fills-v2" - "0008-fix-library-colors-v4"])) + "0008-fix-library-colors-v4" + "0009-clean-library-colors"])) diff --git a/common/src/app/common/types/color.cljc b/common/src/app/common/types/color.cljc index 7d55b99c19..37c909d4a2 100644 --- a/common/src/app/common/types/color.cljc +++ b/common/src/app/common/types/color.cljc @@ -117,6 +117,7 @@ [:ref-id {:optional true} ::sm/uuid] [:ref-file {:optional true} ::sm/uuid]]) +;; This schema represent an "applied color" (def schema:color [:and [:merge {:title "Color"} diff --git a/common/src/app/common/types/path/impl.cljc b/common/src/app/common/types/path/impl.cljc index 5ec185f1a4..ae1520e78b 100644 --- a/common/src/app/common/types/path/impl.cljc +++ b/common/src/app/common/types/path/impl.cljc @@ -20,7 +20,8 @@ [app.common.schema.generators :as sg] [app.common.svg.path :as svg.path] [app.common.transit :as t] - [app.common.types.path :as-alias path]) + [app.common.types.path :as-alias path] + [cuerdas.core :as str]) (:import #?(:cljs [goog.string StringBuffer] :clj [java.nio ByteBuffer ByteOrder]))) @@ -530,7 +531,9 @@ :decode/json (fn [s] (cond (string? s) - (from-string s) + (if (str/empty? s) + (from-plain []) + (from-string s)) (vector? s) (let [decode-fn (deref decoder)] diff --git a/frontend/src/app/main/ui/inspect/attributes.cljs b/frontend/src/app/main/ui/inspect/attributes.cljs index 107010049e..831860480f 100644 --- a/frontend/src/app/main/ui/inspect/attributes.cljs +++ b/frontend/src/app/main/ui/inspect/attributes.cljs @@ -15,7 +15,6 @@ [app.main.ui.inspect.attributes.blur :refer [blur-panel]] [app.main.ui.inspect.attributes.fill :refer [fill-panel]] [app.main.ui.inspect.attributes.geometry :refer [geometry-panel]] - [app.main.ui.inspect.attributes.image :refer [image-panel]] [app.main.ui.inspect.attributes.layout :refer [layout-panel]] [app.main.ui.inspect.attributes.layout-element :refer [layout-element-panel]] [app.main.ui.inspect.attributes.shadow :refer [shadow-panel]] @@ -69,7 +68,6 @@ :stroke stroke-panel :shadow shadow-panel :blur blur-panel - :image image-panel :text text-panel :svg svg-panel :variant variant-panel*) diff --git a/frontend/src/app/main/ui/inspect/attributes/image.cljs b/frontend/src/app/main/ui/inspect/attributes/image.cljs deleted file mode 100644 index bdf38f0b9a..0000000000 --- a/frontend/src/app/main/ui/inspect/attributes/image.cljs +++ /dev/null @@ -1,51 +0,0 @@ -;; This Source Code Form is subject to the terms of the Mozilla Public -;; License, v. 2.0. If a copy of the MPL was not distributed with this -;; file, You can obtain one at http://mozilla.org/MPL/2.0/. -;; -;; Copyright (c) KALEIDOS INC - -(ns app.main.ui.inspect.attributes.image - (:require-macros [app.main.style :as stl]) - (:require - [app.common.files.helpers :as cfh] - [app.common.media :as cm] - [app.config :as cf] - [app.main.ui.components.copy-button :refer [copy-button*]] - [app.util.code-gen.style-css :as css] - [app.util.i18n :refer [tr]] - [cuerdas.core :as str] - [rumext.v2 :as mf])) - -(defn has-image? [shape] - (= (:type shape) :image)) - -(mf/defc image-panel - [{:keys [objects shapes]}] - (for [shape (filter cfh/image-shape? shapes)] - [:div {:class (stl/css :attributes-block) - :key (str "image-" (:id shape))} - [:div {:class (stl/css :image-wrapper)} - [:img {:src (cf/resolve-file-media (-> shape :metadata))}]] - - [:div {:class (stl/css :image-row)} - [:div {:class (stl/css :global/attr-label)} - (tr "inspect.attributes.image.width")] - [:div {:class (stl/css :global/attr-value)} - [:> copy-button* {:data (css/get-css-property objects (:metadata shape) :width)} - [:div {:class (stl/css :button-children)} (css/get-css-value objects (:metadata shape) :width)]]]] - - [:div {:class (stl/css :image-row)} - [:div {:class (stl/css :global/attr-label)} - (tr "inspect.attributes.image.height")] - [:div {:class (stl/css :global/attr-value)} - [:> copy-button* {:data (css/get-css-property objects (:metadata shape) :height)} - [:div {:class (stl/css :button-children)} (css/get-css-value objects (:metadata shape) :height)]]]] - - (let [mtype (-> shape :metadata :mtype) - name (:name shape) - extension (cm/mtype->extension mtype)] - [:a {:class (stl/css :download-button) - :target "_blank" - :download (cond-> name extension (str/concat extension)) - :href (cf/resolve-file-media (-> shape :metadata))} - (tr "inspect.attributes.image.download")])]))