Skip to content

Commit 26667c6

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fb_domainLsids
2 parents 3ffd027 + fb32c1a commit 26667c6

13 files changed

Lines changed: 284 additions & 140 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ else if (!dataFileDir.exists())
604604
QueryImportPipelineJob job = new QueryImportPipelineJob(getQueryImportProviderName(), info, root, importContextBuilder);
605605
PipelineService.get().queueJob(job, getQueryImportJobNotificationProviderName());
606606

607-
SimpleMetricsService.get().increment("query", "fileBackgroundImports", getMetricPrefix(_target));
607+
if (_target != null)
608+
SimpleMetricsService.get().increment("query", "fileBackgroundImports", getMetricPrefix(_target));
608609
JSONObject response = new JSONObject();
609610
response.put("success", true);
610611
response.put("jobId", PipelineService.get().getJobId(user, getContainer(), job.getJobGUID()));
@@ -917,7 +918,7 @@ else if (queryName != null)
917918
SimpleMetricsService.get().increment("query", featureArea, targetType);
918919
}
919920

920-
public static String getMetricPrefix(TableInfo target)
921+
private static String getMetricPrefix(@NotNull TableInfo target)
921922
{
922923
String metricPrefix = target.getUserSchema() == null ? target.getSchema().getName() : target.getUserSchema().getSchemaName();
923924
return metricPrefix.replace("exp.", "");

assay/src/org/labkey/assay/view/tsvDataDescription.jsp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,22 @@
3232
<div id="showExpectedDataFieldsDiv"><%= link("Show Expected Data Fields").onClick("document.getElementById('expectedDataFields').style.display = 'block'; document.getElementById('showExpectedDataFieldsDiv').style.display = 'none'; return false;").id("showExpectedDataFieldsLink") %></div>
3333
<div id="expectedDataFields" style="display: none">
3434
<strong>Expected Data Fields</strong>
35-
<table class="labkey-show-borders" cellpadding="3" cellspacing="0">
35+
<table class="labkey-data-region-legacy labkey-show-borders">
3636
<tr>
37-
<td><strong>Name</strong></td>
38-
<td><strong>Type</strong></td>
39-
<td><strong>Required</strong></td>
40-
<td><strong>Description</strong></td>
37+
<td class="labkey-column-header">Name</td>
38+
<td class="labkey-column-header">Type</td>
39+
<td class="labkey-column-header">Required</td>
40+
<td class="labkey-column-header">Description</td>
4141
</tr>
4242
<%
43+
int row = 0;
4344
for (DomainProperty pd : bean.getRunDataProperties()) { %>
44-
<tr>
45-
<td><%= h(pd.getName()) %></td>
46-
<td><%= h(ColumnRenderProperties.getFriendlyTypeName(pd.getPropertyDescriptor().getPropertyType().getJavaType())) %></td>
47-
<td><%= unsafe(pd.isRequired() ? "yes" : "no") %></td>
48-
<td><%=h(pd.getDescription())%></td></tr>
45+
<tr class="<%=getShadeRowClass(row++)%>">
46+
<td><%= h(pd.getName()) %></td>
47+
<td><%= h(ColumnRenderProperties.getFriendlyTypeName(pd.getPropertyDescriptor().getPropertyType().getJavaType())) %></td>
48+
<td><%= unsafe(pd.isRequired() ? "yes" : "no") %></td>
49+
<td><%=h(pd.getDescription())%></td>
50+
</tr>
4951
<% } %>
5052
</table>
5153
</div>

issues/src/org/labkey/issue/model/IssuePage.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,6 @@ private TableInfo getIssueTable(ViewContext context)
400400
return _tableInfo;
401401
}
402402

403-
public HtmlString renderColumn(DomainProperty prop, ViewContext context) throws IOException
404-
{
405-
return renderColumn(prop, context, true, false);
406-
}
407-
408403
public HtmlString renderColumn(DomainProperty prop, ViewContext context, boolean visible, boolean readOnly) throws IOException
409404
{
410405
if (prop != null && shouldDisplay(prop, context.getContainer(), context.getUser()))

issues/src/org/labkey/issue/view/detailView.jsp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
<tr><%=bean.renderLabel(bean.getLabel("Status", false))%><td><%=h(issue.getStatus())%></td></tr><%
245245
for (DomainProperty prop : extraColumns)
246246
{%>
247-
<%=bean.renderColumn(prop, getViewContext())%><%
247+
<%=bean.renderColumn(prop, getViewContext(), true, true)%><%
248248
}%>
249249

250250
<%=unsafe(bean.renderAdditionalDetailInfo())%>
@@ -277,7 +277,7 @@
277277
}
278278
for (DomainProperty prop : column1Props)
279279
{%>
280-
<%=bean.renderColumn(prop, getViewContext())%><%
280+
<%=bean.renderColumn(prop, getViewContext(), true, true)%><%
281281
}%>
282282
</table></td>
283283
<td valign="top" width="33%"><table class="lk-fields-table">
@@ -290,7 +290,7 @@
290290
291291
for (DomainProperty prop : column2Props)
292292
{%>
293-
<%=bean.renderColumn(prop, getViewContext())%><%
293+
<%=bean.renderColumn(prop, getViewContext(), true, true)%><%
294294
}%>
295295
</table></td>
296296
</tr>

issues/src/org/labkey/issue/view/updateView.jsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
352352
for (DomainProperty prop : column1Props)
353353
{%>
354-
<%=bean.renderColumn(prop, getViewContext())%><%
354+
<%=bean.renderColumn(prop, getViewContext(), true, false)%><%
355355
}%>
356356
</table>
357357
</td>
@@ -385,16 +385,16 @@
385385
}
386386
for (DomainProperty prop : column2Props)
387387
{%>
388-
<%=bean.renderColumn(prop, getViewContext())%><%
388+
<%=bean.renderColumn(prop, getViewContext(), true, false)%><%
389389
}%>
390390
</table></td>
391391
</tr>
392392
<%=bean.renderColumn(propertyMap.get("assignedTo"), getViewContext(), bean.isVisible("assignedTo"), bean.isReadOnly("assignedTo"))%>
393393
<%
394394
for (DomainProperty prop : extraColumns)
395395
{%>
396-
<%=bean.renderColumn(prop, getViewContext())%><%
397-
}%>
396+
<%=bean.renderColumn(prop, getViewContext(), true, false)%><%
397+
}%>
398398
<tr>
399399
<%=bean.renderLabel(bean.getLabel("Comment", bean.isInsert()))%>
400400
<td colspan="3">

query/src/org/labkey/query/QueryTestCase.jsp

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ d,seven,twelve,day,month,date,duration,guid
330330
}
331331
}
332332
333-
protected void validateResults(ResultSet rs) throws Exception
333+
protected void validateResults(Results rs) throws Exception
334334
{
335335
}
336336
}
@@ -368,7 +368,7 @@ d,seven,twelve,day,month,date,duration,guid
368368
}
369369
370370
@Override
371-
protected void validateResults(ResultSet rs) throws Exception
371+
protected void validateResults(Results rs) throws Exception
372372
{
373373
assertTrue("Expected one row: " + _sql, rs.next());
374374
Object o = rs.getObject(1);
@@ -667,8 +667,8 @@ d,seven,twelve,day,month,date,duration,guid
667667
668668
private void verifyType(ColumnInfo column, JdbcType expectedType, @Nullable String expectedFormat)
669669
{
670-
assertEquals("Type discrepancy for " + column.getName(), column.getJdbcType(), expectedType);
671-
assertEquals("Format discrepancy for " + column.getName(), column.getFormat(), expectedFormat);
670+
assertEquals("Type discrepancy for " + column.getName(), expectedType, column.getJdbcType());
671+
assertEquals("Format discrepancy for " + column.getName(), expectedFormat, column.getFormat());
672672
}
673673
},
674674
@@ -702,6 +702,9 @@ d,seven,twelve,day,month,date,duration,guid
702702
new MethodSqlTest("SELECT concat('concat', concat('in', concat('the', 'hat'))) FROM R WHERE rowid=1", JdbcType.VARCHAR, "concatinthehat"),
703703
new MethodSqlTest("SELECT contextPath()", JdbcType.VARCHAR, () -> new ActionURL().getContextPath()),
704704
new MethodSqlTest("SELECT CONVERT(123, VARCHAR) FROM R WHERE rowid=1", JdbcType.VARCHAR, "123"),
705+
new MethodSqlTest("SELECT CONVERT('+infinity', DOUBLE)", JdbcType.DOUBLE, Double.POSITIVE_INFINITY),
706+
new MethodSqlTest("SELECT CONVERT('-infinity', DOUBLE)", JdbcType.DOUBLE, Double.NEGATIVE_INFINITY),
707+
new MethodSqlTest("SELECT CONVERT('nan', DOUBLE)", JdbcType.DOUBLE, Double.NaN),
705708
new MethodSqlTest("SELECT COUNT(R.twelve) as cnt FROM R", JdbcType.INTEGER),
706709
// TODO: cos
707710
// TODO: cot
@@ -835,7 +838,40 @@ d,seven,twelve,day,month,date,duration,guid
835838
new SqlTest("WITH v AS (SELECT column1, column2 FROM (VALUES (CAST('1' as VARCHAR), CAST('1' as INTEGER)), ('two', 2)) as v_) SELECT column1 as txt, column2 as i FROM v WHERE column1 = 'two'", 2, 1),
836839
837840
// regression test: field reference in sub-select (https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=43580)
838-
new SqlTest("SELECT (SELECT a.title), a.parent.rowid FROM core.containers a", 2, 1)
841+
new SqlTest("SELECT (SELECT a.title), a.parent.rowid FROM core.containers a", 2, 1),
842+
843+
// Column annotations
844+
new SqlTest("SELECT 1 AS name @title='New Label'")
845+
{
846+
@Override
847+
protected void validateResults(Results rs) throws Exception
848+
{
849+
assertEquals("New Label", rs.getColumn(1).getLabel());
850+
assertFalse(rs.getColumn(1).isHidden());
851+
assertNull(rs.getColumn(1).getFormat());
852+
}
853+
},
854+
new SqlTest("SELECT 1 AS name @hidden'")
855+
{
856+
@Override
857+
protected void validateResults(Results rs) throws Exception
858+
{
859+
assertEquals("Name", rs.getColumn(1).getLabel());
860+
assertTrue(rs.getColumn(1).isHidden());
861+
assertNull(rs.getColumn(1).getFormat());
862+
}
863+
},
864+
new SqlTest("SELECT 1 AS name @format='0.00'")
865+
{
866+
@Override
867+
protected void validateResults(Results rs) throws Exception
868+
{
869+
assertEquals("Name", rs.getColumn(1).getLabel());
870+
assertFalse(rs.getColumn(1).isHidden());
871+
assertEquals("0.00", rs.getColumn(1).getFormat());
872+
}
873+
}
874+
839875
);
840876
841877
List<SqlTest> postgres = List.of(

0 commit comments

Comments
 (0)