From 73415e2f8a883b1b0e7adfd154b9ff6a3c9878af Mon Sep 17 00:00:00 2001 From: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com> Date: Wed, 4 Mar 2026 09:33:32 +0100 Subject: [PATCH] chore(ui): improve provider wizard docs link labels (#10244) --- .../wizard/provider-wizard-modal.tsx | 2 +- .../provider-wizard-modal.utils.test.ts | 4 +-- .../wizard/provider-wizard-modal.utils.ts | 34 ++++++++++++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ui/components/providers/wizard/provider-wizard-modal.tsx b/ui/components/providers/wizard/provider-wizard-modal.tsx index 2becce7161..76b2a6ea77 100644 --- a/ui/components/providers/wizard/provider-wizard-modal.tsx +++ b/ui/components/providers/wizard/provider-wizard-modal.tsx @@ -84,7 +84,7 @@ export function ProviderWizardModal({ diff --git a/ui/components/providers/wizard/provider-wizard-modal.utils.test.ts b/ui/components/providers/wizard/provider-wizard-modal.utils.test.ts index 758d4d957e..b96fbc8a1f 100644 --- a/ui/components/providers/wizard/provider-wizard-modal.utils.test.ts +++ b/ui/components/providers/wizard/provider-wizard-modal.utils.test.ts @@ -58,7 +58,7 @@ describe("getProviderWizardDocsDestination", () => { "https://goto.prowler.com/provider-aws", ); - expect(destination).toBe("aws"); + expect(destination).toBe("AWS"); }); it("returns a compact destination label for long docs links", () => { @@ -66,6 +66,6 @@ describe("getProviderWizardDocsDestination", () => { "https://docs.prowler.com/user-guide/tutorials/prowler-cloud-aws-organizations", ); - expect(destination).toBe("aws-organizations"); + expect(destination).toBe("AWS Organizations"); }); }); diff --git a/ui/components/providers/wizard/provider-wizard-modal.utils.ts b/ui/components/providers/wizard/provider-wizard-modal.utils.ts index 414fe5cfd6..be1c7985eb 100644 --- a/ui/components/providers/wizard/provider-wizard-modal.utils.ts +++ b/ui/components/providers/wizard/provider-wizard-modal.utils.ts @@ -29,6 +29,24 @@ export function getProviderWizardModalTitle(mode: ProviderWizardMode) { } export function getProviderWizardDocsDestination(docsLink: string) { + const destinationLabelMap: Record = { + "aws-organizations": "AWS Organizations", + aws: "AWS", + azure: "Azure", + m365: "Microsoft 365", + gcp: "GCP", + k8s: "Kubernetes", + kubernetes: "Kubernetes", + github: "GitHub", + iac: "IaC", + oraclecloud: "Oracle Cloud", + mongodbatlas: "MongoDB Atlas", + alibabacloud: "Alibaba Cloud", + cloudflare: "Cloudflare", + openstack: "OpenStack", + help: "Cloud Provider", + }; + try { const parsed = new URL(docsLink); const pathSegments = parsed.pathname @@ -40,7 +58,21 @@ export function getProviderWizardDocsDestination(docsLink: string) { return parsed.hostname; } - return lastSegment.replace(/^provider-/, "").replace(/^prowler-cloud-/, ""); + const compactDestination = lastSegment + .replace(/^provider-/, "") + .replace(/^prowler-cloud-/, ""); + const mappedDestination = destinationLabelMap[compactDestination]; + + if (mappedDestination) { + return mappedDestination; + } + + return compactDestination + .split("-") + .map((word) => + word.length === 0 ? word : word[0].toUpperCase() + word.slice(1), + ) + .join(" "); } catch { return docsLink; }