Browse Source

start config in puestos consum ws

amenpunk 3 years ago
parent
commit
c2d707aaba

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

14
 export function HelpModal (props) {
14
 export function HelpModal (props) {
15
 
15
 
16
     let { visible, handleClose } = props
16
     let { visible, handleClose } = props
17
-    console.log('props >>.', props )
18
 
17
 
19
     const [activeStep, setActiveStep] = React.useState(0);
18
     const [activeStep, setActiveStep] = React.useState(0);
20
     const [skipped, setSkipped] = React.useState(new Set());
19
     const [skipped, setSkipped] = React.useState(new Set());

+ 3 - 1
src/Components/Password/CustomToolbar.jsx

26
 
26
 
27
 
27
 
28
     render() {
28
     render() {
29
-        let { visible, setVisible } = this.state;
29
+
30
+        let { visible } = this.state;
31
+
30
         return (
32
         return (
31
             <React.Fragment>
33
             <React.Fragment>
32
                 <Tooltip title={"custom icon"}>
34
                 <Tooltip title={"custom icon"}>

+ 0 - 0
src/Components/Password/PasswordModal


+ 2 - 3
src/Css/all.css

284
 .main .panel {
284
 .main .panel {
285
     background: #ffffff;
285
     background: #ffffff;
286
     color: #25344f;
286
     color: #25344f;
287
-    /* margin-bottom: 30px; */
288
-    margin-bottom: 5px;
287
+    margin-bottom: 20px;
289
     border-radius: 2px;
288
     border-radius: 2px;
290
     width: 100%;
289
     width: 100%;
291
     float: left;
290
     float: left;
292
     border: 1px solid #dcdcdc;
291
     border: 1px solid #dcdcdc;
293
-    padding : 10px;
292
+    /* padding : 10px; */
294
 }
293
 }
295
 .footerinfo p {
294
 .footerinfo p {
296
     font-size: 14px;
295
     font-size: 14px;

+ 3 - 2
src/Pages/Login.jsx

58
             request
58
             request
59
             .post({})
59
             .post({})
60
             .then( response => {
60
             .then( response => {
61
-                console.log("Service Response :: ", response)
61
+                // console.log("Service Response :: ", response)
62
                 let { token, nombre, apelidos } = response;
62
                 let { token, nombre, apelidos } = response;
63
                 toast.success(`Bienvenido ${nombre} ${apelidos}!!`)
63
                 toast.success(`Bienvenido ${nombre} ${apelidos}!!`)
64
                 token = token.replace("Bearer ", "")
64
                 token = token.replace("Bearer ", "")
65
                 let user_permissions = jwt_decode(token);
65
                 let user_permissions = jwt_decode(token);
66
-                console.log("TOKEN >> ", token, 'decrypt', user_permissions )
66
+                Object.keys(user_permissions);
67
+                console.log("Bearer ", token)
67
                 setTimeout( () => {
68
                 setTimeout( () => {
68
                     setOpen(false)
69
                     setOpen(false)
69
                     auth.login(token)
70
                     auth.login(token)

+ 40 - 18
src/Pages/Puestos.jsx

1
-import React  from 'react';
1
+import React, { useState }  from 'react';
2
 import { Row, Col } from 'react-bootstrap'
2
 import { Row, Col } from 'react-bootstrap'
3
-import { Box } from '@mui/material';
4
 import toast, { Toaster } from 'react-hot-toast';
3
 import toast, { Toaster } from 'react-hot-toast';
5
 
4
 
6
-import ToggleButton from '@mui/material/ToggleButton';
7
-import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
5
+import { 
6
+    ToggleButton, 
7
+    ToggleButtonGroup, 
8
+    Box, Paper
9
+} from '@mui/material';
8
 
10
 
9
-import ViewListIcon from '@mui/icons-material/ViewList';
10
-import ViewModuleIcon from '@mui/icons-material/ViewModule';
11
+import { 
12
+    ViewList as ViewListIcon,
13
+    ViewModule as ViewModuleIcon,
14
+    RemoveRedEye as RemoveRedEyeIcon,
15
+    Edit as EditIcon,
16
+    HighlightOff as HighlightOffIcon,
17
+} from '@mui/icons-material';
11
 
18
 
12
-import RemoveRedEyeIcon from '@mui/icons-material/RemoveRedEye';
13
-import EditIcon from '@mui/icons-material/Edit';
14
-import HighlightOffIcon from '@mui/icons-material/HighlightOff';
19
+import { default as useAuth } from '../Auth/useAuth';
20
+import { Service } from '../Utils/HTTP';
15
 
21
 
16
-import NotFound from '../Images/not_found.png';
17
 
22
 
23
+import NotFound from '../Images/not_found.png';
18
 import Express from '../Components/Modal/AgregarExpress';
24
 import Express from '../Components/Modal/AgregarExpress';
19
 import Manual from '../Components/Modal/AgregarManual';
25
 import Manual from '../Components/Modal/AgregarManual';
20
 
26
 
51
 
57
 
52
     return(
58
     return(
53
         <React.Fragment> 
59
         <React.Fragment> 
60
+
54
             {
61
             {
55
                 data.length ? 
62
                 data.length ? 
56
                 data.slice(23).map( plaza => {
63
                 data.slice(23).map( plaza => {
118
 }
125
 }
119
 
126
 
120
 export function Puestos() {
127
 export function Puestos() {
128
+    const auth = useAuth();
129
+    
130
+    useState(() => {
131
+        let rest = new Service("/plaza/getall")
132
+        let token = auth.getToken();
133
+
134
+        rest
135
+        .get(token)
136
+        .then(({data}) => {
137
+            console.log('data > ', data)
138
+        })
139
+        .catch((error) => {
140
+            console.log('error fetching data  ', error );
141
+        })
142
+    },[])
121
 
143
 
122
     const [alignment, setAlignment] = React.useState('list');
144
     const [alignment, setAlignment] = React.useState('list');
123
 
145
 
124
-    const handleChange = (event, newAlignment) => setAlignment(newAlignment);
146
+    const handleChange = (_event, newAlignment) => setAlignment(newAlignment);
125
 
147
 
126
     const children = [
148
     const children = [
127
         <ToggleButton value="list" key="list">
149
         <ToggleButton value="list" key="list">
149
 
171
 
150
     return (
172
     return (
151
         <div className="content-section">
173
         <div className="content-section">
152
-
153
             <div className="main">
174
             <div className="main">
154
-
155
-                <h1>Puestos</h1>
175
+                <Box sx={{ width: '100%' }}>
176
+                <Paper sx={{ width: '100%', mb: 2, padding : 2 }}>
156
 
177
 
157
                 <Row>
178
                 <Row>
158
                     <Col md="2" sm="2" xs="2">
179
                     <Col md="2" sm="2" xs="2">
194
                         />
215
                         />
195
                     </Row>
216
                     </Row>
196
                 </div>
217
                 </div>
218
+
219
+                </Paper>
220
+                </Box>
221
+
197
             </div>
222
             </div>
198
 
223
 
199
             <Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
224
             <Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
202
             <Editar  puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
227
             <Editar  puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
203
             <Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
228
             <Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
204
             <Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
229
             <Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
205
-            <Toaster
206
-                position="bottom-right"
207
-                reverseOrder={false}
208
-            />
230
+            <Toaster position="bottom-right" reverseOrder={false} />
209
 
231
 
210
         </div>
232
         </div>
211
     )
233
     )