diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index a3f47866..8e3bc56a 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -50,7 +50,7 @@ const AdministradoresSistema = () => { const [adminDialog, setAdminDialog] = useState(false); const [submitted, setSubmitted] = useState(false); - const [editAdminDialog, setEditAdminDialog] = useState(false); + const [formAdminDialog, setFormAdminDialog] = useState(false); const [saveButtonTitle, setSaveButtonTitle] = useState("Registrar") @@ -136,7 +136,7 @@ const AdministradoresSistema = () => { life: 3000, }); setAdministrators(_administrators) - setEditAdminDialog(false); + setFormAdminDialog(false); setSysAdmin(emptySysAdmin); } ) @@ -267,7 +267,23 @@ const AdministradoresSistema = () => { const editAdmin = (sysadmin) => { setSysAdmin({ ...sysadmin }); setSaveButtonTitle('Actualizar'); + setFormAdminDialog(true) + }; + const openNewAdmin = () => { + setSysAdmin(emptySysAdmin); + setFormAdminDialog(true) + setSubmitted(false); + }; + + const hideFormAdminDialog = () => { + setSubmitted(false); + setFormAdminDialog(false) + setSysAdmin(emptySysAdmin); + setSaveButtonTitle('Registrar'); + + }; + const deleteSysAdmin = () => { fetch('http://localhost:4000/user/deleteAdminSystem/' + sysadmin._id, { @@ -386,6 +402,12 @@ const AdministradoresSistema = () => { return (
+
- - - -
-
-
Mantenimiento Administrador del Sistema
-
+ +
@@ -953,28 +977,12 @@ const AdministradoresSistema = () => { )}
-
-
-
+
-
+ ); };