浏览代码

small fixes

amenpunk 2 年之前
父节点
当前提交
4a19aa7c29
共有 5 个文件被更改,包括 190 次插入184 次删除
  1. 1 1
      src/Components/Home/Candidato.jsx
  2. 1 1
      src/Components/Modal/AgregarManual.js
  3. 4 2
      src/Components/Modal/EditPlaza.js
  4. 32 28
      src/Pages/Puestos.jsx
  5. 152 152
      src/Pages/Register.jsx

+ 1 - 1
src/Components/Home/Candidato.jsx

@@ -31,7 +31,7 @@ function Asignaciones(props) {
31 31
   return (
32 32
     <tr>
33 33
       <td>
34
-        {cattest.decription}
34
+        {cattest.decription +  " " +estado}
35 35
         {
36 36
           test_result.length > 0 ?
37 37
             (

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

@@ -75,7 +75,7 @@ function Manual(props) {
75 75
   const formik = useFormik({
76 76
     initialValues: {
77 77
       nombrepuesto: "",
78
-      puestosuperior: "",
78
+      puestosuperior: 1,
79 79
       aredepto: 1,
80 80
       fecha: date,
81 81
       notas: "",

+ 4 - 2
src/Components/Modal/EditPlaza.js

@@ -42,7 +42,7 @@ function Edit(props) {
42 42
     resolver: yupResolver(plazeSchema),
43 43
     defaultValues: {
44 44
       nombrepuesto: 'mingtest',
45
-      puestosuperior: 77,
45
+      puestosuperior: 0,
46 46
       fecha: '01/01/2019',
47 47
       notas: 'esto es un ejemplod e una nota',
48 48
       aredepto: 1,
@@ -127,10 +127,12 @@ function Edit(props) {
127 127
     rest
128 128
       .getQuery(auth.token)
129 129
       .then(response => {
130
-        console.log(response.data)
130
+        console.log('puesto edit: ',response.data)
131 131
         let { areadeptoplz_id, fecha, tests } = response.data;
132 132
         let temp_test = tests.map(t => ({ id: t.id }))
133 133
         setChecklist(temp_test.map(t => t.id))
134
+
135
+
134 136
         reset({ ...response.data, aredepto: areadeptoplz_id, fecha: new Date(fecha), tests: temp_test })
135 137
       })
136 138
       .catch(console.log)

+ 32 - 28
src/Pages/Puestos.jsx

@@ -110,7 +110,7 @@ export function Puestos() {
110 110
   const total_items = Divide(filter ? filter : result.data).length
111 111
 
112 112
   return (
113
-    <div className="content-section">
113
+    <div  className="content-section">
114 114
       <div className="main">
115 115
         <Box>
116 116
           <Paper sx={{ mb: 2, padding: 2, }}>
@@ -121,32 +121,36 @@ export function Puestos() {
121 121
                     <ToggleButtonGroup style={{ marginRight: 20 }} size="small" {...control}>
122 122
                       {children}
123 123
                     </ToggleButtonGroup>
124
-                    <TextField
125
-                      id="search_plaza_input"
126
-                      onChange={(event) => {
127
-                        let nombre = event.target.value
128
-                        if (nombre) {
129
-                          let temp = result.data.filter(plaza => {
130
-                            let isset = plaza.nombrepuesto.toUpperCase().includes(nombre.toUpperCase())
131
-                            return isset
132
-                          })
133
-                          if(temp.lenght <= 0){
124
+
125
+
126
+                    {/*
127
+                      <TextField
128
+                        id="search_plaza_input"
129
+                        onChange={(event) => {
130
+                          let nombre = event.target.value
131
+                          if (nombre) {
132
+                            let temp = result.data.filter(plaza => {
133
+                              let isset = plaza.nombrepuesto.toUpperCase().includes(nombre.toUpperCase())
134
+                              return isset
135
+                            })
136
+                            if(temp.lenght <= 0){
137
+                              setFilter(null)
138
+                            }
139
+                            setFilter(temp)
140
+                          } else {
134 141
                             setFilter(null)
135 142
                           }
136
-                          setFilter(temp)
137
-                        } else {
138
-                          setFilter(null)
139
-                        }
140
-                      }}
141
-                      InputProps={{
142
-                        startAdornment: (
143
-                          <InputAdornment position="start">
144
-                            <SearchIcon />
145
-                          </InputAdornment>
146
-                        ),
147
-                      }}
148
-                      variant="standard"
149
-                    />
143
+                        }}
144
+                        InputProps={{
145
+                          startAdornment: (
146
+                            <InputAdornment position="start">
147
+                              <SearchIcon />
148
+                            </InputAdornment>
149
+                          ),
150
+                        }}
151
+                        variant="standard"
152
+                      />
153
+*/}
150 154
 
151 155
 
152 156
 
@@ -169,9 +173,9 @@ export function Puestos() {
169 173
               </Col>
170 174
             </Row>
171 175
 
172
-            <div >
176
+            <div style={{padding:7}}>
173 177
               <div className={` main_grid_plazas main_productos ${alignment === 'grid' ? 'activar_vista' : 'desactivar_vista'}`} id="grid_view">
174
-                <Row>
178
+                <Row style={{minHeight:'75vh'}}>
175 179
                   <GridMode
176 180
                     toggle={toggle}
177 181
                     showing={alignment}
@@ -181,7 +185,7 @@ export function Puestos() {
181 185
                 </Row>
182 186
               </div>
183 187
               <div className={`main_list_products ${alignment === 'list' ? 'activar_vista' : 'desactivar_vista'}`} id="list_view_products">
184
-                <Row>
188
+                <Row style={{minHeight:'75vh'}}>
185 189
                   <ListMode
186 190
                     toggle={toggle}
187 191
                     showing={alignment}

+ 152 - 152
src/Pages/Register.jsx

@@ -1,167 +1,167 @@
1 1
 import * as React from 'react';
2 2
 import { Link as RouterLink } from 'react-router-dom';
3 3
 
4
-import { 
5
-    Box, Link, Container, Typography,Card,
6
-    StepLabel,Step,Stepper, Button,Paper, StepContent
4
+import {
5
+  Box, Link, Container, Typography, Card,
6
+  StepLabel, Step, Stepper, Button, Paper, StepContent
7 7
 } from '@mui/material';
8 8
 
9 9
 import { RegisterForm } from '../Components/Register/RegisterForm';
10 10
 import { PersonalInfo } from '../Components/Register/PersonalInfo.js';
11 11
 import AuthLayout from '../Components/Register/AuthLayout';
12 12
 
13
-import Mock from  '../Images/register_mok.png'
14
-import useAuth from '../Auth/useAuth';
13
+import Mock from '../Images/register_mok.png'
15 14
 import { useNavigate } from 'react-router-dom'
16
-import { Col , Row,} from 'react-bootstrap';
15
+import { Col, Row, } from 'react-bootstrap';
16
+import { useSelector } from 'react-redux'
17 17
 
18 18
 
19 19
 export function Register() {
20 20
 
21
-    let auth = useAuth();
22
-    let navigate = useNavigate()
23
-
24
-    React.useEffect(() => {
25
-        if(auth.isLogged()){
26
-            return navigate('/dashboard/home')
27
-        }
28
-    }, [auth,navigate])
29
-
30
-
31
-    const TODAY = new Date()
32
-
33
-    const [activeStep, setActiveStep] = React.useState(0);
34
-    const [client, setClient] = React.useState({
35
-        firstName: '',
36
-        lastName: '',
37
-        email: '',
38
-        password: '',
39
-        password_confirm: '',
40
-        nit: "",
41
-        cui: "",
42
-        direccion: "",
43
-        nacimiento : TODAY.getFullYear() +'-10-18',
44
-        telefono : "",
45
-    });
46
-
47
-    const handleNext = () => {
48
-        setActiveStep((prevActiveStep) => prevActiveStep + 1);
49
-    };
50
-
51
-    const handleBack = () => {
52
-        setActiveStep((prevActiveStep) => prevActiveStep - 1);
53
-    };
54
-
55
-    const handleReset = () => {
56
-        setActiveStep(0);
57
-    };
58
-
59
-    const steps = [
60
-        {
61
-            label: 'Información de tu cuenta',
62
-            description: 
63
-            <RegisterForm 
64
-            client={client} 
65
-            setClient={setClient} 
66
-            handleBack={handleBack}
67
-            handleNext={handleNext}
68
-            />
69
-        }, 
70
-        {
71
-            label: 'Datos Personales',
72
-            description: 
73
-            <PersonalInfo 
74
-            client={client} 
75
-            setClient={setClient} 
76
-            handleBack={handleBack}
77
-            />
78
-        },
79
-    ];
80
-
81
-    return (
82
-        <Container>
83
-            <Row className="register_content">
84
-                <Col md={4} className="d-none d-md-block">
85
-
86
-                    <Card className="card_register">
87
-
88
-                        <AuthLayout>
89
-
90
-                            <Link to="/login" component={RouterLink}>
91
-
92
-                            </Link>
93
-                        </AuthLayout>
94
-
95
-                        <h1 variant="h3" sx={{ px: 5, mt: 10, mb: 5 }}>
96
-                            Efectividad para tus procesos de reclutamiento
97
-                        </h1>
98
-                        <img alt="register" src={Mock} />
99
-                    </Card>
100
-
101
-                </Col>
102
-
103
-                <Col style={{ "padding" : 45}} md={6}>
104
-
105
-                    <Box sx={{ mb: 5 }}>
106
-                        <Typography variant="h4" gutterBottom>
107
-                            Empieza de forma gratuita.
108
-                        </Typography>
109
-                        <Typography sx={{ color: 'text.secondary' }}>
110
-                            Gratis para siempre. No se necesita tarjeta de crédito.
111
-                        </Typography>
112
-                    </Box>
113
-
114
-                    <Stepper activeStep={activeStep} orientation="vertical">
115
-                        {steps.map((step, index) => (
116
-                            <Step key={step.label}>
117
-                                <StepLabel
118
-                                    optional={
119
-                                    index === 2 ? (
120
-                                        <Typography variant="caption">Last step</Typography>
121
-                                    ) : null
122
-                                }
123
-                                >
124
-                                    {step.label}
125
-                                </StepLabel>
126
-                                <StepContent style={{ padding: 25 }}>
127
-                                    {step.description}
128
-                                </StepContent>
129
-                            </Step>
130
-                        ))}
131
-                    </Stepper>
132
-                    {activeStep === steps.length && (
133
-                        <Paper square elevation={0} sx={{ p: 3 }}>
134
-                            <Typography>All steps completed - you&apos;re finished</Typography>
135
-                            <Button onClick={handleReset} sx={{ mt: 1, mr: 1 }}>
136
-                                Reset
137
-                            </Button>
138
-                        </Paper>
139
-                    )}
140
-
141
-                    <div>
142
-                        <Typography variant="body2" align="center" sx={{ color: 'text.secondary', mt: 0 }}>
143
-                            Estoy de acuerdo con las {" "}
144
-                            <Link underline="always" sx={{ color: "#d32f2f" }}>
145
-                                Condiciones de servicio
146
-                            </Link>
147
-                            {" "}y{" "}
148
-                            <Link underline="always" sx={{ color: "#d32f2f" }}>
149
-                                Política de privacidad
150
-                            </Link>
151
-                            .
152
-                        </Typography>
153
-
154
-                        <Typography variant="subtitle2" sx={{ mt: 0, textAlign: 'center' }}>
155
-                            Ya tiene una cuenta?&nbsp;
156
-                            <Link to="/login" component={RouterLink}>
157
-                                Ingresa
158
-                            </Link>
159
-                        </Typography>
160
-                    </div>
161
-
162
-
163
-                </Col>
164
-            </Row>
165
-        </Container>
166
-    );
21
+  let navigate = useNavigate()
22
+  const auth = useSelector((state) => state.token)
23
+
24
+  React.useEffect(() => {
25
+    if (auth.token) {
26
+      return navigate('/dashboard/home')
27
+    }
28
+  }, [auth, navigate])
29
+
30
+
31
+  const TODAY = new Date()
32
+
33
+  const [activeStep, setActiveStep] = React.useState(0);
34
+  const [client, setClient] = React.useState({
35
+    firstName: '',
36
+    lastName: '',
37
+    email: '',
38
+    password: '',
39
+    password_confirm: '',
40
+    nit: "",
41
+    cui: "",
42
+    direccion: "",
43
+    nacimiento: TODAY.getFullYear() + '-10-18',
44
+    telefono: "",
45
+  });
46
+
47
+  const handleNext = () => {
48
+    setActiveStep((prevActiveStep) => prevActiveStep + 1);
49
+  };
50
+
51
+  const handleBack = () => {
52
+    setActiveStep((prevActiveStep) => prevActiveStep - 1);
53
+  };
54
+
55
+  const handleReset = () => {
56
+    setActiveStep(0);
57
+  };
58
+
59
+  const steps = [
60
+    {
61
+      label: 'Información de tu cuenta',
62
+      description:
63
+        <RegisterForm
64
+          client={client}
65
+          setClient={setClient}
66
+          handleBack={handleBack}
67
+          handleNext={handleNext}
68
+        />
69
+    },
70
+    {
71
+      label: 'Datos Personales',
72
+      description:
73
+        <PersonalInfo
74
+          client={client}
75
+          setClient={setClient}
76
+          handleBack={handleBack}
77
+        />
78
+    },
79
+  ];
80
+
81
+  return (
82
+    <Container style={{paddingTop:40}}>
83
+      <Row className="register_content">
84
+        <Col md={4} className="d-none d-md-block">
85
+
86
+          <Card className="card_register">
87
+
88
+            <AuthLayout>
89
+
90
+              <Link to="/login" component={RouterLink}>
91
+
92
+              </Link>
93
+            </AuthLayout>
94
+
95
+            <h1 variant="h3" sx={{ px: 5, mt: 10, mb: 5 }}>
96
+              Efectividad para tus procesos de reclutamiento
97
+            </h1>
98
+            <img alt="register" src={Mock} />
99
+          </Card>
100
+
101
+        </Col>
102
+
103
+        <Col style={{ "padding": 45 }} md={6}>
104
+
105
+          <Box sx={{ mb: 5 }}>
106
+            <Typography variant="h4" gutterBottom>
107
+              Empieza de forma gratuita.
108
+            </Typography>
109
+            <Typography sx={{ color: 'text.secondary' }}>
110
+              Gratis para siempre. No se necesita tarjeta de crédito.
111
+            </Typography>
112
+          </Box>
113
+
114
+          <Stepper activeStep={activeStep} orientation="vertical">
115
+            {steps.map((step, index) => (
116
+              <Step key={step.label}>
117
+                <StepLabel
118
+                  optional={
119
+                    index === 2 ? (
120
+                      <Typography variant="caption">Last step</Typography>
121
+                    ) : null
122
+                  }
123
+                >
124
+                  {step.label}
125
+                </StepLabel>
126
+                <StepContent style={{ padding: 25 }}>
127
+                  {step.description}
128
+                </StepContent>
129
+              </Step>
130
+            ))}
131
+          </Stepper>
132
+          {activeStep === steps.length && (
133
+            <Paper square elevation={0} sx={{ p: 3 }}>
134
+              <Typography>All steps completed - you&apos;re finished</Typography>
135
+              <Button onClick={handleReset} sx={{ mt: 1, mr: 1 }}>
136
+                Reset
137
+              </Button>
138
+            </Paper>
139
+          )}
140
+
141
+          <div>
142
+            <Typography variant="body2" align="center" sx={{ color: 'text.secondary', mt: 0 }}>
143
+              Estoy de acuerdo con las {" "}
144
+              <Link underline="always" sx={{ color: "#d32f2f" }}>
145
+                Condiciones de servicio
146
+              </Link>
147
+              {" "}y{" "}
148
+              <Link underline="always" sx={{ color: "#d32f2f" }}>
149
+                Política de privacidad
150
+              </Link>
151
+              .
152
+            </Typography>
153
+
154
+            <Typography variant="subtitle2" sx={{ mt: 0, textAlign: 'center' }}>
155
+              Ya tiene una cuenta?&nbsp;
156
+              <Link to="/login" component={RouterLink}>
157
+                Ingresa
158
+              </Link>
159
+            </Typography>
160
+          </div>
161
+
162
+
163
+        </Col>
164
+      </Row>
165
+    </Container>
166
+  );
167 167
 }