public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-yew-comp 1/1] key value list: accept objects as data
@ 2026-05-26 16:49 Stefan Hanreich
  2026-05-26 20:47 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hanreich @ 2026-05-26 16:49 UTC (permalink / raw)
  To: yew-devel

When setting the value, convert any objects into a list of (String,
Value) pairs and then set the data.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---

Notes:
    Not sure about this change, but accepting objects seems reasonable
    here? Probably good if someone with more clue about the component can
    chime in. Fixes the issue with resetting the prepared answer form for
    me.

 src/key_value_list.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/key_value_list.rs b/src/key_value_list.rs
index e6377b8..f579b04 100644
--- a/src/key_value_list.rs
+++ b/src/key_value_list.rs
@@ -242,6 +242,14 @@ impl ManagedField for KeyValueListField {
                         .unwrap();
                 self.set_data(&data);
             }
+            Value::Object(map) => {
+                let values: Vec<(String, Value)> = map
+                    .iter()
+                    .map(|(key, value)| (key.clone(), value.clone()))
+                    .collect();
+
+                self.set_data(&values);
+            }
             value => {
                 let data = serde_json::from_value::<Vec<(String, Value)>>(value.clone()).unwrap();
                 self.set_data(&data);
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* applied: [PATCH proxmox-yew-comp 1/1] key value list: accept objects as data
  2026-05-26 16:49 [PATCH proxmox-yew-comp 1/1] key value list: accept objects as data Stefan Hanreich
@ 2026-05-26 20:47 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-05-26 20:47 UTC (permalink / raw)
  To: yew-devel, Stefan Hanreich

On Tue, 26 May 2026 18:49:02 +0200, Stefan Hanreich wrote:
> When setting the value, convert any objects into a list of (String,
> Value) pairs and then set the data.

Applied, thanks!

[1/1] key value list: accept objects as data
      commit: e623cb531f1fda75ece6cdff1f169d0245c48d95




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-26 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 16:49 [PATCH proxmox-yew-comp 1/1] key value list: accept objects as data Stefan Hanreich
2026-05-26 20:47 ` applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal