Skip to content

Commit 09a7a09

Browse files
author
Levente Gal
committed
#12963 Incorrect saving message appears when saving a sample
1 parent 138ef7e commit 09a7a09

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ public void savePathogenTests(List<PathogenTestDto> pathogenTests, SampleReferen
311311
handleAssociatedCase(pathogenTests, associatedCase, suppressNavigateToCase);
312312
}
313313

314-
Notification.show(I18nProperties.getString(Strings.messagePathogenTestsSavedShort), TRAY_NOTIFICATION);
314+
Notification.show(
315+
I18nProperties.getString(pathogenTests.size() == 1 ? Strings.messagePathogenTestSavedShort : Strings.messagePathogenTestsSavedShort),
316+
TRAY_NOTIFICATION);
315317
}
316318

317319
private void handleAssociatedCase(List<PathogenTestDto> pathogenTests, CaseReferenceDto associatedCase, boolean suppressNavigateToCase) {

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/humansample/SampleController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ private CommitDiscardWrapperComponent<SampleCreateForm> getSampleCreateComponent
304304
if (callback != null) {
305305
callback.run();
306306
}
307+
308+
Notification.show(I18nProperties.getString(Strings.messageSampleSaved), Type.TRAY_NOTIFICATION);
307309
}
308310
});
309311

@@ -360,6 +362,8 @@ public CommitDiscardWrapperComponent<SampleCreateForm> getSampleReferralCreateCo
360362
SampleDto updatedSample = FacadeProvider.getSampleFacade().getSampleByUuid(existingSample.getUuid());
361363
updatedSample.setReferredTo(referralSample.toReference());
362364
FacadeProvider.getSampleFacade().saveSample(updatedSample);
365+
366+
Notification.show(I18nProperties.getString(Strings.messageSampleSaved), Type.TRAY_NOTIFICATION);
363367
}
364368
});
365369
return createView;

sormas-ui/src/main/java/de/symeda/sormas/ui/samples/humansample/SampleEditPathogenTestListHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public List<PathogenTestDto> getPathogenTests() {
3939
}
4040

4141
public void saveAll(SampleReferenceDto sample) {
42-
ControllerProvider.getPathogenTestController().savePathogenTests(pathogenTests, sample, true);
42+
if (!pathogenTests.isEmpty()) {
43+
ControllerProvider.getPathogenTestController().savePathogenTests(pathogenTests, sample, true);
44+
}
4345
}
4446
}

0 commit comments

Comments
 (0)