Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion api/src/org/labkey/api/view/menu/NavTreeMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ private void renderLinks(NavTree nav, int level, String pathToHere, String rootI
ActionURL expandCollapseUrl = Objects.requireNonNull(PageFlowUtil.urlProvider(ProjectUrls.class)).getExpandCollapseURL(getViewContext().getContainer(), pathToHere, rootId);

String image = collapsed ? "plus.gif" : "minus.gif";
String altPrefix = collapsed ? "Expand" : "Collapse";
id = config.makeId("navtree");
oldWriter.printf("<a id=\"%s\" href=\"%s\">", id, filter(expandCollapseUrl));
config.addHandler(id, "click", "return LABKEY.Utils.toggleLink(this,true);");
oldWriter.printf("<img src=\"%s/_images/%s\" width=9 height=9></a>", context.getContextPath(), image);
oldWriter.printf("<img src=\"%s/_images/%s\" width=9 height=9 alt=\"%s %s\"></a>", filter(context.getContextPath()), filter(image), filter(altPrefix), filter(nav.getText()));
}
else if (indentForExpansionGifs)
oldWriter.printf("<div class=\"labkey-nav-tree-indenter\"></div>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public void renderCollapsiblePortalTitle(PrintWriter out)

public void renderCustomDropDown(String title, NavTree current, PrintWriter out)
{
renderMenuWithFontImage(null, current, out, null, false);
renderMenuWithFontImage(title, current, out, null, false);
}
}

Expand Down Expand Up @@ -750,7 +750,9 @@ private void renderMenuWithFontImage(String title, NavTree menu, PrintWriter out
if (rightAlign)
out.print(" pull-right");
out.print("\">");
out.print("<a href=\"#\" data-toggle=\"dropdown\" class=\"dropdown-toggle ");
out.print("<a href=\"#\" aria-label=\"");
out.print(filter(title) + " webpart options");
out.print("\" data-toggle=\"dropdown\" class=\"dropdown-toggle ");
out.print(!StringUtils.isEmpty(imageCls) ? imageCls : !StringUtils.isEmpty(menu.getImageCls()) ? menu.getImageCls() : "");
out.print("\">");
out.print("</a>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
{
%>
<li class="navbar-search hidden-xs">
<a class="fa fa-search" id="global-search-trigger"></a>
<a class="fa fa-search" id="global-search-trigger" aria-label="<%=h(SearchUtils.getPlaceholder(c))%>"></a>
<div id="global-search" class="global-search">
<labkey:form id="global-search-form" action="<%=urlProvider(SearchUrls.class).getSearchURL(c, null)%>" method="GET">
<input type="text" class="search-box" name="q" placeholder="<%=h(SearchUtils.getPlaceholder(c))%>" value="">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,42 @@ public FileUnionTable(@NotNull ExpSchema schema)
FileContentService svc = FileContentService.get();

_query = new SQLFragment();
if (svc == null)
return;

SQLFragment listQuery = svc.listSampleFilesQuery(schema.getUser());
if (StringUtils.isEmpty(listQuery))
return;

TableInfo expDataTable = ExperimentService.get().getTinfoData();
TableInfo materialTable = ExperimentService.get().getTinfoMaterial();
SQLFragment listQuery = new SQLFragment();
if (svc != null)
listQuery = svc.listSampleFilesQuery(schema.getUser());

_query.appendComment("<SampleFileListTableInfo>", getSchema().getSqlDialect());

SQLFragment sampleFileSql = new SQLFragment("SELECT m.Container, if.FilePathShort \n")
.append("FROM (")
.append(svc.listSampleFilesQuery(schema.getUser()))
.append(") AS if \n")
.append("JOIN ")
.append(materialTable, "m")
.append(" ON if.SourceKey = m.RowId");

SQLFragment unreferencedFileSql = new SQLFragment("SELECT ed.rowId, ed.name as filename, ed.container, ed.created, ed.createdBy, ed.DataFileUrl FROM ")
.append(expDataTable, "ed")
.append(" LEFT JOIN (")
.append(sampleFileSql)
.append(" ) sf\n")
.append(" ON ed.name = sf.FilePathShort AND ed.container = sf.container\n")
.append(" WHERE ed.datafileurl LIKE ")
.appendValue("%@files/sampletype/%")
.append(" AND sf.FilePathShort IS NULL");

_query.append(unreferencedFileSql);
TableInfo expDataTable = ExperimentService.get().getTinfoData();
if (!StringUtils.isEmpty(listQuery))
{
TableInfo materialTable = ExperimentService.get().getTinfoMaterial();

SQLFragment sampleFileSql = new SQLFragment("SELECT m.Container, if.FilePathShort \n")
.append("FROM (")
.append(listQuery)
.append(") AS if \n")
.append("JOIN ")
.append(materialTable, "m")
.append(" ON if.SourceKey = m.RowId");

SQLFragment unreferencedFileSql = new SQLFragment("SELECT ed.rowId, ed.name as filename, ed.container, ed.created, ed.createdBy, ed.DataFileUrl FROM ")
.append(expDataTable, "ed")
.append(" LEFT JOIN (")
.append(sampleFileSql)
.append(" ) sf\n")
.append(" ON ed.name = sf.FilePathShort AND ed.container = sf.container\n")
.append(" WHERE ed.datafileurl LIKE ")
.appendValue("%@files/sampletype/%")
.append(" AND sf.FilePathShort IS NULL");

_query.append(unreferencedFileSql);

}
else
{
_query.append("SELECT RowId, Name AS FileName, Container, Created, CreatedBy, DataFileUrl FROM ").append(expDataTable).append(" WHERE (1=0)");
}
_query.appendComment("</SampleFileListTableInfo>", getSchema().getSqlDialect());

var rowIdCol = new BaseColumnInfo("RowId", this, JdbcType.INTEGER);
Expand Down
7 changes: 4 additions & 3 deletions query/src/org/labkey/query/controllers/QueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ public DataSourceAdminAction(ViewContext viewContext)
public ModelAndView getView(Object o, BindException errors)
{
// Site Admin or Troubleshooter? Troubleshooters can see all the information but can't test data sources.
boolean hasAdminOpsPerms = getContainer().hasPermission(getUser(), AdminOperationsPermission.class);
// Dev mode only, since "Test" is meant for LabKey's own development and testing purposes.
boolean showTestButton = getContainer().hasPermission(getUser(), AdminOperationsPermission.class) && AppProps.getInstance().isDevMode();
List<ExternalSchemaDef> allDefs = QueryManager.get().getExternalSchemaDefs(null);

MultiValuedMap<String, ExternalSchemaDef> byDataSourceName = new ArrayListValuedHashMap<>();
Expand All @@ -729,7 +730,7 @@ public ModelAndView getView(Object o, BindException errors)
BR(),
TABLE(cl("labkey-data-region"),
TR(cl("labkey-show-borders"),
hasAdminOpsPerms ? TD(cl("labkey-column-header"), "Test") : null,
showTestButton ? TD(cl("labkey-column-header"), "Test") : null,
TD(cl("labkey-column-header"), "Data Source"),
TD(cl("labkey-column-header"), "Current Status"),
TD(cl("labkey-column-header"), "URL"),
Expand Down Expand Up @@ -759,7 +760,7 @@ public ModelAndView getView(Object o, BindException errors)
return Stream.of(
TR(
cl(rowStyle),
hasAdminOpsPerms ? TD(connected ? new ButtonBuilder("Test").href(new ActionURL(TestDataSourceConfirmAction.class, getContainer()).addParameter("dataSource", scope.getDataSourceName())) : "") : null,
showTestButton ? TD(connected ? new ButtonBuilder("Test").href(new ActionURL(TestDataSourceConfirmAction.class, getContainer()).addParameter("dataSource", scope.getDataSourceName())) : "") : null,
TD(HtmlString.NBSP, scope.getDisplayName()),
TD(status),
TD(scope.getDatabaseUrl()),
Expand Down
2 changes: 1 addition & 1 deletion search/src/org/labkey/search/view/search.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<div style="position:relative;">
<labkey:form id="<%=searchFormId%>" className="lk-search-form" action="<%=searchConfig.getPostURL(c)%>">
<labkey:input type="text" name="q" placeholder="<%=form.isWebPart() ? \"\" : SearchUtils.getPlaceholder(c)%>" formGroup="false" value="<%=value%>"/>
<a class="search-overlay fa fa-search"></a>
<a class="search-overlay fa fa-search" aria-label="<%= h(SearchUtils.getPlaceholder(c)) %>"></a>
<% if (showAdvancedUI) { %>
<small>
<a class="search-advanced-toggle">advanced options</a>
Expand Down
2 changes: 1 addition & 1 deletion wiki/src/org/labkey/wiki/WikiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public ActionURL getCancelUrl()
@Override
public ActionURL getFailURL(WikiNameForm wikiNameForm, BindException errors)
{
return new ManageAction(getViewContext(), _wiki).getUrl();
return _wiki != null ? new ManageAction(getViewContext(), _wiki).getUrl() : null;
}
}

Expand Down