Skip to content

[BI-1590] - Disallow Adding New Observation Unit to Existing Environment#212

Merged
HMS17 merged 3 commits intodevelopfrom
bug/BI-1590
Sep 28, 2022
Merged

[BI-1590] - Disallow Adding New Observation Unit to Existing Environment#212
HMS17 merged 3 commits intodevelopfrom
bug/BI-1590

Conversation

@HMS17
Copy link
Contributor

@HMS17 HMS17 commented Sep 20, 2022

Description

Story: BI-1590 - Disallow Adding New Observation Unit to Existing Environment

Added logic to check for an experiment import row with an Env that already existed and no ObsUnitId (implying that a new ObsUnit should be created for an existing Environment), and if so, throw an error that displays in the banner.
In addition, fixed file mapping for experiment import template so ObsUnitId could actually be retrieved for said logic.
Note that this change just checks for existence of values in ObsUnitId column and does not do any validation on said column.

Dependencies

bi-web/develop

Testing

  • Import experiment
  • Try to upload another experiment with same environment as first and ObsUnitId column missing values - error in banner should appear
  • Try to upload another experiment with same environment as first and ObsUnitId with filled values - should get successfully to 'Confirm New Experiments & Observations Records' page

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have tested that my code works with both the brapi-java-server and BreedBase
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <please include a link to TAF run>

@github-actions github-actions bot added the bug Something isn't working label Sep 20, 2022
@HMS17 HMS17 marked this pull request as ready for review September 20, 2022 20:21
@HMS17 HMS17 requested review from a team, davedrp and dmeidlin and removed request for a team September 20, 2022 20:21
@davedrp
Copy link
Contributor

davedrp commented Sep 23, 2022

The developer test passed.

public class ExperimentProcessor implements Processor {

private static final String NAME = "Experiment";
private static final String missingObsUnitIdError = "Experiment Units are missing Observation Unit Id.\n" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor quibble: By convention, because it is a static final, the variable should be in all upper case (MISSING_OBS_UNIT_ID_ERROR)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

@HMS17 HMS17 requested a review from davedrp September 23, 2022 21:29
@HMS17 HMS17 merged commit 02b8276 into develop Sep 28, 2022
@HMS17 HMS17 deleted the bug/BI-1590 branch September 28, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants