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 (