feat(integrations): external links and copies changed (#8574)

This commit is contained in:
Alejandro Bailo authored and GitHub committed 2025-08-27 12:40:25 +02:00
1 parent 329ac113f2
commit 06c2608a05
5 files changed
+23 -20

No files matched your search

@@ -3,6 +3,7 @@
import { IdIcon } from "@/components/icons";
import { CustomButton } from "@/components/ui/custom";
import { SnippetChip } from "@/components/ui/entities";
import { IntegrationType } from "@/types/integrations";
interface CredentialsRoleHelperProps {
externalId: string;
@@ -11,20 +12,22 @@ interface CredentialsRoleHelperProps {
cloudformationQuickLink: string;
terraform: string;
};
type?: "providers" | "integrations";
integrationType?: IntegrationType;
}
export const CredentialsRoleHelper = ({
externalId,
templateLinks,
type = "providers",
integrationType,
}: CredentialsRoleHelperProps) => {
const isAmazonS3 = integrationType === "amazon_s3";
return (
<div className="flex flex-col gap-2">
<div className="flex flex-col gap-4">
<p className="text-sm text-gray-600 dark:text-gray-400">
A <strong>read-only IAM role</strong> must be manually created
{type === "integrations" ? " or updated" : ""}.
{isAmazonS3 ? " or updated" : ""}
</p>
<CustomButton
@@ -46,9 +49,9 @@ export const CredentialsRoleHelper = ({
</div>
<p className="text-sm text-gray-600 dark:text-gray-400">
{type === "providers"
? "Use one of the following templates to create the IAM role"
: "Refer to the documentation"}
{isAmazonS3
? "Refer to the documentation"
: "Use one of the following templates to create the IAM role"}
</p>
<div className="flex w-fit flex-col gap-2">
@@ -59,7 +62,7 @@ export const CredentialsRoleHelper = ({
asLink={templateLinks.cloudformation}
target="_blank"
>
CloudFormation {type === "providers" ? "Template" : ""}
CloudFormation {integrationType ? "" : "Template"}
</CustomButton>
<CustomButton
ariaLabel="Terraform Code"
@@ -68,7 +71,7 @@ export const CredentialsRoleHelper = ({
asLink={templateLinks.terraform}
target="_blank"
>
Terraform {type === "providers" ? "Code" : ""}
Terraform {integrationType ? "" : "Code"}
</CustomButton>
</div>
@@ -6,6 +6,7 @@ import { CredentialsRoleHelper } from "@/components/providers/workflow";
import { CustomInput } from "@/components/ui/custom";
import { ProviderCredentialFields } from "@/lib/provider-credentials/provider-credential-fields";
import { AWSCredentialsRole } from "@/types";
import { IntegrationType } from "@/types/integrations";
export const AWSRoleCredentialsForm = ({
control,
@@ -13,6 +14,7 @@ export const AWSRoleCredentialsForm = ({
externalId,
templateLinks,
type = "providers",
integrationType,
}: {
control: Control<AWSCredentialsRole>;
setValue: UseFormSetValue<AWSCredentialsRole>;
@@ -23,6 +25,7 @@ export const AWSRoleCredentialsForm = ({
terraform: string;
};
type?: "providers" | "integrations";
integrationType?: IntegrationType;
}) => {
const isCloudEnv = process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true";
const defaultCredentialsType = isCloudEnv
@@ -187,7 +190,7 @@ export const AWSRoleCredentialsForm = ({
<CredentialsRoleHelper
externalId={externalId}
templateLinks={templateLinks}
type={type}
integrationType={integrationType}
/>
<Divider />