Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a2b5af1
update @labkey/components package version
cnathe Jan 23, 2026
723dfbf
InferDomainAction update to take optional param for a list of columns…
cnathe Jan 23, 2026
5bf8bca
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 23, 2026
f4c894e
InferDomain distinctValues map to use CaseInsensitiveHashSet for dist…
cnathe Jan 23, 2026
8bb8d73
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 26, 2026
5a5b231
Test fixes for error message single quote to bold
cnathe Jan 26, 2026
2f037e4
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 26, 2026
b69975a
update @labkey/components package version
cnathe Jan 26, 2026
72c0039
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 27, 2026
2939d17
Update text for "can't upload attachment" error message for consistency
cnathe Jan 28, 2026
95d8f53
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 28, 2026
f70e33b
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 28, 2026
38c7a1a
More convert helper error message consistency
cnathe Jan 28, 2026
d5f07a7
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Jan 29, 2026
8b86713
Merge remote-tracking branch 'origin/develop' into fb_crossSampleType…
cnathe Feb 2, 2026
6fe7cee
update @labkey/components package version
cnathe Feb 2, 2026
e7e8417
CR feedback - @Nullable annotation
cnathe Feb 2, 2026
fec711f
InferDomainAction to include null values in distinct value map response
cnathe Feb 2, 2026
88c6297
error message updates for highlighting field names / values
cnathe Feb 2, 2026
85f3ae1
InferDomainAction to only include distinctValuesMap for keys that exi…
cnathe Feb 2, 2026
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
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/data/ConvertHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ public static String getStandardConversionErrorMessage(Object value, String fiel

// Issue 50768: Need a better error message if date value is not in the expected format.
if (fieldType.equalsIgnoreCase("date") || fieldType.equalsIgnoreCase("datetime") || fieldType.equalsIgnoreCase("timestamp"))
return "'" + value + "' is not a valid " + fieldType + " for " + fieldName + " using " + LookAndFeelProperties.getInstance(ContainerManager.getRoot()).getDateParsingMode().getDisplayString();
return "'" + value + "' is not a valid " + fieldType + " for '" + fieldName + "' using " + LookAndFeelProperties.getInstance(ContainerManager.getRoot()).getDateParsingMode().getDisplayString();

return "Could not convert value '" + value + "' (" + value.getClass().getSimpleName() + ") for " + fieldType + " field '" + fieldName + "'" ;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ else if (attachmentValue instanceof File file)

private ValidationException propertyValidationException(DomainProperty property, Object value)
{
return rowValidationException(String.format("Can't upload '%s' to field %s with type %s.", value, property.getName(), property.getType().getLabel()));
return rowValidationException(String.format("Cannot upload '%s' to %s type field '%s'.", value, property.getType().getLabel(), property.getName()));
}

private ValidationException rowValidationException(String message)
Expand Down
6 changes: 3 additions & 3 deletions api/src/org/labkey/api/exp/api/SampleTypeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@

public interface SampleTypeService
{
String MISSING_AMOUNT_ERROR_MESSAGE = "An Amount value must be provided when Units are provided.";
String MISSING_UNITS_ERROR_MESSAGE = "A Units value must be provided when Amounts are provided.";
String UNPROVIDED_VALUE_ERROR_MESSAGE_PATTERN = "No %s value provided for %s %s.";
String MISSING_AMOUNT_ERROR_MESSAGE = "An 'Amount' value must be provided when 'Units' are provided.";
String MISSING_UNITS_ERROR_MESSAGE = "A 'Units' value must be provided when 'Amounts' are provided.";
String UNPROVIDED_VALUE_ERROR_MESSAGE_PATTERN = "No '%s' value provided for %s '%s'.";
String NEW_SAMPLE_TYPE_ALIAS_VALUE = "{{this_sample_set}}";
String MATERIAL_INPUTS_PREFIX = "MaterialInputs/";
String MODULE_NAME = "Experiment";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public Map<Integer, Map<String, Object>> getExistingRows(User user, Container co
if (StringUtils.isEmpty(dataContainer))
dataContainer = (String) row.get("folder");
if (!container.getId().equals(dataContainer))
throw new InvalidKeyException("Data doesn't belong to folder '" + container.getName() + "': " + key.getValue().values());
throw new InvalidKeyException("Data does not belong to folder '" + container.getName() + "': " + key.getValue().values());
}
}
else if (verifyExisting)
Expand Down
8 changes: 4 additions & 4 deletions assay/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean": "rimraf resources/web/assay/gen && rimraf resources/views/gen && rimraf resources/web/gen"
},
"dependencies": {
"@labkey/components": "7.14.0"
"@labkey/components": "7.14.0-fb-crossSampleTypeWarnings.0"
},
"devDependencies": {
"@labkey/build": "8.7.0",
Expand Down
8 changes: 4 additions & 4 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
},
"dependencies": {
"@labkey/components": "7.14.0",
"@labkey/components": "7.14.0-fb-crossSampleTypeWarnings.0",
"@labkey/themes": "1.5.0"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions experiment/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion experiment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test-integration": "cross-env NODE_ENV=test jest --ci --runInBand -c test/js/jest.config.integration.js"
},
"dependencies": {
"@labkey/components": "7.14.0"
"@labkey/components": "7.14.0-fb-crossSampleTypeWarnings.0"
},
"devDependencies": {
"@labkey/build": "8.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ protected Map<String, Object> _update(User user, Container c, Map<String, Object
else if (value != null && !StringUtils.isEmpty(String.valueOf(value)))
{
// Issue 53498: string value for attachment field is not allowed
throw new ValidationException("Can't upload '" + value + "' to field " + name + " with type Attachment.");
throw new ValidationException("Cannot upload '" + value + "' to Attachment type field '" + name + "'.");
}
else
rowStripped.put(name, value); // if null or empty, remove attachment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -1215,17 +1216,21 @@ else if (fileMap.size() == 1)
throw new IllegalArgumentException("Unable to find a posted file or the file for the posted id/path.");
}

return getInferDomainResponse(loader, form.getNumLinesToInclude(), form.isCheckCommentLineCount(), form.getDomainKindName());
return getInferDomainResponse(loader, form);
}
finally
{
IOUtils.closeQuietly(loader);
}
}

private ApiSimpleResponse getInferDomainResponse(DataLoader loader, Integer numLinesToInclude, boolean checkCommentLineCount, String domainKindName) throws IOException
private ApiSimpleResponse getInferDomainResponse(DataLoader loader, InferDomainForm form) throws IOException
{
ApiSimpleResponse response = new ApiSimpleResponse();
Integer numLinesToInclude = form.getNumLinesToInclude();
boolean checkCommentLineCount = form.isCheckCommentLineCount();
String domainKindName = form.getDomainKindName();
Collection<String> distinctValueColumns = form.getDistinctValueColumns();

List<GWTPropertyDescriptor> fields = new ArrayList<>();
List<GWTPropertyDescriptor> reservedFields = new ArrayList<>();
Expand Down Expand Up @@ -1258,12 +1263,45 @@ private ApiSimpleResponse getInferDomainResponse(DataLoader loader, Integer numL
{
response.put("commentLineCount", loader.getCommentLineCount());
}
if (distinctValueColumns != null && !distinctValueColumns.isEmpty())
{
response.put("distinctValues", getDistinctValues(loader, distinctValueColumns));
}
}

response.put("fields", fields);
response.put("reservedFields", reservedFields);
return response;
}

/**
* Iterate through the data and get the distinct values for the specified columns.
* Response is a map of column name to set of distinct string values, for those columns
* that have at least one non-null value.
*/
private Map<String, Set<String>> getDistinctValues(DataLoader loader, Collection<String> colKeys) throws IOException
{
Map<String, Set<String>> distinctValuesMap = new HashMap<>();
try (var iter = loader.iterator())
{
while (iter.hasNext())
{
Map<String, Object> values = iter.next();
if (values == null)
continue;

for (String key : colKeys)
{
if (values.containsKey(key))
{
Object val = values.get(key);
distinctValuesMap.computeIfAbsent(key, k -> new CaseInsensitiveHashSet()).add(val == null ? null : val.toString());
}
}
}
}
return distinctValuesMap;
}
}

public static class InferDomainForm
Expand All @@ -1274,6 +1312,7 @@ public static class InferDomainForm
private String _domainKindName;
private boolean _guessFormatAsTSV;
private boolean _checkCommentLineCount;
private @Nullable Collection<String> _distinctValueColumns;

public Integer getNumLinesToInclude()
{
Expand Down Expand Up @@ -1324,6 +1363,16 @@ public void setCheckCommentLineCount(boolean checkCommentLineCount)
{
_checkCommentLineCount = checkCommentLineCount;
}

public Collection<String> getDistinctValueColumns()
{
return _distinctValueColumns;
}

public void setDistinctValueColumns(Collection<String> distinctValueColumns)
{
_distinctValueColumns = distinctValueColumns;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion list/src/org/labkey/list/model/ListQueryUpdateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ protected Map<String, Object> updateRow(User user, Container container, Map<Stri
}
else if (r.getValue() != null && !StringUtils.isEmpty(String.valueOf(r.getValue())))
{
throw new ValidationException("Can't upload '" + r.getValue() + "' to field " + r.getKey() + " with type Attachment.");
throw new ValidationException("Cannot upload '" + r.getValue() + "' to Attachment type field '" + r.getKey() + "'.");
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions pipeline/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build-prod": "npm run clean && cross-env NODE_ENV=production PROD_SOURCE_MAP=source-map webpack --config node_modules/@labkey/build/webpack/prod.config.js --color --progress --profile"
},
"dependencies": {
"@labkey/components": "7.14.0"
"@labkey/components": "7.14.0-fb-crossSampleTypeWarnings.0"
},
"devDependencies": {
"@labkey/build": "8.7.0",
Expand Down
2 changes: 1 addition & 1 deletion study/test/src/org/labkey/test/tests/study/AssayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private void uploadRuns(String folder, String asUser)
assertTextPresent(
"Could not convert value 'Bad Test' (String) for Double field '" + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 1) + "'.",
"Could not convert value 'Bad Test' (String) for Integer field '" + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 2) + "'.",
"'Bad Test' is not a valid Date for " + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 3) + " using U.S. date parsing (MDY).");
"'Bad Test' is not a valid Date for '" + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 3) + "' using U.S. date parsing (MDY).");
setFormElement(Locator.name(TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 1)), TEST_ASSAY_SET_PROPERTIES[1]);
setFormElement(Locator.name(TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 2)), TEST_ASSAY_SET_PROPERTIES[2]);
setFormElement(Locator.name(TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 3)), TEST_ASSAY_SET_PROPERTIES[3]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private void uploadRuns(String folder, String asUser)
assertTextPresent(
"Could not convert value 'Bad Test' (String) for Double field '" + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 1) + "'.",
"Could not convert value 'Bad Test' (String) for Integer field '" + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 2) + "'.",
"'Bad Test' is not a valid Date for " + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 3) + " using U.S. date parsing (MDY).");
"'Bad Test' is not a valid Date for '" + TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 3) + "' using U.S. date parsing (MDY).");
setFormElement(Locator.name(TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 1)), TEST_ASSAY_SET_PROPERTIES[1]);
setFormElement(Locator.name(TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 2)), TEST_ASSAY_SET_PROPERTIES[2]);
setFormElement(Locator.name(TEST_ASSAY_SET_PROP_NAME + (TEST_ASSAY_SET_PREDEFINED_PROP_COUNT + 3)), TEST_ASSAY_SET_PROPERTIES[3]);
Expand Down