forked from Plugin-JF-Onkostar/osc-variant
Extract method to apply form field profile part
This commit is contained in:
@@ -28,7 +28,7 @@ use std::hash::{Hash, Hasher};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::profile::{FormReference, Profile};
|
||||
use crate::profile::{FormField, FormReference, Profile};
|
||||
|
||||
pub mod data_catalogue;
|
||||
pub mod data_form;
|
||||
@@ -232,6 +232,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn apply_profile_to_form_field<E>(entry: &mut E, form_field: &FormField)
|
||||
where
|
||||
E: FormEntry,
|
||||
{
|
||||
if entry.get_name() == form_field.name && form_field.hide {
|
||||
entry.hide()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait FormEntryContainer {
|
||||
fn apply_profile(&mut self, profile: &Profile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user