diff --git a/frontend/app/components/UsabilityTesting/StepsModal.tsx b/frontend/app/components/UsabilityTesting/StepsModal.tsx index beab8b7c1..e19f4442d 100644 --- a/frontend/app/components/UsabilityTesting/StepsModal.tsx +++ b/frontend/app/components/UsabilityTesting/StepsModal.tsx @@ -1,11 +1,21 @@ -import { UxTask } from "App/services/UxtestingService"; -import React from 'react' -import { Button, Input, Switch, Typography } from 'antd' +import { UxTask } from 'App/services/UxtestingService'; +import React from 'react'; +import { Button, Input, Switch, Typography } from 'antd'; -function StepsModal({ onAdd, onHide, editTask }: { onAdd: (step: UxTask) => void; onHide: () => void, editTask?: UxTask }) { +function StepsModal({ + onAdd, + onHide, + editTask, + typingEnabled, +}: { + onAdd: (step: UxTask) => void; + onHide: () => void; + editTask?: UxTask; + typingEnabled?: boolean; +}) { const [title, setTitle] = React.useState(editTask?.title ?? ''); const [description, setDescription] = React.useState(editTask?.description ?? ''); - const [isAnswerEnabled, setIsAnswerEnabled] = React.useState(editTask?.allowTyping ?? false); + const [isAnswerEnabled, setIsAnswerEnabled] = React.useState(editTask?.allowTyping ?? typingEnabled); const save = () => { onAdd({ @@ -15,6 +25,7 @@ function StepsModal({ onAdd, onHide, editTask }: { onAdd: (step: UxTask) => void }); onHide(); }; + return (
@@ -63,4 +74,4 @@ function StepsModal({ onAdd, onHide, editTask }: { onAdd: (step: UxTask) => void ); } -export default StepsModal; \ No newline at end of file +export default StepsModal; diff --git a/frontend/app/components/UsabilityTesting/TestEdit.tsx b/frontend/app/components/UsabilityTesting/TestEdit.tsx index 17ffcfc17..a3dc00ed1 100644 --- a/frontend/app/components/UsabilityTesting/TestEdit.tsx +++ b/frontend/app/components/UsabilityTesting/TestEdit.tsx @@ -36,6 +36,7 @@ function TestEdit() { // @ts-ignore const { siteId, testId } = useParams(); const [hasChanged, setHasChanged] = React.useState(testId === 'new'); + const [typingEnabled, setTypingEnabled] = React.useState(false); const { uxtestingStore } = useStore(); const [newTestTitle, setNewTestTitle] = React.useState(''); const [newTestDescription, setNewTestDescription] = React.useState(''); @@ -328,9 +329,11 @@ function TestEdit() { onClick={() => showModal( { setHasChanged(true); + setTypingEnabled(task.allowTyping); uxtestingStore.instance!.setProperty('tasks', [ ...uxtestingStore.instance!.tasks, task,