Skip to content

Commit

Permalink
Generalize experimental features to optional features
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-adam committed Jul 5, 2024
1 parent d4a27af commit d29bda9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.labkey.api.data.Container;
import org.labkey.api.security.User;
import org.labkey.api.settings.AdminConsole;
import org.labkey.api.settings.ExperimentalFeatureService;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.study.SpecimenService;
import org.labkey.api.util.HtmlString;

Expand All @@ -20,12 +20,12 @@ public DelegatingSpecimenRequestCustomizer(SpecimenService.SpecimenRequestCustom
{
_default = defaultCustomizer;

_active = ExperimentalFeatureService.get().isFeatureEnabled(ITN_SPECIMEN_HANDLING_FEATURE_NAME) ? _itn : _default;
_active = OptionalFeatureService.get().isFeatureEnabled(ITN_SPECIMEN_HANDLING_FEATURE_NAME) ? _itn : _default;

AdminConsole.addExperimentalFeatureFlag(ITN_SPECIMEN_HANDLING_FEATURE_NAME, "ITN specimen behavior",
"This feature allows empty specimen requests, adds ITN-specific messages, hides some reporting options, and other tweaks", false);

ExperimentalFeatureService.get().addFeatureListener(ITN_SPECIMEN_HANDLING_FEATURE_NAME, (feature, enabled) -> _active = enabled ? _itn : _default);
OptionalFeatureService.get().addFeatureListener(ITN_SPECIMEN_HANDLING_FEATURE_NAME, (feature, enabled) -> _active = enabled ? _itn : _default);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.labkey.test.pages.study.specimen.ShowCreateSpecimenRequestPage;
import org.labkey.test.pages.study.specimen.TypeSummaryReportPage;
import org.labkey.test.util.ApiPermissionsHelper;
import org.labkey.test.util.ExperimentalFeaturesHelper;
import org.labkey.test.util.OptionalFeatureHelper;
import org.labkey.test.util.LogMethod;
import org.labkey.test.util.PermissionsHelper.MemberType;
import org.labkey.test.util.TestLogger;
Expand Down Expand Up @@ -192,7 +192,7 @@ public void testRequestPermissionCustomization()
public void enableITNSpecimenHandling(boolean enable)
{
Connection cn = createDefaultConnection(false);
ExperimentalFeaturesHelper.setExperimentalFeature(cn, ITN_SPECIMEN_HANDLING, enable);
OptionalFeatureHelper.setOptionalFeature(cn, ITN_SPECIMEN_HANDLING, enable);
}

@Override
Expand Down

0 comments on commit d29bda9

Please sign in to comment.