Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#12624 - [Environment Samples] Weather conditions selected for enviro… #12640

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package de.symeda.sormas.api.environment.environmentsample;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -145,6 +146,7 @@ public static EnvironmentSampleDto build(EnvironmentReferenceDto environment, Us

sample.setUuid(DataHelper.createUuid());
sample.setEnvironment(environment);
sample.setWeatherConditions(new HashMap<>());
sample.setReportDate(new Date());
sample.setReportingUser(reportingUser);
sample.setSampleDateTime(new Date());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package de.symeda.sormas.ui.samples.environmentsample;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;

Expand Down Expand Up @@ -95,6 +96,10 @@ public CommitDiscardWrapperComponent<EnvironmentSampleEditForm> getEditComponent
DeletionInfoDto automaticDeletionInfoDto = environmentSampleFacade.getAutomaticDeletionInfo(sampleUuid);
DeletionInfoDto manuallyDeletionInfoDto = environmentSampleFacade.getManuallyDeletionInfo(sampleUuid);

if (sample.getWeatherConditions() == null) {
sample.setWeatherConditions(new HashMap<>());
}

EnvironmentSampleEditForm editForm = new EnvironmentSampleEditForm(sample.isPseudonymized(), false);
editForm.setValue(sample);
editForm.setWidth(100, Sizeable.Unit.PERCENTAGE);
Expand Down