Skip to content

Commit dafb688

Browse files
Issue #980: Deprecate the UI for deriving samples in LKS (#7764)
1 parent edefaf5 commit dafb688

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public interface AppProps
4646
String SCOPE_OPTIONAL_FEATURE = "ExperimentalFeature"; // Startup property prefix for all optional features; "Experimental" for historical reasons.
4747
String EXPERIMENTAL_NO_GUESTS = "disableGuestAccount";
4848
String EXPERIMENTAL_BLOCKER = "blockMaliciousClients";
49+
String DEPRECATED_DERIVE_SAMPLES_NOT_IN_APP = "deriveSamplesNotInApp";
4950
String EXPERIMENTAL_RESOLVE_PROPERTY_URI_COLUMNS = "resolve-property-uri-columns";
5051
String ADMIN_PROVIDED_ALLOWED_EXTERNAL_RESOURCES = "allowedExternalResources";
5152
String QUANTITY_COLUMN_SUFFIX_TESTING = "quantityColumnSuffixTesting";

experiment/src/org/labkey/experiment/ExperimentModule.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
import org.labkey.api.security.User;
9797
import org.labkey.api.security.roles.RoleManager;
9898
import org.labkey.api.settings.AppProps;
99+
import org.labkey.api.settings.OptionalFeatureFlag;
99100
import org.labkey.api.settings.OptionalFeatureService;
100101
import org.labkey.api.usageMetrics.UsageMetricsService;
101102
import org.labkey.api.util.GUID;
@@ -264,6 +265,13 @@ protected void init()
264265
ExperimentService.get().registerNameExpressionType("aliquots", "exp", "MaterialSource", "aliquotnameexpression");
265266
ExperimentService.get().registerNameExpressionType("dataclass", "exp", "DataClass", "nameexpression");
266267

268+
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(
269+
AppProps.DEPRECATED_DERIVE_SAMPLES_NOT_IN_APP,
270+
"Derive Samples in LabKey Server UI",
271+
"Enables the UI for deriving samples in LabKey Server UI from either the samples grids or a sample lineage page. This option will be removed in LabKey Server 26.11",
272+
false,
273+
false,
274+
OptionalFeatureService.FeatureType.Deprecated));
267275
OptionalFeatureService.get().addExperimentalFeatureFlag(AppProps.EXPERIMENTAL_RESOLVE_PROPERTY_URI_COLUMNS, "Resolve property URIs as columns on experiment tables",
268276
"If a column is not found on an experiment table, attempt to resolve the column name as a Property URI and add it as a property column", false, true);
269277
if (CoreSchema.getInstance().getSqlDialect().isSqlServer())

experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
import org.labkey.api.security.roles.ReaderRole;
210210
import org.labkey.api.settings.AppProps;
211211
import org.labkey.api.settings.ConceptURIProperties;
212+
import org.labkey.api.settings.OptionalFeatureService;
212213
import org.labkey.api.sql.LabKeySql;
213214
import org.labkey.api.study.Dataset;
214215
import org.labkey.api.study.StudyService;
@@ -1117,7 +1118,8 @@ public ModelAndView getView(Object o, BindException errors)
11171118
protected void populateButtonBar(DataView view, ButtonBar bar)
11181119
{
11191120
super.populateButtonBar(view, bar);
1120-
bar.add(SampleTypeContentsView.getDeriveSamplesButton(getContainer(),null));
1121+
if (OptionalFeatureService.get().isFeatureEnabled(AppProps.DEPRECATED_DERIVE_SAMPLES_NOT_IN_APP))
1122+
bar.add(SampleTypeContentsView.getDeriveSamplesButton(getContainer(),null));
11211123
}
11221124
};
11231125
view.setShowDetailsColumn(false);
@@ -1257,7 +1259,7 @@ public VBox getView(ExpObjectForm form, BindException errors) throws Exception
12571259
}
12581260
}
12591261

1260-
if (getContainer().hasPermission(getUser(), InsertPermission.class))
1262+
if (getContainer().hasPermission(getUser(), InsertPermission.class) && OptionalFeatureService.get().isFeatureEnabled(AppProps.DEPRECATED_DERIVE_SAMPLES_NOT_IN_APP))
12611263
{
12621264
ActionURL deriveURL = new ActionURL(DeriveSamplesChooseTargetAction.class, getContainer());
12631265
deriveURL.addParameter("rowIds", _material.getRowId());

experiment/src/org/labkey/experiment/controllers/exp/SampleTypeContentsView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import org.labkey.api.query.QuerySettings;
3434
import org.labkey.api.query.QueryView;
3535
import org.labkey.api.security.permissions.InsertPermission;
36+
import org.labkey.api.settings.AppProps;
37+
import org.labkey.api.settings.OptionalFeatureService;
3638
import org.labkey.api.study.StudyUrls;
3739
import org.labkey.api.study.publish.StudyPublishService;
3840
import org.labkey.api.util.PageFlowUtil;
@@ -215,7 +217,8 @@ protected void populateButtonBar(DataView view, ButtonBar bar)
215217
{
216218
super.populateButtonBar(view, bar);
217219

218-
bar.add(getDeriveSamplesButton(getContainer(), _source.getRowId()));
220+
if (OptionalFeatureService.get().isFeatureEnabled(AppProps.DEPRECATED_DERIVE_SAMPLES_NOT_IN_APP))
221+
bar.add(getDeriveSamplesButton(getContainer(), _source.getRowId()));
219222

220223
ActionButton linkToStudyButton = getLinkToStudyButton(view);
221224
if (linkToStudyButton != null)

0 commit comments

Comments
 (0)