Skip to content

Commit 801ba05

Browse files
committed
Address several optional feature issues
1 parent a0fc13f commit 801ba05

4 files changed

Lines changed: 19 additions & 21 deletions

File tree

api/src/org/labkey/api/query/QueryView.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@
146146
*/
147147
public class QueryView extends WebPartView<Object> implements ContainerUser
148148
{
149-
public static final String EXPERIMENTAL_GENERIC_DETAILS_URL = "generic-details-url";
150-
151149
public static final String EXCEL_WEB_QUERY_EXPORT_TYPE = "excelWebQuery";
152150
public static final String DATAREGIONNAME_DEFAULT = "query";
153151

@@ -3012,12 +3010,6 @@ protected ContainerFilter getContainerFilter()
30123010
return null;
30133011
}
30143012

3015-
private boolean isShowExperimentalGenericDetailsURL()
3016-
{
3017-
return AppProps.getInstance().isOptionalFeatureEnabled(EXPERIMENTAL_GENERIC_DETAILS_URL);
3018-
}
3019-
3020-
30213013
List<DisplayColumn> _queryDefDisplayColumns = null;
30223014

30233015
public List<DisplayColumn> getDisplayColumns()
@@ -3050,7 +3042,7 @@ protected void addDetailsAndUpdateColumns(List<DisplayColumn> ret, TableInfo tab
30503042
if (isPrintView() || isExportView())
30513043
return;
30523044

3053-
if (_showDetailsColumn && (null != _detailsURL || table.hasDetailsURL() || isShowExperimentalGenericDetailsURL()))
3045+
if (_showDetailsColumn && (null != _detailsURL || table.hasDetailsURL()))
30543046
{
30553047
StringExpression urlDetails = urlExpr(QueryAction.detailsQueryRow);
30563048

api/src/org/labkey/api/settings/OptionalFeatureService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ static void setInstance(OptionalFeatureService impl)
4949

5050
/**
5151
* @param flag must be unique and conform to the Java identifier rules (e.g., alphanumeric plus _, start with a
52-
* letter, no spaces). That way it can be used as a startup property to enable/disable the task. If
53-
* you must use a flag that doesn't conform to these rules (why?) the call the other variant.
52+
* letter, no spaces) so it can be used as a startup property to enable/disable the task.
5453
*/
5554
default void addExperimentalFeatureFlag(String flag, String title, String description, boolean requiresRestart)
5655
{
5756
addExperimentalFeatureFlag(flag, title, description, requiresRestart, false);
5857
}
5958

6059
/**
61-
* This is left for backward compatibility. Use the variant above and provide flag that follows Java identifier rules.
60+
* This is left for backward compatibility. Use the variant above and provide a flag that follows Java identifier rules.
6261
*/
62+
@Deprecated
6363
default void addExperimentalFeatureFlag(String flag, String title, String description, boolean requiresRestart, boolean useDumbName)
6464
{
6565
addFeatureFlag(new OptionalFeatureFlag(flag, title, description, requiresRestart, false, FeatureType.Experimental, useDumbName));
@@ -127,8 +127,8 @@ public HtmlString getAdminGuidance()
127127
{
128128
return HtmlString.unsafe(
129129
"""
130-
Optional features are not typically used; discuss with your account manager before enabling any
131-
optional feature.
130+
Optional features are disabled by default. Review the description for each feature before enabling
131+
it, and discuss with your Account Manager if you have questions.
132132
"""
133133
);
134134
}

core/src/org/labkey/core/CoreModule.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,29 +1146,37 @@ public void moduleStartupComplete(ServletContext servletContext)
11461146
.filter(DataLoaderFactory::indexable)
11471147
.forEach(ss::addDocumentParser);
11481148

1149-
OptionalFeatureService.get().addExperimentalFeatureFlag(AppProps.EXPERIMENTAL_NO_GUESTS,
1149+
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(
1150+
AppProps.EXPERIMENTAL_NO_GUESTS,
11501151
"No Guest Account",
11511152
"Disable the guest account",
1152-
false);
1153+
false,
1154+
false,
1155+
FeatureType.Optional
1156+
));
11531157
OptionalFeatureService.get().addExperimentalFeatureFlag(AppProps.EXPERIMENTAL_BLOCKER,
11541158
"Block malicious clients",
11551159
"Reject requests from clients that appear malicious. Turn this feature off if you want to run a security scanner.",
11561160
false);
1157-
OptionalFeatureService.get().addExperimentalFeatureFlag(FEATURE_FLAG_DISABLE_ENFORCE_CSP,
1161+
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(
1162+
FEATURE_FLAG_DISABLE_ENFORCE_CSP,
11581163
"Disable enforce Content Security Policy",
11591164
"Stop sending the " + ContentSecurityPolicyFilter.ContentSecurityPolicyType.Enforce.getHeaderName() + " header to browsers, " +
11601165
"but continue sending the " + ContentSecurityPolicyFilter.ContentSecurityPolicyType.Report.getHeaderName() + " header. " +
11611166
"This turns off an important layer of security for the entire site, so use it as a last resort only on a temporary basis " +
11621167
"(e.g., if an enforce CSP breaks critical functionality).",
1163-
false);
1168+
false,
1169+
false,
1170+
FeatureType.Deprecated
1171+
));
11641172
OptionalFeatureService.get().addExperimentalFeatureFlag(DataRegion.EXPERIMENTAL_DATA_REGION_ASYNC_TOTAL_ROWS,
11651173
"Data Region Async Total Rows",
11661174
"Enable asynchronous calculation of total rows for data regions. This can improve performance for large datasets.",
11671175
false);
11681176

11691177
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(EXPERIMENTAL_LOCAL_MARKETING_UPDATE,
11701178
"Self test marketing updates", "Test marketing updates from this local server (requires the mothership module).", false, true, FeatureType.Experimental));
1171-
OptionalFeatureService.get().addFeatureListener(EXPERIMENTAL_LOCAL_MARKETING_UPDATE, (feature, enabled) -> {
1179+
OptionalFeatureService.get().addFeatureListener(EXPERIMENTAL_LOCAL_MARKETING_UPDATE, (_, enabled) -> {
11721180
// update the timer task when this setting changes
11731181
MothershipReport.setSelfTestMarketingUpdates(enabled);
11741182
UsageReportingLevel.reportNow();

query/src/org/labkey/query/QueryModule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ public QuerySchema createSchema(DefaultSchema schema, Module module)
237237
DataViewService.get().registerProvider(QueryDataViewProvider.TYPE, new QueryDataViewProvider());
238238
DataViewService.get().registerProvider(InheritedQueryDataViewProvider.TYPE, new InheritedQueryDataViewProvider());
239239

240-
OptionalFeatureService.get().addExperimentalFeatureFlag(QueryView.EXPERIMENTAL_GENERIC_DETAILS_URL, "Generic [details] link in grids/queries",
241-
"This feature will turn on generating a generic [details] URL link in most grids.", false, true);
242240
OptionalFeatureService.get().addExperimentalFeatureFlag(QueryServiceImpl.EXPERIMENTAL_LAST_MODIFIED, "Include Last-Modified header on query metadata requests",
243241
"For schema, query, and view metadata requests include a Last-Modified header such that the browser can cache the response. " +
244242
"The metadata is invalidated when performing actions such as creating a new List or modifying the columns on a custom view", false);

0 commit comments

Comments
 (0)