]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/commitdiff
ManagedField: improve docs
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 9 Oct 2023 16:30:42 +0000 (18:30 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 9 Oct 2023 16:30:42 +0000 (18:30 +0200)
src/widget/form/checkbox2.rs
src/widget/form/field2.rs
src/widget/form/managed_field.rs
src/widget/form/number.rs
src/widget/form/selector2.rs
src/widget/form/textarea.rs
src/widget/form/tristate_boolean.rs
src/widget/menu/menu_checkbox2.rs

index 8016685bdb83e0165386f7ef5a048d6a53c1b541..5ee13d60a174ec3a1dd102f15b7b1b4f6be34abd 100644 (file)
@@ -94,11 +94,9 @@ impl ManagedField for CheckboxField {
             None => default.clone(),
         };
 
-        let valid = Ok(());
-
         ManagedFieldState {
             value: value.into(),
-            valid, // fixme: remove
+            valid: Ok(()),
             default: default.into(),
             radio_group: props.radio_group,
             unique: false,
index 0fb077f1bd34694368fedd8f28a16d6e040d9cdc..9bed2f97fbab22733224c0d1382f85a116c55c40 100644 (file)
@@ -248,7 +248,7 @@ impl ManagedField for StandardField {
 
         ManagedFieldState {
             value: value,
-            valid: Ok(()), // fixme
+            valid: Ok(()),
             default,
             radio_group: false,
             unique: false,
index a9dcfb165e1b272768d278715762d0cfb2bf4c73..0ce7335ce5c3d90312b8d2dc9ab342ce6ffd1e5f 100644 (file)
@@ -162,6 +162,11 @@ pub trait ManagedField: Sized {
     }
 
     /// Returns the initial field setup.
+    ///
+    /// # Note
+    ///
+    /// The [ManagedFieldState::valid] property is ignored and
+    /// immediately overwritten by a call to the validation function.
     fn setup(props: &Self::Properties) -> ManagedFieldState;
 
     /// Create the component state.
index b63518f807519cc1649a4042f0bf5d9d9e25ab37..88250060001abbe4ff80184c93f02873ca4c6e24 100644 (file)
@@ -371,7 +371,7 @@ impl<T: NumberTypeInfo> ManagedField for NumberField<T> {
 
         ManagedFieldState {
             value: value,
-            valid: Ok(()), // fixme:
+            valid: Ok(()),
             default,
             radio_group: false,
             unique: false,
index 51f4f5c9f76a9de0c2fa34c509e66d64bd391672..c13990d050f771fc28594d4f0691d1e28749d38c 100644 (file)
@@ -218,7 +218,7 @@ impl<S: DataStore + 'static> ManagedField for SelectorField<S> {
 
         ManagedFieldState {
             value,
-            valid: Ok(()), //fixme
+            valid: Ok(()),
             default,
             radio_group: false,
             unique: false,
index 282929fcb4f9b8ee8179c879ce72830a54fd2b55..4b550056682a94a1948c49b8ea056195ca4d80d8 100644 (file)
@@ -151,7 +151,7 @@ impl ManagedField for TextAreaField {
 
         ManagedFieldState {
             value: value,
-            valid: Ok(()), // fixme
+            valid: Ok(()),
             default,
             radio_group: false,
             unique: false,
index 462f53afc5cfe06108e4554a79217b3a7d49634f..eda00d55f086b1d30577262adf0e7d622ed7b01d 100644 (file)
@@ -129,7 +129,7 @@ impl ManagedField for PwtTristateBoolean {
 
         ManagedFieldState {
             value: value,
-            valid: Ok(()), // fixme
+            valid: Ok(()),
             default,
             radio_group: false,
             unique: false,
index eb6e76183b3e550ce075558bd66e00ee1d827d02..f6cc4fb10f76556fe5816bac09881f70b58c4da7 100644 (file)
@@ -126,7 +126,7 @@ impl ManagedField for MenuCheckboxField {
 
         ManagedFieldState {
             value: value.into(),
-            valid: Ok(()), //fixme
+            valid: Ok(()),
             default: default.into(),
             radio_group: props.radio_group,
             unique: true,