浏览代码

modal asignacion de pruebas

amenpunk 2 年之前
父节点
当前提交
3c65fffc99
共有 5 个文件被更改,包括 17 次插入11 次删除
  1. 1 1
      src/App.js
  2. 14 9
      src/Components/Modal/AgregarManual.js
  3. 0 0
      src/Components/Password/test.tsx
  4. 1 0
      src/Pages/Home.jsx
  5. 1 1
      src/Pages/Puestos.jsx

+ 1 - 1
src/App.js

12
 const queryClient = new QueryClient({
12
 const queryClient = new QueryClient({
13
   defaultOptions: {
13
   defaultOptions: {
14
     queries: {
14
     queries: {
15
-      refetchOnWindowFocus: true,
15
+      refetchOnWindowFocus: false,
16
     },
16
     },
17
   },
17
   },
18
 })
18
 })

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

1
 import React, { memo } from 'react';
1
 import React, { memo } from 'react';
2
 import * as Yup from 'yup';
2
 import * as Yup from 'yup';
3
 import { useFormik, Form, FormikProvider } from 'formik';
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
 import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
7
 import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
8
 import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
8
 import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
83
     },
83
     },
84
     onSubmit: (fields, { resetForm }) => {
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
       setOpen(true)
92
       setOpen(true)
87
       fields['fecha'] = new Date(fields.fecha).toISOString();
93
       fields['fecha'] = new Date(fields.fecha).toISOString();
88
       fields['areadeptoplz_id'] = 1;
94
       fields['areadeptoplz_id'] = 1;
126
 
132
 
127
   return (
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
       onClose={onClose}>
140
       onClose={onClose}>
135
 
141
 
136
       <DialogTitle>
142
       <DialogTitle>
152
               <Stack spacing={1}>
158
               <Stack spacing={1}>
153
                 <Box style={{ paddingTop: 5, paddingLeft: 15 }}>
159
                 <Box style={{ paddingTop: 5, paddingLeft: 15 }}>
154
                   <Divider />
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
                   <Divider />
162
                   <Divider />
157
                   <FormGroup>
163
                   <FormGroup>
158
                     {
164
                     {
296
         onClick={handleClose} >
302
         onClick={handleClose} >
297
         <CircularProgress color="inherit" />
303
         <CircularProgress color="inherit" />
298
       </Backdrop>
304
       </Backdrop>
299
-      <Toaster position="top-right" />
300
     </Dialog>
305
     </Dialog>
301
   )
306
   )
302
 }
307
 }

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


+ 1 - 0
src/Pages/Home.jsx

85
   )
85
   )
86
 
86
 
87
 }
87
 }
88
+

+ 1 - 1
src/Pages/Puestos.jsx

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