Skip to content

Commit 51d9fd2

Browse files
committed
merge from develop
2 parents b5df9c3 + 9f6cca0 commit 51d9fd2

18 files changed

Lines changed: 117 additions & 54 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: 8 additions & 8 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.1-fb-mvtc-convert.1",
56+
"@labkey/components": "7.16.0",
5757
"@labkey/themes": "1.6.0"
5858
},
5959
"devDependencies": {

core/src/org/labkey/core/admin/AdminController.java

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
import org.labkey.api.security.AdminConsoleAction;
192192
import org.labkey.api.security.CSRF;
193193
import org.labkey.api.security.Directive;
194+
import org.labkey.api.security.ElevatedUser;
194195
import org.labkey.api.security.Group;
195196
import org.labkey.api.security.GroupManager;
196197
import org.labkey.api.security.IgnoresTermsOfUse;
@@ -3613,21 +3614,40 @@ protected String getQueryName()
36133614
abstract protected UserSchema getUserSchema();
36143615
}
36153616

3616-
// This allows Troubleshooters to GET and POST to the action, supporting export to Excel and script, e.g.
3617-
@RequiresPermission(TroubleshooterPermission.class)
3618-
public class AttachmentsAction extends AbstractAdminQueryAction
3617+
private abstract static class AbstractAttachmentQueryAction extends AbstractAdminQueryAction
36193618
{
3620-
@SuppressWarnings("unused") // Invoked via reflection
3621-
public AttachmentsAction()
3619+
public AbstractAttachmentQueryAction(String queryName)
3620+
{
3621+
super("core", queryName);
3622+
}
3623+
3624+
@Override
3625+
public void setViewContext(ViewContext context)
36223626
{
3623-
super("core", "DocumentsGroupedByParentTypeAdmin");
3627+
// Give Troubleshooters (and ImpersonatingTroubleshooters) read permissions in all containers so they can
3628+
// see attachment counts by parent type plus details. I don't love poking an elevated user into the
3629+
// ViewContext, but this is the only way I could get DataRegion to see read permission on tables that are
3630+
// wrapped by a query (e.g., core.Documents used by DocumentsGroupedByParentType.sql).
3631+
context.setUser(ElevatedUser.getElevatedUser(context.getUser(), ReaderRole.class));
3632+
super.setViewContext(context);
36243633
}
36253634

36263635
@Override
36273636
protected UserSchema getUserSchema()
36283637
{
36293638
return new CoreQuerySchema(getUser(), getContainer(), false);
36303639
}
3640+
}
3641+
3642+
// This allows Troubleshooters to GET and POST to the action, supporting export to Excel and script, e.g.
3643+
@RequiresPermission(TroubleshooterPermission.class)
3644+
public class AttachmentsAction extends AbstractAttachmentQueryAction
3645+
{
3646+
@SuppressWarnings("unused") // Invoked via reflection
3647+
public AttachmentsAction()
3648+
{
3649+
super("DocumentsGroupedByParentTypeAdmin");
3650+
}
36313651

36323652
@Override
36333653
public void addNavTrail(NavTree root)
@@ -3638,18 +3658,12 @@ public void addNavTrail(NavTree root)
36383658

36393659
@SuppressWarnings("unused") // Linked from core.DocumentsGroupedByParentTypeAdmin
36403660
@RequiresPermission(TroubleshooterPermission.class)
3641-
public class AttachmentsForTypeAction extends AbstractAdminQueryAction
3661+
public class AttachmentsForTypeAction extends AbstractAttachmentQueryAction
36423662
{
36433663
@SuppressWarnings("unused") // Invoked via reflection
36443664
public AttachmentsForTypeAction()
36453665
{
3646-
super("core", "Documents");
3647-
}
3648-
3649-
@Override
3650-
protected UserSchema getUserSchema()
3651-
{
3652-
return new CoreQuerySchema(getUser(), getContainer(), false);
3666+
super("Documents");
36533667
}
36543668

36553669
@Override

experiment/package-lock.json

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

0 commit comments

Comments
 (0)