Skip to content

Commit

Permalink
Remove "Cross project file import" experimental feature flag (#5461)
Browse files Browse the repository at this point in the history
- replace usages of isCrossProjectsImportEnabled() with isProductProjectsEnabled()
- AbstractQueryImportAction to use container.hasProductProjects() instead
- QueryModel.getPageContextJson update to remove duplicate code
  • Loading branch information
cnathe committed Apr 30, 2024
1 parent f8f0f64 commit 3ebcdf3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ public static DataIteratorContext createDataIteratorContext(QueryUpdateService.I
context.setSupportAutoIncrementKey(true);
}
context.setCrossTypeImport(crossTypeImport);
context.setCrossFolderImport(crossFolderImport && QueryService.get().isCrossProjectsImportEnabled(container));
context.setCrossFolderImport(crossFolderImport && container != null && container.hasProductProjects());
context.setAllowCreateStorage(allowCreateStorage);
context.setUseTransactionAuditCache(useTransactionAuditCache);
context.setLogger(logger);
Expand Down
3 changes: 0 additions & 3 deletions api/src/org/labkey/api/query/QueryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public interface QueryService
String PRODUCT_PROJECTS_ENABLED = "isProductProjectsEnabled";
String PRODUCT_PROJECTS_EXIST = "hasProductProjects";
String USE_ROW_BY_ROW_UPDATE = "useLegacyUpdateRows";
String CROSS_PROJECT_IMPORT_ENABLED = "isCrossProjectImportEnabled";

String MODULE_QUERIES_DIRECTORY = "queries";
Path MODULE_QUERIES_PATH = Path.parse(MODULE_QUERIES_DIRECTORY);
Expand Down Expand Up @@ -690,6 +689,4 @@ default Results select()
* Returns true if the "Product projects display project-specific data" experimental feature is enabled.
*/
boolean isProductProjectsDataListingScopedToProject();

boolean isCrossProjectsImportEnabled(Container container);
}
7 changes: 1 addition & 6 deletions query/src/org/labkey/query/QueryModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
import org.labkey.query.reports.getdata.FilterClauseBuilder;
import org.labkey.query.reports.view.ReportAndDatasetChangeDigestEmailTemplate;
import org.labkey.query.reports.view.ReportUIProvider;
import org.labkey.query.sql.CalculatedExpressionColumn;
import org.labkey.query.sql.Method;
import org.labkey.query.sql.QNode;
import org.labkey.query.sql.SqlParser;
Expand Down Expand Up @@ -232,8 +231,6 @@ public QuerySchema createSchema(DefaultSchema schema, Module module)
"Allow for lookup fields in product projects to query across all folders within the top-level folder.", false);
AdminConsole.addExperimentalFeatureFlag(QueryServiceImpl.EXPERIMENTAL_PRODUCT_PROJECT_DATA_LISTING_SCOPED, "Product projects display project-specific data",
"Only list project-specific data within product projects.", false);
AdminConsole.addExperimentalFeatureFlag(QueryServiceImpl.CROSS_PROJECT_IMPORT_ENABLED, "Cross project file import",
"Allow import of sample data across projects", false);
}


Expand Down Expand Up @@ -412,12 +409,10 @@ public JSONObject getPageContextJson(ContainerUser context)
json.put("hasEditQueriesPermission", hasEditQueriesPermission);
Container container = context.getContainer();
boolean isProductProjectsEnabled = container != null && container.isProductProjectsEnabled(); // TODO: should these be moved to CoreModule?
json.put(QueryService.PRODUCT_PROJECTS_ENABLED, container != null && container.isProductProjectsEnabled());
json.put(QueryService.PRODUCT_PROJECTS_ENABLED, isProductProjectsEnabled);
json.put(QueryService.PRODUCT_PROJECTS_EXIST, isProductProjectsEnabled && container.hasProductProjects());
json.put(QueryService.EXPERIMENTAL_PRODUCT_ALL_FOLDER_LOOKUPS, QueryService.get().isProductProjectsAllFolderScopeEnabled());
json.put(QueryService.EXPERIMENTAL_PRODUCT_PROJECT_DATA_LISTING_SCOPED, QueryService.get().isProductProjectsDataListingScopedToProject());
json.put(QueryService.CROSS_PROJECT_IMPORT_ENABLED, QueryService.get().isCrossProjectsImportEnabled(container));

return json;
}
}
6 changes: 0 additions & 6 deletions query/src/org/labkey/query/QueryServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -3412,12 +3412,6 @@ public boolean isProductProjectsDataListingScopedToProject()
return AppProps.getInstance().isExperimentalFeatureEnabled(EXPERIMENTAL_PRODUCT_PROJECT_DATA_LISTING_SCOPED);
}

@Override
public boolean isCrossProjectsImportEnabled(@Nullable Container container)
{
return container != null && container.isProductProjectsEnabled() && AppProps.getInstance().isExperimentalFeatureEnabled(CROSS_PROJECT_IMPORT_ENABLED);
}

public static class TestCase extends Assert
{
@Test
Expand Down

0 comments on commit 3ebcdf3

Please sign in to comment.