Jelajahi Sumber

small fixes

amenpunk 3 tahun lalu
induk
melakukan
4a19aa7c29

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

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

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

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

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

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

+ 32 - 28
src/Pages/Puestos.jsx

@@ -110,7 +110,7 @@ export function Puestos() {
   const total_items = Divide(filter ? filter : result.data).length
 
   return (
-    <div className="content-section">
+    <div  className="content-section">
       <div className="main">
         <Box>
           <Paper sx={{ mb: 2, padding: 2, }}>
@@ -121,32 +121,36 @@ export function Puestos() {
                     <ToggleButtonGroup style={{ marginRight: 20 }} size="small" {...control}>
                       {children}
                     </ToggleButtonGroup>
-                    <TextField
-                      id="search_plaza_input"
-                      onChange={(event) => {
-                        let nombre = event.target.value
-                        if (nombre) {
-                          let temp = result.data.filter(plaza => {
-                            let isset = plaza.nombrepuesto.toUpperCase().includes(nombre.toUpperCase())
-                            return isset
-                          })
-                          if(temp.lenght <= 0){
+
+
+                    {/*
+                      <TextField
+                        id="search_plaza_input"
+                        onChange={(event) => {
+                          let nombre = event.target.value
+                          if (nombre) {
+                            let temp = result.data.filter(plaza => {
+                              let isset = plaza.nombrepuesto.toUpperCase().includes(nombre.toUpperCase())
+                              return isset
+                            })
+                            if(temp.lenght <= 0){
+                              setFilter(null)
+                            }
+                            setFilter(temp)
+                          } else {
                             setFilter(null)
                           }
-                          setFilter(temp)
-                        } else {
-                          setFilter(null)
-                        }
-                      }}
-                      InputProps={{
-                        startAdornment: (
-                          <InputAdornment position="start">
-                            <SearchIcon />
-                          </InputAdornment>
-                        ),
-                      }}
-                      variant="standard"
-                    />
+                        }}
+                        InputProps={{
+                          startAdornment: (
+                            <InputAdornment position="start">
+                              <SearchIcon />
+                            </InputAdornment>
+                          ),
+                        }}
+                        variant="standard"
+                      />
+*/}
 
 
 
@@ -169,9 +173,9 @@ export function Puestos() {
               </Col>
             </Row>
 
-            <div >
+            <div style={{padding:7}}>
               <div className={` main_grid_plazas main_productos ${alignment === 'grid' ? 'activar_vista' : 'desactivar_vista'}`} id="grid_view">
-                <Row>
+                <Row style={{minHeight:'75vh'}}>
                   <GridMode
                     toggle={toggle}
                     showing={alignment}
@@ -181,7 +185,7 @@ export function Puestos() {
                 </Row>
               </div>
               <div className={`main_list_products ${alignment === 'list' ? 'activar_vista' : 'desactivar_vista'}`} id="list_view_products">
-                <Row>
+                <Row style={{minHeight:'75vh'}}>
                   <ListMode
                     toggle={toggle}
                     showing={alignment}

+ 152 - 152
src/Pages/Register.jsx

@@ -1,167 +1,167 @@
 import * as React from 'react';
 import { Link as RouterLink } from 'react-router-dom';
 
-import { 
-    Box, Link, Container, Typography,Card,
-    StepLabel,Step,Stepper, Button,Paper, StepContent
+import {
+  Box, Link, Container, Typography, Card,
+  StepLabel, Step, Stepper, Button, Paper, StepContent
 } from '@mui/material';
 
 import { RegisterForm } from '../Components/Register/RegisterForm';
 import { PersonalInfo } from '../Components/Register/PersonalInfo.js';
 import AuthLayout from '../Components/Register/AuthLayout';
 
-import Mock from  '../Images/register_mok.png'
-import useAuth from '../Auth/useAuth';
+import Mock from '../Images/register_mok.png'
 import { useNavigate } from 'react-router-dom'
-import { Col , Row,} from 'react-bootstrap';
+import { Col, Row, } from 'react-bootstrap';
+import { useSelector } from 'react-redux'
 
 
 export function Register() {
 
-    let auth = useAuth();
-    let navigate = useNavigate()
-
-    React.useEffect(() => {
-        if(auth.isLogged()){
-            return navigate('/dashboard/home')
-        }
-    }, [auth,navigate])
-
-
-    const TODAY = new Date()
-
-    const [activeStep, setActiveStep] = React.useState(0);
-    const [client, setClient] = React.useState({
-        firstName: '',
-        lastName: '',
-        email: '',
-        password: '',
-        password_confirm: '',
-        nit: "",
-        cui: "",
-        direccion: "",
-        nacimiento : TODAY.getFullYear() +'-10-18',
-        telefono : "",
-    });
-
-    const handleNext = () => {
-        setActiveStep((prevActiveStep) => prevActiveStep + 1);
-    };
-
-    const handleBack = () => {
-        setActiveStep((prevActiveStep) => prevActiveStep - 1);
-    };
-
-    const handleReset = () => {
-        setActiveStep(0);
-    };
-
-    const steps = [
-        {
-            label: 'Información de tu cuenta',
-            description: 
-            <RegisterForm 
-            client={client} 
-            setClient={setClient} 
-            handleBack={handleBack}
-            handleNext={handleNext}
-            />
-        }, 
-        {
-            label: 'Datos Personales',
-            description: 
-            <PersonalInfo 
-            client={client} 
-            setClient={setClient} 
-            handleBack={handleBack}
-            />
-        },
-    ];
-
-    return (
-        <Container>
-            <Row className="register_content">
-                <Col md={4} className="d-none d-md-block">
-
-                    <Card className="card_register">
-
-                        <AuthLayout>
-
-                            <Link to="/login" component={RouterLink}>
-
-                            </Link>
-                        </AuthLayout>
-
-                        <h1 variant="h3" sx={{ px: 5, mt: 10, mb: 5 }}>
-                            Efectividad para tus procesos de reclutamiento
-                        </h1>
-                        <img alt="register" src={Mock} />
-                    </Card>
-
-                </Col>
-
-                <Col style={{ "padding" : 45}} md={6}>
-
-                    <Box sx={{ mb: 5 }}>
-                        <Typography variant="h4" gutterBottom>
-                            Empieza de forma gratuita.
-                        </Typography>
-                        <Typography sx={{ color: 'text.secondary' }}>
-                            Gratis para siempre. No se necesita tarjeta de crédito.
-                        </Typography>
-                    </Box>
-
-                    <Stepper activeStep={activeStep} orientation="vertical">
-                        {steps.map((step, index) => (
-                            <Step key={step.label}>
-                                <StepLabel
-                                    optional={
-                                    index === 2 ? (
-                                        <Typography variant="caption">Last step</Typography>
-                                    ) : null
-                                }
-                                >
-                                    {step.label}
-                                </StepLabel>
-                                <StepContent style={{ padding: 25 }}>
-                                    {step.description}
-                                </StepContent>
-                            </Step>
-                        ))}
-                    </Stepper>
-                    {activeStep === steps.length && (
-                        <Paper square elevation={0} sx={{ p: 3 }}>
-                            <Typography>All steps completed - you&apos;re finished</Typography>
-                            <Button onClick={handleReset} sx={{ mt: 1, mr: 1 }}>
-                                Reset
-                            </Button>
-                        </Paper>
-                    )}
-
-                    <div>
-                        <Typography variant="body2" align="center" sx={{ color: 'text.secondary', mt: 0 }}>
-                            Estoy de acuerdo con las {" "}
-                            <Link underline="always" sx={{ color: "#d32f2f" }}>
-                                Condiciones de servicio
-                            </Link>
-                            {" "}y{" "}
-                            <Link underline="always" sx={{ color: "#d32f2f" }}>
-                                Política de privacidad
-                            </Link>
-                            .
-                        </Typography>
-
-                        <Typography variant="subtitle2" sx={{ mt: 0, textAlign: 'center' }}>
-                            Ya tiene una cuenta?&nbsp;
-                            <Link to="/login" component={RouterLink}>
-                                Ingresa
-                            </Link>
-                        </Typography>
-                    </div>
-
-
-                </Col>
-            </Row>
-        </Container>
-    );
+  let navigate = useNavigate()
+  const auth = useSelector((state) => state.token)
+
+  React.useEffect(() => {
+    if (auth.token) {
+      return navigate('/dashboard/home')
+    }
+  }, [auth, navigate])
+
+
+  const TODAY = new Date()
+
+  const [activeStep, setActiveStep] = React.useState(0);
+  const [client, setClient] = React.useState({
+    firstName: '',
+    lastName: '',
+    email: '',
+    password: '',
+    password_confirm: '',
+    nit: "",
+    cui: "",
+    direccion: "",
+    nacimiento: TODAY.getFullYear() + '-10-18',
+    telefono: "",
+  });
+
+  const handleNext = () => {
+    setActiveStep((prevActiveStep) => prevActiveStep + 1);
+  };
+
+  const handleBack = () => {
+    setActiveStep((prevActiveStep) => prevActiveStep - 1);
+  };
+
+  const handleReset = () => {
+    setActiveStep(0);
+  };
+
+  const steps = [
+    {
+      label: 'Información de tu cuenta',
+      description:
+        <RegisterForm
+          client={client}
+          setClient={setClient}
+          handleBack={handleBack}
+          handleNext={handleNext}
+        />
+    },
+    {
+      label: 'Datos Personales',
+      description:
+        <PersonalInfo
+          client={client}
+          setClient={setClient}
+          handleBack={handleBack}
+        />
+    },
+  ];
+
+  return (
+    <Container style={{paddingTop:40}}>
+      <Row className="register_content">
+        <Col md={4} className="d-none d-md-block">
+
+          <Card className="card_register">
+
+            <AuthLayout>
+
+              <Link to="/login" component={RouterLink}>
+
+              </Link>
+            </AuthLayout>
+
+            <h1 variant="h3" sx={{ px: 5, mt: 10, mb: 5 }}>
+              Efectividad para tus procesos de reclutamiento
+            </h1>
+            <img alt="register" src={Mock} />
+          </Card>
+
+        </Col>
+
+        <Col style={{ "padding": 45 }} md={6}>
+
+          <Box sx={{ mb: 5 }}>
+            <Typography variant="h4" gutterBottom>
+              Empieza de forma gratuita.
+            </Typography>
+            <Typography sx={{ color: 'text.secondary' }}>
+              Gratis para siempre. No se necesita tarjeta de crédito.
+            </Typography>
+          </Box>
+
+          <Stepper activeStep={activeStep} orientation="vertical">
+            {steps.map((step, index) => (
+              <Step key={step.label}>
+                <StepLabel
+                  optional={
+                    index === 2 ? (
+                      <Typography variant="caption">Last step</Typography>
+                    ) : null
+                  }
+                >
+                  {step.label}
+                </StepLabel>
+                <StepContent style={{ padding: 25 }}>
+                  {step.description}
+                </StepContent>
+              </Step>
+            ))}
+          </Stepper>
+          {activeStep === steps.length && (
+            <Paper square elevation={0} sx={{ p: 3 }}>
+              <Typography>All steps completed - you&apos;re finished</Typography>
+              <Button onClick={handleReset} sx={{ mt: 1, mr: 1 }}>
+                Reset
+              </Button>
+            </Paper>
+          )}
+
+          <div>
+            <Typography variant="body2" align="center" sx={{ color: 'text.secondary', mt: 0 }}>
+              Estoy de acuerdo con las {" "}
+              <Link underline="always" sx={{ color: "#d32f2f" }}>
+                Condiciones de servicio
+              </Link>
+              {" "}y{" "}
+              <Link underline="always" sx={{ color: "#d32f2f" }}>
+                Política de privacidad
+              </Link>
+              .
+            </Typography>
+
+            <Typography variant="subtitle2" sx={{ mt: 0, textAlign: 'center' }}>
+              Ya tiene una cuenta?&nbsp;
+              <Link to="/login" component={RouterLink}>
+                Ingresa
+              </Link>
+            </Typography>
+          </div>
+
+
+        </Col>
+      </Row>
+    </Container>
+  );
 }