Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(secret-manager): migrate native integration creation pages to V3 (S11) (#8614)

Andrew Huang332c410933a9
diff --git a/frontend/src/pages/secret-manager/integrations/AwsParameterStoreAuthorizePage/AwsParameterStoreAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/AwsParameterStoreAuthorizePage/AwsParameterStoreAuthorizePage.tsx
index 956eb99cb7..87fd5029b7 100644
--- a/frontend/src/pages/secret-manager/integrations/AwsParameterStoreAuthorizePage/AwsParameterStoreAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AwsParameterStoreAuthorizePage/AwsParameterStoreAuthorizePage.tsx
@@ -7,16 +7,26 @@ import { useNavigate } from "@tanstack/react-router";
import { z } from "zod";
import {
+ Badge,
Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
+ ProviderIcon,
Select,
- SelectItem
-} from "@app/components/v2";
-import { ProviderIcon } from "@app/components/v3";
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -89,54 +99,65 @@ export const AWSParameterStoreAuthorizeIntegrationPage = () => {
<Helmet>
<title>Authorize AWS Parameter Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="After adding the details below, you will be prompted to set up an integration for a particular Infisical project and environment."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
- </div>
- <span className="ml-1.5">AWS Parameter Store Integration </span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://infisical.com/docs/integrations/cloud/aws-parameter-store"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
+ <span>AWS Parameter Store Integration</span>
+ </CardTitle>
+ <CardDescription>
+ After adding the details below, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ target="_blank"
+ rel="noopener noreferrer"
+ href="https://infisical.com/docs/integrations/cloud/aws-parameter-store"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <CardBody>
- <form onSubmit={handleSubmit(handleFormSubmit)}>
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <form onSubmit={handleSubmit(handleFormSubmit)} className="flex flex-col gap-5">
+ <CardContent>
<Controller
control={control}
name="type"
defaultValue={AwsAuthType.AccessKey}
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Authentication Mode"
- errorText={error?.message}
- isError={Boolean(error)}
- >
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awsparameterstore-type">Authentication Mode</FieldLabel>
<Select
defaultValue={field.value}
- {...field}
onValueChange={(e) => onChange(e)}
- className="w-full"
+ name={field.name}
+ disabled={field.disabled}
+ value={field.value}
>
- <SelectItem value={AwsAuthType.AccessKey}>Access Key</SelectItem>
- <SelectItem value={AwsAuthType.AssumeRole}>AWS Assume Role</SelectItem>
+ <SelectTrigger
+ className="w-full"
+ id="awsparameterstore-type"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awsparameterstore-type-error" : undefined}
+ ref={field.ref}
+ onBlur={field.onBlur}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value={AwsAuthType.AccessKey}>Access Key</SelectItem>
+ <SelectItem value={AwsAuthType.AssumeRole}>AWS Assume Role</SelectItem>
+ </SelectContent>
</Select>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="awsparameterstore-type-error">{error?.message}</FieldError>
+ )}
+ </Field>
)}
/>
{formAwsAuthTypeField === AwsAuthType.AccessKey ? (
@@ -145,31 +166,48 @@ export const AWSParameterStoreAuthorizeIntegrationPage = () => {
control={control}
name="accessKey"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Access Key ID"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="" {...field} />
- </FormControl>
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awsparameterstore-accesskey">Access Key ID</FieldLabel>
+ <Input
+ placeholder=""
+ {...field}
+ id="awsparameterstore-accesskey"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awsparameterstore-accesskey-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="awsparameterstore-accesskey-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
<Controller
control={control}
name="accessSecretKey"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Secret Access Key"
- errorText={error?.message}
- isError={Boolean(error)}
- >
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awsparameterstore-accesssecretkey">
+ Secret Access Key
+ </FieldLabel>
<Input
type="password"
autoComplete="new-password"
placeholder=""
{...field}
+ id="awsparameterstore-accesssecretkey"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awsparameterstore-accesssecretkey-error" : undefined
+ }
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="awsparameterstore-accesssecretkey-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
</>
@@ -178,27 +216,33 @@ export const AWSParameterStoreAuthorizeIntegrationPage = () => {
control={control}
name="iamRoleArn"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="IAM Role ARN For Role Assumption"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="" {...field} />
- </FormControl>
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awsparameterstore-iamrolearn">
+ IAM Role ARN For Role Assumption
+ </FieldLabel>
+ <Input
+ placeholder=""
+ {...field}
+ id="awsparameterstore-iamrolearn"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awsparameterstore-iamrolearn-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="awsparameterstore-iamrolearn-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
)}
- <Button
- type="submit"
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isLoading={formState.isSubmitting}
- >
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button type="submit" isPending={formState.isSubmitting} variant="project">
Connect to AWS Parameter Store
</Button>
- </form>
- </CardBody>
+ </CardFooter>
+ </form>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/AwsParameterStoreConfigurePage/AwsParamterStoreConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/AwsParameterStoreConfigurePage/AwsParamterStoreConfigurePage.tsx
index c517ac3d41..de4d3df7af 100644
--- a/frontend/src/pages/secret-manager/integrations/AwsParameterStoreConfigurePage/AwsParamterStoreConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AwsParameterStoreConfigurePage/AwsParamterStoreConfigurePage.tsx
@@ -11,20 +11,31 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
import { motion } from "motion/react";
import {
+ Badge,
Button,
Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
+ ProviderIcon,
Select,
+ SelectContent,
SelectItem,
- Switch,
- Tab,
- TabList,
- TabPanel,
- Tabs
-} from "@app/components/v2";
-import { Badge, ProviderIcon } from "@app/components/v3";
+ SelectTrigger,
+ SelectValue,
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger,
+ Toggle
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -151,8 +162,6 @@ export const AWSParameterStoreConfigurePage = () => {
...(shouldDisableDelete && { shouldDisableDelete })
}
});
-
- setIsLoading(false);
setPathErrorText("");
navigate({
@@ -167,6 +176,8 @@ export const AWSParameterStoreConfigurePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
@@ -175,174 +186,209 @@ export const AWSParameterStoreConfigurePage = () => {
<Helmet>
<title>Set Up AWS Parameter Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Choose which environment in Infisical you want to sync to secerts in AWS Parameter Store."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
- </div>
- <span className="ml-1.5">AWS Parameter Store Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/aws-parameter-store"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
+ <span>AWS Parameter Store Integration</span>
+ </CardTitle>
+ <CardDescription>
+ Choose which environment in Infisical you want to sync to secerts in AWS Parameter
+ Store.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/aws-parameter-store"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <Tabs defaultValue={TabSections.Connection} className="px-6">
- <TabList>
- <div className="flex w-full flex-row border-b border-border-control">
- <Tab value={TabSections.Connection}>Connection</Tab>
- <Tab value={TabSections.Options}>Options</Tab>
- </div>
- </TabList>
- <TabPanel value={TabSections.Connection}>
- <motion.div
- key="panel-1"
- transition={{ duration: 0.15 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 30 }}
- >
- <FormControl label="Project Environment">
- <Select
- value={selectedSourceEnvironment}
- onValueChange={(val) => setSelectedSourceEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {currentProject?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`flyio-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl label="AWS Region">
- <Select
- value={selectedAWSRegion}
- onValueChange={(val) => {
- setSelectedAWSRegion(val);
- setKmsKeyId("");
- }}
- className="w-full border border-border-strong"
- >
- {awsRegions.map((awsRegion) => (
- <SelectItem value={awsRegion.slug} key={`aws-environment-${awsRegion.slug}`}>
- {awsRegion.name} <Badge variant="neutral">{awsRegion.slug}</Badge>
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Path" errorText={pathErrorText} isError={pathErrorText !== ""}>
- <Input
- placeholder={`/${currentProject.name
- .toLowerCase()
- .replace(/ /g, "-")}/${selectedSourceEnvironment}/`}
- value={path}
- onChange={(e) => setPath(e.target.value)}
- />
- </FormControl>
- </motion.div>
- </TabPanel>
- <TabPanel value={TabSections.Options}>
- <motion.div
- key="panel-1"
- transition={{ duration: 0.15 }}
- initial={{ opacity: 0, translateX: -30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 30 }}
- >
- <div className="mt-2 ml-1">
- <Switch
- id="delete-aws"
- onCheckedChange={setShouldDisableDelete}
- isChecked={shouldDisableDelete}
- >
- Disable deleting secrets in AWS Parameter Store
- </Switch>
- </div>
- <div className="mt-4 ml-1">
- <Switch id="tag-aws" onCheckedChange={setShouldTag} isChecked={shouldTag}>
- Tag in AWS Parameter Store
- </Switch>
- </div>
- {shouldTag && (
- <div className="mt-4">
- <FormControl label="Tag Key">
- <Input
- placeholder="managed-by"
- value={tagKey}
- onChange={(e) => setTagKey(e.target.value)}
- />
- </FormControl>
- <FormControl label="Tag Value">
- <Input
- placeholder="infisical"
- value={tagValue}
- onChange={(e) => setTagValue(e.target.value)}
- />
- </FormControl>
- </div>
- )}
- <FormControl label="Encryption Key" className="mt-4">
- <Select
- value={kmsKeyId}
- onValueChange={(e) => {
- setKmsKeyId(e);
- }}
- className="w-full border border-border-strong"
- >
- {integrationAuthAwsKmsKeys?.length ? (
- integrationAuthAwsKmsKeys.map((key) => {
- return (
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Tabs defaultValue={TabSections.Connection}>
+ <TabsList variant="project">
+ <TabsTrigger value={TabSections.Connection}>Connection</TabsTrigger>
+ <TabsTrigger value={TabSections.Options}>Options</TabsTrigger>
+ </TabsList>
+ <TabsContent value={TabSections.Connection}>
+ <motion.div
+ key="panel-1"
+ transition={{ duration: 0.15 }}
+ initial={{ opacity: 0, translateX: 30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 30 }}
+ >
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="awsparameterstore-project-environment">
+ Project Environment
+ </FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger className="w-full" id="awsparameterstore-project-environment">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`flyio-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="awsparameterstore-secrets-path">Secrets Path</FieldLabel>
+ <Input
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ id="awsparameterstore-secrets-path"
+ />
+ </Field>
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="awsparameterstore-aws-region">AWS Region</FieldLabel>
+ <Select
+ value={selectedAWSRegion}
+ onValueChange={(val) => {
+ setSelectedAWSRegion(val);
+ setKmsKeyId("");
+ }}
+ >
+ <SelectTrigger className="w-full" id="awsparameterstore-aws-region">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {awsRegions.map((awsRegion) => (
<SelectItem
- value={key.id as string}
- key={`repo-id-${key.id}`}
- className="w-[28.4rem] text-sm"
+ value={awsRegion.slug}
+ key={`aws-environment-${awsRegion.slug}`}
>
- {key.alias}
+ {awsRegion.name} <Badge variant="neutral">{awsRegion.slug}</Badge>
</SelectItem>
- );
- })
- ) : (
- <div />
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field className="mb-4" data-invalid={pathErrorText !== ""}>
+ <FieldLabel htmlFor="awsparameterstore-path">Path</FieldLabel>
+ <Input
+ placeholder={`/${currentProject.name
+ .toLowerCase()
+ .replace(/ /g, "-")}/${selectedSourceEnvironment}/`}
+ value={path}
+ onChange={(e) => setPath(e.target.value)}
+ id="awsparameterstore-path"
+ isError={pathErrorText !== ""}
+ aria-describedby={
+ pathErrorText !== "" ? "awsparameterstore-path-error" : undefined
+ }
+ />
+ {pathErrorText !== "" && (
+ <FieldError id="awsparameterstore-path-error">{pathErrorText}</FieldError>
)}
- </Select>
- </FormControl>
- </motion.div>
- </TabPanel>
- </Tabs>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto"
- isLoading={isLoading}
- >
- Create Integration
- </Button>
+ </Field>
+ </motion.div>
+ </TabsContent>
+ <TabsContent value={TabSections.Options}>
+ <motion.div
+ key="panel-1"
+ transition={{ duration: 0.15 }}
+ initial={{ opacity: 0, translateX: -30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 30 }}
+ >
+ <div className="mt-2 ml-1">
+ <Field orientation="horizontal">
+ <FieldLabel htmlFor="delete-aws">
+ Disable deleting secrets in AWS Parameter Store
+ </FieldLabel>
+ <Toggle
+ id="delete-aws"
+ onCheckedChange={setShouldDisableDelete}
+ checked={shouldDisableDelete}
+ variant="project"
+ />
+ </Field>
+ </div>
+ <div className="mt-4 ml-1">
+ <Field orientation="horizontal">
+ <FieldLabel htmlFor="tag-aws">Tag in AWS Parameter Store</FieldLabel>
+ <Toggle
+ id="tag-aws"
+ onCheckedChange={setShouldTag}
+ checked={shouldTag}
+ variant="project"
+ />
+ </Field>
+ </div>
+ {shouldTag && (
+ <div className="mt-4">
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="awsparameterstore-tag-key">Tag Key</FieldLabel>
+ <Input
+ placeholder="managed-by"
+ value={tagKey}
+ onChange={(e) => setTagKey(e.target.value)}
+ id="awsparameterstore-tag-key"
+ />
+ </Field>
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="awsparameterstore-tag-value">Tag Value</FieldLabel>
+ <Input
+ placeholder="infisical"
+ value={tagValue}
+ onChange={(e) => setTagValue(e.target.value)}
+ id="awsparameterstore-tag-value"
+ />
+ </Field>
+ </div>
+ )}
+ <Field className="mt-4 mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="awsparameterstore-encryption-key">Encryption Key</FieldLabel>
+ <Select
+ value={kmsKeyId}
+ onValueChange={(e) => {
+ setKmsKeyId(e);
+ }}
+ >
+ <SelectTrigger className="w-full" id="awsparameterstore-encryption-key">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthAwsKmsKeys?.length ? (
+ integrationAuthAwsKmsKeys.map((key) => {
+ return (
+ <SelectItem value={key.id as string} key={`repo-id-${key.id}`}>
+ {key.alias}
+ </SelectItem>
+ );
+ })
+ ) : (
+ <div />
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ </motion.div>
+ </TabsContent>
+ </Tabs>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
<div className="mt-6 w-full max-w-md border-t border-border-faint" />
<div className="mt-6 flex w-full max-w-lg flex-col rounded-md border border-border-control bg-surface-raised p-4">
diff --git a/frontend/src/pages/secret-manager/integrations/AwsSecretManagerAuthorizePage/AwsSecretManagerAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/AwsSecretManagerAuthorizePage/AwsSecretManagerAuthorizePage.tsx
index 142772e1d3..16677892b3 100644
--- a/frontend/src/pages/secret-manager/integrations/AwsSecretManagerAuthorizePage/AwsSecretManagerAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AwsSecretManagerAuthorizePage/AwsSecretManagerAuthorizePage.tsx
@@ -7,16 +7,26 @@ import { useNavigate } from "@tanstack/react-router";
import { z } from "zod";
import {
+ Badge,
Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
+ ProviderIcon,
Select,
- SelectItem
-} from "@app/components/v2";
-import { ProviderIcon } from "@app/components/v3";
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -86,54 +96,65 @@ export const AWSSecretManagerAuthorizePage = () => {
<Helmet>
<title>Authorize AWS Secrets Manager Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="After adding the details below, you will be prompted to set up an integration for a particular Infisical project and environment."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
- </div>
- <span className="ml-1.5">AWS Secrets Manager Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/aws-secret-manager"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
+ <span>AWS Secrets Manager Integration</span>
+ </CardTitle>
+ <CardDescription>
+ After adding the details below, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/aws-secret-manager"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <CardBody>
- <form onSubmit={handleSubmit(handleFormSubmit)}>
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <form onSubmit={handleSubmit(handleFormSubmit)} className="flex flex-col gap-5">
+ <CardContent>
<Controller
control={control}
name="type"
defaultValue={AwsAuthType.AccessKey}
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Authentication Mode"
- errorText={error?.message}
- isError={Boolean(error)}
- >
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-type">Authentication Mode</FieldLabel>
<Select
defaultValue={field.value}
- {...field}
onValueChange={(e) => onChange(e)}
- className="w-full"
+ name={field.name}
+ disabled={field.disabled}
+ value={field.value}
>
- <SelectItem value={AwsAuthType.AccessKey}>Access Key</SelectItem>
- <SelectItem value={AwsAuthType.AssumeRole}>AWS Assume Role</SelectItem>
+ <SelectTrigger
+ className="w-full"
+ id="awssecretmanager-type"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awssecretmanager-type-error" : undefined}
+ ref={field.ref}
+ onBlur={field.onBlur}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value={AwsAuthType.AccessKey}>Access Key</SelectItem>
+ <SelectItem value={AwsAuthType.AssumeRole}>AWS Assume Role</SelectItem>
+ </SelectContent>
</Select>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-type-error">{error?.message}</FieldError>
+ )}
+ </Field>
)}
/>
{formAwsAuthTypeField === AwsAuthType.AccessKey ? (
@@ -142,31 +163,48 @@ export const AWSSecretManagerAuthorizePage = () => {
control={control}
name="accessKey"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Access Key ID"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="" {...field} />
- </FormControl>
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-accesskey">Access Key ID</FieldLabel>
+ <Input
+ placeholder=""
+ {...field}
+ id="awssecretmanager-accesskey"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awssecretmanager-accesskey-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-accesskey-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
<Controller
control={control}
name="accessSecretKey"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Secret Access Key"
- errorText={error?.message}
- isError={Boolean(error)}
- >
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-accesssecretkey">
+ Secret Access Key
+ </FieldLabel>
<Input
type="password"
autoComplete="new-password"
placeholder=""
{...field}
+ id="awssecretmanager-accesssecretkey"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-accesssecretkey-error" : undefined
+ }
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-accesssecretkey-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
</>
@@ -175,27 +213,33 @@ export const AWSSecretManagerAuthorizePage = () => {
control={control}
name="iamRoleArn"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="IAM Role ARN For Role Assumption"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="" {...field} />
- </FormControl>
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-iamrolearn">
+ IAM Role ARN For Role Assumption
+ </FieldLabel>
+ <Input
+ placeholder=""
+ {...field}
+ id="awssecretmanager-iamrolearn"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awssecretmanager-iamrolearn-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-iamrolearn-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
)}
- <Button
- type="submit"
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isLoading={formState.isSubmitting}
- >
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button type="submit" isPending={formState.isSubmitting} variant="project">
Connect to AWS Secrets Manager
</Button>
- </form>
- </CardBody>
+ </CardFooter>
+ </form>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/AwsSecretManagerConfigurePage/AwsSecretManagerConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/AwsSecretManagerConfigurePage/AwsSecretManagerConfigurePage.tsx
index 8f616ad0f5..47a13e5fc1 100644
--- a/frontend/src/pages/secret-manager/integrations/AwsSecretManagerConfigurePage/AwsSecretManagerConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AwsSecretManagerConfigurePage/AwsSecretManagerConfigurePage.tsx
@@ -14,21 +14,32 @@ import { motion } from "motion/react";
import z from "zod";
import {
+ Badge,
Button,
Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
+ ProviderIcon,
+ SecretPathInput,
Select,
+ SelectContent,
SelectItem,
- Switch,
- Tab,
- TabList,
- TabPanel,
- Tabs
-} from "@app/components/v2";
-import { SecretPathInput } from "@app/components/v2/SecretPathInput";
-import { Badge, ProviderIcon } from "@app/components/v3";
+ SelectTrigger,
+ SelectValue,
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger,
+ Toggle
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -225,344 +236,435 @@ export const AwsSecretManagerConfigurePage = () => {
<title>Set Up AWS Secrets Manager Integration</title>
</Helmet>
<form onSubmit={handleSubmit(handleButtonClick)}>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Choose which environment in Infisical you want to sync to secerts in AWS Secrets Manager."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <ProviderIcon
- icon="Amazon Web Services.png"
- height={35}
- width={35}
- alt="AWS logo"
- />
- </div>
- <span className="ml-1.5">AWS Secrets Manager Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/aws-secret-manager"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <ProviderIcon icon="Amazon Web Services.png" height={35} width={35} alt="AWS logo" />
+ <span>AWS Secrets Manager Integration</span>
+ </CardTitle>
+ <CardDescription>
+ Choose which environment in Infisical you want to sync to secerts in AWS Secrets
+ Manager.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/aws-secret-manager"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <Tabs defaultValue={TabSections.Connection} className="px-6">
- <TabList>
- <div className="flex w-full flex-row border-b border-border-control">
- <Tab value={TabSections.Connection}>Connection</Tab>
- <Tab value={TabSections.Options}>Options</Tab>
- </div>
- </TabList>
- <TabPanel value={TabSections.Connection}>
- <motion.div
- key="panel-1"
- transition={{ duration: 0.15 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 30 }}
- >
- <Controller
- control={control}
- name="sourceEnvironment"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Project Environment"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Select
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
- value={field.value}
- onValueChange={(val) => {
- field.onChange(val);
- }}
- >
- {currentProject?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="secretPath"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Secrets Path"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <SecretPathInput {...field} environment={selectedSourceEnvironment} />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="awsRegion"
- render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="AWS region"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Select
- defaultValue={field.value}
- onValueChange={(e) => onChange(e)}
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
- >
- {awsRegions.map((awsRegion) => (
- <SelectItem
- value={awsRegion.slug}
- className="flex w-full justify-between"
- key={`aws-environment-${awsRegion.slug}`}
- >
- {awsRegion.name} <Badge variant="neutral">{awsRegion.slug}</Badge>
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="mappingBehavior"
- render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Mapping Behavior"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Select
- defaultValue={field.value}
- onValueChange={(e) => {
- if (e === IntegrationMappingBehavior.MANY_TO_ONE) {
- setValue("metadataSyncMode", IntegrationMetadataSyncMode.CUSTOM);
- }
- onChange(e);
- }}
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
- >
- {mappingBehaviors.map((option) => (
- <SelectItem
- value={option.value}
- className="text-left"
- key={`mapping-behavior-${option.value}`}
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Tabs defaultValue={TabSections.Connection}>
+ <TabsList variant="project">
+ <TabsTrigger value={TabSections.Connection}>Connection</TabsTrigger>
+ <TabsTrigger value={TabSections.Options}>Options</TabsTrigger>
+ </TabsList>
+ <TabsContent value={TabSections.Connection}>
+ <motion.div
+ key="panel-1"
+ transition={{ duration: 0.15 }}
+ initial={{ opacity: 0, translateX: 30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 30 }}
+ >
+ <Controller
+ control={control}
+ name="sourceEnvironment"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-sourceenvironment">
+ Project Environment
+ </FieldLabel>
+ <Select
+ value={field.value}
+ onValueChange={(val) => {
+ field.onChange(val);
+ }}
+ >
+ <SelectTrigger
+ className="w-full"
+ id="awssecretmanager-sourceenvironment"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-sourceenvironment-error" : undefined
+ }
>
- {option.label}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
- {selectedMappingBehavior === IntegrationMappingBehavior.MANY_TO_ONE && (
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-sourceenvironment-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
<Controller
control={control}
- name="secretName"
+ name="secretPath"
render={({ field, fieldState: { error } }) => (
- <FormControl
- label="AWS SM Secret Name"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input
- placeholder={`${currentProject.name
- .toLowerCase()
- .replace(/ /g, "-")}/${selectedSourceEnvironment}`}
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-secretpath">Secrets Path</FieldLabel>
+ <SecretPathInput
{...field}
+ environment={selectedSourceEnvironment}
+ id="awssecretmanager-secretpath"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awssecretmanager-secretpath-error" : undefined}
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-secretpath-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
- )}
- </motion.div>
- </TabPanel>
- <TabPanel value={TabSections.Options}>
- <motion.div
- key="panel-1"
- transition={{ duration: 0.15 }}
- initial={{ opacity: 0, translateX: -30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 30 }}
- >
- <div className="mt-2 mb-3 ml-1">
<Controller
control={control}
- name="shouldTag"
- render={({ field: { onChange, value } }) => (
- <Switch
- id="tag-aws"
- onCheckedChange={(isChecked) => {
- if (
- isChecked &&
- selectedMappingBehavior === IntegrationMappingBehavior.ONE_TO_ONE
- ) {
- setValue(
- "metadataSyncMode",
- IntegrationMetadataSyncMode.SECRET_METADATA
- );
- }
- onChange(isChecked);
- }}
- isChecked={value}
- >
- Tag in AWS Secrets Manager
- </Switch>
+ name="awsRegion"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-awsregion">AWS region</FieldLabel>
+ <Select defaultValue={field.value} onValueChange={(e) => onChange(e)}>
+ <SelectTrigger
+ className="w-full"
+ id="awssecretmanager-awsregion"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-awsregion-error" : undefined
+ }
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {awsRegions.map((awsRegion) => (
+ <SelectItem
+ value={awsRegion.slug}
+ key={`aws-environment-${awsRegion.slug}`}
+ >
+ {awsRegion.name} <Badge variant="neutral">{awsRegion.slug}</Badge>
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-awsregion-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
- </div>
- {shouldTagState &&
- selectedMappingBehavior === IntegrationMappingBehavior.ONE_TO_ONE && (
- <Controller
- control={control}
- name="metadataSyncMode"
- render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Tag Sync Mode"
- errorText={error?.message}
- isError={Boolean(error)}
+ <Controller
+ control={control}
+ name="mappingBehavior"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-mappingbehavior">
+ Mapping Behavior
+ </FieldLabel>
+ <Select
+ defaultValue={field.value}
+ onValueChange={(e) => {
+ if (e === IntegrationMappingBehavior.MANY_TO_ONE) {
+ setValue("metadataSyncMode", IntegrationMetadataSyncMode.CUSTOM);
+ }
+ onChange(e);
+ }}
>
- <Select
- defaultValue={field.value}
- onValueChange={(e) => {
- setValue("tags", []);
- onChange(e);
- }}
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
+ <SelectTrigger
+ className="w-full"
+ id="awssecretmanager-mappingbehavior"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-mappingbehavior-error" : undefined
+ }
>
- <SelectItem
- value={IntegrationMetadataSyncMode.SECRET_METADATA}
- className="text-left"
- key={`sync-mode-${IntegrationMetadataSyncMode.SECRET_METADATA}`}
- >
- Secret Metadata
- </SelectItem>
- <SelectItem
- value={IntegrationMetadataSyncMode.CUSTOM}
- className="text-left"
- key={`sync-mode-${IntegrationMetadataSyncMode.CUSTOM}`}
- >
- Custom
- </SelectItem>
- </Select>
- </FormControl>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {mappingBehaviors.map((option) => (
+ <SelectItem
+ value={option.value}
+ key={`mapping-behavior-${option.value}`}
+ >
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-mappingbehavior-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ {selectedMappingBehavior === IntegrationMappingBehavior.MANY_TO_ONE && (
+ <Controller
+ control={control}
+ name="secretName"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-secretname">
+ AWS SM Secret Name
+ </FieldLabel>
+ <Input
+ placeholder={`${currentProject.name
+ .toLowerCase()
+ .replace(/ /g, "-")}/${selectedSourceEnvironment}`}
+ {...field}
+ id="awssecretmanager-secretname"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-secretname-error" : undefined
+ }
+ />
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-secretname-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
)}
- {shouldTagState &&
- selectedMetadataSyncMode === IntegrationMetadataSyncMode.CUSTOM && (
- <div className="mt-4 flex justify-between">
+ </motion.div>
+ </TabsContent>
+ <TabsContent value={TabSections.Options}>
+ <motion.div
+ key="panel-1"
+ transition={{ duration: 0.15 }}
+ initial={{ opacity: 0, translateX: -30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 30 }}
+ >
+ <div className="mt-2 mb-3 ml-1">
+ <Controller
+ control={control}
+ name="shouldTag"
+ render={({ field: { onChange, value } }) => (
+ <Field orientation="horizontal">
+ <FieldLabel htmlFor="tag-aws">Tag in AWS Secrets Manager</FieldLabel>
+ <Toggle
+ id="tag-aws"
+ onCheckedChange={(isChecked) => {
+ if (
+ isChecked &&
+ selectedMappingBehavior === IntegrationMappingBehavior.ONE_TO_ONE
+ ) {
+ setValue(
+ "metadataSyncMode",
+ IntegrationMetadataSyncMode.SECRET_METADATA
+ );
+ }
+ onChange(isChecked);
+ }}
+ checked={value}
+ variant="project"
+ />
+ </Field>
+ )}
+ />
+ </div>
+ {shouldTagState &&
+ selectedMappingBehavior === IntegrationMappingBehavior.ONE_TO_ONE && (
<Controller
control={control}
- name="tags.0.key"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Tag Key"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="managed-by" {...field} />
- </FormControl>
+ name="metadataSyncMode"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-metadatasyncmode">
+ Tag Sync Mode
+ </FieldLabel>
+ <Select
+ defaultValue={field.value}
+ onValueChange={(e) => {
+ setValue("tags", []);
+ onChange(e);
+ }}
+ >
+ <SelectTrigger
+ className="w-full"
+ id="awssecretmanager-metadatasyncmode"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-metadatasyncmode-error" : undefined
+ }
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem
+ value={IntegrationMetadataSyncMode.SECRET_METADATA}
+ key={`sync-mode-${IntegrationMetadataSyncMode.SECRET_METADATA}`}
+ >
+ Secret Metadata
+ </SelectItem>
+ <SelectItem
+ value={IntegrationMetadataSyncMode.CUSTOM}
+ key={`sync-mode-${IntegrationMetadataSyncMode.CUSTOM}`}
+ >
+ Custom
+ </SelectItem>
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-metadatasyncmode-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
- <Controller
- control={control}
- name="tags.0.value"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Tag Value"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="infisical" {...field} />
- </FormControl>
+ )}
+ {shouldTagState &&
+ selectedMetadataSyncMode === IntegrationMetadataSyncMode.CUSTOM && (
+ <div className="mt-4 flex justify-between">
+ <Controller
+ control={control}
+ name="tags.0.key"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-tags-0-key">Tag Key</FieldLabel>
+ <Input
+ placeholder="managed-by"
+ {...field}
+ id="awssecretmanager-tags-0-key"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-tags-0-key-error" : undefined
+ }
+ />
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-tags-0-key-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="tags.0.value"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-tags-0-value">
+ Tag Value
+ </FieldLabel>
+ <Input
+ placeholder="infisical"
+ {...field}
+ id="awssecretmanager-tags-0-value"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-tags-0-value-error" : undefined
+ }
+ />
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-tags-0-value-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ </div>
+ )}
+ <Controller
+ control={control}
+ name="secretPrefix"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mt-4 mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-secretprefix">
+ Secret Prefix
+ </FieldLabel>
+ <Input
+ placeholder="INFISICAL_"
+ {...field}
+ id="awssecretmanager-secretprefix"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "awssecretmanager-secretprefix-error" : undefined
+ }
+ />
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-secretprefix-error">
+ {error?.message}
+ </FieldError>
)}
- />
- </div>
- )}
- <Controller
- control={control}
- name="secretPrefix"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Secret Prefix"
- errorText={error?.message}
- isError={Boolean(error)}
- className="mt-4"
- >
- <Input placeholder="INFISICAL_" {...field} />
- </FormControl>
- )}
- />
+ </Field>
+ )}
+ />
- <Controller
- control={control}
- name="kmsKeyId"
- render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Encryption Key"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Select
- defaultValue={field.value}
- onValueChange={(e) => onChange(e)}
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
- >
- {integrationAuthAwsKmsKeys?.length ? (
- integrationAuthAwsKmsKeys.map((key) => {
- return (
- <SelectItem
- value={key.id as string}
- key={`repo-id-${key.id}`}
- className="w-[28.4rem] text-sm"
- >
- {key.alias}
+ <Controller
+ control={control}
+ name="kmsKeyId"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="awssecretmanager-kmskeyid">Encryption Key</FieldLabel>
+ <Select defaultValue={field.value} onValueChange={(e) => onChange(e)}>
+ <SelectTrigger
+ className="w-full"
+ id="awssecretmanager-kmskeyid"
+ isError={Boolean(error)}
+ aria-describedby={error ? "awssecretmanager-kmskeyid-error" : undefined}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthAwsKmsKeys?.length ? (
+ integrationAuthAwsKmsKeys.map((key) => {
+ return (
+ <SelectItem value={key.id as string} key={`repo-id-${key.id}`}>
+ {key.alias}
+ </SelectItem>
+ );
+ })
+ ) : (
+ <SelectItem disabled value="no-keys" key="no-keys">
+ No KMS keys available
</SelectItem>
- );
- })
- ) : (
- <SelectItem isDisabled value="no-keys" key="no-keys">
- No KMS keys available
- </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="awssecretmanager-kmskeyid-error">
+ {error?.message}
+ </FieldError>
)}
- </Select>
- </FormControl>
- )}
- />
- </motion.div>
- </TabPanel>
- </Tabs>
- <Button
- colorSchema="secondary"
- variant="outline_bg"
- type="submit"
- className="mt-2 mr-6 mb-6 ml-auto"
- isLoading={isSubmitting}
- >
- Create Integration
- </Button>
+ </Field>
+ )}
+ />
+ </motion.div>
+ </TabsContent>
+ </Tabs>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button type="submit" isPending={isSubmitting} variant="project">
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
<div className="mt-6 w-full max-w-md border-t border-border-faint" />
<div className="mt-6 flex w-full max-w-lg flex-col rounded-md border border-border-control bg-surface-raised p-4">
diff --git a/frontend/src/pages/secret-manager/integrations/AzureAppConfigurationConfigurePage/AzureAppConfigurationConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/AzureAppConfigurationConfigurePage/AzureAppConfigurationConfigurePage.tsx
index 9efac8b015..e2265a96fc 100644
--- a/frontend/src/pages/secret-manager/integrations/AzureAppConfigurationConfigurePage/AzureAppConfigurationConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AzureAppConfigurationConfigurePage/AzureAppConfigurationConfigurePage.tsx
@@ -9,17 +9,27 @@ import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import {
+ Badge,
Button,
Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
- FormLabel,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
+ SecretPathInput,
Select,
+ SelectContent,
SelectItem,
- Switch
-} from "@app/components/v2";
-import { SecretPathInput } from "@app/components/v2/SecretPathInput";
+ SelectTrigger,
+ SelectValue,
+ Toggle
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -153,176 +163,234 @@ export const AzureAppConfigurationConfigurePage = () => {
<Helmet>
<title>Set Up Azure App Configuration Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="text-left text-xl"
- subTitle="Choose which environment in Infisical you want to sync to your Azure App Configuration."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <img
- src="/images/integrations/Microsoft Azure.png"
- height={35}
- width={35}
- alt="Azure logo"
- />
- </div>
- <span className="ml-1.5">Azure App Configuration</span>
- <a
- href="https://infisical.com/docs/integrations/cloud/azure-app-configuration"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
- Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <div className="px-6">
- <div className="">
- <Controller
- control={control}
- name="sourceEnvironment"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Project Environment"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Select
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
- value={field.value}
- onValueChange={(val) => {
- field.onChange(val);
- }}
- >
- {workspace?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/Microsoft Azure.png"
+ height={35}
+ width={35}
+ alt="Azure logo"
/>
-
- <div className="mb-2 flex w-full flex-col gap-1">
+ <span>Azure App Configuration</span>
+ </CardTitle>
+ <CardDescription>
+ Choose which environment in Infisical you want to sync to your Azure App Configuration.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/azure-app-configuration"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
+ Docs
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <div>
+ <div className="">
<Controller
control={control}
- name="useLabels"
- render={({ field: { onChange, value } }) => (
- <Switch
- id="use-environment-labels"
- onCheckedChange={(isChecked) => onChange(isChecked)}
- isChecked={value}
- >
- <FormLabel label="Use Labels" />
- </Switch>
+ name="sourceEnvironment"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="azureappconfiguration-sourceenvironment">
+ Project Environment
+ </FieldLabel>
+ <Select
+ value={field.value}
+ onValueChange={(val) => {
+ field.onChange(val);
+ }}
+ >
+ <SelectTrigger
+ className="w-full"
+ id="azureappconfiguration-sourceenvironment"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "azureappconfiguration-sourceenvironment-error" : undefined
+ }
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {workspace?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="azureappconfiguration-sourceenvironment-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
- {shouldUseLabels && (
+ <div className="mb-2 flex w-full flex-col gap-1">
<Controller
control={control}
- name="azureLabel"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- className=""
- // label="Label"
- errorText={error?.message}
+ name="useLabels"
+ render={({ field: { onChange, value } }) => (
+ <Field orientation="horizontal">
+ <FieldLabel htmlFor="use-environment-labels">Use Labels</FieldLabel>
+ <Toggle
+ id="use-environment-labels"
+ onCheckedChange={(isChecked) => onChange(isChecked)}
+ checked={value}
+ variant="project"
+ />
+ </Field>
+ )}
+ />
+
+ {shouldUseLabels && (
+ <Controller
+ control={control}
+ name="azureLabel"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <Input
+ {...field}
+ placeholder="pre-prod"
+ id="azureappconfiguration-azurelabel"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "azureappconfiguration-azurelabel-error" : undefined
+ }
+ />
+ {Boolean(error) && (
+ <FieldError id="azureappconfiguration-azurelabel-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ )}
+ </div>
+ </div>
+ <Controller
+ control={control}
+ name="secretPath"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="azureappconfiguration-secretpath">Secrets Path</FieldLabel>
+ <SecretPathInput
+ {...field}
+ environment={selectedEnvironment}
+ id="azureappconfiguration-secretpath"
+ isError={Boolean(error)}
+ aria-describedby={error ? "azureappconfiguration-secretpath-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="azureappconfiguration-secretpath-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="baseUrl"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="azureappconfiguration-baseurl">
+ Azure App Configuration URL
+ </FieldLabel>
+ <Input
+ placeholder="https://infisical-configuration-integration-test.azconfig.io"
+ {...field}
+ id="azureappconfiguration-baseurl"
+ isError={Boolean(error)}
+ aria-describedby={error ? "azureappconfiguration-baseurl-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="azureappconfiguration-baseurl-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="secretPrefix"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="azureappconfiguration-secretprefix">Key Prefix</FieldLabel>
+ <Input
+ {...field}
+ id="azureappconfiguration-secretprefix"
+ isError={Boolean(error)}
+ aria-describedby={
+ error ? "azureappconfiguration-secretprefix-error" : undefined
+ }
+ />
+ {Boolean(error) && (
+ <FieldError id="azureappconfiguration-secretprefix-error">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="initialSyncBehavior"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="azureappconfiguration-initialsyncbehavior">
+ Initial Sync Behavior
+ </FieldLabel>
+ <Select defaultValue={field.value} onValueChange={(e) => onChange(e)}>
+ <SelectTrigger
+ className="w-full"
+ id="azureappconfiguration-initialsyncbehavior"
isError={Boolean(error)}
+ aria-describedby={
+ error ? "azureappconfiguration-initialsyncbehavior-error" : undefined
+ }
>
- <Input {...field} placeholder="pre-prod" />
- </FormControl>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {initialSyncBehaviors.map((b) => {
+ return (
+ <SelectItem value={b.value} key={`sync-behavior-${b.value}`}>
+ {b.label}
+ </SelectItem>
+ );
+ })}
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="azureappconfiguration-initialsyncbehavior-error">
+ {error?.message}
+ </FieldError>
)}
- />
+ </Field>
)}
- </div>
+ />
</div>
- <Controller
- control={control}
- name="secretPath"
- render={({ field, fieldState: { error } }) => (
- <FormControl label="Secrets Path" errorText={error?.message} isError={Boolean(error)}>
- <SecretPathInput {...field} environment={selectedEnvironment} />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="baseUrl"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Azure App Configuration URL"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input
- placeholder="https://infisical-configuration-integration-test.azconfig.io"
- {...field}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="secretPrefix"
- render={({ field, fieldState: { error } }) => (
- <FormControl label="Key Prefix" errorText={error?.message} isError={Boolean(error)}>
- <Input {...field} />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="initialSyncBehavior"
- render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Initial Sync Behavior"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Select
- defaultValue={field.value}
- onValueChange={(e) => onChange(e)}
- className="w-full border border-border-strong"
- dropdownContainerClassName="max-w-full"
- >
- {initialSyncBehaviors.map((b) => {
- return (
- <SelectItem
- value={b.value}
- key={`sync-behavior-${b.value}`}
- className="w-full"
- >
- {b.label}
- </SelectItem>
- );
- })}
- </Select>
- </FormControl>
- )}
- />
- <Button
- type="submit"
- colorSchema="secondary"
- variant="outline_bg"
- className="mt-4 mb-6 ml-auto"
- isLoading={isSubmitting}
- >
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button type="submit" isPending={isSubmitting} variant="project">
Create Integration
</Button>
- </div>
+ </CardFooter>
</Card>
</form>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/AzureDevopsAuthorizePage/AzureDevopsAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/AzureDevopsAuthorizePage/AzureDevopsAuthorizePage.tsx
index fa0ddd07f0..e4aaf0e615 100644
--- a/frontend/src/pages/secret-manager/integrations/AzureDevopsAuthorizePage/AzureDevopsAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AzureDevopsAuthorizePage/AzureDevopsAuthorizePage.tsx
@@ -4,7 +4,24 @@ import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-sv
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Badge,
+ Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -36,8 +53,6 @@ export const AzureDevopsAuthorizePage = () => {
accessToken: btoa(`:${apiKey}`) // This is a base64 encoding of the API key without any username
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-devops/create",
params: {
@@ -50,6 +65,8 @@ export const AzureDevopsAuthorizePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
@@ -58,67 +75,95 @@ export const AzureDevopsAuthorizePage = () => {
<Helmet>
<title>Authorize Azure DevOps Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="After adding the details below, you will be prompted to set up an integration for a particular Infisical project and environment."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <img
- src="/images/integrations/Microsoft Azure.png"
- height={35}
- width={35}
- alt="Azure DevOps logo"
- />
- </div>
- <span className="ml-1.5">Azure DevOps Integration </span>
- <a
- target="_blank"
- href="https://infisical.com/docs/integrations/cloud/azure-devops"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/Microsoft Azure.png"
+ height={35}
+ width={35}
+ alt="Azure DevOps logo"
+ />
+ <span>Azure DevOps Integration</span>
+ </CardTitle>
+ <CardDescription>
+ After adding the details below, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ target="_blank"
+ href="https://infisical.com/docs/integrations/cloud/azure-devops"
+ rel="noopener noreferrer"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>{" "}
- <FormControl
- className="px-6"
- label="Azure DevOps API Token"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- >
- <Input placeholder="" value={apiKey} onChange={(e) => setApiKey(e.target.value)} />
- </FormControl>
- <FormControl
- className="px-6"
- label="Azure DevOps Organization Name"
- tooltipText="This is the slug of the organization. An example would be 'my-acme-org'"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- >
- <Input
- placeholder=""
- value={devopsOrgName}
- onChange={(e) => setDevopsOrgName(e.target.value)}
- />
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isLoading={isLoading}
- >
- Connect to Azure DevOps
- </Button>
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ {" "}
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="azuredevops-azure-devops-api-token">
+ Azure DevOps API Token
+ </FieldLabel>
+ <Input
+ placeholder=""
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ id="azuredevops-azure-devops-api-token"
+ isError={apiKeyErrorText !== ""}
+ aria-describedby={
+ apiKeyErrorText !== "" ? "azuredevops-azure-devops-api-token-error" : undefined
+ }
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="azuredevops-azure-devops-api-token-error">
+ {apiKeyErrorText}
+ </FieldError>
+ )}
+ </Field>
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="azuredevops-azure-devops-organization-name">
+ Azure DevOps Organization Name
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button type="button" aria-label="More information">
+ ?
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ This is the slug of the organization. An example would be &apos;my-acme-org&apos;
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ placeholder=""
+ value={devopsOrgName}
+ onChange={(e) => setDevopsOrgName(e.target.value)}
+ id="azuredevops-azure-devops-organization-name"
+ isError={apiKeyErrorText !== ""}
+ aria-describedby={
+ apiKeyErrorText !== ""
+ ? "azuredevops-azure-devops-organization-name-error"
+ : undefined
+ }
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="azuredevops-azure-devops-organization-name-error">
+ {apiKeyErrorText}
+ </FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Azure DevOps
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/AzureDevopsConfigurePage/AzureDevopsConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/AzureDevopsConfigurePage/AzureDevopsConfigurePage.tsx
index 45f21e7ab4..ed1b395641 100644
--- a/frontend/src/pages/secret-manager/integrations/AzureDevopsConfigurePage/AzureDevopsConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AzureDevopsConfigurePage/AzureDevopsConfigurePage.tsx
@@ -5,14 +5,24 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate, useSearch } from "@tanstack/react-router";
import {
+ Badge,
Button,
Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldLabel,
Input,
Select,
- SelectItem
-} from "@app/components/v2";
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -77,8 +87,6 @@ export const AzureDevopsConfigurePage = () => {
secretPath
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -91,6 +99,8 @@ export const AzureDevopsConfigurePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
@@ -103,92 +113,99 @@ export const AzureDevopsConfigurePage = () => {
<Helmet>
<title>Set Up Azure DevOps Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Choose which environment in Infisical you want to sync to secrets in Azure DevOps."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <img
- src="/images/integrations/Microsoft Azure.png"
- height={35}
- width={35}
- alt="Azure DevOps logo"
- />
- </div>
- <span className="ml-1.5">Azure DevOps Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/azure-devops"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
- Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <FormControl label="Project Environment" className="mt-4 px-6">
- <Select
- value={selectedSourceEnvironment}
- onValueChange={(val) => setSelectedSourceEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {workspace?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/Microsoft Azure.png"
+ height={35}
+ width={35}
+ alt="Azure DevOps logo"
+ />
+ <span>Azure DevOps Integration</span>
+ </CardTitle>
+ <CardDescription>
+ Choose which environment in Infisical you want to sync to secrets in Azure DevOps.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/azure-devops"
+ target="_blank"
+ rel="noopener noreferrer"
>
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl className="px-6" label="Secrets Path">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl label="Azure DevOps Project" className="px-6">
- <Select
- value={targetApp}
- onValueChange={(val) => setTargetApp(val)}
- className="w-full border border-border-strong"
- isDisabled={integrationAuthApps.length === 0}
- >
- {integrationAuthApps.length > 0 ? (
- integrationAuthApps.map((integrationAuthApp) => (
- <SelectItem
- value={integrationAuthApp.name}
- key={`target-environment-${integrationAuthApp.name}`}
- >
- {integrationAuthApp.name}
- </SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-app-none">
- No projects found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isLoading={isLoading}
- >
- Create Integration
- </Button>
+ <FontAwesomeIcon icon={faBookOpen} />
+ Docs
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Field className="mt-4" data-invalid={false}>
+ <FieldLabel htmlFor="azuredevops-project-environment">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger className="w-full" id="azuredevops-project-environment">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {workspace?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field data-invalid={false}>
+ <FieldLabel htmlFor="azuredevops-secrets-path">Secrets Path</FieldLabel>
+ <Input
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ id="azuredevops-secrets-path"
+ />
+ </Field>
+ <Field data-invalid={false}>
+ <FieldLabel htmlFor="azuredevops-azure-devops-project">Azure DevOps Project</FieldLabel>
+ <Select
+ value={targetApp}
+ onValueChange={(val) => setTargetApp(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger className="w-full" id="azuredevops-azure-devops-project">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthApps.length > 0 ? (
+ integrationAuthApps.map((integrationAuthApp) => (
+ <SelectItem
+ value={integrationAuthApp.name}
+ key={`target-environment-${integrationAuthApp.name}`}
+ >
+ {integrationAuthApp.name}
+ </SelectItem>
+ ))
+ ) : (
+ <SelectItem value="none" key="target-app-none">
+ No projects found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/AzureKeyVaultAuthorizePage/AzureKeyVaultAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/AzureKeyVaultAuthorizePage/AzureKeyVaultAuthorizePage.tsx
index eb11c5b558..944b32e955 100644
--- a/frontend/src/pages/secret-manager/integrations/AzureKeyVaultAuthorizePage/AzureKeyVaultAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AzureKeyVaultAuthorizePage/AzureKeyVaultAuthorizePage.tsx
@@ -6,7 +6,21 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useSearch } from "@tanstack/react-router";
import z from "zod";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Badge,
+ Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
const schema = z.object({
@@ -40,60 +54,61 @@ export function AzureKeyVaultAuthorizePage() {
<title>Authorize Azure Key Vault Integration</title>
<link rel="icon" href="/infisical.ico" />
</Helmet>
- <Card className="mb-12 max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Authenticate with a specific tenant ID or let OAuth handle it automatically."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img
- src="/images/integrations/Microsoft Azure.png"
- height={30}
- width={30}
- alt="Azure Key Vault logo"
- />
- </div>
- <span className="ml-2.5">Azure Key Vault Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/azure-key-vault"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
- Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <form onSubmit={handleSubmit(onFormSubmit)} className="px-6 pb-8 text-right">
- <Controller
- control={control}
- name="tenantId"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Tenant ID (optional)"
- errorText={error?.message}
- isError={Boolean(error)}
+ <Card className="mb-12 w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/Microsoft Azure.png"
+ height={30}
+ width={30}
+ alt="Azure Key Vault logo"
+ />
+ <span>Azure Key Vault Integration</span>
+ </CardTitle>
+ <CardDescription>
+ Authenticate with a specific tenant ID or let OAuth handle it automatically.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/azure-key-vault"
+ target="_blank"
+ rel="noopener noreferrer"
>
- <Input {...field} placeholder="2e39537c-9a01-4bd6-a7b8-c3b88cbb8db9" />
- </FormControl>
- )}
- />
- <Button
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 w-min"
- size="sm"
- type="submit"
- >
- Connect to Azure Key Vault
- </Button>
+ <FontAwesomeIcon icon={faBookOpen} />
+ Docs
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <form onSubmit={handleSubmit(onFormSubmit)} className="flex flex-col gap-5">
+ <CardContent>
+ <Controller
+ control={control}
+ name="tenantId"
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4" data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="azurekeyvault-tenantid">Tenant ID (optional)</FieldLabel>
+ <Input
+ {...field}
+ placeholder="2e39537c-9a01-4bd6-a7b8-c3b88cbb8db9"
+ id="azurekeyvault-tenantid"
+ isError={Boolean(error)}
+ aria-describedby={error ? "azurekeyvault-tenantid-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="azurekeyvault-tenantid-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button size="sm" type="submit" variant="project">
+ Connect to Azure Key Vault
+ </Button>
+ </CardFooter>
</form>
</Card>
</div>
diff --git a/frontend/src/pages/secret-manager/integrations/AzureKeyVaultConfigurePage/AzureKeyVaultConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/AzureKeyVaultConfigurePage/AzureKeyVaultConfigurePage.tsx
index 28d71c7596..5e6c7704b9 100644
--- a/frontend/src/pages/secret-manager/integrations/AzureKeyVaultConfigurePage/AzureKeyVaultConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/AzureKeyVaultConfigurePage/AzureKeyVaultConfigurePage.tsx
@@ -4,12 +4,20 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
import {
Button,
Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
Select,
- SelectItem
-} from "@app/components/v2";
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -85,7 +93,6 @@ export const AzureKeyVaultConfigurePage = () => {
initialSyncBehavior
}
});
- setIsLoading(false);
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
@@ -99,70 +106,92 @@ export const AzureKeyVaultConfigurePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
return integrationAuth && workspace && selectedSourceEnvironment ? (
<div className="flex h-full w-full items-center justify-center">
- <Card className="max-w-md rounded-md p-8">
- <CardTitle className="text-center">Azure Key Vault Integration</CardTitle>
- <FormControl label="Project Environment" className="mt-4">
- <Select
- value={selectedSourceEnvironment}
- onValueChange={(val) => setSelectedSourceEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {workspace?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`azure-key-vault-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl
- label="Vault URI"
- errorText={vaultBaseUrlErrorText}
- isError={vaultBaseUrlErrorText !== ""}
- >
- <Input
- placeholder="https://example.vault.azure.net"
- value={vaultBaseUrl}
- onChange={(e) => setVaultBaseUrl(e.target.value)}
- />
- </FormControl>
- <FormControl label="Initial Sync Behavior">
- <Select
- value={initialSyncBehavior}
- onValueChange={(e) => setInitialSyncBehavior(e as IntegrationSyncBehavior)}
- className="w-full"
- >
- {initialSyncBehaviors.map((b) => {
- return (
- <SelectItem value={b.value} key={`sync-behavior-${b.value}`}>
- {b.label}
- </SelectItem>
- );
- })}
- </Select>
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- className="mt-4"
- isLoading={isLoading}
- >
- Create Integration
- </Button>
+ <Card className="w-full max-w-md">
+ <CardHeader>
+ <CardTitle>Azure Key Vault Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Field className="mt-4" data-invalid={false}>
+ <FieldLabel htmlFor="azurekeyvault-project-environment">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger className="w-full" id="azurekeyvault-project-environment">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {workspace?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`azure-key-vault-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field data-invalid={false}>
+ <FieldLabel htmlFor="azurekeyvault-secrets-path">Secrets Path</FieldLabel>
+ <Input
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ id="azurekeyvault-secrets-path"
+ />
+ </Field>
+ <Field data-invalid={vaultBaseUrlErrorText !== ""}>
+ <FieldLabel htmlFor="azurekeyvault-vault-uri">Vault URI</FieldLabel>
+ <Input
+ placeholder="https://example.vault.azure.net"
+ value={vaultBaseUrl}
+ onChange={(e) => setVaultBaseUrl(e.target.value)}
+ id="azurekeyvault-vault-uri"
+ isError={vaultBaseUrlErrorText !== ""}
+ aria-describedby={
+ vaultBaseUrlErrorText !== "" ? "azurekeyvault-vault-uri-error" : undefined
+ }
+ />
+ {vaultBaseUrlErrorText !== "" && (
+ <FieldError id="azurekeyvault-vault-uri-error">{vaultBaseUrlErrorText}</FieldError>
+ )}
+ </Field>
+ <Field data-invalid={false}>
+ <FieldLabel htmlFor="azurekeyvault-initial-sync-behavior">
+ Initial Sync Behavior
+ </FieldLabel>
+ <Select
+ value={initialSyncBehavior}
+ onValueChange={(e) => setInitialSyncBehavior(e as IntegrationSyncBehavior)}
+ >
+ <SelectTrigger className="w-full" id="azurekeyvault-initial-sync-behavior">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {initialSyncBehaviors.map((b) => {
+ return (
+ <SelectItem value={b.value} key={`sync-behavior-${b.value}`}>
+ {b.label}
+ </SelectItem>
+ );
+ })}
+ </SelectContent>
+ </Select>
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="outline">
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/BitbucketConfigurePage/BitbucketConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/BitbucketConfigurePage/BitbucketConfigurePage.tsx
index 7d22d16a34..458086023e 100644
--- a/frontend/src/pages/secret-manager/integrations/BitbucketConfigurePage/BitbucketConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/BitbucketConfigurePage/BitbucketConfigurePage.tsx
@@ -6,8 +6,20 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
-import { Button, Card, CardTitle, FilterableSelect, FormControl, Input } from "@app/components/v2";
-import { Spinner } from "@app/components/v3";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Combobox,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ Spinner
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import {
@@ -184,149 +196,192 @@ export const BitbucketConfigurePage = () => {
onSubmit={handleSubmit(onSubmit)}
className="flex h-full w-full items-center justify-center"
>
- <Card className="max-w-md rounded-md p-8 pt-4">
- <CardTitle className="text-center">
- <SiBitbucket size="1.2rem" className="mr-2 mb-1 inline-block" />
- Bitbucket Integration
- </CardTitle>
- <Controller
- control={control}
- name="sourceEnvironment"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="Project Environment"
- >
- <FilterableSelect
- getOptionValue={(option) => option.slug}
- value={value}
- getOptionLabel={(option) => option.name}
- onChange={onChange}
- options={currentProject?.environments}
- placeholder="Select a project environment"
- isDisabled={!currentProject?.environments.length}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="secretPath"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl isError={Boolean(error)} label="Secrets Path">
- <Input
- value={value}
- onChange={onChange}
- placeholder='Provide a path (defaults to "/")'
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="targetWorkspace"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="Bitbucket Workspace"
- >
- <FilterableSelect
- getOptionValue={(option) => option.slug}
- value={value}
- getOptionLabel={(option) => option.name}
- onChange={(option) => {
- onChange(option);
- setValue("targetRepo", null);
- setValue("targetEnvironment", null);
- }}
- options={bitbucketWorkspaces}
- placeholder={
- bitbucketWorkspaces?.length ? "Select a workspace..." : "No workspaces found..."
- }
- isLoading={isBitbucketWorkspacesLoading}
- isDisabled={!bitbucketWorkspaces?.length || isBitbucketWorkspacesLoading}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="targetRepo"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl errorText={error?.message} isError={Boolean(error)} label="Bitbucket Repo">
- <FilterableSelect
- getOptionValue={(option) => option.appId!}
- value={value}
- getOptionLabel={(option) => option.name}
- onChange={(option) => {
- onChange(option);
- setValue("targetEnvironment", null);
- }}
- options={bitbucketRepos}
- placeholder={
- bitbucketRepos?.length ? "Select a repository..." : "No repositories found..."
- }
- isLoading={isBitbucketReposLoading}
- isDisabled={!bitbucketRepos?.length || isBitbucketReposLoading}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="scope"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl errorText={error?.message} isError={Boolean(error)} label="Scope">
- <FilterableSelect
- value={value}
- getOptionValue={(option) => option.value}
- getOptionLabel={(option) => option.label}
- onChange={onChange}
- options={ScopeOptions}
- />
- </FormControl>
- )}
- />
-
- {scope?.value === BitbucketScope.Env && (
+ <Card className="w-full max-w-md">
+ <CardHeader>
+ <CardTitle>
+ <SiBitbucket size="1.2rem" className="mr-2 mb-1 inline-block" />
+ Bitbucket Integration
+ </CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
<Controller
control={control}
- name="targetEnvironment"
+ name="sourceEnvironment"
render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="Bitbucket Deployment Environment"
- >
- <FilterableSelect
- getOptionValue={(option) => option.uuid}
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="bitbucket-sourceenvironment">Project Environment</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ getOptionValue={(option) => option.slug}
value={value}
getOptionLabel={(option) => option.name}
+ onValueChange={onChange}
+ options={currentProject?.environments}
+ placeholder="Select a project environment"
+ isDisabled={!currentProject?.environments.length}
+ id="bitbucket-sourceenvironment"
+ isError={Boolean(error)}
+ aria-describedby={error ? "bitbucket-sourceenvironment-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="bitbucket-sourceenvironment-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="secretPath"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="bitbucket-secretpath">Secrets Path</FieldLabel>
+ <Input
+ value={value}
onChange={onChange}
- options={bitbucketEnvironments}
+ placeholder='Provide a path (defaults to "/")'
+ id="bitbucket-secretpath"
+ isError={Boolean(error)}
+ aria-describedby={error ? "bitbucket-secretpath-error" : undefined}
+ />
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="targetWorkspace"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="bitbucket-targetworkspace">Bitbucket Workspace</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ getOptionValue={(option) => option.slug}
+ value={value}
+ getOptionLabel={(option) => option.name}
+ onValueChange={(option) => {
+ onChange(option);
+ setValue("targetRepo", null);
+ setValue("targetEnvironment", null);
+ }}
+ options={bitbucketWorkspaces}
+ placeholder={
+ bitbucketWorkspaces?.length ? "Select a workspace..." : "No workspaces found..."
+ }
+ isLoading={isBitbucketWorkspacesLoading}
+ isDisabled={!bitbucketWorkspaces?.length || isBitbucketWorkspacesLoading}
+ id="bitbucket-targetworkspace"
+ isError={Boolean(error)}
+ aria-describedby={error ? "bitbucket-targetworkspace-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="bitbucket-targetworkspace-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="targetRepo"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="bitbucket-targetrepo">Bitbucket Repo</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ getOptionValue={(option) => option.appId!}
+ value={value}
+ getOptionLabel={(option) => option.name}
+ onValueChange={(option) => {
+ onChange(option);
+ setValue("targetEnvironment", null);
+ }}
+ options={bitbucketRepos}
placeholder={
- bitbucketEnvironments?.length
- ? "Select an environment..."
- : "No environments found..."
+ bitbucketRepos?.length ? "Select a repository..." : "No repositories found..."
}
- isLoading={isBitbucketEnvironmentsLoading && Boolean(bitbucketRepo)}
- isDisabled={!bitbucketEnvironments?.length || isBitbucketEnvironmentsLoading}
+ isLoading={isBitbucketReposLoading}
+ isDisabled={!bitbucketRepos?.length || isBitbucketReposLoading}
+ id="bitbucket-targetrepo"
+ isError={Boolean(error)}
+ aria-describedby={error ? "bitbucket-targetrepo-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="bitbucket-targetrepo-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="scope"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="bitbucket-scope">Scope</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ value={value}
+ getOptionValue={(option) => option.value}
+ getOptionLabel={(option) => option.label}
+ onValueChange={onChange}
+ options={ScopeOptions}
+ id="bitbucket-scope"
+ isError={Boolean(error)}
+ aria-describedby={error ? "bitbucket-scope-error" : undefined}
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="bitbucket-scope-error">{error?.message}</FieldError>
+ )}
+ </Field>
)}
/>
- )}
- <Button
- type="submit"
- colorSchema="primary"
- className="mt-4"
- isLoading={createIntegration.isPending}
- isDisabled={createIntegration.isPending || !bitbucketRepos?.length}
- >
- Create Integration
- </Button>
+ {scope?.value === BitbucketScope.Env && (
+ <Controller
+ control={control}
+ name="targetEnvironment"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="bitbucket-targetenvironment">
+ Bitbucket Deployment Environment
+ </FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ getOptionValue={(option) => option.uuid}
+ value={value}
+ getOptionLabel={(option) => option.name}
+ onValueChange={onChange}
+ options={bitbucketEnvironments}
+ placeholder={
+ bitbucketEnvironments?.length
+ ? "Select an environment..."
+ : "No environments found..."
+ }
+ isLoading={isBitbucketEnvironmentsLoading && Boolean(bitbucketRepo)}
+ isDisabled={!bitbucketEnvironments?.length || isBitbucketEnvironmentsLoading}
+ id="bitbucket-targetenvironment"
+ isError={Boolean(error)}
+ aria-describedby={error ? "bitbucket-targetenvironment-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="bitbucket-targetenvironment-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ )}
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button
+ type="submit"
+ isPending={createIntegration.isPending}
+ isDisabled={createIntegration.isPending || !bitbucketRepos?.length}
+ variant="project"
+ >
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</form>
);
diff --git a/frontend/src/pages/secret-manager/integrations/ChecklyAuthorizePage/ChecklyAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/ChecklyAuthorizePage/ChecklyAuthorizePage.tsx
index e2a092c408..813187c9dc 100644
--- a/frontend/src/pages/secret-manager/integrations/ChecklyAuthorizePage/ChecklyAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/ChecklyAuthorizePage/ChecklyAuthorizePage.tsx
@@ -4,7 +4,21 @@ import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-sv
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Badge,
+ Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -34,8 +48,6 @@ export const ChecklyAuthorizePage = () => {
accessToken
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/checkly/create",
params: {
@@ -48,6 +60,8 @@ export const ChecklyAuthorizePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
@@ -56,61 +70,55 @@ export const ChecklyAuthorizePage = () => {
<Helmet>
<title>Authorize Checkly Integration</title>
</Helmet>
- <Card className="mb-12 max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="After adding your API key, you will be prompted to set up an integration for a particular Infisical project and environment."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img
- src="/images/integrations/Checkly.png"
- height={30}
- width={30}
- alt="Checkly logo"
- />
- </div>
- <span className="ml-2.5">Checkly Integration </span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://infisical.com/docs/integrations/cloud/checkly"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="mb-12 w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img src="/images/integrations/Checkly.png" height={30} width={30} alt="Checkly logo" />
+ <span>Checkly Integration</span>
+ </CardTitle>
+ <CardDescription>
+ After adding your API key, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ target="_blank"
+ rel="noopener noreferrer"
+ href="https://infisical.com/docs/integrations/cloud/checkly"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <FormControl
- label="Checkly API key"
- errorText={accessTokenErrorText}
- isError={accessTokenErrorText !== ""}
- className="mx-6"
- >
- <Input
- placeholder=""
- value={accessToken}
- type="password"
- autoComplete="new-password"
- onChange={(e) => setAccessToken(e.target.value)}
- />
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isFullWidth={false}
- isLoading={isLoading}
- >
- Connect to Checkly
- </Button>
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Field data-invalid={accessTokenErrorText !== ""}>
+ <FieldLabel htmlFor="checkly-checkly-api-key">Checkly API key</FieldLabel>
+ <Input
+ placeholder=""
+ value={accessToken}
+ type="password"
+ autoComplete="new-password"
+ onChange={(e) => setAccessToken(e.target.value)}
+ id="checkly-checkly-api-key"
+ isError={accessTokenErrorText !== ""}
+ aria-describedby={
+ accessTokenErrorText !== "" ? "checkly-checkly-api-key-error" : undefined
+ }
+ />
+ {accessTokenErrorText !== "" && (
+ <FieldError id="checkly-checkly-api-key-error">{accessTokenErrorText}</FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Checkly
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/ChecklyConfigurePage/ChecklyConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/ChecklyConfigurePage/ChecklyConfigurePage.tsx
index 224b18d54d..ba917239cf 100644
--- a/frontend/src/pages/secret-manager/integrations/ChecklyConfigurePage/ChecklyConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/ChecklyConfigurePage/ChecklyConfigurePage.tsx
@@ -6,18 +6,28 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
import { motion } from "motion/react";
import {
+ Badge,
Button,
Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldLabel,
Input,
Select,
+ SelectContent,
SelectItem,
- Tab,
- TabList,
- TabPanel,
- Tabs
-} from "@app/components/v2";
+ SelectTrigger,
+ SelectValue,
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -85,8 +95,6 @@ export const ChecklyConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
const targetApp = integrationAuthApps?.find(
(integrationAuthApp) => integrationAuthApp.appId === targetAppId
);
@@ -96,6 +104,8 @@ export const ChecklyConfigurePage = () => {
if (!targetApp) return;
+ setIsLoading(true);
+
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
@@ -110,8 +120,6 @@ export const ChecklyConfigurePage = () => {
}
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -124,6 +132,8 @@ export const ChecklyConfigurePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
@@ -137,150 +147,159 @@ export const ChecklyConfigurePage = () => {
<Helmet>
<title>Set Up Checkly Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control p-0">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Choose which environment in Infisical you want to sync to Checkly environment variables."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img
- src="/images/integrations/Checkly.png"
- height={30}
- width={30}
- alt="Checkly logo"
- />
- </div>
- <span className="ml-2.5">Checkly Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/checkly"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img src="/images/integrations/Checkly.png" height={30} width={30} alt="Checkly logo" />
+ <span>Checkly Integration</span>
+ </CardTitle>
+ <CardDescription>
+ Choose which environment in Infisical you want to sync to Checkly environment variables.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cloud/checkly"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <Tabs defaultValue={TabSections.Connection} className="px-6">
- <TabList>
- <div className="flex w-full flex-row border-b border-border-control">
- <Tab value={TabSections.Connection}>Connection</Tab>
- <Tab value={TabSections.Options}>Options</Tab>
- </div>
- </TabList>
- <TabPanel value={TabSections.Connection}>
- <motion.div
- key="panel-1"
- transition={{ duration: 0.15 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 30 }}
- >
- <FormControl label="Infisical Project Environment">
- <Select
- value={selectedSourceEnvironment}
- onValueChange={(val) => setSelectedSourceEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {workspace?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl label="Checkly Account">
- <Select
- value={targetAppId}
- onValueChange={(val) => setTargetAppId(val)}
- className="w-full border border-border-strong"
- isDisabled={integrationAuthApps.length === 0}
- >
- {integrationAuthApps.length > 0 ? (
- integrationAuthApps.map((integrationAuthApp) => (
- <SelectItem
- value={integrationAuthApp.appId as string}
- key={`target-app-${integrationAuthApp.appId as string}`}
- >
- {integrationAuthApp.name}
- </SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-app-none">
- No apps found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- <FormControl label="Checkly Group (Optional)">
- <Select
- value={targetGroupId}
- onValueChange={(val) => setTargetGroupId(val)}
- className="w-full border border-border-strong"
- >
- {integrationAuthGroups.length > 0 ? (
- integrationAuthGroups.map((integrationAuthGroup) => (
- <SelectItem
- value={String(integrationAuthGroup.groupId)}
- key={`target-group-${String(integrationAuthGroup.groupId)}`}
- >
- {integrationAuthGroup.name}
- </SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-group-none">
- No groups found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- </motion.div>
- </TabPanel>
- <TabPanel value={TabSections.Options}>
- <motion.div
- key="panel-1"
- transition={{ duration: 0.15 }}
- initial={{ opacity: 0, translateX: -30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 30 }}
- >
- <FormControl label="Append Secret Names with..." className="pb-39">
- <Input
- value={secretSuffix}
- onChange={(evt) => setSecretSuffix(evt.target.value)}
- placeholder="Provide a suffix for secret names, default is no suffix"
- />
- </FormControl>
- </motion.div>
- </TabPanel>
- </Tabs>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- variant="outline_bg"
- className="mr-6 mb-6 ml-auto"
- isFullWidth={false}
- isLoading={isLoading}
- >
- Create Integration
- </Button>
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Tabs defaultValue={TabSections.Connection}>
+ <TabsList variant="project">
+ <TabsTrigger value={TabSections.Connection}>Connection</TabsTrigger>
+ <TabsTrigger value={TabSections.Options}>Options</TabsTrigger>
+ </TabsList>
+ <TabsContent value={TabSections.Connection}>
+ <motion.div
+ key="panel-1"
+ transition={{ duration: 0.15 }}
+ initial={{ opacity: 0, translateX: 30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 30 }}
+ >
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="checkly-infisical-project-environment">
+ Infisical Project Environment
+ </FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger className="w-full" id="checkly-infisical-project-environment">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {workspace?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="checkly-secrets-path">Secrets Path</FieldLabel>
+ <Input
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ id="checkly-secrets-path"
+ />
+ </Field>
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="checkly-checkly-account">Checkly Account</FieldLabel>
+ <Select
+ value={targetAppId}
+ onValueChange={(val) => setTargetAppId(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger className="w-full" id="checkly-checkly-account">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthApps.length > 0 ? (
+ integrationAuthApps.map((integrationAuthApp) => (
+ <SelectItem
+ value={integrationAuthApp.appId as string}
+ key={`target-app-${integrationAuthApp.appId as string}`}
+ >
+ {integrationAuthApp.name}
+ </SelectItem>
+ ))
+ ) : (
+ <SelectItem value="none" key="target-app-none">
+ No apps found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field className="mb-4" data-invalid={false}>
+ <FieldLabel htmlFor="checkly-checkly-group-optional-">
+ Checkly Group (Optional)
+ </FieldLabel>
+ <Select value={targetGroupId} onValueChange={(val) => setTargetGroupId(val)}>
+ <SelectTrigger className="w-full" id="checkly-checkly-group-optional-">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthGroups.length > 0 ? (
+ integrationAuthGroups.map((integrationAuthGroup) => (
+ <SelectItem
+ value={String(integrationAuthGroup.groupId)}
+ key={`target-group-${String(integrationAuthGroup.groupId)}`}
+ >
+ {integrationAuthGroup.name}
+ </SelectItem>
+ ))
+ ) : (
+ <SelectItem value="none" key="target-group-none">
+ No groups found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ </motion.div>
+ </TabsContent>
+ <TabsContent value={TabSections.Options}>
+ <motion.div
+ key="panel-1"
+ transition={{ duration: 0.15 }}
+ initial={{ opacity: 0, translateX: -30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 30 }}
+ >
+ <Field className="mb-4 pb-39" data-invalid={false}>
+ <FieldLabel htmlFor="checkly-append-secret-names-with-">
+ Append Secret Names with...
+ </FieldLabel>
+ <Input
+ value={secretSuffix}
+ onChange={(evt) => setSecretSuffix(evt.target.value)}
+ placeholder="Provide a suffix for secret names, default is no suffix"
+ id="checkly-append-secret-names-with-"
+ />
+ </Field>
+ </motion.div>
+ </TabsContent>
+ </Tabs>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/CircleCIAuthorizePage/CircleCIAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/CircleCIAuthorizePage/CircleCIAuthorizePage.tsx
index 745a8d78b4..d5190afc66 100644
--- a/frontend/src/pages/secret-manager/integrations/CircleCIAuthorizePage/CircleCIAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/CircleCIAuthorizePage/CircleCIAuthorizePage.tsx
@@ -4,7 +4,21 @@ import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-sv
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Badge,
+ Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -33,8 +47,6 @@ export const CircleCIAuthorizePage = () => {
accessToken: apiKey
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/circleci/create",
params: {
@@ -47,6 +59,8 @@ export const CircleCIAuthorizePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
@@ -55,54 +69,58 @@ export const CircleCIAuthorizePage = () => {
<Helmet>
<title>Authorize CircleCI Integration</title>
</Helmet>
- <Card className="mb-12 max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="After adding your API Token, you will be prompted to set up an integration for a particular Infisical project and environment."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img
- src="/images/integrations/CircleCI.png"
- height={30}
- width={30}
- alt="CircleCI logo"
- />
- </div>
- <span className="ml-1.5">CircleCI Integration </span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://infisical.com/docs/integrations/cicd/circleci"
- >
- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
+ <Card className="mb-12 w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/CircleCI.png"
+ height={30}
+ width={30}
+ alt="CircleCI logo"
+ />
+ <span>CircleCI Integration</span>
+ </CardTitle>
+ <CardDescription>
+ After adding your API Token, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ target="_blank"
+ rel="noopener noreferrer"
+ href="https://infisical.com/docs/integrations/cicd/circleci"
+ >
+ <FontAwesomeIcon icon={faBookOpen} />
Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <FormControl
- label="CircleCI API Token"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- className="px-6"
- >
- <Input placeholder="" value={apiKey} onChange={(e) => setApiKey(e.target.value)} />
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isLoading={isLoading}
- >
- Connect to CircleCI
- </Button>
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="circleci-circleci-api-token">CircleCI API Token</FieldLabel>
+ <Input
+ placeholder=""
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ id="circleci-circleci-api-token"
+ isError={apiKeyErrorText !== ""}
+ aria-describedby={
+ apiKeyErrorText !== "" ? "circleci-circleci-api-token-error" : undefined
+ }
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="circleci-circleci-api-token-error">{apiKeyErrorText}</FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to CircleCI
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/CircleCIConfigurePage/CircleCIConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/CircleCIConfigurePage/CircleCIConfigurePage.tsx
index 61ad9fab09..e911e7893f 100644
--- a/frontend/src/pages/secret-manager/integrations/CircleCIConfigurePage/CircleCIConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/CircleCIConfigurePage/CircleCIConfigurePage.tsx
@@ -7,16 +7,27 @@ import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import {
+ Badge,
Button,
Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FilterableSelect,
- FormControl,
+ Combobox,
+ Field,
+ FieldError,
+ FieldLabel,
+ SecretPathInput,
Select,
- SelectItem
-} from "@app/components/v2";
-import { SecretPathInput } from "@app/components/v2/SecretPathInput";
-import { Spinner } from "@app/components/v3";
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Spinner
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration, useGetIntegrationAuthCircleCIOrganizations } from "@app/hooks/api";
@@ -125,186 +136,227 @@ export const CircleCIConfigurePage = () => {
onSubmit={handleSubmit(onSubmit)}
className="flex h-full w-full items-center justify-center"
>
- <Card className="max-w-lg rounded-md p-8 pt-4">
- <CardTitle
- className="w-full px-0 text-left text-xl"
- subTitle="Choose which environment or folder in Infisical you want to sync to CircleCI."
- >
- <div className="flex w-full flex-row items-center justify-between">
- <div className="flex flex-row items-center gap-1.5">
- <img
- src="/images/integrations/CircleCI.png"
- height={30}
- width={30}
- alt="CircleCI logo"
- />
-
- <span className="">CircleCI Context Integration </span>
- </div>
-
- <a
- href="https://infisical.com/docs/integrations/cicd/circleci"
- target="_blank"
- rel="noopener noreferrer"
- >
- <div className="mb-1 ml-2 flex cursor-pointer flex-row items-center gap-0.5 rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">
- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
- Docs
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.07rem] ml-1.5"
- />
- </div>
- </a>
- </div>
- </CardTitle>
- <Controller
- control={control}
- name="sourceEnvironment"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="Project Environment"
- >
- <FilterableSelect
- getOptionValue={(option) => option.slug}
- value={value}
- getOptionLabel={(option) => option.name}
- onChange={onChange}
- options={currentProject?.environments}
- placeholder="Select a project environment"
- isDisabled={!currentProject?.environments.length}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="secretPath"
- render={({ field, fieldState: { error } }) => (
- <FormControl label="Secrets Path" errorText={error?.message} isError={Boolean(error)}>
- <SecretPathInput {...field} environment={selectedEnvironment.slug} />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="targetOrg"
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="CircleCI Organization"
- >
- <FilterableSelect
- getOptionValue={(option) => option.slug}
- value={value}
- getOptionLabel={(option) => option.name}
- onChange={(e) => {
- setValue("targetProject", {
- name: "",
- id: ""
- });
- setValue("targetContext", {
- name: "",
- id: ""
- });
-
- onChange(e);
- }}
- options={circleCIOrganizations}
- placeholder={
- circleCIOrganizations?.length
- ? "Select an organization..."
- : "No organizations found..."
- }
- isDisabled={!circleCIOrganizations?.length}
- />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="scope"
- render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl label="Scope" errorText={error?.message} isError={Boolean(error)}>
- <Select
- defaultValue={field.value}
- onValueChange={(e) => {
- onChange(e);
- }}
- className="w-full border border-border-strong"
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/CircleCI.png"
+ height={30}
+ width={30}
+ alt="CircleCI logo"
+ />
+ <span>CircleCI Context Integration</span>
+ </CardTitle>
+ <CardDescription>
+ Choose which environment or folder in Infisical you want to sync to CircleCI.
+ </CardDescription>
+ <CardAction>
+ <Badge variant="info" asChild>
+ <a
+ href="https://infisical.com/docs/integrations/cicd/circleci"
+ target="_blank"
+ rel="noopener noreferrer"
>
- <SelectItem value={CircleCiScope.Project}>Project</SelectItem>
- <SelectItem value={CircleCiScope.Context}>Context</SelectItem>
- </Select>
- </FormControl>
- )}
- />
- {selectedScope === CircleCiScope.Context && selectedOrganizationEntry && (
+ <FontAwesomeIcon icon={faBookOpen} />
+ Docs
+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />
+ </a>
+ </Badge>
+ </CardAction>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
<Controller
control={control}
- name="targetContext"
+ name="sourceEnvironment"
render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="CircleCI Context"
- >
- <FilterableSelect
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="circleci-sourceenvironment">Project Environment</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ getOptionValue={(option) => option.slug}
value={value}
- getOptionValue={(option) => option.id!}
getOptionLabel={(option) => option.name}
- onChange={onChange}
- options={selectedOrganizationEntry?.contexts}
- placeholder={
- selectedOrganizationEntry.contexts?.length
- ? "Select a context..."
- : "No contexts found..."
- }
- isDisabled={!selectedOrganizationEntry.contexts?.length}
+ onValueChange={onChange}
+ options={currentProject?.environments}
+ placeholder="Select a project environment"
+ isDisabled={!currentProject?.environments.length}
+ id="circleci-sourceenvironment"
+ isError={Boolean(error)}
+ aria-describedby={error ? "circleci-sourceenvironment-error" : undefined}
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="circleci-sourceenvironment-error">{error?.message}</FieldError>
+ )}
+ </Field>
)}
/>
- )}
- {selectedScope === CircleCiScope.Project && selectedOrganizationEntry && (
<Controller
control={control}
- name="targetProject"
+ name="secretPath"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="circleci-secretpath">Secrets Path</FieldLabel>
+ <SecretPathInput
+ {...field}
+ environment={selectedEnvironment.slug}
+ id="circleci-secretpath"
+ isError={Boolean(error)}
+ aria-describedby={error ? "circleci-secretpath-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="circleci-secretpath-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="targetOrg"
render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error)}
- label="CircleCI Project"
- >
- <FilterableSelect
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="circleci-targetorg">CircleCI Organization</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ getOptionValue={(option) => option.slug}
value={value}
- getOptionValue={(option) => option.id!}
getOptionLabel={(option) => option.name}
- onChange={onChange}
- options={selectedOrganizationEntry?.projects}
+ onValueChange={(e) => {
+ setValue("targetProject", {
+ name: "",
+ id: ""
+ });
+ setValue("targetContext", {
+ name: "",
+ id: ""
+ });
+
+ onChange(e);
+ }}
+ options={circleCIOrganizations}
placeholder={
- selectedOrganizationEntry.projects?.length
- ? "Select a project..."
- : "No projects found..."
+ circleCIOrganizations?.length
+ ? "Select an organization..."
+ : "No organizations found..."
}
- isDisabled={!selectedOrganizationEntry.projects?.length}
+ isDisabled={!circleCIOrganizations?.length}
+ id="circleci-targetorg"
+ isError={Boolean(error)}
+ aria-describedby={error ? "circleci-targetorg-error" : undefined}
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="circleci-targetorg-error">{error?.message}</FieldError>
+ )}
+ </Field>
)}
/>
- )}
- <Button
- type="submit"
- colorSchema="primary"
- className="mt-4"
- isLoading={isCreatingIntegration}
- isDisabled={isCreatingIntegration}
- >
- Create Integration
- </Button>
+ <Controller
+ control={control}
+ name="scope"
+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="circleci-scope">Scope</FieldLabel>
+ <Select
+ defaultValue={field.value}
+ onValueChange={(e) => {
+ onChange(e);
+ }}
+ >
+ <SelectTrigger
+ className="w-full"
+ id="circleci-scope"
+ isError={Boolean(error)}
+ aria-describedby={error ? "circleci-scope-error" : undefined}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value={CircleCiScope.Project}>Project</SelectItem>
+ <SelectItem value={CircleCiScope.Context}>Context</SelectItem>
+ </SelectContent>
+ </Select>
+ {Boolean(error) && (
+ <FieldError id="circleci-scope-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ {selectedScope === CircleCiScope.Context && selectedOrganizationEntry && (
+ <Controller
+ control={control}
+ name="targetContext"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="circleci-targetcontext">CircleCI Context</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ value={value}
+ getOptionValue={(option) => option.id!}
+ getOptionLabel={(option) => option.name}
+ onValueChange={onChange}
+ options={selectedOrganizationEntry?.contexts}
+ placeholder={
+ selectedOrganizationEntry.contexts?.length
+ ? "Select a context..."
+ : "No contexts found..."
+ }
+ isDisabled={!selectedOrganizationEntry.contexts?.length}
+ id="circleci-targetcontext"
+ isError={Boolean(error)}
+ aria-describedby={error ? "circleci-targetcontext-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="circleci-targetcontext-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ )}
+ {selectedScope === CircleCiScope.Project && selectedOrganizationEntry && (
+ <Controller
+ control={control}
+ name="targetProject"
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="circleci-targetproject">CircleCI Project</FieldLabel>
+ <Combobox
+ includeMissingSelectedOptions={false}
+ isClearable={false}
+ value={value}
+ getOptionValue={(option) => option.id!}
+ getOptionLabel={(option) => option.name}
+ onValueChange={onChange}
+ options={selectedOrganizationEntry?.projects}
+ placeholder={
+ selectedOrganizationEntry.projects?.length
+ ? "Select a project..."
+ : "No projects found..."
+ }
+ isDisabled={!selectedOrganizationEntry.projects?.length}
+ id="circleci-targetproject"
+ isError={Boolean(error)}
+ aria-describedby={error ? "circleci-targetproject-error" : undefined}
+ />
+ {Boolean(error) && (
+ <FieldError id="circleci-targetproject-error">{error?.message}</FieldError>
+ )}
+ </Field>
+ )}
+ />
+ )}
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button
+ type="submit"
+ isPending={isCreatingIntegration}
+ isDisabled={isCreatingIntegration}
+ variant="project"
+ >
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</form>
);
diff --git a/frontend/src/pages/secret-manager/integrations/Cloud66AuthorizePage/Cloud66AuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/Cloud66AuthorizePage/Cloud66AuthorizePage.tsx
index d3c5315abe..c6f97f3b7e 100644
--- a/frontend/src/pages/secret-manager/integrations/Cloud66AuthorizePage/Cloud66AuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/Cloud66AuthorizePage/Cloud66AuthorizePage.tsx
@@ -1,7 +1,18 @@
import { useState } from "react";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -31,8 +42,6 @@ export const Cloud66AuthorizePage = () => {
accessToken: apiKey
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/cloud-66/create",
params: {
@@ -45,28 +54,44 @@ export const Cloud66AuthorizePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
return (
<div className="flex h-full w-full items-center justify-center">
- <Card className="max-w-md rounded-md p-8">
- <CardTitle className="text-center">Cloud 66 Integration</CardTitle>
- <FormControl
- label="Cloud 66 Personal Access Token"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- >
- <Input placeholder="" value={apiKey} onChange={(e) => setApiKey(e.target.value)} />
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- className="mt-4"
- isLoading={isLoading}
- >
- Connect to Cloud 66
- </Button>
+ <Card className="w-full max-w-md">
+ <CardHeader>
+ <CardTitle>Cloud 66 Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="cloud66-cloud-66-personal-access-token">
+ Cloud 66 Personal Access Token
+ </FieldLabel>
+ <Input
+ placeholder=""
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ id="cloud66-cloud-66-personal-access-token"
+ isError={apiKeyErrorText !== ""}
+ aria-describedby={
+ apiKeyErrorText !== "" ? "cloud66-cloud-66-personal-access-token-error" : undefined
+ }
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="cloud66-cloud-66-personal-access-token-error">
+ {apiKeyErrorText}
+ </FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="outline">
+ Connect to Cloud 66
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/Cloud66ConfigurePage/Cloud66ConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/Cloud66ConfigurePage/Cloud66ConfigurePage.tsx
index ec0a8bc919..cc003da12b 100644
--- a/frontend/src/pages/secret-manager/integrations/Cloud66ConfigurePage/Cloud66ConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/Cloud66ConfigurePage/Cloud66ConfigurePage.tsx
@@ -4,12 +4,19 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
import {
Button,
Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ Field,
+ FieldLabel,
Input,
Select,
- SelectItem
-} from "@app/components/v2";
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -72,8 +79,6 @@ export const Cloud66ConfigurePage = () => {
secretPath
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -86,68 +91,87 @@ export const Cloud66ConfigurePage = () => {
});
} catch (err) {
console.error(err);
+ } finally {
+ setIsLoading(false);
}
};
return integrationAuth && selectedSourceEnvironment && integrationAuthApps && targetApp ? (
<div className="flex h-full w-full items-center justify-center">
- <Card className="max-w-md rounded-md p-8">
- <CardTitle className="text-center">Cloud 66 Integration</CardTitle>
- <FormControl label="Project Environment" className="mt-4">
- <Select
- value={selectedSourceEnvironment}
- onValueChange={(val) => setSelectedSourceEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {currentProject?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl label="Cloud 66 Application" className="mt-4">
- <Select
- value={targetApp}
- onValueChange={(val) => setTargetApp(val)}
- className="w-full border border-border-strong"
+ <Card className="w-full max-w-md">
+ <CardHeader>
+ <CardTitle>Cloud 66 Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-5">
+ <Field className="mt-4" data-invalid={false}>
+ <FieldLabel htmlFor="cloud66-project-environment">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger className="w-full" id="cloud66-project-environment">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field data-invalid={false}>
+ <FieldLabel htmlFor="cloud66-secrets-path">Secrets Path</FieldLabel>
+ <Input
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ id="cloud66-secrets-path"
+ />
+ </Field>
+ <Field className="mt-4" data-invalid={false}>
+ <FieldLabel htmlFor="cloud66-cloud-66-application">Cloud 66 Application</FieldLabel>
+ <Select
+ value={targetApp}
+ onValueChange={(val) => setTargetApp(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger className="w-full" id="cloud66-cloud-66-application">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthApps.length > 0 ? (
+ integrationAuthApps.map((integrationAuthApp) => (
+ <SelectItem
+ value={integrationAuthApp.name}
+ key={`target-app-${integrationAuthApp.name}`}
+ >
+ {integrationAuthApp.name}
+ </SelectItem>
+ ))
+ ) : (
+ <SelectItem value="none" key="target-app-none">
+ No applications found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
isDisabled={integrationAuthApps.length === 0}
+ variant="outline"
>
- {integrationAuthApps.length > 0 ? (
- integrationAuthApps.map((integrationAuthApp) => (
- <SelectItem
- value={integrationAuthApp.name}
- key={`target-app-${integrationAuthApp.name}`}
- >
- {integrationAuthApp.name}
- </SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-app-none">
- No applications found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- className="mt-4"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (