FieldInfo and FieldKey improvements#2516
Conversation
labkey-danield
left a comment
There was a problem hiding this comment.
The test shouldn't always quote the parent sample.
| log("Verify import tsv should successfully create derivatives from parent starting with #, as long as values are quoted"); | ||
| data = "MaterialInputs/" + EscapeUtil.fieldKeyEncodePart(PARENT_SAMPLE_TYPE) + "\n"; // fully encoded | ||
| data += "\"" + PARENT_SAMPLE_03 + "\"\n"; | ||
| data += "\"" + PARENT_SAMPLE_03 + "," + PARENT_SAMPLE_02 + "\"\n"; |
There was a problem hiding this comment.
You shouldn't quote the parent id all the time. Having a parent id not quoted is valid input, and this should be tested. Obviously there are exception (if the name begins with a # and it is the first character).
There was a problem hiding this comment.
I quoted these because PARENT_SAMPLE_03 does start with a #.
There was a problem hiding this comment.
Ok, I obviously missed that.
I'll mark the PR as approved.
| { | ||
| return nameExpressionNeedsEscaping.matcher(name).replaceAll("\\\\$1"); | ||
| } | ||
| } |
| * @param fieldDefinitionMutator will be invoked by {@link #getFieldDefinition()} | ||
| * @return a new FieldInfo with the provided mutator. Any existing mutator will be replaced. | ||
| */ | ||
| @Contract(pure = true) |
There was a problem hiding this comment.
I'm curious to know the use case for a Consumer of FieldDefinition
| @@ -286,7 +285,7 @@ private void validateListValues(List<Map<String, String>> expectedValue) | |||
| private String tsvFromColumn(List<String> column) | |||
There was a problem hiding this comment.
I don't suppose this method is generic enough to belong in TestDataUtils?
labkey-chrisj
left a comment
There was a problem hiding this comment.
I'm excited for these changes and all the fieldkey work you're doing here. I don't have any requests for changes, will defer to Dan
Rationale
While writing additional tests for editable grids, I made some improvements to
FieldInfoandFieldKeythat I'd like to roll out before finishing the new editable grid tests.Related Pull Requests
Changes
FieldInfocompatible with recent column identifier improvementsFieldInfo.randomto make defining fields with random names less verboseEditableGridTestto useFieldInfoSampleTypeNameExpressionTestto use random field namesTestDataGenerator.writeDatafunctionality intoTestDataUtils