Extract method to apply form field profile part

This commit is contained in:
2023-09-01 12:31:48 +02:00
parent 1e7a95bb09
commit 3ec51099c7
3 changed files with 24 additions and 15 deletions

View File

@@ -30,8 +30,9 @@ use serde::{Deserialize, Serialize};
use crate::model::onkostar_editor::OnkostarEditor;
use crate::model::requirements::{Requirement, Requires};
use crate::model::{
apply_profile_to_form_entry, Ansichten, Comparable, Entries, Filter, FolderContent, FormEntry,
FormEntryContainer, Listable, MenuCategory, PlausibilityRules, RefEntries, Script, Sortable,
apply_profile_to_form_entry, apply_profile_to_form_field, Ansichten, Comparable, Entries,
Filter, FolderContent, FormEntry, FormEntryContainer, Listable, MenuCategory,
PlausibilityRules, RefEntries, Script, Sortable,
};
use crate::model::{Haeufigkeiten, Ordner};
use crate::profile::Profile;
@@ -170,11 +171,10 @@ impl FormEntryContainer for DataForm {
});
// Hide form field using filter set to "false" if requested
profile_form.form_fields.iter().for_each(|form_field| {
if entry.name == form_field.name && form_field.hide {
entry.hide()
}
});
profile_form
.form_fields
.iter()
.for_each(|form_field| apply_profile_to_form_field(entry, form_field));
if let Some(menu_category) = &profile_form.menu_category {
self.menu_category = Some(MenuCategory {