Skip to content

Commit 9f6cca0

Browse files
authored
Provide warnings for unknown fields for cross sample type import (#7370)
- update @labkey/components package version - InferDomainAction update to take optional param for a list of columns to get distinct values for based on the data file contents - test fixes for error message single quote to bold
1 parent f114846 commit 9f6cca0

17 files changed

Lines changed: 81 additions & 32 deletions

File tree

api/src/org/labkey/api/data/ConvertHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ public static String getStandardConversionErrorMessage(Object value, String fiel
13421342

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

13471347
return "Could not convert value '" + value + "' (" + value.getClass().getSimpleName() + ") for " + fieldType + (null==fieldName ? "" : " field '" + fieldName + "'");
13481348
}

api/src/org/labkey/api/dataiterator/AttachmentDataIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ else if (attachmentValue instanceof File file)
172172

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

178178
private ValidationException rowValidationException(String message)

api/src/org/labkey/api/exp/api/SampleTypeService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555

5656
public interface SampleTypeService
5757
{
58-
String MISSING_AMOUNT_ERROR_MESSAGE = "An Amount value must be provided when Units are provided.";
59-
String MISSING_UNITS_ERROR_MESSAGE = "A Units value must be provided when Amounts are provided.";
60-
String UNPROVIDED_VALUE_ERROR_MESSAGE_PATTERN = "No %s value provided for %s %s.";
58+
String MISSING_AMOUNT_ERROR_MESSAGE = "An 'Amount' value must be provided when 'Units' are provided.";
59+
String MISSING_UNITS_ERROR_MESSAGE = "A 'Units' value must be provided when 'Amounts' are provided.";
60+
String UNPROVIDED_VALUE_ERROR_MESSAGE_PATTERN = "No '%s' value provided for %s '%s'.";
6161
String NEW_SAMPLE_TYPE_ALIAS_VALUE = "{{this_sample_set}}";
6262
String MATERIAL_INPUTS_PREFIX = "MaterialInputs/";
6363
String MODULE_NAME = "Experiment";

api/src/org/labkey/api/query/AbstractQueryUpdateService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public Map<Integer, Map<String, Object>> getExistingRows(User user, Container co
214214
if (StringUtils.isEmpty(dataContainer))
215215
dataContainer = (String) row.get("folder");
216216
if (!container.getId().equals(dataContainer))
217-
throw new InvalidKeyException("Data doesn't belong to folder '" + container.getName() + "': " + key.getValue().values());
217+
throw new InvalidKeyException("Data does not belong to folder '" + container.getName() + "': " + key.getValue().values());
218218
}
219219
}
220220
else if (verifyExisting)

assay/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"clean": "rimraf resources/web/assay/gen && rimraf resources/views/gen && rimraf resources/web/gen"
1313
},
1414
"dependencies": {
15-
"@labkey/components": "7.15.0"
15+
"@labkey/components": "7.16.0"
1616
},
1717
"devDependencies": {
1818
"@labkey/build": "8.8.0",

core/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
}
5454
},
5555
"dependencies": {
56-
"@labkey/components": "7.15.0",
56+
"@labkey/components": "7.16.0",
5757
"@labkey/themes": "1.6.0"
5858
},
5959
"devDependencies": {

experiment/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

experiment/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test-integration": "cross-env NODE_ENV=test jest --ci --runInBand -c test/js/jest.config.integration.js"
1414
},
1515
"dependencies": {
16-
"@labkey/components": "7.15.0"
16+
"@labkey/components": "7.16.0"
1717
},
1818
"devDependencies": {
1919
"@labkey/build": "8.8.0",

0 commit comments

Comments
 (0)