Skip to content

Commit

Permalink
Merge branch 'development' into #12794-the_same_person_should_not_be_…
Browse files Browse the repository at this point in the history
…allowed_to_be_added_as_event_participant
  • Loading branch information
carina29 committed Jan 8, 2024
2 parents bfc98c6 + 57e34ac commit 2400118
Show file tree
Hide file tree
Showing 21 changed files with 159 additions and 110 deletions.
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The development team uses an epic as an umbrella for large change or feature str

## Contributing to the Project

There are many ways in which you can contribute to this project as a non-developer. If there is something you would like to do that you don't find instructions about here - or if you want to learn how you can get involved - please contact us at sormas@helmholtz-hzi.de
There are many ways in which you can contribute to this project as a non-developer. If there is something you would like to do that you don't find instructions about here - or if you want to learn how you can get involved - please contact us at info@sormas.org
or through our [GitHub Discussions](https://github.com/sormas-foundation/SORMAS-Project/discussions) and let us know how we can assist you!

Some possibilities to contribute to SORMAS are:
Expand All @@ -115,7 +115,7 @@ Some possibilities to contribute to SORMAS are:
## Contributing to the Code

If you're interested in participating in the development of SORMAS, please follow the [Development Environment Setup Instructions](DEVELOPMENT_ENVIRONMENT.md) before you start developing. If you have problems setting up your development environment or need assistance in choosing the first issue to work on,
please get in touch with us through our [GitHub Discussions](https://github.com/sormas-foundation/SORMAS-Project/discussions) or by contacting us at sormas@helmholtz-hzi.de.
please get in touch with us through our [GitHub Discussions](https://github.com/sormas-foundation/SORMAS-Project/discussions) or by contacting us at info@sormas.org.

Additionally, our [Wiki](https://github.com/sormas-foundation/SORMAS-Project/wiki) contains some specific development guides that cover common issues like adding new fields to an entity that we suggest to check out before you start implementing something related to those topics:

Expand Down Expand Up @@ -249,4 +249,4 @@ These dependencies have been added to the dependabot ignore list, so no dependen

#### Keycloak
The Keycloak version in SORMAS-Project only defines the version of the Keycloak admin client library. When a new version of Keycloak is available this should be updated after the [Keycloak version is SORMAS-Docker](https://github.com/SORMAS-Foundation/SORMAS-Docker/blob/devops/keycloak/Dockerfile) has been updated. \
This can be tested locally by building the updated Keycloak docker image and then using it in a [container](https://github.com/SORMAS-Foundation/SORMAS-Project/tree/development/sormas-base/setup/keycloak) together with a local Payara instance.
This can be tested locally by building the updated Keycloak docker image and then using it in a [container](https://github.com/SORMAS-Foundation/SORMAS-Project/tree/development/sormas-base/setup/keycloak) together with a local Payara instance.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import de.symeda.sormas.api.externalmessage.processing.flow.ProcessingResult;
import de.symeda.sormas.api.externalmessage.processing.flow.ProcessingResultStatus;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.infrastructure.facility.FacilityDto;
import de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto;
import de.symeda.sormas.api.infrastructure.facility.FacilityType;
Expand Down Expand Up @@ -157,7 +156,7 @@ protected CaseDataDto buildCase(PersonDto person, ExternalMessageDto externalMes
caseDto.setReportDate(
externalMessageDto.getCaseReportDate() != null ? externalMessageDto.getCaseReportDate() : externalMessageDto.getMessageDateTime());

if (processingFacade.isFeaturePropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (processingFacade.isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
caseDto.setResponsibleRegion(processingFacade.getDefaultRegionReference());
caseDto.setResponsibleDistrict(processingFacade.getDefaultDistrictReference());
caseDto.setResponsibleCommunity(processingFacade.getDefaultCommunityReference());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import de.symeda.sormas.api.externalmessage.ExternalMessageFacade;
import de.symeda.sormas.api.feature.FeatureConfigurationFacade;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.infrastructure.community.CommunityFacade;
import de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto;
import de.symeda.sormas.api.infrastructure.country.CountryFacade;
Expand Down Expand Up @@ -253,8 +252,8 @@ public PersonDto getPersonByContext(PersonContext personContext, String personUu

}

public boolean isFeaturePropertyValueTrue(FeatureType featureType, FeatureTypeProperty featureTypeProperty) {
return featureConfigurationFacade.isPropertyValueTrue(featureType, featureTypeProperty);
public boolean isFeatureEnabled(FeatureType featureType) {
return featureConfigurationFacade.isFeatureEnabled(featureType);
}

public RegionReferenceDto getDefaultRegionReference() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ public enum FeatureType {
// FEATURE MODULES
AGGREGATE_REPORTING(true, true, null, null, null),
CAMPAIGNS(true, false, null, null, null),
CASE_SURVEILANCE(true,
true,
null,
null,
ImmutableMap
.of(FeatureTypeProperty.AUTOMATIC_RESPONSIBILITY_ASSIGNMENT, Boolean.TRUE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS, Boolean.FALSE)),
CASE_SURVEILANCE(true, true, null, null, ImmutableMap.of(FeatureTypeProperty.AUTOMATIC_RESPONSIBILITY_ASSIGNMENT, Boolean.TRUE)),
CLINICAL_MANAGEMENT(true, true, null, null, null),
CONTACT_TRACING(true,
true,
Expand Down Expand Up @@ -208,6 +203,7 @@ public enum FeatureType {
ImmutableMap.of(FeatureTypeProperty.THRESHOLD_IN_DAYS, 90)),
EDIT_ARCHIVED_ENTITIES(true, true, null, null, null),
EXTERNAL_EMAILS(true, false, null, null, null),
HIDE_JURISDICTION_FIELDS(true, false, null, null, null),

// SHOW/HIDE VIEW TAB FEATURES
VIEW_TAB_CASES_HOSPITALIZATION(true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public enum FeatureTypeProperty {
SHARE_SAMPLES(Boolean.class),
SHARE_IMMUNIZATIONS(Boolean.class),
SHARE_REPORTS(Boolean.class),
FETCH_MODE(Boolean.class),
HIDE_JURISDICTION_FIELDS(Boolean.class);
FETCH_MODE(Boolean.class);

private final Class<?> returnType;

Expand Down
8 changes: 7 additions & 1 deletion sormas-backend/src/main/resources/sql/sormas_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12833,5 +12833,11 @@ ALTER TABLE userroles_history ADD COLUMN restrictAccessToAssignedEntities boolea

INSERT INTO schema_version (version_number, comment) VALUES (536, 'Assign case(s) to a User and allow them to see the data of only the assigned case(s) in the system #12697');

-- 2023-12-18 Move hide jurisdiction fields feature property to dedicated feature type #12806
INSERT INTO featureconfiguration (id, uuid, creationdate, changedate, enabled, featuretype)VALUES (nextval('entity_seq'), generate_base32_uuid(), now(), now(), (SELECT properties::jsonb->'HIDE_JURISDICTION_FIELDS' FROM featureconfiguration WHERE featuretype = 'CASE_SURVEILANCE')::text::boolean, 'HIDE_JURISDICTION_FIELDS');

-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
UPDATE featureconfiguration SET properties = properties::jsonb - 'HIDE_JURISDICTION_FIELDS' WHERE featuretype = 'CASE_SURVEILANCE';

INSERT INTO schema_version (version_number, comment) VALUES (537, 'Move hide jurisdiction fields feature property to dedicated feature type #12806');

-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class EditSharesPage {

public static final By SHARE_FIRST_EYE_ICON = By.xpath("(//span[@class='v-icon v-icon-eye'])[1]");
public static final By SHARE_FIRST_EYE_ICON = By.cssSelector(".v-icon.v-icon-eye");
public static final By SHARE_UUID_CASE_TITLE =
By.cssSelector(".popupContent [class='v-grid-cell v-grid-cell-focused'] a");
public static final By EXTRA_COMMENT_INPUT_SHARE_POPUP = By.cssSelector(".popupContent #comment");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public SharesDirectorySteps(
When(
"I click on the The Eye Icon located in the Shares Page",
() -> {
TimeUnit.SECONDS.sleep(2); // wait for the page to load all records
TimeUnit.SECONDS.sleep(3); // wait for the page to load all records
webDriverHelpers.waitUntilIdentifiedElementIsPresent(SHARE_FIRST_EYE_ICON);
webDriverHelpers.clickOnWebElementBySelector(SHARE_FIRST_EYE_ICON);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import de.symeda.sormas.api.disease.DiseaseVariant;
import de.symeda.sormas.api.event.TypeOfPlace;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.i18n.Captions;
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.i18n.Strings;
Expand Down Expand Up @@ -715,8 +714,7 @@ public void setValue(CaseDataDto caseDataDto) throws com.vaadin.v7.data.Property
PersonDto personByUuid = personUuid == null ? null : FacadeProvider.getPersonFacade().getByUuid(personUuid);
personCreateForm.setPerson(personByUuid);

if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
hideAndFillJurisdictionFields();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import java.util.Map;
import java.util.stream.Collectors;

import de.symeda.sormas.ui.utils.UserField;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;

Expand Down Expand Up @@ -145,6 +144,7 @@
import de.symeda.sormas.ui.utils.NullableOptionGroup;
import de.symeda.sormas.ui.utils.OutbreakFieldVisibilityChecker;
import de.symeda.sormas.ui.utils.StringToAngularLocationConverter;
import de.symeda.sormas.ui.utils.UserField;
import de.symeda.sormas.ui.utils.VaadinUiUtil;
import de.symeda.sormas.ui.utils.ValidationUtils;
import de.symeda.sormas.ui.utils.ViewMode;
Expand Down Expand Up @@ -1416,8 +1416,7 @@ public String getFormattedHtmlMessage() {
}
});

if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
hideJurisdictionFields();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.infrastructure.community.CommunityCriteria;
import de.symeda.sormas.api.infrastructure.community.CommunityDto;
Expand Down Expand Up @@ -57,8 +56,7 @@ public CommunitiesGrid(CommunityCriteria criteria) {
CommunityDto.REGION,
CommunityDto.DISTRICT,
CommunityDto.EXTERNAL_ID };
if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
columns = ArrayUtils.add(columns, CommunityDto.DEFAULT_INFRASTRUCTURE);
}
setColumns(columns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.infrastructure.InfrastructureDtoWithDefault;
import de.symeda.sormas.api.infrastructure.community.CommunityDto;
import de.symeda.sormas.api.infrastructure.district.DistrictDto;
Expand Down Expand Up @@ -68,8 +67,7 @@ protected void addFields() {
ComboBox district = addInfrastructureField(CommunityDto.DISTRICT);
addField(RegionDto.EXTERNAL_ID, TextField.class);

if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
addField(InfrastructureDtoWithDefault.DEFAULT_INFRASTRUCTURE, CheckBox.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.infrastructure.InfrastructureDtoWithDefault;
import de.symeda.sormas.api.infrastructure.district.DistrictDto;
import de.symeda.sormas.api.infrastructure.region.RegionDto;
Expand Down Expand Up @@ -63,8 +62,7 @@ protected void addFields() {
ComboBox region = addInfrastructureField(DistrictDto.REGION);
addField(RegionDto.EXTERNAL_ID, TextField.class);

if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
addField(InfrastructureDtoWithDefault.DEFAULT_INFRASTRUCTURE, CheckBox.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.infrastructure.district.DistrictCriteria;
import de.symeda.sormas.api.infrastructure.district.DistrictIndexDto;
Expand Down Expand Up @@ -59,8 +58,7 @@ public DistrictsGrid(DistrictCriteria criteria) {
DistrictIndexDto.EXTERNAL_ID,
DistrictIndexDto.POPULATION,
DistrictIndexDto.GROWTH_RATE };
if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
columns = ArrayUtils.add(columns, DistrictIndexDto.DEFAULT_INFRASTRUCTURE);
}
setColumns(columns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.infrastructure.InfrastructureDtoWithDefault;
import de.symeda.sormas.api.infrastructure.region.RegionDto;
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
Expand Down Expand Up @@ -84,8 +83,7 @@ protected void addFields() {
ComboBox area = addInfrastructureField(RegionDto.AREA);
addField(RegionDto.EXTERNAL_ID, TextField.class);

if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
addField(InfrastructureDtoWithDefault.DEFAULT_INFRASTRUCTURE, CheckBox.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import de.symeda.sormas.api.FacadeProvider;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.infrastructure.region.RegionCriteria;
import de.symeda.sormas.api.infrastructure.region.RegionIndexDto;
Expand Down Expand Up @@ -64,8 +63,7 @@ public RegionsGrid(RegionCriteria criteria) {
RegionIndexDto.EXTERNAL_ID,
RegionIndexDto.POPULATION,
RegionIndexDto.GROWTH_RATE);
if (FacadeProvider.getFeatureConfigurationFacade()
.isPropertyValueTrue(FeatureType.CASE_SURVEILANCE, FeatureTypeProperty.HIDE_JURISDICTION_FIELDS)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) {
columns = ArrayUtils.add(columns, RegionIndexDto.DEFAULT_INFRASTRUCTURE);
}
setColumns(columns);
Expand Down
Loading

0 comments on commit 2400118

Please sign in to comment.