2222import java .util .HashSet ;
2323import java .util .List ;
2424import java .util .Set ;
25+ import java .util .function .Consumer ;
2526
2627import org .apache .commons .lang3 .StringUtils ;
2728
5051import de .symeda .sormas .api .event .EventParticipantDto ;
5152import de .symeda .sormas .api .event .EventParticipantReferenceDto ;
5253import de .symeda .sormas .api .event .EventReferenceDto ;
54+ import de .symeda .sormas .api .event .EventStatus ;
5355import de .symeda .sormas .api .i18n .Captions ;
5456import de .symeda .sormas .api .i18n .I18nProperties ;
5557import de .symeda .sormas .api .i18n .Strings ;
@@ -269,15 +271,17 @@ public boolean linkCaseToEvent(EventReferenceDto eventReferenceDto, CaseDataDto
269271 final PersonDto personDto = FacadeProvider .getPersonFacade ().getPersonByUuid (caseDataDto .getPerson ().getUuid ());
270272 final EventParticipantDto eventParticipantDto =
271273 new EventParticipantDto ().buildFromCase (caseRef , personDto , eventReferenceDto , UserProvider .getCurrent ().getUserReference ());
272- ControllerProvider .getEventParticipantController ().createEventParticipant (eventReferenceDto , r -> {}, eventParticipantDto );
274+ ControllerProvider .getEventParticipantController ().createEventParticipant (eventReferenceDto , r -> {
275+ }, eventParticipantDto );
273276 return false ;
274277 }
275278
276279 public void createEventParticipantWithContact (EventReferenceDto eventReferenceDto , ContactDto contact ) {
277280 final PersonDto personDto = FacadeProvider .getPersonFacade ().getPersonByUuid (contact .getPerson ().getUuid ());
278281 final EventParticipantDto eventParticipantDto =
279282 new EventParticipantDto ().buildFromPerson (personDto , eventReferenceDto , UserProvider .getCurrent ().getUserReference ());
280- ControllerProvider .getEventParticipantController ().createEventParticipant (eventReferenceDto , r -> {}, eventParticipantDto );
283+ ControllerProvider .getEventParticipantController ().createEventParticipant (eventReferenceDto , r -> {
284+ }, eventParticipantDto );
281285 }
282286
283287 public void navigateToIndex () {
@@ -426,7 +430,7 @@ public CommitDiscardWrapperComponent<EventDataForm> getEventCreateComponent(
426430 return component ;
427431 }
428432
429- public CommitDiscardWrapperComponent <EventDataForm > getEventDataEditComponent (final String eventUuid ) {
433+ public CommitDiscardWrapperComponent <EventDataForm > getEventDataEditComponent (final String eventUuid , Consumer < EventStatus > saveCallback ) {
430434
431435 EventDto event = findEvent (eventUuid );
432436 EventDataForm eventEditForm = new EventDataForm (false , event .isPseudonymized ());
@@ -442,6 +446,10 @@ public CommitDiscardWrapperComponent<EventDataForm> getEventDataEditComponent(fi
442446 eventDto = FacadeProvider .getEventFacade ().saveEvent (eventDto );
443447 Notification .show (I18nProperties .getString (Strings .messageEventSaved ), Type .WARNING_MESSAGE );
444448 SormasUI .refreshView ();
449+
450+ if (saveCallback != null ) {
451+ saveCallback .accept (eventDto .getEventStatus ());
452+ }
445453 }
446454 });
447455
0 commit comments