Show Credentials after adding tenant (#599)
* Show Credentials after adding tenant * assets * Change order of routing
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -290,14 +290,14 @@ const Console = ({
|
|||||||
component: WebhookPanel,
|
component: WebhookPanel,
|
||||||
path: "/webhook/audit",
|
path: "/webhook/audit",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: AddTenant,
|
|
||||||
path: "/add-tenant",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
component: ListTenants,
|
component: ListTenants,
|
||||||
path: "/tenants",
|
path: "/tenants",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: AddTenant,
|
||||||
|
path: "/add-tenant",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
component: TenantDetails,
|
component: TenantDetails,
|
||||||
path: "/namespaces/:tenantNamespace/tenants/:tenantName",
|
path: "/namespaces/:tenantNamespace/tenants/:tenantName",
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ import { setModalErrorSnackMessage } from "../../../../actions";
|
|||||||
import { getHardcodedAffinity } from "../TenantDetails/utils";
|
import { getHardcodedAffinity } from "../TenantDetails/utils";
|
||||||
import history from "../../../../history";
|
import history from "../../../../history";
|
||||||
import PageHeader from "../../Common/PageHeader/PageHeader";
|
import PageHeader from "../../Common/PageHeader/PageHeader";
|
||||||
|
import CredentialsPrompt from "../../Common/CredentialsPrompt/CredentialsPrompt";
|
||||||
|
|
||||||
interface IAddTenantProps {
|
interface IAddTenantProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -140,6 +141,13 @@ const styles = (theme: Theme) =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
const AddTenant = ({ classes }: IAddTenantProps) => {
|
const AddTenant = ({ classes }: IAddTenantProps) => {
|
||||||
|
// Modals
|
||||||
|
const [showNewCredentials, setShowNewCredentials] = useState<boolean>(false);
|
||||||
|
const [
|
||||||
|
createdAccount,
|
||||||
|
setCreatedAccount,
|
||||||
|
] = useState<NewServiceAccount | null>(null);
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
const [addSending, setAddSending] = useState<boolean>(false);
|
const [addSending, setAddSending] = useState<boolean>(false);
|
||||||
const [tenantName, setTenantName] = useState<string>("");
|
const [tenantName, setTenantName] = useState<string>("");
|
||||||
@@ -292,6 +300,10 @@ const AddTenant = ({ classes }: IAddTenantProps) => {
|
|||||||
const [vaultCAVal, setVaultCAVal] = useState<string>("");
|
const [vaultCAVal, setVaultCAVal] = useState<string>("");
|
||||||
const [gemaltoCAVal, setGemaltoCAVal] = useState<string>("");
|
const [gemaltoCAVal, setGemaltoCAVal] = useState<string>("");
|
||||||
|
|
||||||
|
// Flow
|
||||||
|
|
||||||
|
const showCredentialsAndRedirect = () => {};
|
||||||
|
|
||||||
// CA Certificates functions
|
// CA Certificates functions
|
||||||
const addCaCertificate = () => {
|
const addCaCertificate = () => {
|
||||||
setCaCertificates((currentCertificates) => [
|
setCaCertificates((currentCertificates) => [
|
||||||
@@ -1225,7 +1237,9 @@ const AddTenant = ({ classes }: IAddTenantProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
setAddSending(false);
|
setAddSending(false);
|
||||||
history.push("/tenants");
|
|
||||||
|
setShowNewCredentials(true);
|
||||||
|
setCreatedAccount(newSrvAcc);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
setAddSending(false);
|
setAddSending(false);
|
||||||
@@ -2831,6 +2845,10 @@ const AddTenant = ({ classes }: IAddTenantProps) => {
|
|||||||
filteredWizardSteps = wizardSteps.filter((step) => !step.advancedOnly);
|
filteredWizardSteps = wizardSteps.filter((step) => !step.advancedOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closeCredentialsModal = () => {
|
||||||
|
history.push("/tenants");
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{addSending && (
|
{addSending && (
|
||||||
@@ -2838,6 +2856,16 @@ const AddTenant = ({ classes }: IAddTenantProps) => {
|
|||||||
<LinearProgress />
|
<LinearProgress />
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
{showNewCredentials && (
|
||||||
|
<CredentialsPrompt
|
||||||
|
newServiceAccount={createdAccount}
|
||||||
|
open={showNewCredentials}
|
||||||
|
closeModal={() => {
|
||||||
|
closeCredentialsModal();
|
||||||
|
}}
|
||||||
|
entity="Tenant"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<PageHeader label={"Add Tenant"} />
|
<PageHeader label={"Add Tenant"} />
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item xs={12} className={classes.container}>
|
<Grid item xs={12} className={classes.container}>
|
||||||
|
|||||||
Reference in New Issue
Block a user