浏览代码

create password steps

amenpunk 3 年之前
父节点
当前提交
6c6c64477d

+ 0 - 2
src/App.css

@@ -1,12 +1,10 @@
1 1
 .App {
2 2
     text-align: center;
3 3
 }
4
-
5 4
 .App-logo {
6 5
     height: 40vmin;
7 6
     pointer-events: none;
8 7
 }
9
-
10 8
 @media (prefers-reduced-motion: no-preference) {
11 9
     .App-logo {
12 10
         animation: App-logo-spin infinite 20s linear;

+ 0 - 1
src/Components/Home/Actividades.js

@@ -5,7 +5,6 @@ import { DesktopDatePicker,LocalizationProvider } from '@mui/lab';
5 5
 import TextField from '@mui/material/TextField';
6 6
 import { Col, Row } from 'react-bootstrap';
7 7
 
8
-
9 8
 import DateFnsUtils from '@date-io/date-fns';
10 9
 
11 10
 import { HelpModal } from './HelpAcividades.jsx'

+ 107 - 0
src/Components/Modal/PasswordModal.jsx

@@ -0,0 +1,107 @@
1
+import { Modal } from 'react-bootstrap'
2
+import * as React from 'react';
3
+
4
+import { 
5
+    Box, Stepper, Step,
6
+    StepLabel, Button , Typography
7
+} from '@mui/material'
8
+
9
+const steps = ['Información del candidato', 'Seleccionar plaza', 'Seleccionar pruebas', 'Confirmar'];
10
+
11
+export function HelpModal (props) {
12
+
13
+    let { visible, handleClose } = props
14
+
15
+    const [activeStep, setActiveStep] = React.useState(0);
16
+    const [skipped, setSkipped] = React.useState(new Set());
17
+
18
+    const isStepSkipped = (step) => {
19
+        return skipped.has(step);
20
+    };
21
+
22
+    const handleNext = () => {
23
+        let newSkipped = skipped;
24
+        if (isStepSkipped(activeStep)) {
25
+            newSkipped = new Set(newSkipped.values());
26
+            newSkipped.delete(activeStep);
27
+        }
28
+
29
+        setActiveStep((prevActiveStep) => prevActiveStep + 1);
30
+        setSkipped(newSkipped);
31
+    };
32
+
33
+    const handleBack = () => {
34
+        setActiveStep((prevActiveStep) => prevActiveStep - 1);
35
+    };
36
+
37
+    const handleReset = () => {
38
+        setActiveStep(0);
39
+    };
40
+
41
+
42
+    return (
43
+        <Modal size="lg" 
44
+            aria-labelledby="contained-modal-title-vcenter" 
45
+            centered show={visible} 
46
+            onHide={handleClose}
47
+        > 
48
+            <Modal.Header>
49
+                <button type="button" className="close" onClick={handleClose}>&times;</button>
50
+                <h4 className="modal-title">Crear Contraseña</h4>
51
+            </Modal.Header>
52
+            <Modal.Body className="modal-body">
53
+
54
+                <Box sx={{ width: '100%' }}>
55
+                    <Stepper activeStep={activeStep}>
56
+                        {steps.map((label, index) => {
57
+                            const stepProps = {};
58
+                            const labelProps = {};
59
+                            if (isStepSkipped(index)) {
60
+                                stepProps.completed = false;
61
+                            }
62
+                            return (
63
+                                <Step key={label} {...stepProps}>
64
+                                    <StepLabel {...labelProps}>{label}</StepLabel>
65
+                                </Step>
66
+                            );
67
+                        })}
68
+                    </Stepper>
69
+                    {activeStep === steps.length ? (
70
+                        <React.Fragment>
71
+                            <Typography sx={{ mt: 2, mb: 1 }}>
72
+                                All steps completed - you&apos;re finished
73
+                            </Typography>
74
+                            <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
75
+                                <Box sx={{ flex: '1 1 auto' }} />
76
+                                <Button onClick={handleReset}>Reiniciar</Button>
77
+                            </Box>
78
+                        </React.Fragment>
79
+                    ) : (
80
+                            <React.Fragment>
81
+
82
+                                <Typography sx={{ mt: 2, mb: 1 }}>
83
+                                    Paso numero: {activeStep + 1}
84
+                                </Typography>
85
+
86
+                                <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
87
+                                    <Button
88
+                                        color="inherit"
89
+                                        disabled={activeStep === 0}
90
+                                        onClick={handleBack}
91
+                                        sx={{ mr: 1 }}
92
+                                    >
93
+                                        Anterior
94
+                                    </Button>
95
+                                    <Box sx={{ flex: '1 1 auto' }} />
96
+                                    <Button onClick={handleNext}>
97
+                                        {activeStep === steps.length - 1 ? 'Guardar' : 'Siguiente'}
98
+                                    </Button>
99
+                                </Box>
100
+                            </React.Fragment>
101
+                        )}
102
+                </Box>
103
+
104
+            </Modal.Body>
105
+        </Modal>
106
+    )
107
+}

+ 6 - 1
src/Components/Password/HeaderOperation.jsx

@@ -1,9 +1,11 @@
1
+import {useState} from 'react'
1 2
 import { 
2 3
     IconButton,Typography,Toolbar,
3 4
     Tooltip
4 5
 } from '@mui/material'
5 6
 
6 7
 import { alpha } from '@mui/material/styles';
8
+import { HelpModal } from '../Modal/PasswordModal'
7 9
 
8 10
 import {
9 11
     Delete as DeleteIcon,
@@ -12,7 +14,9 @@ import {
12 14
 } from '@mui/icons-material/'
13 15
 
14 16
 export const TableEncabezadoOperation = (props) => {
17
+
15 18
     const { numSelected } = props;
19
+    const [ visible, setVisible ] = useState(false);
16 20
 
17 21
     return (
18 22
         <Toolbar
@@ -59,12 +63,13 @@ export const TableEncabezadoOperation = (props) => {
59 63
                             </IconButton>
60 64
                         </Tooltip>
61 65
                         <Tooltip title="Agregar">
62
-                            <IconButton onClick={() => console.log('click')}>
66
+                            <IconButton onClick={() => setVisible(true) }>
63 67
                                 <AddIcon />
64 68
                             </IconButton>
65 69
                         </Tooltip>
66 70
                     </div>
67 71
                 )}
72
+            <HelpModal visible={visible} handleClose={() => setVisible(false)} />
68 73
         </Toolbar>
69 74
     );
70 75
 

+ 2 - 2
src/Components/Password/Rows.js

@@ -42,10 +42,10 @@ export const encabezados = [
42 42
         label: 'Con CV',
43 43
     },
44 44
     {
45
-        id: 'replic',
45
+        id: 'estado',
46 46
         numeric: true,
47 47
         disablePadding: false,
48
-        label: 'Replicar',
48
+        label: 'Envido?',
49 49
     },
50 50
     {
51 51
         id: 'ope',

+ 5 - 3
src/Components/Password/config.js

@@ -1,5 +1,7 @@
1
+import { Check } from '@mui/icons-material'
2
+
1 3
 export const rows = [
2
-    createData('Cupcake', 305, 'Analista',109238109238, 'SI', 'SI', 'Nice', 'Good'),
4
+    createData('Cupcake', 305, 'Analista',109238109238, 'SI', 'SI', 'Nice', <Check/>),
3 5
 ]
4 6
 
5 7
 new Array(50).fill(50).forEach( (_,i) => {
@@ -18,7 +20,7 @@ export const action_icon =  {
18 20
     margin :5
19 21
 }
20 22
 
21
-export function createData( pass, nivel, puesto, cui, uso, picture, cv, replic, ope) {
23
+export function createData( pass, nivel, puesto, cui, uso, picture, cv, estado, ope) {
22 24
     return {
23 25
         pass,
24 26
         nivel,
@@ -27,7 +29,7 @@ export function createData( pass, nivel, puesto, cui, uso, picture, cv, replic,
27 29
         uso,
28 30
         picture,
29 31
         cv,
30
-        replic,
32
+        estado,
31 33
         ope,
32 34
     };
33 35
 }

+ 6 - 7
src/Pages/Contras.jsx

@@ -1,18 +1,12 @@
1 1
 import * as React from 'react';
2 2
 
3
-import { EditSharp, MailSharp } from '@mui/icons-material'
4
-
5 3
 import { 
6 4
     rows,
7 5
     action_icon,
8 6
     Comparar,
9 7
     Cuerpo,
10
-    // TableEncabezadoOperation
11 8
 } from '../Components/Password/config.js';
12 9
 
13
-import { TableHeadCustom as TableHead } from '../Components/Password/Header'
14
-import { TableEncabezadoOperation as TableOperation } from '../Components/Password/HeaderOperation.jsx'
15
-
16 10
 import { 
17 11
     Table, TableBody, TableCell, TableContainer, 
18 12
     TableRow, TablePagination,
@@ -20,6 +14,11 @@ import {
20 14
     Checkbox,
21 15
 } from '@mui/material';
22 16
 
17
+import { EditSharp, MailSharp } from '@mui/icons-material'
18
+
19
+import { TableHeadCustom as TableHead } from '../Components/Password/Header'
20
+import { TableEncabezadoOperation as TableOperation } from '../Components/Password/HeaderOperation.jsx'
21
+
23 22
 export function Contras() {
24 23
 
25 24
     const [order, setOrder] = React.useState('asc');
@@ -148,7 +147,7 @@ export function Contras() {
148 147
                                                 <TableCell align="right">{row.uso}</TableCell>
149 148
                                                 <TableCell align="right">{row.picture}</TableCell>
150 149
                                                 <TableCell align="right">{row.cv}</TableCell>
151
-                                                <TableCell align="right">{row.replic}</TableCell>
150
+                                                <TableCell align="right">{row.estado}</TableCell>
152 151
                                                 <TableCell align="center">
153 152
                                                     <EditSharp style={action_icon} />
154 153
                                                     <MailSharp style={action_icon}/>