[BI-1761] Error message with the backend code#319
Conversation
src/main/java/org/breedinginsight/brapps/importer/services/processors/ExperimentProcessor.java
Outdated
Show resolved
Hide resolved
src/test/java/org/breedinginsight/brapps/importer/ExperimentFileImportTest.java
Outdated
Show resolved
Hide resolved
|
updated the message after confirming with Shawn |
| "If you’re trying to add these units to the experiment, please create a new environment" + | ||
| " with all appropriate experiment units (NOTE: this will generate new Observation Unit Ids " + | ||
| "for each experiment unit)."; | ||
| private static final String MISSING_OBS_UNIT_ID_ERROR = "Experimental entities are missing ObsUnitIDs. You must append file with the appropriate ObsUnitIDs or specify a new environment for these entities to proceed."; |
There was a problem hiding this comment.
The source of truth reads,Error detected in file, XXX.xls. Experimental entities are missing ObsUnitIDs. Import cannot proceed.
The current error message reads,Error(s) detected in file, XXX.xls. Experimental entities are missing ObsUnitIDs. You must append file with the appropriate ObsUnitIDs or specify a new environment for these entities to proceed.. Import cannot proceed.
I recommend changing MISSING_OBS_UNIT_ID_ERROR to "Experimental entities are missing ObsUnitIDs"
NOTE: there is no period (.) at the end of this string. It is added by the javascript code.
[ I do like your wording, at the very least, please change MISSING_OBS_UNIT_ID_ERROR to "Experimental entities are missing ObsUnitIDs. You must append file with the appropriate ObsUnitIDs or specify a new environment" ( and leave off " for these entities to proceed." ) ]
c1484d8 to
ffbf034
Compare
| "If you’re trying to add these units to the experiment, please create a new environment" + | ||
| " with all appropriate experiment units (NOTE: this will generate new Observation Unit Ids " + | ||
| "for each experiment unit)."; | ||
| private static final String MISSING_OBS_UNIT_ID_ERROR = "Experimental entities are missing ObsUnitIDs. You must append file with the appropriate ObsUnitIDs or specify a new environment for these entities to proceed"; |
There was a problem hiding this comment.
| private static final String MISSING_OBS_UNIT_ID_ERROR = "Experimental entities are missing ObsUnitIDs. You must append file with the appropriate ObsUnitIDs or specify a new environment for these entities to proceed"; | |
| private static final String MISSING_OBS_UNIT_ID_ERROR = "Experimental entities are missing ObsUnitIDs"; |
This will be interpolated into "Error detected in file, ${fileName}. ${backendErrorMessage}. Import cannot proceed." by bi-web, to produce the desired message, "Error detected in file, XXX.xls. Experimental entities are missing ObsUnitIDs. Import cannot proceed.". See row 15 in the source of truth.
| assertEquals(422, result.getAsJsonObject("progress").get("statuscode").getAsInt(), "Returned data: " + result); | ||
|
|
||
| assertTrue(result.getAsJsonObject("progress").get("message").getAsString().startsWith("Cannot create new observation unit")); | ||
| assertTrue(result.getAsJsonObject("progress").get("message").getAsString().startsWith("Experimental entities are missing ObsUnitIDs.")); |
There was a problem hiding this comment.
| assertTrue(result.getAsJsonObject("progress").get("message").getAsString().startsWith("Experimental entities are missing ObsUnitIDs.")); | |
| assertTrue(result.getAsJsonObject("progress").get("message").getAsString().startsWith("Experimental entities are missing ObsUnitIDs")); |
Remove period.
69d3859 to
0fe6b3a
Compare
0fe6b3a to
bded938
Compare
Description
Story: BI-1761
updated the error message for missing observation unit ids in experiment file import.
Dependencies
none
Testing
run all tests in
ExperimentFileImportTestChecklist: