Skip to content

Conditionalize option 'Fail import for undefined visits' during folder import #6607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
26 changes: 19 additions & 7 deletions core/src/org/labkey/core/admin/importFolder.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<%@ page import="org.labkey.api.util.DOM" %>
<%@ page import="static org.labkey.api.util.DOM.SPAN" %>
<%@ page import="static org.labkey.api.util.DOM.Attribute.style" %>
<%@ page import="org.labkey.api.study.TimepointType" %>
<%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>
<%!
Expand All @@ -47,6 +48,7 @@
Container project = c.getProject();
String requestOrigin = (request.getParameter("origin") != null) ? request.getParameter("origin") : "here";
boolean canCreateSharedDatasets = false;
boolean showFailForUndefinedVisits = false;
boolean isAdvancedImportOptionEnabled = OptionalFeatureService.get().isFeatureEnabled("advancedImportFlag");

String sharedDatasetsHelpText = "By default, datasets will be created in this container. For Dataspace projects, shared " +
Expand All @@ -72,6 +74,9 @@
Study studyProject = svc.getStudy(project);
if (null != studyProject && studyProject.getShareDatasetDefinitions())
canCreateSharedDatasets = true;

TimepointType timepointType = studyProject != null ? studyProject.getTimepointType() : null;
showFailForUndefinedVisits = (timepointType == null || timepointType == TimepointType.VISIT) && ((studyProject == null) || !studyProject.isFailForUndefinedTimepoints());
}
}
}
Expand Down Expand Up @@ -152,34 +157,41 @@
<tr>
<td id="SourcePicker" style="padding-top: 5px;"/>
</tr>
<%
if (canCreateSharedDatasets)
{
%>
<%
if (canCreateSharedDatasets)
{
%>
<tr>
<td style="padding-left: 15px; padding-top: 5px;">
<label><input type="checkbox" name="createSharedDatasets" <%=h(form.isCreateSharedDatasets() ? "checked" : "")%> value="true">
Create shared datasets <%=helpPopup("Create Shared Datasets", sharedDatasetsTooltip) %>
</label>
</td>
</tr>
<%
}
%>
<%
}
%>
<tr>
<td style="padding-left: 15px; padding-top: 5px;">
<label><input type="checkbox" name="validateQueries" <%=h(form.isValidateQueries() ? "checked" : "")%> value="true">
Validate all queries after <%=h(action.toLowerCase())%> <%=helpPopup("Validate all queries", validateQueriesTooltip) %>
</label>
</td>
</tr>
<%
if (showFailForUndefinedVisits)
{
%>
<tr>
<td style="padding-left: 15px; padding-top: 5px;">
<label><input type="checkbox" name="failForUndefinedVisits" <%=h(form.isFailForUndefinedVisits() ? "checked" : "")%> value="true">
Fail import for undefined visits <%= helpPopup("Fail import for undefined visits", failForUndefinedVisitsTooltip) %>
</label>
</td>
</tr>
<%
}
%>
<%
if (isAdvancedImportOptionEnabled)
{
Expand Down