Skip to content

Commit

Permalink
feat(protocol-designer): wire up rename step
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyaochen authored and shiyaochen committed Oct 8, 2024
1 parent 6869198 commit be90fc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions protocol-designer/src/assets/localization/en/shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"message_uses_standard_namespace": "This labware definition uses the Opentrons standard labware namespace. Change the namespace if it is custom, or use the standard labware in your protocol.",
"mismatched": "The new labware has a different arrangement of wells than the labware it is replacing. Clicking Overwrite will deselect all wells in any existing steps that use this labware. You will have to edit each of those steps and select new wells.",
"module": "Module",
"name_step": "Name step",
"next": "next",
"ninety_six_channel": "96-Channel",
"no_hints_to_restore": "No hints to restore",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
COLORS,
Flex,
Icon,
Modal,
PrimaryButton,
SPACING,
SecondaryButton,
Expand Down Expand Up @@ -38,6 +39,7 @@ import { getSaveStepSnackbarText } from './utils'
import type { StepFieldName } from '../../../../steplist/fieldLevel'
import type { FormData, StepType } from '../../../../form-types'
import type { FieldPropsByName, FocusHandlers, StepFormProps } from './types'
import { MoreOptionsModal } from '../../../../components/modals/MoreOptionsModal'

Check failure on line 42 in protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepFormToolbox.tsx

View workflow job for this annotation

GitHub Actions / js checks

'MoreOptionsModal' is defined but never used

Check failure on line 42 in protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepFormToolbox.tsx

View workflow job for this annotation

GitHub Actions / js checks

'MoreOptionsModal' is defined but never used

type StepFormMap = {
[K in StepType]?: React.ComponentType<StepFormProps> | null
Expand Down Expand Up @@ -97,6 +99,7 @@ export function StepFormToolbox(props: StepFormToolboxProps): JSX.Element {
? 1
: 0
)
const [isRename, setIsRename] = useState<boolean>(false)
const icon = stepIconsByType[formData.stepType]

const ToolsComponent: typeof STEP_FORM_MAP[keyof typeof STEP_FORM_MAP] = get(
Expand Down Expand Up @@ -136,8 +139,12 @@ export function StepFormToolbox(props: StepFormToolboxProps): JSX.Element {
}) as string
)
}

return (
<>
{isRename ?
<Modal></Modal>
: null}
<Toolbox
subHeader={
isMultiStepToolbox ? (
Expand All @@ -149,7 +156,7 @@ export function StepFormToolbox(props: StepFormToolboxProps): JSX.Element {
secondaryHeaderButton={
<Btn
onClick={() => {
console.log('TODO: wire this up')
setIsRename(true)
}}
css={BUTTON_LINK_STYLE}
textDecoration={TYPOGRAPHY.textDecorationUnderline}
Expand Down

0 comments on commit be90fc3

Please sign in to comment.