-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol-designer, step-generation): add comment to step form (#…
- Loading branch information
Showing
21 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
protocol-designer/src/components/StepEditForm/forms/CommentForm/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { FormGroup, SPACING } from '@opentrons/components' | ||
import { TextField } from '../../fields' | ||
import type { StepFormProps } from '../../types' | ||
|
||
import styles from '../../StepEditForm.module.css' | ||
|
||
export function CommentForm(props: StepFormProps): JSX.Element { | ||
const { t } = useTranslation(['tooltip', 'application', 'form']) | ||
|
||
const { propsForFields } = props | ||
|
||
return ( | ||
<div className={styles.form_wrapper}> | ||
<div className={styles.section_header}> | ||
<span className={styles.section_header_text}> | ||
{t('application:stepType.comment')} | ||
</span> | ||
</div> | ||
<div | ||
className={styles.section_wrapper} | ||
style={{ paddingTop: SPACING.spacing16 }} | ||
> | ||
<FormGroup label={t('form:step_edit_form.field.comment.label')}> | ||
<TextField | ||
{...propsForFields.message} | ||
className={styles.large_field} | ||
/> | ||
</FormGroup> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
protocol-designer/src/components/steplist/CommentStepItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react' | ||
import type { CommentArgs } from '@opentrons/step-generation' | ||
|
||
import styles from './StepItem.module.css' | ||
|
||
interface CommentStepItemProps { | ||
commentArgs: CommentArgs | ||
} | ||
|
||
export function CommentStepItems( | ||
props: CommentStepItemProps | ||
): JSX.Element | null { | ||
const { commentArgs } = props | ||
const message = commentArgs.message | ||
|
||
return ( | ||
<> | ||
<div className={styles.substep_header}> | ||
<span>Comment</span> | ||
</div> | ||
<div className={styles.substep_content}>{`"${message}"`}</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
protocol-designer/src/steplist/formLevel/stepFormToArgs/commentFormToArgs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { CommentArgs } from '@opentrons/step-generation' | ||
import type { HydratedCommentFormData } from '../../../form-types' | ||
|
||
export const commentFormToArgs = ( | ||
hydratedFormData: HydratedCommentFormData | ||
): CommentArgs => { | ||
const { fields, stepName, stepDetails } = hydratedFormData | ||
const { message } = fields | ||
|
||
return { | ||
commandCreatorFnName: 'comment', | ||
description: stepDetails, | ||
name: stepName, | ||
message, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,5 @@ export { | |
touchTip, | ||
moveLabware, | ||
moveToAddressableArea, | ||
comment, | ||
} from './atomic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ export { | |
waitForTemperature, | ||
blowout, | ||
consolidate, | ||
comment, | ||
distribute, | ||
deactivateTemperature, | ||
delay, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters