From 76b64b58aa17d7195ecd47e2c839721b67f7ded3 Mon Sep 17 00:00:00 2001 From: Anthony4m Date: Mon, 15 Aug 2022 15:55:47 +0000 Subject: [PATCH] hiding verify test results for lab officer --- .../de/symeda/sormas/ui/samples/PathogenTestForm.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java index 4fcf3e76b40..4a753f4bc6e 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java @@ -53,8 +53,10 @@ import de.symeda.sormas.api.sample.PathogenTestType; import de.symeda.sormas.api.sample.SampleDto; import de.symeda.sormas.api.sample.SamplePurpose; +import de.symeda.sormas.api.user.UserRole; import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers; import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers; +import de.symeda.sormas.ui.UserProvider; import de.symeda.sormas.ui.utils.AbstractEditForm; import de.symeda.sormas.ui.utils.CssStyles; import de.symeda.sormas.ui.utils.DateComparisonValidator; @@ -123,7 +125,6 @@ protected void addFields() { if (sample == null) { return; } - pathogenTestHeadingLabel = new Label(); pathogenTestHeadingLabel.addStyleName(H3); getContent().addComponent(pathogenTestHeadingLabel, PATHOGEN_TEST_HEADING_LOC); @@ -170,11 +171,14 @@ protected void addFields() { cqValueField.setConversionError(I18nProperties.getValidationError(Validations.onlyNumbersAllowed, cqValueField.getCaption())); NullableOptionGroup testResultVerifiedField = addField(PathogenTestDto.TEST_RESULT_VERIFIED, NullableOptionGroup.class); testResultVerifiedField.setRequired(true); + if (UserProvider.getCurrent().hasUserRole(UserRole.LAB_USER)) { + testResultVerifiedField.setRequired(false); + testResultVerifiedField.setVisible(false); + } CheckBox fourFoldIncrease = addField(PathogenTestDto.FOUR_FOLD_INCREASE_ANTIBODY_TITER, CheckBox.class); CssStyles.style(fourFoldIncrease, VSPACE_3, VSPACE_TOP_4); fourFoldIncrease.setVisible(false); fourFoldIncrease.setEnabled(false); - addField(PathogenTestDto.TEST_RESULT_TEXT, TextArea.class).setRows(6); addField(PathogenTestDto.PRELIMINARY).addStyleName(CssStyles.VSPACE_4);