mirror of
https://github.com/penpot/penpot.git
synced 2026-09-08 13:09:22 +00:00
🐛 Fix title for button when trying to remove last variant property (#7017)
This commit is contained in:
parent
e43b6fb0b7
commit
4d688b1d55
@ -354,7 +354,7 @@
|
|||||||
|
|
||||||
[:*
|
[:*
|
||||||
[:div {:class (stl/css :variant-property-list)}
|
[: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 {:key (str variant-id "-" pos) :class (stl/css :variant-property-container)}
|
||||||
[:*
|
[:*
|
||||||
[:div {:class (stl/css :variant-property-name-wrapper)}
|
[:div {:class (stl/css :variant-property-name-wrapper)}
|
||||||
@ -1073,10 +1073,11 @@
|
|||||||
(when-not multi?
|
(when-not multi?
|
||||||
[:div {:class (stl/css :variant-property-list)}
|
[:div {:class (stl/css :variant-property-list)}
|
||||||
(for [[pos property] (map-indexed vector properties)]
|
(for [[pos property] (map-indexed vector properties)]
|
||||||
(let [meta (->> (:value property)
|
(let [last-prop? (<= (count properties) 1)
|
||||||
(move-empty-items-to-end)
|
meta (->> (:value property)
|
||||||
(replace {"" "--"})
|
(move-empty-items-to-end)
|
||||||
(str/join ", "))]
|
(replace {"" "--"})
|
||||||
|
(str/join ", "))]
|
||||||
[:div {:key (str (:id shape) pos)
|
[:div {:key (str (:id shape) pos)
|
||||||
:class (stl/css :variant-property-row)}
|
:class (stl/css :variant-property-row)}
|
||||||
[:> input-with-meta* {:value (:name property)
|
[:> input-with-meta* {:value (:name property)
|
||||||
@ -1085,11 +1086,13 @@
|
|||||||
:data-position pos
|
:data-position pos
|
||||||
:on-blur update-property-name}]
|
:on-blur update-property-name}]
|
||||||
[:> icon-button* {:variant "ghost"
|
[:> 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
|
:on-click remove-property
|
||||||
:data-position pos
|
:data-position pos
|
||||||
:icon "remove"
|
:icon "remove"
|
||||||
:disabled (<= (count properties) 1)}]]))])
|
:disabled last-prop?}]]))])
|
||||||
|
|
||||||
(if malformed?
|
(if malformed?
|
||||||
[:div {:class (stl/css :variant-warning-wrapper)}
|
[:div {:class (stl/css :variant-warning-wrapper)}
|
||||||
|
|||||||
@ -6973,6 +6973,10 @@ msgstr "Remove layout"
|
|||||||
msgid "workspace.shape.menu.remove-variant-property"
|
msgid "workspace.shape.menu.remove-variant-property"
|
||||||
msgstr "Remove 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
|
#: src/app/main/ui/workspace/context_menu.cljs:318
|
||||||
msgid "workspace.shape.menu.rename"
|
msgid "workspace.shape.menu.rename"
|
||||||
msgstr "Rename"
|
msgstr "Rename"
|
||||||
|
|||||||
@ -6975,6 +6975,10 @@ msgstr "Eliminar layout"
|
|||||||
msgid "workspace.shape.menu.remove-variant-property"
|
msgid "workspace.shape.menu.remove-variant-property"
|
||||||
msgstr "Eliminar propiedad"
|
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
|
#: src/app/main/ui/workspace/context_menu.cljs:318
|
||||||
msgid "workspace.shape.menu.rename"
|
msgid "workspace.shape.menu.rename"
|
||||||
msgstr "Renombrar"
|
msgstr "Renombrar"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user