diff --git a/app/src/pages/ProtocolDetails/__tests__/ProtocolDetails.test.tsx b/app/src/pages/ProtocolDetails/__tests__/ProtocolDetails.test.tsx index 12ad7ef870f7..0e6bfb0da8ca 100644 --- a/app/src/pages/ProtocolDetails/__tests__/ProtocolDetails.test.tsx +++ b/app/src/pages/ProtocolDetails/__tests__/ProtocolDetails.test.tsx @@ -21,6 +21,7 @@ import { i18n } from '../../../i18n' import { useHardwareStatusText } from '../../../organisms/OnDeviceDisplay/RobotDashboard/hooks' import { useOffsetCandidatesForAnalysis } from '../../../organisms/ApplyHistoricOffsets/hooks/useOffsetCandidatesForAnalysis' import { useMissingProtocolHardware } from '../../Protocols/hooks' +import { useFeatureFlag } from '../../../redux/config' import { formatTimeWithUtcLabel } from '../../../resources/runs' import { ProtocolDetails } from '..' import { Deck } from '../Deck' @@ -52,6 +53,7 @@ vi.mock('../Deck') vi.mock('../Hardware') vi.mock('../Labware') vi.mock('../Parameters') +vi.mock('../../../redux/config') const MOCK_HOST_CONFIG = {} as HostConfig const mockCreateRun = vi.fn((id: string) => {}) @@ -90,6 +92,7 @@ const render = (path = '/protocols/fakeProtocolId') => { describe('ODDProtocolDetails', () => { beforeEach(() => { + vi.mocked(useFeatureFlag).mockReturnValue(true) vi.mocked(useCreateRunMutation).mockReturnValue({ createRun: mockCreateRun, } as any) diff --git a/app/src/pages/ProtocolDetails/index.tsx b/app/src/pages/ProtocolDetails/index.tsx index d8237b1ac4b6..758d5f018a8c 100644 --- a/app/src/pages/ProtocolDetails/index.tsx +++ b/app/src/pages/ProtocolDetails/index.tsx @@ -44,6 +44,7 @@ import { getApplyHistoricOffsets, getPinnedProtocolIds, updateConfigValue, + useFeatureFlag, } from '../../redux/config' import { useOffsetCandidatesForAnalysis } from '../../organisms/ApplyHistoricOffsets/hooks/useOffsetCandidatesForAnalysis' import { useMissingProtocolHardware } from '../Protocols/hooks' @@ -163,8 +164,17 @@ const protocolSectionTabOptions = [ 'Liquids', 'Deck', ] as const +const protocolSectionTabOptionsWithoutParameters = [ + 'Summary', + 'Hardware', + 'Labware', + 'Liquids', + 'Deck', +] as const -type TabOption = typeof protocolSectionTabOptions[number] +type TabOption = + | typeof protocolSectionTabOptions[number] + | typeof protocolSectionTabOptionsWithoutParameters[number] interface ProtocolSectionTabsProps { currentOption: TabOption @@ -175,9 +185,13 @@ const ProtocolSectionTabs = ({ currentOption, setCurrentOption, }: ProtocolSectionTabsProps): JSX.Element => { + const enableRtpFF = useFeatureFlag('enableRunTimeParameters') + const options = enableRtpFF + ? protocolSectionTabOptions + : protocolSectionTabOptionsWithoutParameters return ( - {protocolSectionTabOptions.map(option => { + {options.map(option => { return ( () const { missingProtocolHardware, @@ -305,8 +320,11 @@ export function ProtocolDetails(): JSX.Element | null { const { makeSnackbar } = useToaster() const queryClient = useQueryClient() const [currentOption, setCurrentOption] = React.useState( - protocolSectionTabOptions[0] + enableRtpFF + ? protocolSectionTabOptions[0] + : protocolSectionTabOptionsWithoutParameters[0] ) + const [showMaxPinsAlert, setShowMaxPinsAlert] = React.useState(false) const { data: protocolRecord,