Issue #8: Add initial sorting based on form dependencies

This commit is contained in:
2023-09-30 15:06:24 +02:00
parent 86e988c50e
commit 416204b30a
6 changed files with 93 additions and 1 deletions

View File

@@ -233,6 +233,10 @@ impl OnkostarEditor {
.data_form
.sort_unstable_by_key(|e| e.sorting_key());
self.editor
.data_form
.sort_unstable_by(DataForm::compare_by_requirement);
self.editor.data_form.iter_mut().for_each(|item| {
item.sorted();
});
@@ -241,6 +245,10 @@ impl OnkostarEditor {
.unterformular
.sort_unstable_by_key(|e| e.sorting_key());
self.editor
.unterformular
.sort_unstable_by(Unterformular::compare_by_requirement);
self.editor.unterformular.iter_mut().for_each(|item| {
item.sorted();
});