diff --git a/ui/components/providers/add-provider-button.tsx b/ui/components/providers/add-provider-button.tsx
index 87dfc3d932..24b1b54c86 100644
--- a/ui/components/providers/add-provider-button.tsx
+++ b/ui/components/providers/add-provider-button.tsx
@@ -7,13 +7,13 @@ export const AddProviderButton = () => {
return (
}
>
- Add Account
+ Add Cloud Provider
);
};
diff --git a/ui/components/providers/workflow/forms/test-connection-form.tsx b/ui/components/providers/workflow/forms/test-connection-form.tsx
index 778df1e478..726ab3be30 100644
--- a/ui/components/providers/workflow/forms/test-connection-form.tsx
+++ b/ui/components/providers/workflow/forms/test-connection-form.tsx
@@ -116,9 +116,13 @@ export const TestConnectionForm = ({
error: connected ? null : error || "Unknown error",
});
- if (connected) {
+ if (connected && isUpdated) return router.push("/providers");
+
+ if (connected && !isUpdated) {
try {
+ // Schedule daily scan by default
const data = await scheduleDaily(formData);
+
if (data.error) {
setApiErrorMessage(data.error);
form.setError("providerId", {
@@ -126,19 +130,8 @@ export const TestConnectionForm = ({
message: data.error,
});
} else {
- const urlParams = new URLSearchParams(window.location.search);
- const isUpdated = urlParams.get("updated") === "true";
-
- if (!isUpdated) {
- setIsRedirecting(true);
- router.push("/scans");
- return;
- } else {
- setConnectionStatus({
- connected: true,
- error: null,
- });
- }
+ setIsRedirecting(true);
+ router.push("/scans");
}
} catch (error) {
form.setError("providerId", {
@@ -203,8 +196,8 @@ export const TestConnectionForm = ({
Scan initiated successfully
-
- Redirecting to scans dashboard...
+
+ Redirecting to scans job details...
- Check connection and launch scan
+ {!isUpdated
+ ? "Check connection and launch scan"
+ : "Check connection"}
- A successful connection will launch a daily scheduled scan.
+ {!isUpdated
+ ? "A successful connection will launch a daily scheduled scan."
+ : "A successful connection will redirect you to the providers page."}
@@ -267,6 +264,12 @@ export const TestConnectionForm = ({
)} */}
+ {isUpdated && !connectionStatus?.error && (
+
@@ -307,27 +310,18 @@ export const TestConnectionForm = ({
type={
isUpdated && connectionStatus?.connected ? "button" : "submit"
}
- onPress={
- isUpdated && connectionStatus?.connected
- ? () => router.push("/providers")
- : undefined
- }
ariaLabel={"Save"}
className="w-1/2"
variant="solid"
color="action"
size="lg"
isLoading={isLoading}
- endContent={!isLoading &&
}
+ endContent={!isLoading && !isUpdated &&
}
>
{isLoading ? (
<>Loading>
) : (
-
- {isUpdated && connectionStatus?.connected
- ? "Go to providers"
- : "Launch scan"}
-
+
{isUpdated ? "Check connection" : "Launch scan"}
)}
)}
diff --git a/ui/components/providers/workflow/workflow-add-provider.tsx b/ui/components/providers/workflow/workflow-add-provider.tsx
index 9d135e0ce6..abc5c0b78f 100644
--- a/ui/components/providers/workflow/workflow-add-provider.tsx
+++ b/ui/components/providers/workflow/workflow-add-provider.tsx
@@ -8,21 +8,21 @@ import { VerticalSteps } from "./vertical-steps";
const steps = [
{
- title: "Add your cloud account",
+ title: "Add your cloud provider",
description:
"Select the cloud provider for the account to connect and specify whether to use an IAM role or credentials for access.",
href: "/providers/connect-account",
},
{
- title: "Add credentials to your cloud account",
+ title: "Add credentials to your cloud provider",
description:
- "Provide the credentials required to connect to the cloud account.",
+ "Provide the credentials required to connect to the cloud provider.",
href: "/providers/add-credentials",
},
{
title: "Check connection and launch scan",
description:
- "Verify the connection to ensure that the provided credentials are valid for accessing the cloud account and initiating a scan.",
+ "Verify the connection to ensure that the provided credentials are valid for accessing the cloud provider and initiating a scan.",
href: "/providers/test-connection",
},
];
@@ -39,10 +39,10 @@ export const WorkflowAddProvider = () => {
return (
- Add a cloud account
+ Add a cloud provider
- Complete the steps to configure the cloud account, enabling the launch
+ Complete the steps to configure the cloud provider, enabling the launch
of the first scan once completed.