Browse Source

start config in puestos consum ws

amenpunk 2 years ago
parent
commit
c2d707aaba

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

@@ -14,7 +14,6 @@ import { StepFour } from '../Password/Steps/four'
14 14
 export function HelpModal (props) {
15 15
 
16 16
     let { visible, handleClose } = props
17
-    console.log('props >>.', props )
18 17
 
19 18
     const [activeStep, setActiveStep] = React.useState(0);
20 19
     const [skipped, setSkipped] = React.useState(new Set());

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

@@ -26,7 +26,9 @@ export default class CustomToolbar extends React.Component {
26 26
 
27 27
 
28 28
     render() {
29
-        let { visible, setVisible } = this.state;
29
+
30
+        let { visible } = this.state;
31
+
30 32
         return (
31 33
             <React.Fragment>
32 34
                 <Tooltip title={"custom icon"}>

+ 0 - 0
src/Components/Password/PasswordModal


+ 2 - 3
src/Css/all.css

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

+ 3 - 2
src/Pages/Login.jsx

@@ -58,12 +58,13 @@ export function Login() {
58 58
             request
59 59
             .post({})
60 60
             .then( response => {
61
-                console.log("Service Response :: ", response)
61
+                // console.log("Service Response :: ", response)
62 62
                 let { token, nombre, apelidos } = response;
63 63
                 toast.success(`Bienvenido ${nombre} ${apelidos}!!`)
64 64
                 token = token.replace("Bearer ", "")
65 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 68
                 setTimeout( () => {
68 69
                     setOpen(false)
69 70
                     auth.login(token)

+ 40 - 18
src/Pages/Puestos.jsx

@@ -1,20 +1,26 @@
1
-import React  from 'react';
1
+import React, { useState }  from 'react';
2 2
 import { Row, Col } from 'react-bootstrap'
3
-import { Box } from '@mui/material';
4 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 24
 import Express from '../Components/Modal/AgregarExpress';
19 25
 import Manual from '../Components/Modal/AgregarManual';
20 26
 
@@ -51,6 +57,7 @@ function GridMode (props) {
51 57
 
52 58
     return(
53 59
         <React.Fragment> 
60
+
54 61
             {
55 62
                 data.length ? 
56 63
                 data.slice(23).map( plaza => {
@@ -118,10 +125,25 @@ function GridMode (props) {
118 125
 }
119 126
 
120 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 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 148
     const children = [
127 149
         <ToggleButton value="list" key="list">
@@ -149,10 +171,9 @@ export function Puestos() {
149 171
 
150 172
     return (
151 173
         <div className="content-section">
152
-
153 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 178
                 <Row>
158 179
                     <Col md="2" sm="2" xs="2">
@@ -194,6 +215,10 @@ export function Puestos() {
194 215
                         />
195 216
                     </Row>
196 217
                 </div>
218
+
219
+                </Paper>
220
+                </Box>
221
+
197 222
             </div>
198 223
 
199 224
             <Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
@@ -202,10 +227,7 @@ export function Puestos() {
202 227
             <Editar  puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
203 228
             <Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
204 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 232
         </div>
211 233
     )