Skip to content

Commit a02bd82

Browse files
Avoiding extra click to make the case classification for IMI take effect
1 parent 1ecdbac commit a02bd82

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/contact/SourceContactListComponent.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.vaadin.ui.VerticalLayout;
2626
import com.vaadin.ui.themes.ValoTheme;
2727

28+
import de.symeda.sormas.api.FacadeProvider;
2829
import de.symeda.sormas.api.ReferenceDto;
2930
import de.symeda.sormas.api.caze.CaseReferenceDto;
3031
import de.symeda.sormas.api.contact.ContactReferenceDto;
@@ -76,7 +77,12 @@ private void createSourceContactListComponent(SourceContactList sourceContactLis
7677
Button createButton = ButtonHelper.createIconButton(
7778
Captions.contactNewContact,
7879
VaadinIcons.PLUS_CIRCLE,
79-
e -> view.showUnsavedChangesPopup(() -> ControllerProvider.getContactController().create(caseReference, true, SormasUI::refreshView)),
80+
e -> view.showUnsavedChangesPopup(() -> ControllerProvider.getContactController().create(caseReference, true, () -> {
81+
// For case classification effectiveness, extra save is needed.
82+
// Ideally, we should mark the epi case data form as dirty when a contact is created, but we couldn't find a way to do that.
83+
FacadeProvider.getCaseFacade().save(FacadeProvider.getCaseFacade().getByUuid(caseReference.getUuid()));
84+
SormasUI.refreshView();
85+
})),
8086
ValoTheme.BUTTON_PRIMARY);
8187
componentHeader.addComponent(createButton);
8288
componentHeader.setComponentAlignment(createButton, Alignment.MIDDLE_RIGHT);

0 commit comments

Comments
 (0)