From 48f34617e6f0504db16d3dd9724b47239c4bcca3 Mon Sep 17 00:00:00 2001 From: Jethary Date: Mon, 25 Mar 2024 14:12:06 -0400 Subject: [PATCH 1/2] feat(protocol-designer): create MoaM feature flag closes AUTH-238 --- protocol-designer/src/feature-flags/reducers.ts | 1 + protocol-designer/src/feature-flags/selectors.ts | 4 ++++ protocol-designer/src/feature-flags/types.ts | 1 + protocol-designer/src/localization/en/feature_flags.json | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/protocol-designer/src/feature-flags/reducers.ts b/protocol-designer/src/feature-flags/reducers.ts index d4492497624..2a806851794 100644 --- a/protocol-designer/src/feature-flags/reducers.ts +++ b/protocol-designer/src/feature-flags/reducers.ts @@ -22,6 +22,7 @@ const initialFlags: Flags = { OT_PD_ALLOW_ALL_TIPRACKS: process.env.OT_PD_ALLOW_ALL_TIPRACKS === '1' || false, OT_PD_ENABLE_MULTI_TIP: process.env.OT_PD_ENABLE_MULTI_TIP === '1' || false, + OT_PD_ENABLE_MOAM: process.env.OT_PD_ENABLE_MOAM === '1' || false } // @ts-expect-error(sa, 2021-6-10): cannot use string literals as action type // TODO IMMEDIATELY: refactor this to the old fashioned way if we cannot have type safety: https://github.com/redux-utilities/redux-actions/issues/282#issuecomment-595163081 diff --git a/protocol-designer/src/feature-flags/selectors.ts b/protocol-designer/src/feature-flags/selectors.ts index 0a27f7fc108..da7e53dd191 100644 --- a/protocol-designer/src/feature-flags/selectors.ts +++ b/protocol-designer/src/feature-flags/selectors.ts @@ -23,3 +23,7 @@ export const getEnableMultiTip: Selector = createSelector( getFeatureFlagData, flags => flags.OT_PD_ENABLE_MULTI_TIP ?? false ) +export const getEnableMoam: Selector = createSelector( + getFeatureFlagData, + flags => flags.OT_PD_ENABLE_MOAM ?? false +) \ No newline at end of file diff --git a/protocol-designer/src/feature-flags/types.ts b/protocol-designer/src/feature-flags/types.ts index 1e441bb9062..99b4b76b1f6 100644 --- a/protocol-designer/src/feature-flags/types.ts +++ b/protocol-designer/src/feature-flags/types.ts @@ -29,6 +29,7 @@ export type FlagTypes = | 'OT_PD_DISABLE_MODULE_RESTRICTIONS' | 'OT_PD_ALLOW_ALL_TIPRACKS' | 'OT_PD_ENABLE_MULTI_TIP' + | 'OT_PD_ENABLE_MOAM' // flags that are not in this list only show in prerelease mode export const userFacingFlags: FlagTypes[] = [ 'OT_PD_DISABLE_MODULE_RESTRICTIONS', diff --git a/protocol-designer/src/localization/en/feature_flags.json b/protocol-designer/src/localization/en/feature_flags.json index e234a9c5b19..ebab1c9635d 100644 --- a/protocol-designer/src/localization/en/feature_flags.json +++ b/protocol-designer/src/localization/en/feature_flags.json @@ -15,5 +15,9 @@ "OT_PD_ENABLE_MULTI_TIP": { "title": "Enable multi tiprack support", "description": "Allow users to select multiple tipracks per pipette" + }, + "OT_PD_ENABLE_MOAM": { + "title": "Enable multiples of a module", + "description": "Allow users to select multiples of a module" } } From b61f3fab01f60ba8df30b06b5240e700e6fa6975 Mon Sep 17 00:00:00 2001 From: Jethary Date: Mon, 25 Mar 2024 14:22:23 -0400 Subject: [PATCH 2/2] fix prettier --- protocol-designer/src/feature-flags/reducers.ts | 2 +- protocol-designer/src/feature-flags/selectors.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol-designer/src/feature-flags/reducers.ts b/protocol-designer/src/feature-flags/reducers.ts index 2a806851794..0fb93e30a8f 100644 --- a/protocol-designer/src/feature-flags/reducers.ts +++ b/protocol-designer/src/feature-flags/reducers.ts @@ -22,7 +22,7 @@ const initialFlags: Flags = { OT_PD_ALLOW_ALL_TIPRACKS: process.env.OT_PD_ALLOW_ALL_TIPRACKS === '1' || false, OT_PD_ENABLE_MULTI_TIP: process.env.OT_PD_ENABLE_MULTI_TIP === '1' || false, - OT_PD_ENABLE_MOAM: process.env.OT_PD_ENABLE_MOAM === '1' || false + OT_PD_ENABLE_MOAM: process.env.OT_PD_ENABLE_MOAM === '1' || false, } // @ts-expect-error(sa, 2021-6-10): cannot use string literals as action type // TODO IMMEDIATELY: refactor this to the old fashioned way if we cannot have type safety: https://github.com/redux-utilities/redux-actions/issues/282#issuecomment-595163081 diff --git a/protocol-designer/src/feature-flags/selectors.ts b/protocol-designer/src/feature-flags/selectors.ts index da7e53dd191..49aaa937cb4 100644 --- a/protocol-designer/src/feature-flags/selectors.ts +++ b/protocol-designer/src/feature-flags/selectors.ts @@ -26,4 +26,4 @@ export const getEnableMultiTip: Selector = createSelector( export const getEnableMoam: Selector = createSelector( getFeatureFlagData, flags => flags.OT_PD_ENABLE_MOAM ?? false -) \ No newline at end of file +)