Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
3cb8cfc
Move 'Advanced Import Options' behind 'Deprecated' flag
labkey-bpatel Mar 4, 2025
fa2f36d
Merge remote-tracking branch 'origin/develop' into fb_advanced_option…
labkey-bpatel Mar 5, 2025
d454eb2
MultipleFolders
labkey-bpatel Mar 5, 2025
cf9f64d
Merge remote-tracking branch 'origin/develop' into fb_advanced_option…
labkey-bpatel Mar 10, 2025
8010619
Display/move 'Create shared datasets' and 'Fail import for undefined …
labkey-bpatel Mar 18, 2025
a4e1090
Merge remote-tracking branch 'origin/develop' into fb_advanced_option…
labkey-bpatel Mar 19, 2025
eca4743
Put 'Advanced Import Options' check on the parent page behind the dep…
labkey-bpatel Mar 19, 2025
4e75680
Merge remote-tracking branch 'origin/develop' into fb_advanced_option…
labkey-bpatel Mar 19, 2025
e8f37f9
Remove unnecessary checks for 'showAdvancedImportOptions' given the a…
labkey-bpatel Mar 19, 2025
3236353
Code review changes: use JspBase.helpPopup(), minor cleanup
labkey-bpatel Mar 20, 2025
a54cd40
html encode tooltip text
labkey-bpatel Mar 20, 2025
69f0b9e
Keep 'Validate Queries' and 'Create Shared Datasets' options for Fold…
labkey-bpatel Mar 21, 2025
4bf8733
Code review change - Add a variant of JspBase.helpPopup() that takes …
labkey-bpatel Mar 22, 2025
5e60f5c
Merge remote-tracking branch 'origin/develop' into fb_advanced_option…
labkey-bpatel Mar 22, 2025
d2cc1b4
Code review change - Remove double encoding. Change JsbBase.helpPopup…
labkey-bpatel Mar 22, 2025
4aae391
Remove DOM.createHtml()
labkey-bpatel Mar 22, 2025
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
35 changes: 21 additions & 14 deletions pipeline/src/org/labkey/pipeline/PipelineController.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import org.labkey.api.security.roles.Role;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.settings.AdminConsole;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.trigger.TriggerConfiguration;
import org.labkey.api.util.DateUtil;
import org.labkey.api.util.FileUtil;
Expand Down Expand Up @@ -1222,14 +1223,17 @@ else if (form.getFilePath() == null)
{
_archiveFile = PipelineManager.validateFolderImportFileNioPath(form.getFilePath(), currentPipelineRoot, errors);

// Be sure that the set of folder to apply the import to match the setting to enable/disable them
if (form.isApplyToMultipleFolders() && (form.getFolderRowIds() == null || form.getFolderRowIds().isEmpty()))
if (OptionalFeatureService.get().isFeatureEnabled(PipelineModule.ADVANCED_IMPORT_FLAG))
{
errors.reject(ERROR_MSG, "At least one folder must be selected when 'apply to multiple folders' is enabled.");
}
else if (!form.isApplyToMultipleFolders() && form.getFolderRowIds() != null)
{
errors.reject(ERROR_MSG, "Folder RowIds provided when 'apply to multiple folders' not enabled.");
// Be sure that the set of folder to apply the import to match the setting to enable/disable them
if (form.isApplyToMultipleFolders() && (form.getFolderRowIds() == null || form.getFolderRowIds().isEmpty()))
{
errors.reject(ERROR_MSG, "At least one folder must be selected when 'apply to multiple folders' is enabled.");
}
else if (!form.isApplyToMultipleFolders() && form.getFolderRowIds() != null)
{
errors.reject(ERROR_MSG, "Folder RowIds provided when 'apply to multiple folders' not enabled.");
}
}

// Be sure that the user has admin permissions to all selected folders and that all selected folders exist
Expand Down Expand Up @@ -1262,14 +1266,17 @@ else if (!selectedContainer.hasPermission(getUser(), AdminPermission.class))
}
}

// Be sure that the provided data types to import match the setting to enable/disable them
if (form.isSpecificImportOptions() && (form.getDataTypes() == null || form.getDataTypes().isEmpty()))
if (OptionalFeatureService.get().isFeatureEnabled(PipelineModule.ADVANCED_IMPORT_FLAG))
{
errors.reject(ERROR_MSG, "At least one folder data type must be selected when 'select specific objects to import' is enabled.");
}
else if (!form.isSpecificImportOptions() && form.getDataTypes() != null)
{
errors.reject(ERROR_MSG, "Folder data types provided when 'select specific objects to import' not enabled.");
// Be sure that the provided data types to import match the setting to enable/disable them
if (form.isSpecificImportOptions() && (form.getDataTypes() == null || form.getDataTypes().isEmpty()))
{
errors.reject(ERROR_MSG, "At least one folder data type must be selected when 'select specific objects to import' is enabled.");
}
else if (!form.isSpecificImportOptions() && form.getDataTypes() != null)
{
errors.reject(ERROR_MSG, "Folder data types provided when 'select specific objects to import' not enabled.");
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions pipeline/src/org/labkey/pipeline/PipelineModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import org.labkey.api.pipeline.trigger.PipelineTriggerRegistry;
import org.labkey.api.pipeline.trigger.PipelineTriggerType;
import org.labkey.api.security.User;
import org.labkey.api.settings.AdminConsole;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.usageMetrics.UsageMetricsService;
import org.labkey.api.util.ContextListener;
import org.labkey.api.util.PageFlowUtil;
Expand Down Expand Up @@ -105,6 +107,7 @@
public class PipelineModule extends SpringModule implements ContainerManager.ContainerListener
{
private static final Logger _log = LogHelper.getLogger(PipelineModule.class, "Module responsible for managing pipeline jobs and logs");
public static final String ADVANCED_IMPORT_FLAG = "advancedImportFlag";

@Override
public String getName()
Expand Down Expand Up @@ -215,6 +218,12 @@ protected void startupAfterSpringConfig(ModuleContext moduleContext)

AuditLogService.get().registerAuditType(new ProtocolManagementAuditProvider());

AdminConsole.addOptionalFeatureFlag(new AdminConsole.OptionalFeatureFlag(ADVANCED_IMPORT_FLAG,
"Restore 'Advanced Import Options' during Folder import",
"This option will be removed in LabKey Server v25.7.",
false, false, OptionalFeatureService.FeatureType.Deprecated
));

UsageMetricsService.get().registerUsageMetrics(getName(), () -> {
DbSchema pipelineSchema = PipelineSchema.getInstance().getSchema();
SqlDialect dialect = PipelineSchema.getInstance().getSchema().getSqlDialect();
Expand Down
4 changes: 4 additions & 0 deletions pipeline/src/org/labkey/pipeline/startPipelineImport.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<%@ page import="org.labkey.api.view.template.ClientDependencies" %>
<%@ page import="org.labkey.pipeline.PipelineController.StartFolderImportAction" %>
<%@ page import="org.labkey.pipeline.PipelineController.StartFolderImportForm" %>
<%@ page import="org.labkey.api.settings.OptionalFeatureService" %>
<%@ page import="org.labkey.pipeline.PipelineModule" %>
<%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>
<%!
Expand Down Expand Up @@ -57,6 +59,7 @@

Study study = studyService != null ? studyService.getStudy(getContainer()) : null;
TimepointType timepointType = study != null ? study.getTimepointType() : null;
boolean isAdvancedImportOptionEnabled = OptionalFeatureService.get().isFeatureEnabled(PipelineModule.ADVANCED_IMPORT_FLAG);
%>

<labkey:errors/>
Expand Down Expand Up @@ -89,6 +92,7 @@ Ext4.onReady(function()
canCreateSharedDatasets: <%=canCreateSharedDatasets%>,
isCreateSharedDatasets: <%=bean.isCreateSharedDatasets()%>,
isValidateQueries: <%=bean.isValidateQueries()%>,
showAdvancedImportOptions: <%=isAdvancedImportOptionEnabled%>,
isSpecificImportOptions: <%=bean.isSpecificImportOptions()%>,
isApplyToMultipleFolders: <%=bean.isApplyToMultipleFolders()%>,
isFailForUndefinedVisits: <%=bean.isFailForUndefinedVisits()%>,
Expand Down
48 changes: 27 additions & 21 deletions pipeline/webapp/pipeline/ImportAdvancedOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Ext4.define('LABKEY.import.OptionsPanel', {
isFailForUndefinedVisits: false,
showFailForUndefinedVisits: true,
isCloudRoot: false,
showAdvancedImportOptions: false,

initComponent: function()
{
Expand Down Expand Up @@ -102,29 +103,34 @@ Ext4.define('LABKEY.import.OptionsPanel', {
isChecked: this.isValidateQueries,
label: 'Validate all queries after import',
optionsForm: null
},{
header: 'Advanced Import Options',
description: 'By default, all objects and settings from the import archive will be used. If you would '
+ 'like to select a subset of those import objects, check the box below to see the full list of '
+ 'folder archive objects to be imported.',
name: 'specificImportOptions',
initChecked: this.isSpecificImportOptions ? "checked": "",
isChecked: this.isSpecificImportOptions,
label: 'Select specific objects to import',
optionsForm: this.getSpecificImportOptionsForm
},{
header: null,
description: 'By default, the imported archive is only applied to the current folder. If you would like to '
+ 'apply this imported archive to multiple folders, check the box below to see additional folders for this project. '
+ 'The import archive will be applied to all selected folders.',
name: 'applyToMultipleFolders',
initChecked: this.isApplyToMultipleFolders ? "checked": "",
isChecked: this.isApplyToMultipleFolders,
hidden: this.isCloudRoot, // Remove Cloud flag as part of fix Issue #43835
label: 'Apply to multiple folders',
optionsForm: this.getApplyToMultipleFoldersForm
}];

if (this.showAdvancedImportOptions) {
data.push({
header: 'Advanced Import Options',
description: 'By default, all objects and settings from the import archive will be used. If you would '
+ 'like to select a subset of those import objects, check the box below to see the full list of '
+ 'folder archive objects to be imported.',
name: 'specificImportOptions',
initChecked: this.isSpecificImportOptions ? "checked" : "",
isChecked: this.isSpecificImportOptions,
label: 'Select specific objects to import',
optionsForm: this.getSpecificImportOptionsForm
});
data.push({
header: null,
description: 'By default, the imported archive is only applied to the current folder. If you would like to '
+ 'apply this imported archive to multiple folders, check the box below to see additional folders for this project. '
+ 'The import archive will be applied to all selected folders.',
name: 'applyToMultipleFolders',
initChecked: this.isApplyToMultipleFolders ? "checked" : "",
isChecked: this.isApplyToMultipleFolders,
hidden: this.isCloudRoot, // Remove Cloud flag as part of fix Issue #43835
label: 'Apply to multiple folders',
optionsForm: this.getApplyToMultipleFoldersForm
})
}

if (this.showFailForUndefinedVisits)
{
data.splice(1, 0, {
Expand Down