Skip to content

Commit

Permalink
[GITFLOW]merging 'hotfix-1.76.5' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
MateStrysewske committed Nov 14, 2022
2 parents 0c0e51b + 866677d commit b7bc62c
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 17 deletions.
2 changes: 1 addition & 1 deletion sormas-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import de.symeda.sormas.api.contact.ContactFacade;
import de.symeda.sormas.api.customizableenum.CustomizableEnumFacade;
import de.symeda.sormas.api.dashboard.DashboardFacade;
import de.symeda.sormas.api.deletionconfiguration.DeletionConfigurationFacade;
import de.symeda.sormas.api.disease.DiseaseConfigurationFacade;
import de.symeda.sormas.api.docgeneneration.DocumentTemplateFacade;
import de.symeda.sormas.api.docgeneneration.EventDocumentFacade;
Expand Down Expand Up @@ -484,6 +485,10 @@ public static AuditLoggerFacade getAuditLoggerFacade() {
return get().lookupEjbRemote(AuditLoggerFacade.class);
}

public static DeletionConfigurationFacade getDeletionConfigurationFacade() {
return get().lookupEjbRemote(DeletionConfigurationFacade.class);
}

@SuppressWarnings("unchecked")
public <P> P lookupEjbRemote(Class<P> clazz) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@

@Remote
public interface DeletionConfigurationFacade {

void startAutomaticDeletion();

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public interface Captions {
String actionDismiss = "actionDismiss";
String actionEnable = "actionEnable";
String actionEnterBulkEditMode = "actionEnterBulkEditMode";
String actionExecuteAutomaticDeletion = "actionExecuteAutomaticDeletion";
String actionGenerate = "actionGenerate";
String actionGenerateNewPassword = "actionGenerateNewPassword";
String actionGenerateNewPasswords = "actionGenerateNewPasswords";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ public interface Strings {
String headingArchiveImmunization = "headingArchiveImmunization";
String headingArchiveTravelEntry = "headingArchiveTravelEntry";
String headingArchivingNotPossible = "headingArchivingNotPossible";
String headingAutomaticDeletionStarted = "headingAutomaticDeletionStarted";
String headingBurialDetails = "headingBurialDetails";
String headingCampaignBasics = "headingCampaignBasics";
String headingCampaignDashboard = "headingCampaignDashboard";
Expand Down Expand Up @@ -937,6 +938,7 @@ public interface Strings {
String messageAreasArchived = "messageAreasArchived";
String messageAreasArchivingNotPossible = "messageAreasArchivingNotPossible";
String messageAreasDearchived = "messageAreasDearchived";
String messageAutomaticDeletionStarted = "messageAutomaticDeletionStarted";
String messageBulkCasesWithDifferentDiseasesSelected = "messageBulkCasesWithDifferentDiseasesSelected";
String messageBulkContactsWithDifferentDiseasesSelected = "messageBulkContactsWithDifferentDiseasesSelected";
String messageBulkDontShareWithReportingToolWarning = "messageBulkDontShareWithReportingToolWarning";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ public enum UserRight {
public static final String _SORMAS_UI = "SORMAS_UI";
public static final String _SORMAS_TO_SORMAS_CLIENT = "SORMAS_TO_SORMAS_CLIENT";
public static final String _EXTERNAL_VISITS = "EXTERNAL_VISITS";
public static final String _DEV_MODE = "DEV_MODE";

private static final Map<UserRight, Set<UserRight>> userRightDependencies = buildUserRightDependencies();

Expand Down
1 change: 1 addition & 0 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ actionOkAndGoToMerge = Okay, and continue to merge overview
actionOkAndGoToContactDirectory = Okay, and continue to contact directory
actionOkAndGoToContactDetails = Okay, and continue to contact
actionOkAndGoToPersonDirectory = Okay, and continue to person directory
actionExecuteAutomaticDeletion = Execute automatic deletion
activityAsCaseFlightNumber=Flight number
ActivityAsCase=Activity as case
ActivityAsCase.startDate=Start of activity
Expand Down
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/strings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ headingDeleteUserRoleNotPossible = Cannot delete user role
headingSaveUserNotPossible = Cannot save user
immunizationVaccinationHeading = Vaccination
immunizationRecoveryHeading = Recovery
headingAutomaticDeletionStarted = Automatic deletion started

# Info texts
infoActivityAsCaseInvestigation = <i>Please document ALL relevant activities after infection:</i>
Expand Down Expand Up @@ -1257,6 +1258,7 @@ messageSormasToSormasSimilarConvertedContactFound = There is at least one simila
messageSormasToSormasSimilarCaseToContactFound = There is at least one similar case in your system.</br>After accepting the request, it may be necessary to perform a manual conversion of the accepted contacts.
messageSormasToSormasSimilarPersonFound = There is at least one similar person in your system. If you accept the request the case/contact maybe will create a person in your system as a duplicate.</br>Please check this after accepting.
messageDeleteWithPendingShareRequest = There is a pending share request. With a deletion, the share request will be revoked and deleted.
messageAutomaticDeletionStarted = Automatic deletion has been started and will be executed in the background. Please note that, depending on the amount of data that is deleted, this process can take some time.
# Notifications
notificationCaseClassificationChanged = The classification of case %s has changed to %s.
notificationCaseInvestigationDone = The investigation of case %s has been done.
Expand Down
2 changes: 1 addition & 1 deletion sormas-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sormas-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
package de.symeda.sormas.backend.deletionconfiguration;

import javax.ejb.Asynchronous;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

import de.symeda.sormas.api.deletionconfiguration.DeletionConfigurationFacade;
import de.symeda.sormas.api.user.UserRight;
import de.symeda.sormas.backend.common.CronService;
import de.symeda.sormas.backend.util.RightsAllowed;

@Stateless(name = "DeletionConfigurationFacade")
public class DeletionConfigurationFacadeEjb implements DeletionConfigurationFacade {

@EJB
private CronService cronService;

@Override
@Asynchronous
@RightsAllowed(UserRight._DEV_MODE)
public void startAutomaticDeletion() {
cronService.deleteExpiredEntities();
}

@LocalBean
@Stateless
public static class DeletionConfigurationFacadeEjbLocal extends DeletionConfigurationFacadeEjb {

}
}
2 changes: 1 addition & 1 deletion sormas-base/dependencies/serverlibs.pom
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<packaging>pom</packaging>
<version>1.76.4</version>
<version>1.76.5</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion sormas-cargoserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-ear/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-keycloak-service-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sormas-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
import de.symeda.sormas.ui.utils.ButtonHelper;
import de.symeda.sormas.ui.utils.CssStyles;
import de.symeda.sormas.ui.utils.DateFormatHelper;
import de.symeda.sormas.ui.utils.VaadinUiUtil;

public class DevModeView extends AbstractConfigurationView {

Expand Down Expand Up @@ -168,12 +169,20 @@ private HorizontalLayout createDevButtonsLayout() {
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSpacing(true);

Button btnResetEnumCache = ButtonHelper.createButton((Captions.actionResetEnumCache), e -> {
FacadeProvider.getCustomizableEnumFacade().loadData();
});

Button btnResetEnumCache =
ButtonHelper.createButton((Captions.actionResetEnumCache), e -> FacadeProvider.getCustomizableEnumFacade().loadData());
horizontalLayout.addComponent(btnResetEnumCache);

Button btnExecuteAutomaticDeletion = ButtonHelper.createButton((Captions.actionExecuteAutomaticDeletion), e -> {
VaadinUiUtil.showSimplePopupWindow(
I18nProperties.getString(Strings.headingAutomaticDeletionStarted),
I18nProperties.getString(Strings.messageAutomaticDeletionStarted),
ContentMode.TEXT,
640);
FacadeProvider.getDeletionConfigurationFacade().startAutomaticDeletion();
});
horizontalLayout.addComponent(btnExecuteAutomaticDeletion);

return horizontalLayout;
}

Expand Down Expand Up @@ -1247,8 +1256,8 @@ private void generateContacts() {
int[] followUpDays = random().ints(1, followUpCount + 1).distinct().limit(followUpCount).toArray();
List<LocalDateTime> followUpDates = new ArrayList<>();
for (int day : followUpDays) {
followUpDates.add(
UtilDate.toLocalDate(contactStartDate).atStartOfDay().plusDays(day - 1).plusMinutes(random().nextInt(60 * 24 + 1)));
followUpDates
.add(UtilDate.toLocalDate(contactStartDate).atStartOfDay().plusDays(day - 1).plusMinutes(random().nextInt(60 * 24 + 1)));
}

for (LocalDateTime date : followUpDates) {
Expand Down
2 changes: 1 addition & 1 deletion sormas-widgetset/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.76.4</version>
<version>1.76.5</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down

0 comments on commit b7bc62c

Please sign in to comment.