amenpunk 3 éve
szülő
commit
3ad831415d

+ 4 - 1
src/Components/Modal/AgregarManual.js

@@ -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)}
                                                         />
                                                     } 

+ 2 - 6
src/Components/Puestos/ListMode.jsx

@@ -43,16 +43,12 @@ export function ListMode(props) {
                                                 }} 
                                                 className="actions_butons_plaza"> 
                                                 <Button 
-                                                    onClick={() => {
-                                                        console.log("VER")
-                                                    }} 
+                                                    onClick={() => props.toggle("VER", plaza)}
                                                     className="ver_producto">
                                                     {!isMovil ? <ShowI/> : "Ver"}
                                                 </Button>
                                                 <Button 
-                                                    onClick={() => {
-                                                        console.log("EDITAR")
-                                                    }} 
+                                                    onClick={() => props.toggle("EDIT", plaza)}
                                                     className="editar_producto">
                                                     {!isMovil ? <EditI/> : "Editar"}
                                                 </Button>