diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart index 15c82f27..66747056 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart @@ -23,7 +23,7 @@ class BuildFilesList extends StatefulWidget { final Patient selectedPatient; final Business? business; final BusinessUser? businessUser; - + final String type; const BuildFilesList({ super.key, required this.files, @@ -31,6 +31,7 @@ class BuildFilesList extends StatefulWidget { required this.selectedPatient, required this.business, required this.businessUser, + required this.type, }); @override @@ -204,14 +205,17 @@ class _BuildFilesListState extends State { ) ], windowTools: [ - IconButton( - onPressed: () { - deleteFilePopUp(filePath, fileID); - }, - icon: Icon( - size: 35, - Icons.delete, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + Visibility( + visible: widget.type == "business", + child: IconButton( + onPressed: () { + deleteFilePopUp(filePath, fileID); + }, + icon: Icon( + size: 35, + Icons.delete, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), ), ), ], diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart index 0ddabf74..a31fc2d5 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart @@ -24,6 +24,7 @@ class BuildNotesList extends StatefulWidget { final Patient selectedPatient; final Business? business; final BusinessUser? businessUser; + final String type; const BuildNotesList({ super.key, required this.notes, @@ -31,6 +32,7 @@ class BuildNotesList extends StatefulWidget { required this.selectedPatient, required this.business, required this.businessUser, + required this.type, }); @override @@ -134,13 +136,16 @@ class _BuildNotesListState extends State { fullscreen: true, windowTitle: selectednote.note_name, windowTools: [ - IconButton( - onPressed: () { - deletePatientPopUp(selectednote.idpatient_notes); - }, - icon: Icon( - Icons.delete, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + Visibility( + visible: widget.type == "business", + child: IconButton( + onPressed: () { + deletePatientPopUp(selectednote.idpatient_notes); + }, + icon: Icon( + Icons.delete, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), ), ), ], diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart index 18782465..00249105 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart @@ -529,6 +529,7 @@ class _PatientFilesState extends State { selectedPatient: widget.selectedPatient, business: widget.business, businessUser: widget.businessUser, + type: widget.type, ), ]); } else { diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_notes.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_notes.dart index 2ec44343..d0b66691 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_notes.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_notes.dart @@ -440,6 +440,7 @@ class _PatientNotesState extends State { selectedPatient: widget.selectedPatient, business: widget.business, businessUser: widget.businessUser, + type: widget.type, ), ]); } else {