-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #974 from qbicsoftware/development
- Loading branch information
Showing
24 changed files
with
577 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../qbic/portal/offermanager/components/affiliation/search/ArchiveAffiliationController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package life.qbic.portal.offermanager.components.affiliation.search; | ||
|
||
import java.util.Objects; | ||
import life.qbic.business.RefactorConverter; | ||
import life.qbic.business.persons.affiliation.archive.ArchiveAffiliationInput; | ||
import life.qbic.datamodel.dtos.business.Affiliation; | ||
|
||
public class ArchiveAffiliationController { | ||
|
||
private final ArchiveAffiliationInput archiveAffiliationInput; | ||
|
||
public ArchiveAffiliationController(ArchiveAffiliationInput archiveAffiliationInput) { | ||
this.archiveAffiliationInput = Objects.requireNonNull(archiveAffiliationInput); | ||
} | ||
|
||
public void archive(Affiliation affiliation) { | ||
life.qbic.business.persons.affiliation.Affiliation convertedAffiliation = RefactorConverter.toAffiliation(affiliation); | ||
archiveAffiliationInput.archive(convertedAffiliation); | ||
} | ||
|
||
|
||
|
||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...e/qbic/portal/offermanager/components/affiliation/search/ArchiveAffiliationPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package life.qbic.portal.offermanager.components.affiliation.search; | ||
|
||
import java.util.Objects; | ||
import life.qbic.business.RefactorConverter; | ||
import life.qbic.business.persons.affiliation.archive.ArchiveAffiliationOutput; | ||
import life.qbic.datamodel.dtos.business.Affiliation; | ||
import life.qbic.portal.offermanager.components.AppViewModel; | ||
import life.qbic.portal.offermanager.dataresources.ResourcesService; | ||
|
||
public class ArchiveAffiliationPresenter implements ArchiveAffiliationOutput { | ||
|
||
private final ResourcesService<Affiliation> affiliationResourcesService; | ||
|
||
private final AppViewModel sharedViewModel; | ||
|
||
public ArchiveAffiliationPresenter(ResourcesService<Affiliation> affiliationResourcesService, | ||
AppViewModel sharedViewModel) { | ||
this.affiliationResourcesService = Objects.requireNonNull(affiliationResourcesService); | ||
this.sharedViewModel = Objects.requireNonNull(sharedViewModel); | ||
} | ||
|
||
|
||
@Override | ||
public void failNotification(String notification) { | ||
sharedViewModel.getFailureNotifications().add(notification); | ||
} | ||
|
||
@Override | ||
public void archivedAffiliation(life.qbic.business.persons.affiliation.Affiliation affiliation) { | ||
affiliationResourcesService.reloadResources(); | ||
affiliationResourcesService.removeFromResource(RefactorConverter.toAffiliationDto(affiliation)); | ||
sharedViewModel.getSuccessNotifications().add("Archived affiliation successfully"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.