Skip to content

Commit

Permalink
fix: report button visible for read-only studies
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvedder committed Aug 25, 2023
1 parent e490db0 commit 99daed1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions designer_v2/l10n-missing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"form_field_report_alphaConfidence_number",
"form_field_report_data_source_title",
"form_field_report_data_source_tooltip",
"form_field_report_data_source_required",
"action_reportPrimary"
"form_field_report_data_source_required"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ class ReportFormItemDelegate
onExecute: () async {
for (var e in formViewModelCollection.formViewModels) {
if (e.formData!.isPrimary) {
// todo make this more efficient
e.formData!.isPrimary = false;
e.buildFormData().isPrimary = false;
formViewModelCollection.add(e);
Expand All @@ -215,10 +214,11 @@ class ReportFormItemDelegate
}
model.formData!.isPrimary = true;
model.save();
//await owner.save(); with propagateOnSave=false
},
);
actions.insert(0, modalAction);
if(!owner.isReadonly) {
actions.insert(0, modalAction);
}

return withIcons(actions, modelActionIcons);
}
Expand Down
1 change: 1 addition & 0 deletions designer_v2/lib/features/design/study_form_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class StudyFormViewModel extends FormViewModel<Study> implements IFormViewModelD
enrollmentFormViewModel.read();
measurementsFormViewModel.read();
interventionsFormViewModel.read();
reportsFormViewModel.read();
super.read(formData);
}

Expand Down
1 change: 1 addition & 0 deletions designer_v2/lib/localization/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
"action_remove": "Entfernen",
"action_duplicate": "Duplizieren",
"action_clipboard": "In Zwischenablage kopieren",
"action_reportPrimary": "Als Primärauswertung setzen",
"action_study_duplicate_draft": "Als Entwurf duplizieren",
"action_study_export_results": "Ergebnisdaten exportieren",
"dialog_close": "Schließen",
Expand Down

0 comments on commit 99daed1

Please sign in to comment.