1
0
mirror of https://github.com/pcvolkmer/osc-variant.git synced 2025-04-19 11:46:50 +00:00

Show notice if form has no field to be used as procedure date

This indicates that the form cannot be used as main form, but as subform only.
This commit is contained in:
Paul-Christian Volkmer 2023-09-03 14:03:31 +02:00
parent 54cea88486
commit 31eda3efc9

View File

@ -192,13 +192,25 @@ impl FormEntryContainer for DataForm {
impl Listable for DataForm {
fn to_listed_string(&self) -> String {
format!(
"Formular ({}) '{}' in Revision '{}'",
"Formular ({}) '{}' in Revision '{}' {}",
match self.is_system_library_content() {
true => style("S").yellow(),
_ => style("u"),
},
style(&self.name).yellow(),
style(&self.revision).yellow()
style(&self.revision).yellow(),
if self
.entries
.entry
.iter()
.filter(|entry| entry.procedure_date_status != "none")
.count()
== 0
{
style("Formular hat keine Angabe zum Prozedurdatum!").red()
} else {
style("")
}
)
}
}