|
|
@@ -50,6 +50,7 @@ function Manual(props) {
|
|
|
const [open, setOpen] = React.useState(false);
|
|
|
const [date, setDate] = React.useState(new Date());
|
|
|
const [tab, setTab] = React.useState(0);
|
|
|
+ const [checklist, setChecklist] = React.useState([]);
|
|
|
|
|
|
const handleClose = () => false
|
|
|
|
|
|
@@ -112,8 +113,9 @@ function Manual(props) {
|
|
|
if(check){
|
|
|
temp = [...pruebas, {id}]
|
|
|
}else{
|
|
|
- temp = pruebas.filter((test) => test.id !== id);
|
|
|
+ temp = pruebas.filter( test => test.id !== id);
|
|
|
}
|
|
|
+ setChecklist( temp.map( test => test.id) )
|
|
|
setValues({...values, pruebas: temp})
|
|
|
};
|
|
|
|
|
|
@@ -149,6 +151,7 @@ function Manual(props) {
|
|
|
key={test.id}
|
|
|
control={
|
|
|
<Checkbox
|
|
|
+ checked={checklist.includes((test.id))}
|
|
|
onChange={(event)=> addPrueba(event.target.checked,test.id)}
|
|
|
/>
|
|
|
}
|