From f810aa560d922ac3a742e7521f3b279ff4636281 Mon Sep 17 00:00:00 2001 From: Mariela Date: Mon, 22 Aug 2022 00:48:45 -0600 Subject: [PATCH 1/6] primeras funciones para modificar admin del sistema --- .../src/components/AdministradoresSistema.js | 217 +++++++++++++++++- 1 file changed, 215 insertions(+), 2 deletions(-) diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index a301c3ed..b47ce821 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -12,6 +12,7 @@ import { faPhoneAlt } from '@fortawesome/free-solid-svg-icons'; import { faAt } from '@fortawesome/free-solid-svg-icons'; import { faIdCardAlt } from '@fortawesome/free-solid-svg-icons'; import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons'; +import classNames from 'classnames'; const AdministradoresSistema = () => { const [administrators, setAdministrators] = useState([]); @@ -30,6 +31,11 @@ const AdministradoresSistema = () => { const [changeStatusAdminSystemDialog, setChangeStatusAdminSystemDialog] = useState(false); const [changeStatusAdminsSystemDialog, setChangeStatusAdminsSystemDialog] = useState(false); + const [adminDialog, setAdminDialog] = useState(false); + const [submitted, setSubmitted] = useState(false); + + const [editAdminDialog, setEditAdminDialog] = useState(false); + let emptySysAdmin = { _id: null, @@ -55,7 +61,7 @@ const AdministradoresSistema = () => { item.status_text = 'Activo'; } else if (item.status == '0') { item.status_text = 'Inactivo'; - } + } }) setAdministrators(await data); } @@ -177,6 +183,28 @@ const AdministradoresSistema = () => { setChangeStatusAdminSystemDialog(true); }; + const hideAdminDialog = () => { + setSubmitted(false); + setAdminDialog(false); + setSysAdmin(emptySysAdmin); + + }; + + const infoAdmin = (sysadmin) => { + setSysAdmin({ ...sysadmin }); + setAdminDialog(true); + }; + + const hideEditAdminDialog = () => { + setSubmitted(false); + setEditAdminDialog(false); + }; + + const editAdmin = (sysadmin) => { + setSysAdmin({ ...sysadmin }); + setEditAdminDialog(true); + }; + const deleteSysAdmin = () => { fetch('http://localhost:4000/user/deleteAdminSystem/' + sysadmin._id, { cache: 'no-cache', @@ -259,6 +287,21 @@ const AdministradoresSistema = () => { return (
+ +
+ )} +
From 999175a246b3202cdcc8e5d68c0e34fa4ec85e0b Mon Sep 17 00:00:00 2001 From: Mariela Date: Mon, 22 Aug 2022 01:12:02 -0600 Subject: [PATCH 2/6] frontend hecho --- .../src/components/AdministradoresSistema.js | 220 +++++++++++++----- 1 file changed, 161 insertions(+), 59 deletions(-) diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index b47ce821..890d1ebe 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -70,46 +70,73 @@ const AdministradoresSistema = () => { fetchP(); }, []) - function registrarAdmin() { - var data = { - dni: document.getElementById('identificacion').value, - name: document.getElementById('nombre').value, - last_name: document.getElementById('apellidos').value, - email: document.getElementById('correo_electronico').value, - phone: document.getElementById('telefono').value, - password: document.getElementById('correo_electronico').value, - user_type: "1", //1 es admin - status: "1" - }; - setSysAdmin(data) - - fetch('http://localhost:4000/user/createAdminSystem/', { - cache: 'no-cache', - method: 'POST', - body: JSON.stringify(data), - headers: { - 'Content-Type': 'application/json' + const findIndexById = (id) => { + let index = -1; + for (let i = 0; i < administrators.length; i++) { + if (administrators[i]._id === id) { + index = i; + break; } - }) - .then( - function (response) { - if (response.status != 201) - console.log('Ocurrió un error con el servicio: ' + response.status); - else - return response.json(); + } + return index; + + } + + function guardarAdmin() { + let _administrators = [...administrators]; + let _admin = { ...sysadmin }; + if (sysadmin._id) { + const index = findIndexById(sysadmin._id); + + _administrators[index] = _admin; + toast.current.show({ + severity: 'success', + summary: 'Exito', + detail: 'Administrador Actualizado', + life: 3000, + }); + setAdministrators(_administrators) + setEditAdminDialog(false); + setSysAdmin(emptySysAdmin); + } else { + var data = { + dni: document.getElementById('identificacion').value, + name: document.getElementById('nombre').value, + last_name: document.getElementById('apellidos').value, + email: document.getElementById('correo_electronico').value, + phone: document.getElementById('telefono').value, + password: document.getElementById('correo_electronico').value, + user_type: "1", //1 es admin + status: "1" + }; + setSysAdmin(data) + + fetch('http://localhost:4000/user/createAdminSystem/', { + cache: 'no-cache', + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json' } - ) - .then( - function (response) { - let _administrators = [...administrators]; - let _admin = { ...sysadmin }; - _administrators.push(_admin); - setAdministrators(_administrators) - } - ) - .catch( - err => console.log('Ocurrió un error con el fetch', err) - ); + }) + .then( + function (response) { + if (response.status != 201) + console.log('Ocurrió un error con el servicio: ' + response.status); + else + return response.json(); + } + ) + .then( + function (response) { + _administrators.push(_admin); + setAdministrators(_administrators) + } + ) + .catch( + err => console.log('Ocurrió un error con el fetch', err) + ); + } } const cambiarStatusUser = () => { @@ -301,7 +328,7 @@ const AdministradoresSistema = () => { title="Editar Administrador" /> - + +
)} @@ -841,7 +943,7 @@ const AdministradoresSistema = () => { - + From 05600cb829ee17bd6262988c3a5debe63bcfc850 Mon Sep 17 00:00:00 2001 From: Mariela Date: Mon, 22 Aug 2022 01:22:32 -0600 Subject: [PATCH 3/6] editar funciones para editar administrador en backend --- api-gateway/src/app.controller.ts | 14 +++++ api-gateway/src/app.service.ts | 13 +++++ .../src/users/users.controller.ts | 8 ++- .../src/components/AdministradoresSistema.js | 58 +++++++++++++++---- 4 files changed, 80 insertions(+), 13 deletions(-) diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index adff4cf7..e8f6326a 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -179,6 +179,20 @@ export class AppController { return this.appService.changeStatusUser(pId, pStatus); } + + @Post('user/updateAdminSystem') + updateAdminSystem( + //Nombre, Apellidos, Correo electrónico, Cédula, Teléfono, Contraseña + @Body('_id') _id: string, + @Body('dni') dni: string, + @Body('name') name: string, + @Body('last_name') last_name: string, + @Body('email') email: string, + @Body('phone') phone: number, + ) { + return this.appService.updateAdminSystem(_id, dni, name, last_name, email, phone); + } + // #==== API Communities @Post('community/createCommunity') createCommunity( diff --git a/api-gateway/src/app.service.ts b/api-gateway/src/app.service.ts index 965b4005..0cf32af5 100644 --- a/api-gateway/src/app.service.ts +++ b/api-gateway/src/app.service.ts @@ -223,6 +223,19 @@ export class AppService { .pipe(map((message: string) => ({ message }))); } + updateAdminSystem(_id: string, dni: string, name: string, + last_name: string, email: string, phone: number + ) { + const pattern = { cmd: 'updateAdminSystem' }; + const payload = { + _id: _id, dni: dni, name: name, last_name: last_name, + email: email, phone: phone + }; + return this.clientUserApp + .send(pattern, payload) + .pipe(map((message: string) => ({ message }))); + } + //GET parameter from API findCommunityAdmin(community_id: string) { const pattern = { cmd: 'findCommunityAdmin' }; diff --git a/servicio-usuarios/src/users/users.controller.ts b/servicio-usuarios/src/users/users.controller.ts index a13bae7c..6a663394 100644 --- a/servicio-usuarios/src/users/users.controller.ts +++ b/servicio-usuarios/src/users/users.controller.ts @@ -66,7 +66,7 @@ export class UsersController { @MessagePattern({ cmd: 'updateUser' }) update(@Payload() user: UserDocument) { - return this.userService.update(user.id, user); + return this.userService.update(user._id, user); } @MessagePattern({ cmd: 'removeUser' }) @@ -74,7 +74,11 @@ export class UsersController { let dni = id['dni']; return this.userService.remove(dni); } - + + @MessagePattern({ cmd: 'updateAdminSystem' }) + updateAdminSystem(@Payload() user: UserDocument) { + return this.userService.update(user._id, user); + } //inicio de sesion @MessagePattern({ cmd: 'loginUser' }) findLogin(@Payload() body: string) { diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index 890d1ebe..dd3f84af 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -86,18 +86,54 @@ const AdministradoresSistema = () => { let _administrators = [...administrators]; let _admin = { ...sysadmin }; if (sysadmin._id) { - const index = findIndexById(sysadmin._id); - _administrators[index] = _admin; - toast.current.show({ - severity: 'success', - summary: 'Exito', - detail: 'Administrador Actualizado', - life: 3000, - }); - setAdministrators(_administrators) - setEditAdminDialog(false); - setSysAdmin(emptySysAdmin); + if (sysadmin.name && sysadmin.dni && sysadmin.last_name && sysadmin.email && + sysadmin.phone) { + + fetch('http://localhost:4000/user/updateAdminSystem/', { + cache: 'no-cache', + method: 'POST', + body: JSON.stringify(_admin), + headers: { + 'Content-Type': 'application/json' + } + }) + .then( + function (response) { + if (response.status != 201) + console.log('Ocurrió un error con el servicio: ' + response.status); + else + return response.json(); + } + ) + .then( + function (response) { + const index = findIndexById(sysadmin._id); + + _administrators[index] = _admin; + toast.current.show({ + severity: 'success', + summary: 'Exito', + detail: 'Administrador Actualizado', + life: 3000, + }); + setAdministrators(_administrators) + setEditAdminDialog(false); + setSysAdmin(emptySysAdmin); + } + ) + .catch( + err => console.log('Ocurrió un error con el fetch', err) + ); + + } else { + setSubmitted(true); + + } + + + + } else { var data = { dni: document.getElementById('identificacion').value, From 387cf0ebca034f5be15ee12f3674360eb47c0ce0 Mon Sep 17 00:00:00 2001 From: Mariela Date: Mon, 22 Aug 2022 09:14:55 -0600 Subject: [PATCH 4/6] editar funcion en backend --- api-gateway/src/app.controller.ts | 2 +- servicio-usuarios/src/users/users.controller.ts | 3 +-- servicio-usuarios/src/users/users.service.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index e8f6326a..06773f17 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -182,7 +182,7 @@ export class AppController { @Post('user/updateAdminSystem') updateAdminSystem( - //Nombre, Apellidos, Correo electrónico, Cédula, Teléfono, Contraseña + //Nombre, Apellidos, Correo electrónico, Cédula, Teléfono @Body('_id') _id: string, @Body('dni') dni: string, @Body('name') name: string, diff --git a/servicio-usuarios/src/users/users.controller.ts b/servicio-usuarios/src/users/users.controller.ts index 6a663394..1f49a3fc 100644 --- a/servicio-usuarios/src/users/users.controller.ts +++ b/servicio-usuarios/src/users/users.controller.ts @@ -74,10 +74,9 @@ export class UsersController { let dni = id['dni']; return this.userService.remove(dni); } - @MessagePattern({ cmd: 'updateAdminSystem' }) updateAdminSystem(@Payload() user: UserDocument) { - return this.userService.update(user._id, user); + return this.userService.updateAdminSystem(user._id, user); } //inicio de sesion @MessagePattern({ cmd: 'loginUser' }) diff --git a/servicio-usuarios/src/users/users.service.ts b/servicio-usuarios/src/users/users.service.ts index d117beeb..1dcba414 100644 --- a/servicio-usuarios/src/users/users.service.ts +++ b/servicio-usuarios/src/users/users.service.ts @@ -78,6 +78,15 @@ export class UsersService { }); } + async updateAdminSystem(id: string, user: UserDocument) { + return this.userModel.findOneAndUpdate({ _id: id }, { + name: user['name'], last_name: user['last_name'], + dni:user['dni'], email: user['email'], phone: user['phone'] + }, { + new: true, + }); + } + /* async remove(id: string) { return this.userModel.findByIdAndRemove({ _id: id }).exec(); }*/ From 18bab545e783ae30fcb4aad11c766a845c4cd66b Mon Sep 17 00:00:00 2001 From: Mariela Date: Mon, 22 Aug 2022 11:00:08 -0600 Subject: [PATCH 5/6] fix stylos y validaciones del registro --- .../src/components/AdministradoresSistema.js | 332 ++++++++++++------ 1 file changed, 227 insertions(+), 105 deletions(-) diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index dd3f84af..7bd0bd6b 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -15,6 +15,22 @@ import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons'; import classNames from 'classnames'; const AdministradoresSistema = () => { + + + let emptySysAdmin = { + _id: null, + dni: '', + name: '', + last_name: '', + email: '', + phone: '', + password: '', + user_type: '1', + status: '1', + status_text: '', + }; + + const [administrators, setAdministrators] = useState([]); const [urlFetch, setUrlFetch] = useState( 'http://localhost:4000/user/findAdminSistema/', @@ -37,19 +53,6 @@ const AdministradoresSistema = () => { const [editAdminDialog, setEditAdminDialog] = useState(false); - let emptySysAdmin = { - _id: null, - dni: '', - name: '', - last_name: '', - email: '', - phone: '', - password: '', - user_type: '1', - status: '1', - status_text: '', - }; - async function fetchP() { let nombres = await fetch(urlFetch, { method: 'GET' }); let adminRes = await nombres.json(); @@ -82,96 +85,110 @@ const AdministradoresSistema = () => { } + const findRepeated = (name, value) => { + let _administrators = [...administrators]; + let value_filtered = _administrators.filter(item => item[`${name}`] === value); + return value_filtered.length + } + + function guardarAdmin() { let _administrators = [...administrators]; let _admin = { ...sysadmin }; - if (sysadmin._id) { - if (sysadmin.name && sysadmin.dni && sysadmin.last_name && sysadmin.email && - sysadmin.phone) { + if (_admin.name && _admin.dni && _admin.last_name && _admin.email && + _admin.phone) { - fetch('http://localhost:4000/user/updateAdminSystem/', { - cache: 'no-cache', - method: 'POST', - body: JSON.stringify(_admin), - headers: { - 'Content-Type': 'application/json' - } - }) - .then( - function (response) { - if (response.status != 201) - console.log('Ocurrió un error con el servicio: ' + response.status); - else - return response.json(); - } - ) - .then( - function (response) { - const index = findIndexById(sysadmin._id); - _administrators[index] = _admin; - toast.current.show({ - severity: 'success', - summary: 'Exito', - detail: 'Administrador Actualizado', - life: 3000, - }); - setAdministrators(_administrators) - setEditAdminDialog(false); - setSysAdmin(emptySysAdmin); - } - ) - .catch( - err => console.log('Ocurrió un error con el fetch', err) - ); - } else { + if (findRepeated('email', _admin.email) || findRepeated('dni', _admin.dni)) { setSubmitted(true); + } else { + if (_admin._id) { + + + + fetch('http://localhost:4000/user/updateAdminSystem/', { + cache: 'no-cache', + method: 'POST', + body: JSON.stringify(_admin), + headers: { + 'Content-Type': 'application/json' + } + }) + .then( + function (response) { + if (response.status != 201) + console.log('Ocurrió un error con el servicio: ' + response.status); + else + return response.json(); + } + ) + .then( + function (response) { + const index = findIndexById(sysadmin._id); + + _administrators[index] = _admin; + toast.current.show({ + severity: 'success', + summary: 'Exito', + detail: 'Administrador Actualizado', + life: 3000, + }); + setAdministrators(_administrators) + setEditAdminDialog(false); + setSysAdmin(emptySysAdmin); + } + ) + .catch( + err => console.log('Ocurrió un error con el fetch', err) + ); + + + + + + + } else { + + + fetch('http://localhost:4000/user/createAdminSystem/', { + cache: 'no-cache', + method: 'POST', + body: JSON.stringify(_admin), + headers: { + 'Content-Type': 'application/json' + } + }) + .then( + function (response) { + if (response.status != 201) + console.log('Ocurrió un error con el servicio: ' + response.status); + else + return response.json(); + } + ) + .then( + function (response) { + _administrators.push(_admin); + setAdministrators(_administrators) + } + ) + .catch( + err => console.log('Ocurrió un error con el fetch', err) + ); + } } - } else { - var data = { - dni: document.getElementById('identificacion').value, - name: document.getElementById('nombre').value, - last_name: document.getElementById('apellidos').value, - email: document.getElementById('correo_electronico').value, - phone: document.getElementById('telefono').value, - password: document.getElementById('correo_electronico').value, - user_type: "1", //1 es admin - status: "1" - }; - setSysAdmin(data) - fetch('http://localhost:4000/user/createAdminSystem/', { - cache: 'no-cache', - method: 'POST', - body: JSON.stringify(data), - headers: { - 'Content-Type': 'application/json' - } - }) - .then( - function (response) { - if (response.status != 201) - console.log('Ocurrió un error con el servicio: ' + response.status); - else - return response.json(); - } - ) - .then( - function (response) { - _administrators.push(_admin); - setAdministrators(_administrators) - } - ) - .catch( - err => console.log('Ocurrió un error con el fetch', err) - ); + + } else { + setSubmitted(true); + } } @@ -256,11 +273,14 @@ const AdministradoresSistema = () => { const infoAdmin = (sysadmin) => { setSysAdmin({ ...sysadmin }); setAdminDialog(true); + }; const hideEditAdminDialog = () => { setSubmitted(false); setEditAdminDialog(false); + setSysAdmin(emptySysAdmin); + }; const editAdmin = (sysadmin) => { @@ -862,9 +882,10 @@ const AdministradoresSistema = () => { {submitted && sysadmin.name === '' && Nombre es requirido.} + -
+
@@ -897,13 +918,16 @@ const AdministradoresSistema = () => { required autoFocus className={classNames({ - 'p-invalid': submitted && sysadmin.email === '', + 'p-invalid': submitted && (sysadmin.email === '' || findRepeated('email', sysadmin.email) > 0), })} />
{submitted && sysadmin.email === '' && ( Correo electrónico es requerido. )} + {submitted && findRepeated('email', sysadmin.email) > 0 && + Correo electrónico se encuentra repetido. + }
@@ -918,13 +942,16 @@ const AdministradoresSistema = () => { required autoFocus className={classNames({ - 'p-invalid': submitted && sysadmin.dni === '', + 'p-invalid': submitted && (sysadmin.dni === '' || findRepeated('dni', sysadmin.dni)), })} />
{submitted && sysadmin.dni === '' && ( Identificación es requerida. )} + {submitted && findRepeated('dni', sysadmin.dni) > 0 && + Identificación se encuentra repetida. + }
@@ -959,29 +986,124 @@ const AdministradoresSistema = () => {
Registro de un administrador del sistema
-
- - +
+ + +
+
+ + + + onInputChange(e, 'name')} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && sysadmin.name === '', + })} + /> +
+ {submitted && sysadmin.name === '' && + Nombre es requirido.} +
-
- - +
+ +
+
+ + + + onInputChange(e, 'last_name')} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && sysadmin.last_name === '', + })} + /> +
+ {submitted && sysadmin.last_name === '' && ( + Apellido(s) es requerido. + )} +
-
+
- +
+
+ + + + onInputChange(e, 'email')} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && (sysadmin.email === '' || findRepeated('email', sysadmin.email) > 0), + })} + /> +
+ {submitted && sysadmin.email === '' && ( + Correo electrónico es requerido. + )} + {submitted && findRepeated('email', sysadmin.email) > 0 && + Correo electrónico se encuentra repetido. + } +
-
- - +
+ +
+
+ + + + onInputChange(e, 'dni')} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && (sysadmin.dni === '' || findRepeated('dni', sysadmin.dni) > 0), + })} + /> +
+ {submitted && sysadmin.dni === '' && ( + Identificación es requerida. + )} + {submitted && findRepeated('dni', sysadmin.dni) > 0 && + Identificación se encuentra repetida. + } +
- - + +
+
+ + + + onInputChange(e, 'phone')} + required + autoFocus + className={classNames({ + 'p-invalid': submitted && sysadmin.phone === '', + })} + /> +
+ {submitted && sysadmin.phone === '' && ( + Teléfono es requerido. + )} +
- + +
+
+
); From 553351d1d9603d390d7e26fc15300b9b81e58a2b Mon Sep 17 00:00:00 2001 From: Mariela Date: Mon, 22 Aug 2022 12:02:45 -0600 Subject: [PATCH 6/6] acomodar formato estandar de editar --- .../src/components/AdministradoresSistema.js | 158 +++--------------- web-ui/web-react/src/components/Inquilinos.js | 2 +- 2 files changed, 25 insertions(+), 135 deletions(-) diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index 7bd0bd6b..6fa70310 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -51,6 +51,7 @@ const AdministradoresSistema = () => { const [submitted, setSubmitted] = useState(false); const [editAdminDialog, setEditAdminDialog] = useState(false); + const [saveButtonTitle, setSaveButtonTitle] = useState("Registrar") async function fetchP() { @@ -276,16 +277,16 @@ const AdministradoresSistema = () => { }; - const hideEditAdminDialog = () => { - setSubmitted(false); - setEditAdminDialog(false); - setSysAdmin(emptySysAdmin); - }; + const cancelEdit = () => { + setSaveButtonTitle('Registrar'); + setSubmitted(false); + setSysAdmin(emptySysAdmin); + } const editAdmin = (sysadmin) => { setSysAdmin({ ...sysadmin }); - setEditAdminDialog(true); + setSaveButtonTitle('Actualizar'); }; const deleteSysAdmin = () => { @@ -853,138 +854,12 @@ const AdministradoresSistema = () => { )}
- - {sysadmin && (
-
- -
-
- - - - onInputChange(e, 'name')} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && sysadmin.name === '', - })} - /> -
- {submitted && sysadmin.name === '' && - Nombre es requirido.} - -
-
-
- -
-
- - - - onInputChange(e, 'last_name')} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && sysadmin.last_name === '', - })} - /> -
- {submitted && sysadmin.last_name === '' && ( - Apellido(s) es requerido. - )} -
-
-
- -
-
- - - - onInputChange(e, 'email')} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && (sysadmin.email === '' || findRepeated('email', sysadmin.email) > 0), - })} - /> -
- {submitted && sysadmin.email === '' && ( - Correo electrónico es requerido. - )} - {submitted && findRepeated('email', sysadmin.email) > 0 && - Correo electrónico se encuentra repetido. - } -
-
-
- -
-
- - - - onInputChange(e, 'dni')} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && (sysadmin.dni === '' || findRepeated('dni', sysadmin.dni)), - })} - /> -
- {submitted && sysadmin.dni === '' && ( - Identificación es requerida. - )} - {submitted && findRepeated('dni', sysadmin.dni) > 0 && - Identificación se encuentra repetida. - } -
-
-
- -
-
- - - - onInputChange(e, 'phone')} - required - autoFocus - className={classNames({ - 'p-invalid': submitted && sysadmin.phone === '', - })} - /> -
- {submitted && sysadmin.phone === '' && ( - Teléfono es requerido. - )} -
-
- -
- )} -
-
Registro de un administrador del sistema
+
Mantenimiento Administrador del Sistema
@@ -1098,7 +973,22 @@ const AdministradoresSistema = () => { )}
- +
+
diff --git a/web-ui/web-react/src/components/Inquilinos.js b/web-ui/web-react/src/components/Inquilinos.js index 244196da..6be6da53 100644 --- a/web-ui/web-react/src/components/Inquilinos.js +++ b/web-ui/web-react/src/components/Inquilinos.js @@ -858,7 +858,7 @@ const Inquilinos = () => { /> {saveButtonTitle === 'Actualizar' && (