Kaynağa Gözat

modal asignacion de pruebas

amenpunk 2 yıl önce
ebeveyn
işleme
3c65fffc99

+ 1 - 1
src/App.js

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

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

@@ -1,8 +1,8 @@
1 1
 import React, { memo } from 'react';
2 2
 import * as Yup from 'yup';
3 3
 import { useFormik, Form, FormikProvider } from 'formik';
4
-import { Dialog,DialogContent, DialogTitle,DialogActions } from '@mui/material'
5
-import toast, { Toaster } from 'react-hot-toast';
4
+import { Dialog, DialogContent, DialogTitle, DialogActions } from '@mui/material'
5
+import toast from 'react-hot-toast';
6 6
 
7 7
 import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
8 8
 import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
@@ -83,6 +83,12 @@ function Manual(props) {
83 83
     },
84 84
     onSubmit: (fields, { resetForm }) => {
85 85
 
86
+      if(fields.tests.length === 0){
87
+        toast.error("Recuerda que seleccionar al menos un test")
88
+        setTab(1)
89
+        return
90
+      }
91
+
86 92
       setOpen(true)
87 93
       fields['fecha'] = new Date(fields.fecha).toISOString();
88 94
       fields['areadeptoplz_id'] = 1;
@@ -126,11 +132,11 @@ function Manual(props) {
126 132
 
127 133
   return (
128 134
 
129
-    <Dialog 
130
-      open={visible} 
131
-      fullWidth="lg" 
132
-      maxWidth="md" 
133
-      aria-labelledby="contained-modal-title-vcenter" 
135
+    <Dialog
136
+      open={visible}
137
+      fullWidth={true}
138
+      maxWidth="md"
139
+      aria-labelledby="contained-modal-title-vcenter"
134 140
       onClose={onClose}>
135 141
 
136 142
       <DialogTitle>
@@ -152,7 +158,7 @@ function Manual(props) {
152 158
               <Stack spacing={1}>
153 159
                 <Box style={{ paddingTop: 5, paddingLeft: 15 }}>
154 160
                   <Divider />
155
-                  <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Seleciona los test a realizar</h4>
161
+                  <h4 style={{ paddingTop: 10, paddingBottom: 10 }}>Selecciona los test a realizar</h4>
156 162
                   <Divider />
157 163
                   <FormGroup>
158 164
                     {
@@ -296,7 +302,6 @@ function Manual(props) {
296 302
         onClick={handleClose} >
297 303
         <CircularProgress color="inherit" />
298 304
       </Backdrop>
299
-      <Toaster position="top-right" />
300 305
     </Dialog>
301 306
   )
302 307
 }

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


+ 1 - 0
src/Pages/Home.jsx

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

+ 1 - 1
src/Pages/Puestos.jsx

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