diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs index b1d0d9e670..73469d1bbd 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs @@ -354,7 +354,7 @@ [:* [:div {:class (stl/css :variant-property-list)} - (for [[pos prop] (map vector (range) properties)] + (for [[pos prop] (map-indexed vector properties)] [:div {:key (str variant-id "-" pos) :class (stl/css :variant-property-container)} [:* [:div {:class (stl/css :variant-property-name-wrapper)} @@ -1073,10 +1073,11 @@ (when-not multi? [:div {:class (stl/css :variant-property-list)} (for [[pos property] (map-indexed vector properties)] - (let [meta (->> (:value property) - (move-empty-items-to-end) - (replace {"" "--"}) - (str/join ", "))] + (let [last-prop? (<= (count properties) 1) + meta (->> (:value property) + (move-empty-items-to-end) + (replace {"" "--"}) + (str/join ", "))] [:div {:key (str (:id shape) pos) :class (stl/css :variant-property-row)} [:> input-with-meta* {:value (:name property) @@ -1085,11 +1086,13 @@ :data-position pos :on-blur update-property-name}] [:> icon-button* {:variant "ghost" - :aria-label (tr "workspace.shape.menu.remove-variant-property") + :aria-label (if last-prop? + (tr "workspace.shape.menu.remove-variant-property.last-property") + (tr "workspace.shape.menu.remove-variant-property")) :on-click remove-property :data-position pos :icon "remove" - :disabled (<= (count properties) 1)}]]))]) + :disabled last-prop?}]]))]) (if malformed? [:div {:class (stl/css :variant-warning-wrapper)} diff --git a/frontend/translations/en.po b/frontend/translations/en.po index dec86d9dab..0b60e95992 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -6973,6 +6973,10 @@ msgstr "Remove layout" msgid "workspace.shape.menu.remove-variant-property" msgstr "Remove property" +#: src/app/main/ui/workspace/sidebar/options/menus/component.cljs:974 +msgid "workspace.shape.menu.remove-variant-property.last-property" +msgstr "Variant should have at least one property" + #: src/app/main/ui/workspace/context_menu.cljs:318 msgid "workspace.shape.menu.rename" msgstr "Rename" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 3821c05bed..7e2ef32b88 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -6975,6 +6975,10 @@ msgstr "Eliminar layout" msgid "workspace.shape.menu.remove-variant-property" msgstr "Eliminar propiedad" +#: src/app/main/ui/workspace/sidebar/options/menus/component.cljs:974 +msgid "workspace.shape.menu.remove-variant-property.last-property" +msgstr "La variante debe tener al menos una propiedad" + #: src/app/main/ui/workspace/context_menu.cljs:318 msgid "workspace.shape.menu.rename" msgstr "Renombrar"