|
|
@@ -30,7 +30,7 @@ const ProvisionerFlow: React.FC<Props> = ({
|
|
|
const [credentialId, setCredentialId] = useState("");
|
|
|
const [showCostConfirmModal, setShowCostConfirmModal] = useState(false);
|
|
|
const [confirmCost, setConfirmCost] = useState("");
|
|
|
- const [useAssumeRole, setUseAssumeRole] = useState(false);
|
|
|
+ const [useCloudFormationForm, setUseCloudFormationForm] = useState(true);
|
|
|
|
|
|
const isUsageExceeded = useMemo(() => {
|
|
|
if (!hasBillingEnabled) {
|
|
|
@@ -42,8 +42,8 @@ const ProvisionerFlow: React.FC<Props> = ({
|
|
|
const markStepCostConsent = async () => {
|
|
|
try {
|
|
|
const res = await api.updateOnboardingStep(
|
|
|
- "<token>",
|
|
|
- { step: "cost-consent-complete" },
|
|
|
+ "<token>",
|
|
|
+ { step: "cost-consent-complete" },
|
|
|
{}
|
|
|
);
|
|
|
} catch (err) {
|
|
|
@@ -51,8 +51,8 @@ const ProvisionerFlow: React.FC<Props> = ({
|
|
|
}
|
|
|
try {
|
|
|
const res = await api.inviteAdmin(
|
|
|
- "<token>",
|
|
|
- {},
|
|
|
+ "<token>",
|
|
|
+ {},
|
|
|
{ project_id: currentProject.id }
|
|
|
);
|
|
|
} catch (err) {
|
|
|
@@ -153,20 +153,18 @@ const ProvisionerFlow: React.FC<Props> = ({
|
|
|
)}
|
|
|
</>
|
|
|
);
|
|
|
- } else if (currentStep === "credentials" && useAssumeRole) {
|
|
|
- return (
|
|
|
+ } else if (currentStep === "credentials") {
|
|
|
+ return useCloudFormationForm ? (
|
|
|
<CloudFormationForm
|
|
|
goBack={() => setCurrentStep("cloud")}
|
|
|
proceed={(id) => {
|
|
|
setCredentialId(id);
|
|
|
setCurrentStep("cluster");
|
|
|
}}
|
|
|
+ switchToCredentialFlow={() => setUseCloudFormationForm(false)}
|
|
|
/>
|
|
|
- );
|
|
|
- } else if (currentStep === "credentials" && !useAssumeRole) {
|
|
|
- return (
|
|
|
+ ) : (
|
|
|
<CredentialsForm
|
|
|
- enableAssumeRole={() => setUseAssumeRole(true)}
|
|
|
goBack={() => setCurrentStep("cloud")}
|
|
|
proceed={(id) => {
|
|
|
setCredentialId(id);
|
|
|
@@ -179,7 +177,7 @@ const ProvisionerFlow: React.FC<Props> = ({
|
|
|
<ProvisionerForm
|
|
|
goBack={() => setCurrentStep("credentials")}
|
|
|
credentialId={credentialId}
|
|
|
- useAssumeRole={useAssumeRole}
|
|
|
+ useAssumeRole={useCloudFormationForm}
|
|
|
/>
|
|
|
);
|
|
|
}
|