Skip to content
Open
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
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 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
Loading