Переглянути джерело

modal asignacion de pruebas

amenpunk 3 роки тому
батько
коміт
3c65fffc99

+ 1 - 1
src/App.js

@@ -12,7 +12,7 @@ import Routes from './Components/Routes'
 const queryClient = new QueryClient({
   defaultOptions: {
     queries: {
-      refetchOnWindowFocus: true,
+      refetchOnWindowFocus: false,
     },
   },
 })

+ 14 - 9
src/Components/Modal/AgregarManual.js

@@ -1,8 +1,8 @@
 import React, { memo } from 'react';
 import * as Yup from 'yup';
 import { useFormik, Form, FormikProvider } from 'formik';
-import { Dialog,DialogContent, DialogTitle,DialogActions } from '@mui/material'
-import toast, { Toaster } from 'react-hot-toast';
+import { Dialog, DialogContent, DialogTitle, DialogActions } from '@mui/material'
+import toast from 'react-hot-toast';
 
 import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
 import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
@@ -83,6 +83,12 @@ function Manual(props) {
     },
     onSubmit: (fields, { resetForm }) => {
 
+      if(fields.tests.length === 0){
+        toast.error("Recuerda que seleccionar al menos un test")
+        setTab(1)
+        return
+      }
+
       setOpen(true)
       fields['fecha'] = new Date(fields.fecha).toISOString();
       fields['areadeptoplz_id'] = 1;
@@ -126,11 +132,11 @@ function Manual(props) {
 
   return (
 
-    <Dialog 
-      open={visible} 
-      fullWidth="lg" 
-      maxWidth="md" 
-      aria-labelledby="contained-modal-title-vcenter" 
+    <Dialog
+      open={visible}
+      fullWidth={true}
+      maxWidth="md"
+      aria-labelledby="contained-modal-title-vcenter"
       onClose={onClose}>
 
       <DialogTitle>
@@ -152,7 +158,7 @@ function Manual(props) {
               <Stack spacing={1}>
                 <Box style={{ paddingTop: 5, paddingLeft: 15 }}>
                   <Divider />
-                  <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Seleciona los test a realizar</h4>
+                  <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Selecciona los test a realizar</h4>
                   <Divider />
                   <FormGroup>
                     {
@@ -296,7 +302,6 @@ function Manual(props) {
         onClick={handleClose} >
         <CircularProgress color="inherit" />
       </Backdrop>
-      <Toaster position="top-right" />
     </Dialog>
   )
 }

+ 0 - 0
src/Components/Password/test.tsx


+ 1 - 0
src/Pages/Home.jsx

@@ -85,3 +85,4 @@ export function Home() {
   )
 
 }
+

+ 1 - 1
src/Pages/Puestos.jsx

@@ -220,7 +220,7 @@ export function Puestos() {
       <Editar visible={edit} toggle={toggle} />
       <Eliminar visible={del} onClose={() => setDelete(false)} />
 
-      <Toaster position="bottom-right" />
+      <Toaster position="top-right" />
 
     </div>
   )