diff --git a/portal-ui/src/screens/Console/Tenants/ListTenants/DeleteTenant.tsx b/portal-ui/src/screens/Console/Tenants/ListTenants/DeleteTenant.tsx index 4114e7492..4559e587b 100644 --- a/portal-ui/src/screens/Console/Tenants/ListTenants/DeleteTenant.tsx +++ b/portal-ui/src/screens/Console/Tenants/ListTenants/DeleteTenant.tsx @@ -28,7 +28,8 @@ import Typography from "@material-ui/core/Typography"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import api from "../../../../common/api"; import { ITenant } from "./types"; - +import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper"; +import Grid from "@material-ui/core/Grid"; interface IDeleteTenant { classes: any; deleteOpen: boolean; @@ -51,6 +52,7 @@ const DeleteTenant = ({ }: IDeleteTenant) => { const [deleteLoading, setDeleteLoading] = useState(false); const [deleteError, setDeleteError] = useState(""); + const [retypeTenant, setRetypeTenant] = useState(""); useEffect(() => { if (deleteLoading) { @@ -73,6 +75,10 @@ const DeleteTenant = ({ }, [deleteLoading]); const removeRecord = () => { + if (retypeTenant !== selectedTenant.name) { + setDeleteError("Tenant name is not correct"); + return; + } setDeleteLoading(true); }; @@ -90,7 +96,18 @@ const DeleteTenant = ({ {deleteLoading && } - Are you sure you want to delete tenant {selectedTenant.name}? + To continue please type {selectedTenant.name} in the box. + + ) => { + setRetypeTenant(event.target.value); + }} + label="" + value={retypeTenant} + /> + {deleteError !== "" && (
@@ -116,7 +133,12 @@ const DeleteTenant = ({ > Cancel -