Skip to content

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

improvement(integrations): port native provider creation pages to V3 (S14) (#8618)

Andrew Huangc1d06ffcd0a3
diff --git a/frontend/src/pages/secret-manager/integrations/RenderAuthorizePage/RenderAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/RenderAuthorizePage/RenderAuthorizePage.tsx
index 53c7a38a9b..31bc72bf65 100644
--- a/frontend/src/pages/secret-manager/integrations/RenderAuthorizePage/RenderAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/RenderAuthorizePage/RenderAuthorizePage.tsx
@@ -1,21 +1,31 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
-import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
export const RenderAuthorizePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useSaveIntegrationAccessToken();
+ const { mutateAsync, isPending: isLoading } = useSaveIntegrationAccessToken();
const { currentProject } = useProject();
const { currentOrg } = useOrganization();
const [apiKey, setApiKey] = useState("");
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const handleButtonClick = async () => {
try {
@@ -25,16 +35,12 @@ export const RenderAuthorizePage = () => {
return;
}
- setIsLoading(true);
-
const integrationAuth = await mutateAsync({
workspaceId: currentProject.id,
integration: "render",
accessToken: apiKey
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/render/create",
params: {
@@ -55,55 +61,41 @@ export const RenderAuthorizePage = () => {
<Helmet>
<title>Authorize Render 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/Render.png" height={30} width={30} alt="Render logo" />
- </div>
- <span className="ml-2.5">Render Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/render"
- 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="Render API Key"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- className="px-6"
- >
- <Input
- placeholder="rnd_xxx"
- value={apiKey}
- type="password"
- autoComplete="new-password"
- 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 Render
- </Button>
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img src="/images/integrations/Render.png" height={30} width={30} alt="Render logo" />
+ Render Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/render" />
+ </CardTitle>
+ <CardDescription>
+ After adding your API key, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="RenderAuthorizePage-field-1">Render API Key</FieldLabel>
+ <Input
+ id="RenderAuthorizePage-field-1"
+ aria-describedby="RenderAuthorizePage-field-1-feedback"
+ isError={apiKeyErrorText !== ""}
+ placeholder="rnd_xxx"
+ value={apiKey}
+ type="password"
+ autoComplete="new-password"
+ onChange={(e) => setApiKey(e.target.value)}
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="RenderAuthorizePage-field-1-feedback">{apiKeyErrorText}</FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Render
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/RenderConfigurePage/RenderConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/RenderConfigurePage/RenderConfigurePage.tsx
index 46a0493470..a30681a397 100644
--- a/frontend/src/pages/secret-manager/integrations/RenderConfigurePage/RenderConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/RenderConfigurePage/RenderConfigurePage.tsx
@@ -1,27 +1,36 @@
-import { useEffect, useState } from "react";
+import { useEffect } from "react";
import { Helmet } from "react-helmet";
import { Controller, useForm } from "react-hook-form";
-import {
- faArrowUpRightFromSquare,
- faBookOpen,
- faBugs,
- faCircleInfo
-} from "@fortawesome/free-solid-svg-icons";
+import { faBugs } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
import { useNavigate, useSearch } from "@tanstack/react-router";
+import { InfoIcon } from "lucide-react";
import { z } from "zod";
import {
+ Alert,
+ AlertDescription,
+ AlertTitle,
Button,
Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ FieldLabel,
+ 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";
@@ -42,7 +51,7 @@ type FormData = z.infer<typeof schema>;
export const RenderConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const { control, handleSubmit, setValue, watch } = useForm<FormData>({
@@ -69,8 +78,6 @@ export const RenderConfigurePage = () => {
integrationAuthId: (integrationAuthId as string) ?? ""
});
- const [isLoading, setIsLoading] = useState(false);
-
useEffect(() => {
if (integrationAuthApps) {
if (integrationAuthApps.length > 0) {
@@ -85,8 +92,6 @@ export const RenderConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
@@ -101,8 +106,6 @@ export const RenderConfigurePage = () => {
}
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -121,63 +124,63 @@ export const RenderConfigurePage = () => {
return integrationAuth && selectedSourceEnvironment && integrationAuthApps ? (
<form
onSubmit={handleSubmit(onFormSubmit)}
- className="flex h-full w-full flex-col items-center justify-center"
+ className="flex h-full w-full flex-col items-center justify-center gap-6"
>
<Helmet>
<title>Set Up Render 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 or folder in Infisical you want to sync to Render environment variables."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img src="/images/integrations/Render.png" height={30} width={30} alt="Render logo" />
- </div>
- <span className="ml-2.5">Render Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/render"
- 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">
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img src="/images/integrations/Render.png" height={30} width={30} alt="Render logo" />
+ Render Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/render" />
+ </CardTitle>
+ <CardDescription>
+ Choose which environment or folder in Infisical you want to sync to Render environment
+ variables.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
<Controller
control={control}
name="selectedSourceEnvironment"
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
- <FormControl
- label="Project Environment"
- errorText={error?.message}
- isError={Boolean(error)}
- >
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RenderConfigurePage-field-1">Project Environment</FieldLabel>
<Select
defaultValue={field.value}
- {...field}
+ value={field.value}
+ name={field.name}
onValueChange={(e) => onChange(e)}
- className="w-full"
>
- {currentProject?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
- >
- {sourceEnvironment.name}
- </SelectItem>
- ))}
+ <SelectTrigger
+ id="RenderConfigurePage-field-1"
+ aria-describedby="RenderConfigurePage-field-1-feedback"
+ isError={Boolean(error)}
+ className="w-full"
+ ref={field.ref}
+ onBlur={field.onBlur}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
</Select>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="RenderConfigurePage-field-1-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
<Controller
@@ -185,13 +188,22 @@ export const RenderConfigurePage = () => {
defaultValue=""
name="secretPath"
render={({ field, fieldState: { error } }) => (
- <FormControl label="Secrets Path" isError={Boolean(error)} errorText={error?.message}>
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RenderConfigurePage-field-2">Secrets Path</FieldLabel>
<SecretPathInput
+ id="RenderConfigurePage-field-2"
+ aria-describedby="RenderConfigurePage-field-2-feedback"
+ isError={Boolean(error)}
{...field}
placeholder="/"
environment={selectedSourceEnvironment}
/>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="RenderConfigurePage-field-2-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
)}
/>
<Controller
@@ -199,77 +211,88 @@ export const RenderConfigurePage = () => {
name="targetAppId"
render={({ field: { onChange, ...field }, fieldState: { error } }) => {
return (
- <FormControl
- label="Render Service"
- errorText={error?.message}
- isError={Boolean(error)}
- >
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RenderConfigurePage-field-3">Render Service</FieldLabel>
<Select
- {...field}
+ value={field.value}
+ name={field.name}
onValueChange={(e) => {
if (e === "") return;
onChange(e);
}}
- className="w-full"
>
- {integrationAuthApps.length > 0 ? (
- integrationAuthApps.map((integrationAuthApp) => (
- <SelectItem
- value={String(integrationAuthApp.appId as string)}
- key={`target-app-${String(integrationAuthApp.appId)}`}
- >
- {integrationAuthApp.name}
+ <SelectTrigger
+ id="RenderConfigurePage-field-3"
+ aria-describedby="RenderConfigurePage-field-3-feedback"
+ isError={Boolean(error)}
+ className="w-full"
+ ref={field.ref}
+ onBlur={field.onBlur}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {integrationAuthApps.length > 0 ? (
+ integrationAuthApps.map((integrationAuthApp) => (
+ <SelectItem
+ value={String(integrationAuthApp.appId as string)}
+ key={`target-app-${String(integrationAuthApp.appId)}`}
+ >
+ {integrationAuthApp.name}
+ </SelectItem>
+ ))
+ ) : (
+ <SelectItem value="none" key="target-app-none">
+ No services found
</SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-app-none">
- No services found
- </SelectItem>
- )}
+ )}
+ </SelectContent>
</Select>
- </FormControl>
+ {Boolean(error) && (
+ <FieldError id="RenderConfigurePage-field-3-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
);
}}
/>
- <div className="mt-8 mb-[2.36rem] ml-1">
- <Controller
- control={control}
- name="shouldAutoRedeploy"
- render={({ field: { onChange, value } }) => (
- <Switch
+ <Controller
+ control={control}
+ name="shouldAutoRedeploy"
+ render={({ field: { onChange, value } }) => (
+ <Field orientation="horizontal">
+ <FieldLabel htmlFor="redeploy-render">
+ Auto-redeploy service upon secret change
+ </FieldLabel>
+ <Toggle
id="redeploy-render"
onCheckedChange={(isChecked) => onChange(isChecked)}
- isChecked={value}
- >
- Auto-redeploy service upon secret change
- </Switch>
- )}
- />
- </div>
- </div>
- <Button
- colorSchema="primary"
- variant="outline_bg"
- className="mt-4 mr-6 mb-8 ml-auto w-min"
- size="sm"
- type="submit"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ checked={value}
+ />
+ </Field>
+ )}
+ />
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button
+ type="submit"
+ isPending={isLoading}
+ isDisabled={integrationAuthApps.length === 0}
+ 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">
- <div className="flex flex-row items-center">
- <FontAwesomeIcon icon={faCircleInfo} className="text-xl text-foreground-secondary" />{" "}
- <span className="text-md ml-3 text-foreground">Pro Tip</span>
- </div>
- <span className="mt-4 text-sm text-label">
+ <Alert variant="info" className="w-full max-w-lg">
+ <InfoIcon />
+ <AlertTitle>Pro Tip</AlertTitle>
+ <AlertDescription>
After creating an integration, your secrets will start syncing immediately. This might
cause an unexpected override of current secrets in Render with secrets from Infisical.
- </span>
- </div>
+ </AlertDescription>
+ </Alert>
</form>
) : (
<div className="flex h-full w-full items-center justify-center">
diff --git a/frontend/src/pages/secret-manager/integrations/RundeckAuthorizePage/RundeckAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/RundeckAuthorizePage/RundeckAuthorizePage.tsx
index da66f0939d..1aa2a13c19 100644
--- a/frontend/src/pages/secret-manager/integrations/RundeckAuthorizePage/RundeckAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/RundeckAuthorizePage/RundeckAuthorizePage.tsx
@@ -1,13 +1,24 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
import { Controller, useForm } from "react-hook-form";
-import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
import { useNavigate } from "@tanstack/react-router";
import z from "zod";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
@@ -68,72 +79,75 @@ export const RundeckAuthorizePage = () => {
<Helmet>
<title>Authorize Rundeck 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 URL and auth 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">
+ <form onSubmit={handleSubmit(onFormSubmit)} className="w-full max-w-lg">
+ <Card>
+ <CardHeader>
+ <CardTitle>
<img
src="/images/integrations/Rundeck.svg"
height={30}
width={30}
alt="Rundeck logo"
/>
- </div>
- <span className="ml-2.5">Rundeck Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cicd/rundeck"
- 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="rundeckURL"
- render={({ field, fieldState: { error } }) => (
- <FormControl label="URL" errorText={error?.message} isError={Boolean(error)}>
- <Input {...field} placeholder="https://self-hosted-rundeck.com" />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="authToken"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Rundeck Auth Token"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input {...field} placeholder="" />
- </FormControl>
- )}
- />
- <Button
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 w-min"
- size="sm"
- type="submit"
- isLoading={isLoading}
- >
- Connect to Rundeck
- </Button>
- </form>
- </Card>
+ Rundeck Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cicd/rundeck" />
+ </CardTitle>
+ <CardDescription>
+ After adding your URL and auth token, you will be prompted to set up an integration
+ for a particular Infisical project and environment.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Controller
+ control={control}
+ name="rundeckURL"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RundeckAuthorizePage-field-1">URL</FieldLabel>
+ <Input
+ id="RundeckAuthorizePage-field-1"
+ aria-describedby="RundeckAuthorizePage-field-1-feedback"
+ isError={Boolean(error)}
+ {...field}
+ placeholder="https://self-hosted-rundeck.com"
+ />
+ {Boolean(error) && (
+ <FieldError id="RundeckAuthorizePage-field-1-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="authToken"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RundeckAuthorizePage-field-2">Rundeck Auth Token</FieldLabel>
+ <Input
+ id="RundeckAuthorizePage-field-2"
+ aria-describedby="RundeckAuthorizePage-field-2-feedback"
+ isError={Boolean(error)}
+ {...field}
+ placeholder=""
+ />
+ {Boolean(error) && (
+ <FieldError id="RundeckAuthorizePage-field-2-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button type="submit" isPending={isLoading} variant="project">
+ Connect to Rundeck
+ </Button>
+ </CardFooter>
+ </Card>
+ </form>
</div>
);
};
diff --git a/frontend/src/pages/secret-manager/integrations/RundeckConfigurePage/RundeckConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/RundeckConfigurePage/RundeckConfigurePage.tsx
index 291eee3706..08e78ae0ea 100644
--- a/frontend/src/pages/secret-manager/integrations/RundeckConfigurePage/RundeckConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/RundeckConfigurePage/RundeckConfigurePage.tsx
@@ -1,6 +1,6 @@
import { Helmet } from "react-helmet";
import { Controller, useForm } from "react-hook-form";
-import { faArrowUpRightFromSquare, faBookOpen, faBugs } from "@fortawesome/free-solid-svg-icons";
+import { faBugs } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
import { useNavigate, useSearch } from "@tanstack/react-router";
@@ -9,13 +9,23 @@ import { z } from "zod";
import {
Button,
Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ FieldLabel,
Input,
+ SecretPathInput,
Select,
- SelectItem
-} from "@app/components/v2";
-import { SecretPathInput } from "@app/components/v2/SecretPathInput";
+ 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";
@@ -91,108 +101,122 @@ export const RundeckConfigurePage = () => {
<Helmet>
<title>Set Up Rundeck 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 or folder in Infisical you want to sync to the Rundeck Key Storage."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
+ <form onSubmit={handleSubmit(onFormSubmit)} className="w-full max-w-lg">
+ <Card>
+ <CardHeader>
+ <CardTitle>
<img
src="/images/integrations/Rundeck.svg"
height={30}
width={30}
alt="Rundeck logo"
/>
- </div>
- <span className="ml-2.5">Rundeck Integration </span>
- <a
- href="https://infisical.com/docs/integrations/cloud/flyio"
- 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="flex w-full flex-col px-6">
- <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"
- value={field.value}
- onValueChange={(val) => {
- field.onChange(val);
- }}
- >
- {currentProject?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`source-environment-${sourceEnvironment.slug}`}
+ Rundeck Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/flyio" />
+ </CardTitle>
+ <CardDescription>
+ Choose which environment or folder in Infisical you want to sync to the Rundeck Key
+ Storage.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Controller
+ control={control}
+ name="sourceEnvironment"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RundeckConfigurePage-field-1">
+ Project Environment
+ </FieldLabel>
+ <Select
+ value={field.value}
+ onValueChange={(val) => {
+ field.onChange(val);
+ }}
+ >
+ <SelectTrigger
+ id="RundeckConfigurePage-field-1"
+ aria-describedby="RundeckConfigurePage-field-1-feedback"
+ isError={Boolean(error)}
+ className="w-full"
>
- {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>
- )}
- />
+ <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="RundeckConfigurePage-field-1-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
- <Controller
- control={control}
- name="keyStoragePath"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Rundeck Key Storage Path"
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input
- placeholder={`keys/project/${currentProject.name
- .toLowerCase()
- .replace(/ /g, "-")}/${selectedSourceEnvironment}`}
- {...field}
- />
- </FormControl>
- )}
- />
+ <Controller
+ control={control}
+ name="secretPath"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RundeckConfigurePage-field-2">Secrets Path</FieldLabel>
+ <SecretPathInput
+ id="RundeckConfigurePage-field-2"
+ aria-describedby="RundeckConfigurePage-field-2-feedback"
+ isError={Boolean(error)}
+ {...field}
+ environment={selectedSourceEnvironment}
+ />
+ {Boolean(error) && (
+ <FieldError id="RundeckConfigurePage-field-2-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
- <Button
- type="submit"
- colorSchema="secondary"
- variant="outline_bg"
- className="mt-2 mb-6 ml-auto"
- isLoading={isSubmitting}
- >
- Create Integration
- </Button>
- </form>
- </Card>
+ <Controller
+ control={control}
+ name="keyStoragePath"
+ render={({ field, fieldState: { error } }) => (
+ <Field data-invalid={Boolean(error)}>
+ <FieldLabel htmlFor="RundeckConfigurePage-field-3">
+ Rundeck Key Storage Path
+ </FieldLabel>
+ <Input
+ id="RundeckConfigurePage-field-3"
+ aria-describedby="RundeckConfigurePage-field-3-feedback"
+ isError={Boolean(error)}
+ placeholder={`keys/project/${currentProject.name
+ .toLowerCase()
+ .replace(/ /g, "-")}/${selectedSourceEnvironment}`}
+ {...field}
+ />
+ {Boolean(error) && (
+ <FieldError id="RundeckConfigurePage-field-3-feedback">
+ {error?.message}
+ </FieldError>
+ )}
+ </Field>
+ )}
+ />
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button type="submit" isPending={isSubmitting} variant="project">
+ Create Integration
+ </Button>
+ </CardFooter>
+ </Card>
+ </form>
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
diff --git a/frontend/src/pages/secret-manager/integrations/SelectIntegrationAuthPage/SelectIntegrationAuthPage.tsx b/frontend/src/pages/secret-manager/integrations/SelectIntegrationAuthPage/SelectIntegrationAuthPage.tsx
index d754eaff08..aef1250d73 100644
--- a/frontend/src/pages/secret-manager/integrations/SelectIntegrationAuthPage/SelectIntegrationAuthPage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/SelectIntegrationAuthPage/SelectIntegrationAuthPage.tsx
@@ -4,8 +4,16 @@ import { useCallback, useEffect } from "react";
import { Helmet } from "react-helmet";
import { useNavigate, useSearch } from "@tanstack/react-router";
-import { Button, Card, CardTitle } from "@app/components/v2";
-import { Loader } from "@app/components/v3";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ FieldSeparator,
+ Loader
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import {
@@ -166,21 +174,20 @@ export const SelectIntegrationAuthPage = () => {
<Helmet>
<title>Select Connection</title>
</Helmet>
- <Card className="mb-12 max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Select an existing connection below or create a new one for your integration."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img src={logo} height={30} width={30} alt="Integration logo" />
- </div>
- <span className="ml-2.5">Select Connection</span>
- </div>
- </CardTitle>
- <div className="mb-7 flex flex-col items-center">
- {!isLoadingIntegrationAuths && integrationAuths?.length
- ? integrationAuths.map((integrationAuth) => {
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img src={logo} height={30} width={30} alt="Integration logo" />
+ Select Connection
+ </CardTitle>
+ <CardDescription>
+ Select an existing connection below or create a new one for your integration.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ {!isLoadingIntegrationAuths && integrationAuths?.length ? (
+ <div className="flex flex-col gap-2">
+ {integrationAuths.map((integrationAuth) => {
let connectionName = "";
if (integrationAuth.integration === "github") {
@@ -189,34 +196,24 @@ export const SelectIntegrationAuthPage = () => {
return (
<Button
- colorSchema="secondary"
- className="mt-3 w-3/4"
+ isFullWidth
isDisabled={isIntegrationAuthSelectLoading}
key={integrationAuth.id}
- size="sm"
type="submit"
onClick={() => handleConnectionSelect(integrationAuth)}
+ variant="outline"
>
{connectionName}
</Button>
);
- })
- : undefined}
- <div className="mt-6 flex w-full flex-row items-center justify-center">
- <div className="w-1/5 border-t border-border-emphasis" />
- <p className="mx-4 text-xs text-muted-cool">OR</p>
- <div className="w-1/5 border-t border-border-emphasis" />
- </div>
- <Button
- colorSchema="primary"
- className="mt-6 w-3/4"
- size="sm"
- type="submit"
- onClick={handleNewConnection}
- >
+ })}
+ </div>
+ ) : undefined}
+ <FieldSeparator>OR</FieldSeparator>
+ <Button isFullWidth type="submit" onClick={handleNewConnection} variant="project">
Create New Connection
</Button>
- </div>
+ </CardContent>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/SupabaseAuthorizePage/SupabaseAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/SupabaseAuthorizePage/SupabaseAuthorizePage.tsx
index 948324d1db..1e22b4dfb5 100644
--- a/frontend/src/pages/secret-manager/integrations/SupabaseAuthorizePage/SupabaseAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/SupabaseAuthorizePage/SupabaseAuthorizePage.tsx
@@ -1,19 +1,29 @@
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";
export const SupabaseAuthorizePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useSaveIntegrationAccessToken();
+ const { mutateAsync, isPending: isLoading } = useSaveIntegrationAccessToken();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const [apiKey, setApiKey] = useState("");
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const handleButtonClick = async () => {
try {
@@ -23,16 +33,12 @@ export const SupabaseAuthorizePage = () => {
return;
}
- setIsLoading(true);
-
const integrationAuth = await mutateAsync({
workspaceId: currentProject.id,
integration: "supabase",
accessToken: apiKey
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/supabase/create",
params: {
@@ -50,23 +56,31 @@ export const SupabaseAuthorizePage = () => {
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">Supabase Integration</CardTitle>
- <FormControl
- label="Supabase API 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 Supabase
- </Button>
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>Supabase Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="SupabaseAuthorizePage-field-1">Supabase API Token</FieldLabel>
+ <Input
+ id="SupabaseAuthorizePage-field-1"
+ aria-describedby="SupabaseAuthorizePage-field-1-feedback"
+ isError={apiKeyErrorText !== ""}
+ placeholder=""
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="SupabaseAuthorizePage-field-1-feedback">{apiKeyErrorText}</FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Supabase
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/SupabaseConfigurePage/SupabaseConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/SupabaseConfigurePage/SupabaseConfigurePage.tsx
index 6074598ef0..356aaf8be2 100644
--- a/frontend/src/pages/secret-manager/integrations/SupabaseConfigurePage/SupabaseConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/SupabaseConfigurePage/SupabaseConfigurePage.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";
@@ -21,7 +28,7 @@ import { IntegrationsListPageTabs } from "@app/types/integrations";
export const SupabaseConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentProject } = useProject();
const { currentOrg } = useOrganization();
const integrationAuthId = useSearch({
@@ -40,8 +47,6 @@ export const SupabaseConfigurePage = () => {
const [secretPath, setSecretPath] = useState("/");
const [targetApp, setTargetApp] = useState("");
- const [isLoading, setIsLoading] = useState(false);
-
useEffect(() => {
if (integrationAuthApps) {
if (integrationAuthApps.length > 0) {
@@ -56,8 +61,6 @@ export const SupabaseConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
@@ -69,8 +72,6 @@ export const SupabaseConfigurePage = () => {
secretPath
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -88,63 +89,89 @@ export const SupabaseConfigurePage = () => {
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">Supabase 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}`}
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>Supabase Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field>
+ <FieldLabel htmlFor="SupabaseConfigurePage-field-1">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger
+ id="SupabaseConfigurePage-field-1"
+ aria-describedby="SupabaseConfigurePage-field-1-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="SupabaseConfigurePage-field-2">Secrets Path</FieldLabel>
+ <Input
+ id="SupabaseConfigurePage-field-2"
+ aria-describedby="SupabaseConfigurePage-field-2-feedback"
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ />
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="SupabaseConfigurePage-field-3">Supabase Project</FieldLabel>
+ <Select
+ value={targetApp}
+ onValueChange={(val) => setTargetApp(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger
+ id="SupabaseConfigurePage-field-3"
+ aria-describedby="SupabaseConfigurePage-field-3-feedback"
+ className="w-full"
>
- {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="Supabase Project" className="mt-4">
- <Select
- value={targetApp}
- onValueChange={(val) => setTargetApp(val)}
- className="w-full border border-border-strong"
+ <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 border-t pt-4">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
isDisabled={integrationAuthApps.length === 0}
+ variant="project"
>
- {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="secondary"
- className="mt-4"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/TeamcityAuthorizePage/TeamcityAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/TeamcityAuthorizePage/TeamcityAuthorizePage.tsx
index a4b2c0b5bb..63c2057994 100644
--- a/frontend/src/pages/secret-manager/integrations/TeamcityAuthorizePage/TeamcityAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/TeamcityAuthorizePage/TeamcityAuthorizePage.tsx
@@ -1,16 +1,27 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
-import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
export const TeamcityAuthorizePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useSaveIntegrationAccessToken();
+ const { mutateAsync, isPending: isLoading } = useSaveIntegrationAccessToken();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
@@ -18,7 +29,6 @@ export const TeamcityAuthorizePage = () => {
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
const [serverUrl, setServerUrl] = useState("");
const [serverUrlErrorText, setServerUrlErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const handleButtonClick = async () => {
try {
@@ -35,8 +45,6 @@ export const TeamcityAuthorizePage = () => {
return;
}
- setIsLoading(true);
-
const integrationAuth = await mutateAsync({
workspaceId: currentProject.id,
integration: "teamcity",
@@ -44,8 +52,6 @@ export const TeamcityAuthorizePage = () => {
url: serverUrl
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/teamcity/create",
params: {
@@ -66,70 +72,60 @@ export const TeamcityAuthorizePage = () => {
<Helmet>
<title>Authorize TeamCity 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 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 pb-0.5">
- <img
- src="/images/integrations/TeamCity.png"
- height={28}
- width={28}
- alt="TeamCity logo"
- />
- </div>
- <span className="ml-2">TeamCity Integration</span>
- <a
- target="_blank"
- href="https://infisical.com/docs/integrations/cloud/teamcity"
- 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="TeamCity Access Token"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- className="px-6"
- >
- <Input
- placeholder="Access Token"
- value={apiKey}
- onChange={(e) => setApiKey(e.target.value)}
- />
- </FormControl>
- <FormControl
- label="TeamCity Server URL"
- errorText={serverUrlErrorText}
- isError={serverUrlErrorText !== ""}
- className="px-6"
- >
- <Input
- placeholder="https://example.teamcity.com"
- value={serverUrl}
- onChange={(e) => setServerUrl(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 TeamCity
- </Button>
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/TeamCity.png"
+ height={28}
+ width={28}
+ alt="TeamCity logo"
+ />
+ TeamCity Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/teamcity" />
+ </CardTitle>
+ <CardDescription>
+ After adding the details below, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="TeamcityAuthorizePage-field-1">TeamCity Access Token</FieldLabel>
+ <Input
+ id="TeamcityAuthorizePage-field-1"
+ aria-describedby="TeamcityAuthorizePage-field-1-feedback"
+ isError={apiKeyErrorText !== ""}
+ placeholder="Access Token"
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="TeamcityAuthorizePage-field-1-feedback">{apiKeyErrorText}</FieldError>
+ )}
+ </Field>
+ <Field data-invalid={serverUrlErrorText !== ""}>
+ <FieldLabel htmlFor="TeamcityAuthorizePage-field-2">TeamCity Server URL</FieldLabel>
+ <Input
+ id="TeamcityAuthorizePage-field-2"
+ aria-describedby="TeamcityAuthorizePage-field-2-feedback"
+ isError={serverUrlErrorText !== ""}
+ placeholder="https://example.teamcity.com"
+ value={serverUrl}
+ onChange={(e) => setServerUrl(e.target.value)}
+ />
+ {serverUrlErrorText !== "" && (
+ <FieldError id="TeamcityAuthorizePage-field-2-feedback">
+ {serverUrlErrorText}
+ </FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to TeamCity
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/TeamcityConfigurePage/TeamcityConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/TeamcityConfigurePage/TeamcityConfigurePage.tsx
index 8fc95ac3b0..c76d73d62a 100644
--- a/frontend/src/pages/secret-manager/integrations/TeamcityConfigurePage/TeamcityConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/TeamcityConfigurePage/TeamcityConfigurePage.tsx
@@ -1,18 +1,27 @@
import { useEffect, useState } from "react";
import { Helmet } from "react-helmet";
-import { faArrowUpRightFromSquare, faBookOpen, faBugs } from "@fortawesome/free-solid-svg-icons";
+import { faBugs } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate, useSearch } from "@tanstack/react-router";
import {
Button,
Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ DocumentationLinkBadge,
+ 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";
@@ -25,7 +34,7 @@ import { IntegrationsListPageTabs } from "@app/types/integrations";
export const TeamcityConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentProject } = useProject();
const { currentOrg } = useOrganization();
const integrationAuthId = useSearch({
@@ -39,7 +48,6 @@ export const TeamcityConfigurePage = () => {
const [targetAppId, setTargetAppId] = useState("");
const [targetBuildConfigId, setTargetBuildConfigId] = useState<string>("");
const [secretPath, setSecretPath] = useState("/");
- const [isLoading, setIsLoading] = useState(false);
const { data: integrationAuth, isPending: isIntegrationAuthLoading } = useGetIntegrationAuthById(
(integrationAuthId as string) ?? ""
@@ -68,8 +76,6 @@ export const TeamcityConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
const targetEnvironment = targetBuildConfigs?.find(
(buildConfig) => buildConfig.buildConfigId === targetBuildConfigId
);
@@ -87,8 +93,6 @@ export const TeamcityConfigurePage = () => {
secretPath
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -113,116 +117,136 @@ export const TeamcityConfigurePage = () => {
<Helmet>
<title>Set Up TeamCity 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="Choose which environment or folders in Infisical you want to sync to which project in TeamCity."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center pb-0.5">
- <img
- src="/images/integrations/TeamCity.png"
- height={28}
- width={28}
- alt="TeamCity logo"
- />
- </div>
- <span className="ml-2">TeamCity Integration</span>
- <a
- href="https://infisical.com/docs/integrations/cloud/teamcity"
- target="_blank"
- rel="noopener noreferrer"
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/TeamCity.png"
+ height={28}
+ width={28}
+ alt="TeamCity logo"
+ />
+ TeamCity Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/teamcity" />
+ </CardTitle>
+ <CardDescription>
+ Choose which environment or folders in Infisical you want to sync to which project in
+ TeamCity.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field>
+ <FieldLabel htmlFor="TeamcityConfigurePage-field-1">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
>
- <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="px-6">
- <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}`}
+ <SelectTrigger
+ id="TeamcityConfigurePage-field-1"
+ aria-describedby="TeamcityConfigurePage-field-1-feedback"
+ className="w-full"
>
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path" className="px-6">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl label="TeamCity Project" className="px-6">
- <Select
- value={targetAppId}
- onValueChange={(val) => setTargetAppId(val)}
- className="w-full border border-border-strong"
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TeamcityConfigurePage-field-2">Secrets Path</FieldLabel>
+ <Input
+ id="TeamcityConfigurePage-field-2"
+ aria-describedby="TeamcityConfigurePage-field-2-feedback"
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ />
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TeamcityConfigurePage-field-3">TeamCity Project</FieldLabel>
+ <Select
+ value={targetAppId}
+ onValueChange={(val) => setTargetAppId(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger
+ id="TeamcityConfigurePage-field-3"
+ aria-describedby="TeamcityConfigurePage-field-3-feedback"
+ className="w-full"
+ >
+ <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 projects found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TeamcityConfigurePage-field-4">
+ Team City Build Config (Optional)
+ </FieldLabel>
+ <Select
+ value={targetBuildConfigId}
+ onValueChange={(val) => setTargetBuildConfigId(val)}
+ disabled={targetBuildConfigs.length === 0}
+ >
+ <SelectTrigger
+ id="TeamcityConfigurePage-field-4"
+ aria-describedby="TeamcityConfigurePage-field-4-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {targetBuildConfigs.length ? (
+ targetBuildConfigs.map((buildConfig: any) => (
+ <SelectItem
+ value={buildConfig.buildConfigId}
+ key={`target-build-config-${buildConfig.buildConfigId}`}
+ >
+ {buildConfig.name}
+ </SelectItem>
+ ))
+ ) : (
+ <SelectItem value="none" key="target-app-none">
+ No build configs found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
isDisabled={integrationAuthApps.length === 0}
+ variant="project"
>
- {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 projects found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- <FormControl label="Team City Build Config (Optional)" className="px-6">
- <Select
- value={targetBuildConfigId}
- onValueChange={(val) => setTargetBuildConfigId(val)}
- className="w-full border border-border-strong"
- isDisabled={targetBuildConfigs.length === 0}
- >
- {targetBuildConfigs.length ? (
- targetBuildConfigs.map((buildConfig: any) => (
- <SelectItem
- value={buildConfig.buildConfigId}
- key={`target-build-config-${buildConfig.buildConfigId}`}
- >
- {buildConfig.name}
- </SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-app-none">
- No build configs found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/TerraformCloudAuthorizePage/TerraformCloudAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/TerraformCloudAuthorizePage/TerraformCloudAuthorizePage.tsx
index 5639b5c13a..474b0133f9 100644
--- a/frontend/src/pages/secret-manager/integrations/TerraformCloudAuthorizePage/TerraformCloudAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/TerraformCloudAuthorizePage/TerraformCloudAuthorizePage.tsx
@@ -1,23 +1,33 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
-import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ DocumentationLinkBadge,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
export const TerraformCloudAuthorizePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useSaveIntegrationAccessToken();
+ const { mutateAsync, isPending: isLoading } = useSaveIntegrationAccessToken();
const { currentProject } = useProject();
const { currentOrg } = useOrganization();
const [apiKey, setApiKey] = useState("");
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
const [workspacesId, setWorkSpacesId] = useState("");
const [workspacesIdErrorText, setWorkspacesIdErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const handleButtonClick = async () => {
try {
@@ -34,8 +44,6 @@ export const TerraformCloudAuthorizePage = () => {
return;
}
- setIsLoading(true);
-
const integrationAuth = await mutateAsync({
workspaceId: currentProject.id,
integration: "terraform-cloud",
@@ -43,8 +51,6 @@ export const TerraformCloudAuthorizePage = () => {
accessToken: apiKey
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/terraform-cloud/create",
params: {
@@ -65,72 +71,68 @@ export const TerraformCloudAuthorizePage = () => {
<Helmet>
<title>Authorize Terraform Cloud 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/Terraform.png"
- height={35}
- width={35}
- alt="Terraform logo"
- />
- </div>
- <span className="ml-1.5">Terraform Cloud Integration </span>
- <a
- target="_blank"
- href="https://infisical.com/docs/integrations/cloud/terraform-cloud"
- 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="Terraform Cloud Workspace ID"
- errorText={workspacesIdErrorText}
- isError={workspacesIdErrorText !== ""}
- className="px-6"
- >
- <Input
- placeholder="Workspace Id"
- value={workspacesId}
- onChange={(e) => setWorkSpacesId(e.target.value)}
- />
- </FormControl>
- <FormControl
- label="Terraform Cloud API Token"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- className="px-6"
- >
- <Input
- placeholder="API Token"
- value={apiKey}
- type="password"
- autoComplete="new-password"
- 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 Terraform Cloud
- </Button>
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/Terraform.png"
+ height={35}
+ width={35}
+ alt="Terraform logo"
+ />
+ Terraform Cloud Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/terraform-cloud" />
+ </CardTitle>
+ <CardDescription>
+ After adding the details below, you will be prompted to set up an integration for a
+ particular Infisical project and environment.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field data-invalid={workspacesIdErrorText !== ""}>
+ <FieldLabel htmlFor="TerraformCloudAuthorizePage-field-1">
+ Terraform Cloud Workspace ID
+ </FieldLabel>
+ <Input
+ id="TerraformCloudAuthorizePage-field-1"
+ aria-describedby="TerraformCloudAuthorizePage-field-1-feedback"
+ isError={workspacesIdErrorText !== ""}
+ placeholder="Workspace Id"
+ value={workspacesId}
+ onChange={(e) => setWorkSpacesId(e.target.value)}
+ />
+ {workspacesIdErrorText !== "" && (
+ <FieldError id="TerraformCloudAuthorizePage-field-1-feedback">
+ {workspacesIdErrorText}
+ </FieldError>
+ )}
+ </Field>
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="TerraformCloudAuthorizePage-field-2">
+ Terraform Cloud API Token
+ </FieldLabel>
+ <Input
+ id="TerraformCloudAuthorizePage-field-2"
+ aria-describedby="TerraformCloudAuthorizePage-field-2-feedback"
+ isError={apiKeyErrorText !== ""}
+ placeholder="API Token"
+ value={apiKey}
+ type="password"
+ autoComplete="new-password"
+ onChange={(e) => setApiKey(e.target.value)}
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="TerraformCloudAuthorizePage-field-2-feedback">
+ {apiKeyErrorText}
+ </FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Terraform Cloud
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/TerraformCloudConfigurePage/TerraformCloudConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/TerraformCloudConfigurePage/TerraformCloudConfigurePage.tsx
index 9f6d21eb77..fcd852c760 100644
--- a/frontend/src/pages/secret-manager/integrations/TerraformCloudConfigurePage/TerraformCloudConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/TerraformCloudConfigurePage/TerraformCloudConfigurePage.tsx
@@ -1,18 +1,26 @@
import { useEffect, useState } from "react";
import { Helmet } from "react-helmet";
-import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate, useSearch } from "@tanstack/react-router";
import {
Button,
Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ DocumentationLinkBadge,
+ 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";
@@ -42,7 +50,7 @@ const variableTypes = [{ name: "env" }, { name: "terraform" }];
export const TerraformCloudConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
@@ -63,7 +71,7 @@ export const TerraformCloudConfigurePage = () => {
const [secretPath, setSecretPath] = useState("/");
const [variableType, setVariableType] = useState(variableTypes[0].name);
const [variableTypeErrorText, setVariableTypeErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
+
const [initialSyncBehavior, setInitialSyncBehavior] = useState("prefer-source");
useEffect(() => {
@@ -86,8 +94,6 @@ export const TerraformCloudConfigurePage = () => {
return;
}
- setIsLoading(true);
-
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
@@ -103,8 +109,6 @@ export const TerraformCloudConfigurePage = () => {
}
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -125,126 +129,154 @@ export const TerraformCloudConfigurePage = () => {
<Helmet>
<title>Create Terraform Cloud Integration</title>
</Helmet>
- <Card className="max-w-lg rounded-md border border-border-control">
- <CardTitle
- className="px-6 text-left text-xl"
- subTitle="Specify the encironment and path within Infisical that you want to push to which project in Terraform."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <img
- src="/images/integrations/Terraform.png"
- height={35}
- width={35}
- alt="Terraform logo"
- />
- </div>
- <span className="ml-1.5">Terraform Cloud Integration </span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://infisical.com/docs/integrations/cloud/terraform-cloud"
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img
+ src="/images/integrations/Terraform.png"
+ height={35}
+ width={35}
+ alt="Terraform logo"
+ />
+ Terraform Cloud Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/terraform-cloud" />
+ </CardTitle>
+ <CardDescription>
+ Specify the encironment and path within Infisical that you want to push to which project
+ in Terraform.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field>
+ <FieldLabel htmlFor="TerraformCloudConfigurePage-field-1">
+ Project Environment
+ </FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
>
- <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="px-6">
- <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}`}
+ <SelectTrigger
+ id="TerraformCloudConfigurePage-field-1"
+ aria-describedby="TerraformCloudConfigurePage-field-1-feedback"
+ className="w-full"
>
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path" className="px-6">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl
- label="Category"
- className="px-6"
- errorText={variableTypeErrorText}
- isError={variableTypeErrorText !== ""}
- >
- <Select
- value={variableType}
- onValueChange={(val) => setVariableType(val)}
- className="w-full border border-border-strong"
- >
- {variableTypes.map((variable) => (
- <SelectItem value={variable.name} key={`target-app-${variable.name}`}>
- {variable.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Terraform Cloud 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-app-${integrationAuthApp.name}`}
- >
- {integrationAuthApp.name}
- </SelectItem>
- ))
- ) : (
- <SelectItem value="none" key="target-app-none">
- No project found
- </SelectItem>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TerraformCloudConfigurePage-field-2">Secrets Path</FieldLabel>
+ <Input
+ id="TerraformCloudConfigurePage-field-2"
+ aria-describedby="TerraformCloudConfigurePage-field-2-feedback"
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ />
+ </Field>
+ <Field data-invalid={variableTypeErrorText !== ""}>
+ <FieldLabel htmlFor="TerraformCloudConfigurePage-field-3">Category</FieldLabel>
+ <Select value={variableType} onValueChange={(val) => setVariableType(val)}>
+ <SelectTrigger
+ id="TerraformCloudConfigurePage-field-3"
+ aria-describedby="TerraformCloudConfigurePage-field-3-feedback"
+ isError={variableTypeErrorText !== ""}
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {variableTypes.map((variable) => (
+ <SelectItem value={variable.name} key={`target-app-${variable.name}`}>
+ {variable.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {variableTypeErrorText !== "" && (
+ <FieldError id="TerraformCloudConfigurePage-field-3-feedback">
+ {variableTypeErrorText}
+ </FieldError>
)}
- </Select>
- </FormControl>
- <FormControl label="Initial Sync Behavior" className="px-6">
- <Select
- value={initialSyncBehavior}
- onValueChange={(e) => setInitialSyncBehavior(e)}
- className="w-full border border-border-control"
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TerraformCloudConfigurePage-field-4">
+ Terraform Cloud Project
+ </FieldLabel>
+ <Select
+ value={targetApp}
+ onValueChange={(val) => setTargetApp(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger
+ id="TerraformCloudConfigurePage-field-4"
+ aria-describedby="TerraformCloudConfigurePage-field-4-feedback"
+ className="w-full"
+ >
+ <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 project found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TerraformCloudConfigurePage-field-5">
+ Initial Sync Behavior
+ </FieldLabel>
+ <Select value={initialSyncBehavior} onValueChange={(e) => setInitialSyncBehavior(e)}>
+ <SelectTrigger
+ id="TerraformCloudConfigurePage-field-5"
+ aria-describedby="TerraformCloudConfigurePage-field-5-feedback"
+ className="w-full"
+ >
+ <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 border-t pt-4">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
+ isDisabled={integrationAuthApps.length === 0}
+ variant="project"
>
- {initialSyncBehaviors.map((b) => {
- return (
- <SelectItem value={b.value} key={`sync-behavior-${b.value}`}>
- {b.label}
- </SelectItem>
- );
- })}
- </Select>
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="primary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto w-min"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/TravisCIAuthorizePage/TravisCIAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/TravisCIAuthorizePage/TravisCIAuthorizePage.tsx
index 86d1db1eae..048da1bce6 100644
--- a/frontend/src/pages/secret-manager/integrations/TravisCIAuthorizePage/TravisCIAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/TravisCIAuthorizePage/TravisCIAuthorizePage.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";
@@ -9,11 +20,10 @@ export const TravisCIAuthorizePage = () => {
const navigate = useNavigate();
const { currentProject } = useProject();
const { currentOrg } = useOrganization();
- const { mutateAsync } = useSaveIntegrationAccessToken();
+ const { mutateAsync, isPending: isLoading } = useSaveIntegrationAccessToken();
const [apiKey, setApiKey] = useState("");
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const handleButtonClick = async () => {
try {
@@ -23,16 +33,12 @@ export const TravisCIAuthorizePage = () => {
return;
}
- setIsLoading(true);
-
const integrationAuth = await mutateAsync({
workspaceId: currentProject.id,
integration: "travisci",
accessToken: apiKey
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/travisci/create",
params: {
@@ -50,23 +56,31 @@ export const TravisCIAuthorizePage = () => {
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">Travis CI Integration</CardTitle>
- <FormControl
- label="Travis CI API 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 Travis CI
- </Button>
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>Travis CI Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="TravisCIAuthorizePage-field-1">Travis CI API Token</FieldLabel>
+ <Input
+ id="TravisCIAuthorizePage-field-1"
+ aria-describedby="TravisCIAuthorizePage-field-1-feedback"
+ isError={apiKeyErrorText !== ""}
+ placeholder=""
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="TravisCIAuthorizePage-field-1-feedback">{apiKeyErrorText}</FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Travis CI
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/TravisCIConfigurePage/TravisCIConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/TravisCIConfigurePage/TravisCIConfigurePage.tsx
index a6ec60f73b..f9f0ee93f6 100644
--- a/frontend/src/pages/secret-manager/integrations/TravisCIConfigurePage/TravisCIConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/TravisCIConfigurePage/TravisCIConfigurePage.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";
@@ -21,7 +28,7 @@ import { IntegrationsListPageTabs } from "@app/types/integrations";
export const TravisCIConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
@@ -41,7 +48,6 @@ export const TravisCIConfigurePage = () => {
);
const [targetApp, setTargetApp] = useState("");
const [secretPath, setSecretPath] = useState("/");
- const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
if (integrationAuthApps) {
@@ -57,8 +63,6 @@ export const TravisCIConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
@@ -70,8 +74,6 @@ export const TravisCIConfigurePage = () => {
secretPath
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -89,63 +91,89 @@ export const TravisCIConfigurePage = () => {
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">Travis CI 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}`}
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>Travis CI Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field>
+ <FieldLabel htmlFor="TravisCIConfigurePage-field-1">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger
+ id="TravisCIConfigurePage-field-1"
+ aria-describedby="TravisCIConfigurePage-field-1-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TravisCIConfigurePage-field-2">Secrets Path</FieldLabel>
+ <Input
+ id="TravisCIConfigurePage-field-2"
+ aria-describedby="TravisCIConfigurePage-field-2-feedback"
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ />
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="TravisCIConfigurePage-field-3">Travis CI Project</FieldLabel>
+ <Select
+ value={targetApp}
+ onValueChange={(val) => setTargetApp(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger
+ id="TravisCIConfigurePage-field-3"
+ aria-describedby="TravisCIConfigurePage-field-3-feedback"
+ className="w-full"
>
- {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="Travis CI Project" className="mt-4">
- <Select
- value={targetApp}
- onValueChange={(val) => setTargetApp(val)}
- className="w-full border border-border-strong"
+ <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 border-t pt-4">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
isDisabled={integrationAuthApps.length === 0}
+ variant="project"
>
- {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="secondary"
- className="mt-4"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (
diff --git a/frontend/src/pages/secret-manager/integrations/VercelConfigurePage/VercelConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/VercelConfigurePage/VercelConfigurePage.tsx
index d6cfaa66c1..b7a23d228c 100644
--- a/frontend/src/pages/secret-manager/integrations/VercelConfigurePage/VercelConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/VercelConfigurePage/VercelConfigurePage.tsx
@@ -1,24 +1,35 @@
import { useEffect, useMemo, useState } from "react";
import { Helmet } from "react-helmet";
-import {
- faArrowUpRightFromSquare,
- faBookOpen,
- faBugs,
- faCircleInfo
-} from "@fortawesome/free-solid-svg-icons";
+import { faBugs, faCircleInfo } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate, useSearch } from "@tanstack/react-router";
+import { InfoIcon } from "lucide-react";
import {
+ Alert,
+ AlertDescription,
+ AlertTitle,
Button,
Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
CardTitle,
- FormControl,
+ DocumentationLinkBadge,
+ Field,
+ FieldDescription,
+ FieldLabel,
Input,
Select,
+ SelectContent,
SelectItem,
- Tooltip
-} from "@app/components/v2";
+ SelectTrigger,
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { useCreateIntegration } from "@app/hooks/api";
@@ -50,7 +61,7 @@ const initialSyncBehaviors = [
export const VercelConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState(
@@ -63,7 +74,6 @@ export const VercelConfigurePage = () => {
const [targetAppId, setTargetAppId] = useState("");
const [targetEnvironment, setTargetEnvironment] = useState("");
const [targetBranch, setTargetBranch] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const integrationAuthId = useSearch({
from: ROUTE_PATHS.SecretManager.Integratons.VercelConfigurePage.id,
@@ -105,8 +115,6 @@ export const VercelConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
const targetApp = integrationAuthApps?.find(
(integrationAuthApp) => integrationAuthApp.appId === targetAppId
);
@@ -130,7 +138,6 @@ export const VercelConfigurePage = () => {
}
});
- setIsLoading(false);
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -171,170 +178,203 @@ export const VercelConfigurePage = () => {
integrationAuthApps &&
targetAppId &&
targetEnvironment ? (
- <div className="flex h-full w-full flex-col items-center justify-center">
+ <div className="flex h-full w-full flex-col items-center justify-center gap-6">
<Helmet>
<title>Set Up Vercel 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="Select which environment or folder in Infisical you want to sync to Vercel's environment variables."
- >
- <div className="flex flex-row items-center">
- <div className="flex items-center">
- <img src="/images/integrations/Vercel.png" height={30} width={30} alt="Vercel logo" />
- </div>
- <span className="ml-2">Vercel Integration </span>
- <a
- target="_blank"
- href="https://infisical.com/docs/integrations/cloud/vercel"
- rel="noopener noreferrer"
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>
+ <img src="/images/integrations/Vercel.png" height={30} width={30} alt="Vercel logo" />
+ Vercel Integration
+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/cloud/vercel" />
+ </CardTitle>
+ <CardDescription>
+ Select which environment or folder in Infisical you want to sync to Vercel&apos;s
+ environment variables.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field>
+ <FieldLabel htmlFor="VercelConfigurePage-field-1">
+ Infisical Project Environment
+ </FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
>
- <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="Infisical Project Environment" className="px-6">
- <Select
- value={selectedSourceEnvironment}
- onValueChange={(val) => setSelectedSourceEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {currentProject?.environments.map((sourceEnvironment) => (
- <SelectItem
- value={sourceEnvironment.slug}
- key={`azure-key-vault-environment-${sourceEnvironment.slug}`}
+ <SelectTrigger
+ id="VercelConfigurePage-field-1"
+ aria-describedby="VercelConfigurePage-field-1-feedback"
+ className="w-full"
>
- {sourceEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- <FormControl label="Secrets Path" className="px-6">
- <Input
- value={secretPath}
- onChange={(evt) => setSecretPath(evt.target.value)}
- placeholder="Provide a path, default is /"
- />
- </FormControl>
- <FormControl
- label="Vercel App"
- helperText={
- <Tooltip
- className="max-w-md"
- content="Double check Infisical's access permissions in Vercel by navigating to Team > Integrations > Infisical > Settings > Manage Access."
- >
- <div>
- <span>Don&#39;t see the project you&#39;re looking for?</span>{" "}
- <FontAwesomeIcon icon={faCircleInfo} className="text-muted" />
- </div>
- </Tooltip>
- }
- className="px-6"
- >
- <Select
- value={targetAppId}
- onValueChange={(val) => {
- if (vercelEnvironments.every((env) => env.slug !== targetEnvironment)) {
- setTargetEnvironment(vercelEnvironments[0].slug);
- }
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`azure-key-vault-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="VercelConfigurePage-field-2">Secrets Path</FieldLabel>
+ <Input
+ id="VercelConfigurePage-field-2"
+ aria-describedby="VercelConfigurePage-field-2-feedback"
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ />
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="VercelConfigurePage-field-3">Vercel App</FieldLabel>
+ <Select
+ value={targetAppId}
+ onValueChange={(val) => {
+ if (vercelEnvironments.every((env) => env.slug !== targetEnvironment)) {
+ setTargetEnvironment(vercelEnvironments[0].slug);
+ }
- 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 projects found
- </SelectItem>
- )}
- </Select>
- </FormControl>
- <FormControl label="Vercel App Environment" className="px-6">
- <Select
- value={targetEnvironment}
- onValueChange={(val) => setTargetEnvironment(val)}
- className="w-full border border-border-strong"
- >
- {selectedVercelEnvironments.map((vercelEnvironment) => (
- <SelectItem
- value={vercelEnvironment.slug}
- key={`target-environment-${vercelEnvironment.slug}`}
+ setTargetAppId(val);
+ }}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger
+ id="VercelConfigurePage-field-3"
+ aria-describedby="VercelConfigurePage-field-3-feedback"
+ className="w-full"
>
- {vercelEnvironment.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- {targetEnvironment === "preview" && filteredBranches && (
- <FormControl label="Vercel Preview Branch (Optional)" className="px-6">
+ <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 projects found
+ </SelectItem>
+ )}
+ </SelectContent>
+ </Select>
+ <FieldDescription id="VercelConfigurePage-field-3-feedback">
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span>
+ <span>Don&#39;t see the project you&#39;re looking for?</span>{" "}
+ <FontAwesomeIcon icon={faCircleInfo} className="text-muted" />
+ </span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-md">
+ {
+ "Double check Infisical's access permissions in Vercel by navigating to Team > Integrations > Infisical > Settings > Manage Access."
+ }
+ </TooltipContent>
+ </Tooltip>
+ </FieldDescription>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="VercelConfigurePage-field-4">Vercel App Environment</FieldLabel>
+ <Select value={targetEnvironment} onValueChange={(val) => setTargetEnvironment(val)}>
+ <SelectTrigger
+ id="VercelConfigurePage-field-4"
+ aria-describedby="VercelConfigurePage-field-4-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {selectedVercelEnvironments.map((vercelEnvironment) => (
+ <SelectItem
+ value={vercelEnvironment.slug}
+ key={`target-environment-${vercelEnvironment.slug}`}
+ >
+ {vercelEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ {targetEnvironment === "preview" && filteredBranches && (
+ <Field>
+ <FieldLabel htmlFor="VercelConfigurePage-field-5">
+ Vercel Preview Branch (Optional)
+ </FieldLabel>
+ <Select value={targetBranch} onValueChange={(val) => setTargetBranch(val)}>
+ <SelectTrigger
+ id="VercelConfigurePage-field-5"
+ aria-describedby="VercelConfigurePage-field-5-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {filteredBranches.map((branchName) => (
+ <SelectItem value={branchName} key={`target-branch-${branchName}`}>
+ {branchName}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ )}
+ <Field>
+ <FieldLabel htmlFor="VercelConfigurePage-field-6">Initial Sync Behavior</FieldLabel>
<Select
- value={targetBranch}
- onValueChange={(val) => setTargetBranch(val)}
- className="w-full border border-border-strong"
+ value={initialSyncBehavior}
+ onValueChange={(val) => setInitialSyncBehavior(val as IntegrationSyncBehavior)}
>
- {filteredBranches.map((branchName) => (
- <SelectItem value={branchName} key={`target-branch-${branchName}`}>
- {branchName}
- </SelectItem>
- ))}
+ <SelectTrigger
+ id="VercelConfigurePage-field-6"
+ aria-describedby="VercelConfigurePage-field-6-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {initialSyncBehaviors.map((syncBehavior) => (
+ <SelectItem
+ value={syncBehavior.value}
+ key={`sync-behavior-${syncBehavior.value}`}
+ >
+ {syncBehavior.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
</Select>
- </FormControl>
- )}
-
- <FormControl label="Initial Sync Behavior" className="px-6">
- <Select
- value={initialSyncBehavior}
- onValueChange={(val) => setInitialSyncBehavior(val as IntegrationSyncBehavior)}
- className="w-full border border-border-strong text-sm"
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
+ isDisabled={integrationAuthApps.length === 0}
+ variant="project"
>
- {initialSyncBehaviors.map((syncBehavior) => (
- <SelectItem value={syncBehavior.value} key={`sync-behavior-${syncBehavior.value}`}>
- {syncBehavior.label}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
-
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- variant="outline_bg"
- className="mt-2 mr-6 mb-6 ml-auto"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ 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">
- <div className="flex flex-row items-center">
- <FontAwesomeIcon icon={faCircleInfo} className="text-xl text-foreground-secondary" />{" "}
- <span className="text-md ml-3 text-foreground">Pro Tip</span>
- </div>
- <span className="mt-4 text-sm text-label">
+ <Alert variant="info" className="w-full max-w-lg">
+ <InfoIcon />
+ <AlertTitle>Pro Tip</AlertTitle>
+ <AlertDescription>
After creating an integration, your secrets will start syncing immediately. This might
cause an unexpected override of current secrets in Vercel with secrets from Infisical.
- </span>
- </div>
+ </AlertDescription>
+ </Alert>
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
diff --git a/frontend/src/pages/secret-manager/integrations/WindmillAuthorizePage/WindmillAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/WindmillAuthorizePage/WindmillAuthorizePage.tsx
index 1f52f84574..55dd3f1118 100644
--- a/frontend/src/pages/secret-manager/integrations/WindmillAuthorizePage/WindmillAuthorizePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/WindmillAuthorizePage/WindmillAuthorizePage.tsx
@@ -1,21 +1,35 @@
import { useState } from "react";
import { useNavigate } from "@tanstack/react-router";
+import { CircleHelpIcon } from "lucide-react";
-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import { isInfisicalCloud } from "@app/helpers/platform";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
export const WindmillAuthorizePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useSaveIntegrationAccessToken();
+ const { mutateAsync, isPending: isLoading } = useSaveIntegrationAccessToken();
const { currentProject } = useProject();
const { currentOrg } = useOrganization();
const [apiKey, setApiKey] = useState("");
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
const [apiUrl, setApiUrl] = useState<string | null>(null);
const [apiUrlErrorText, setApiUrlErrorText] = useState("");
- const [isLoading, setIsLoading] = useState(false);
const isLocalOrPrivateIpAddress = (url: string): boolean => {
try {
@@ -66,8 +80,6 @@ export const WindmillAuthorizePage = () => {
}
}
- setIsLoading(true);
-
const integrationAuth = await mutateAsync({
workspaceId: currentProject.id,
integration: "windmill",
@@ -75,8 +87,6 @@ export const WindmillAuthorizePage = () => {
url: apiUrl ?? undefined
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/windmill/create",
params: {
@@ -94,35 +104,59 @@ export const WindmillAuthorizePage = () => {
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">Windmill Integration</CardTitle>
- <FormControl
- label="Windmill Access Token"
- errorText={apiKeyErrorText}
- isError={apiKeyErrorText !== ""}
- >
- <Input placeholder="" value={apiKey} onChange={(e) => setApiKey(e.target.value)} />
- </FormControl>
- <FormControl
- label="Windmill Instance URL"
- errorText={apiUrlErrorText}
- isError={apiUrlErrorText !== ""}
- tooltipText="If you are using a custom domain, enter it here. Otherwise, leave it blank."
- >
- <Input
- value={apiUrl ?? ""}
- onChange={(e) => setApiUrl(e.target.value.trim() === "" ? null : e.target.value.trim())}
- placeholder="https://xxxx.windmill.dev"
- />
- </FormControl>
- <Button
- onClick={handleButtonClick}
- colorSchema="secondary"
- className="mt-4"
- isLoading={isLoading}
- >
- Connect to Windmill
- </Button>
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>Windmill Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field data-invalid={apiKeyErrorText !== ""}>
+ <FieldLabel htmlFor="WindmillAuthorizePage-field-1">Windmill Access Token</FieldLabel>
+ <Input
+ id="WindmillAuthorizePage-field-1"
+ aria-describedby="WindmillAuthorizePage-field-1-feedback"
+ isError={apiKeyErrorText !== ""}
+ placeholder=""
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ />
+ {apiKeyErrorText !== "" && (
+ <FieldError id="WindmillAuthorizePage-field-1-feedback">{apiKeyErrorText}</FieldError>
+ )}
+ </Field>
+ <Field data-invalid={apiUrlErrorText !== ""}>
+ <FieldLabel htmlFor="WindmillAuthorizePage-field-2">
+ Windmill Instance URL
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button type="button" aria-label="Windmill Instance URL">
+ <CircleHelpIcon className="size-3.5" />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ If you are using a custom domain, enter it here. Otherwise, leave it blank.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ id="WindmillAuthorizePage-field-2"
+ aria-describedby="WindmillAuthorizePage-field-2-feedback"
+ isError={apiUrlErrorText !== ""}
+ value={apiUrl ?? ""}
+ onChange={(e) =>
+ setApiUrl(e.target.value.trim() === "" ? null : e.target.value.trim())
+ }
+ placeholder="https://xxxx.windmill.dev"
+ />
+ {apiUrlErrorText !== "" && (
+ <FieldError id="WindmillAuthorizePage-field-2-feedback">{apiUrlErrorText}</FieldError>
+ )}
+ </Field>
+ </CardContent>
+ <CardFooter className="justify-end border-t pt-4">
+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">
+ Connect to Windmill
+ </Button>
+ </CardFooter>
</Card>
</div>
);
diff --git a/frontend/src/pages/secret-manager/integrations/WindmillConfigurePage/WindmillConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/WindmillConfigurePage/WindmillConfigurePage.tsx
index 826e59e8de..15f674c3bf 100644
--- a/frontend/src/pages/secret-manager/integrations/WindmillConfigurePage/WindmillConfigurePage.tsx
+++ b/frontend/src/pages/secret-manager/integrations/WindmillConfigurePage/WindmillConfigurePage.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";
@@ -21,7 +28,7 @@ import { IntegrationsListPageTabs } from "@app/types/integrations";
export const WindmillConfigurePage = () => {
const navigate = useNavigate();
- const { mutateAsync } = useCreateIntegration();
+ const { mutateAsync, isPending: isLoading } = useCreateIntegration();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
@@ -41,8 +48,6 @@ export const WindmillConfigurePage = () => {
const [secretPath, setSecretPath] = useState("/");
const [targetApp, setTargetApp] = useState("");
- const [isLoading, setIsLoading] = useState(false);
-
useEffect(() => {
if (integrationAuthApps) {
if (integrationAuthApps.length > 0) {
@@ -57,8 +62,6 @@ export const WindmillConfigurePage = () => {
try {
if (!integrationAuth?.id) return;
- setIsLoading(true);
-
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
@@ -71,8 +74,6 @@ export const WindmillConfigurePage = () => {
url: integrationAuth.url ?? undefined
});
- setIsLoading(false);
-
navigate({
to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",
params: {
@@ -90,63 +91,89 @@ export const WindmillConfigurePage = () => {
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">Windmill 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}`}
+ <Card className="w-full max-w-lg">
+ <CardHeader>
+ <CardTitle>Windmill Integration</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <Field>
+ <FieldLabel htmlFor="WindmillConfigurePage-field-1">Project Environment</FieldLabel>
+ <Select
+ value={selectedSourceEnvironment}
+ onValueChange={(val) => setSelectedSourceEnvironment(val)}
+ >
+ <SelectTrigger
+ id="WindmillConfigurePage-field-1"
+ aria-describedby="WindmillConfigurePage-field-1-feedback"
+ className="w-full"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {currentProject?.environments.map((sourceEnvironment) => (
+ <SelectItem
+ value={sourceEnvironment.slug}
+ key={`source-environment-${sourceEnvironment.slug}`}
+ >
+ {sourceEnvironment.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="WindmillConfigurePage-field-2">Secrets Path</FieldLabel>
+ <Input
+ id="WindmillConfigurePage-field-2"
+ aria-describedby="WindmillConfigurePage-field-2-feedback"
+ value={secretPath}
+ onChange={(evt) => setSecretPath(evt.target.value)}
+ placeholder="Provide a path, default is /"
+ />
+ </Field>
+ <Field>
+ <FieldLabel htmlFor="WindmillConfigurePage-field-3">Windmill Workspace</FieldLabel>
+ <Select
+ value={targetApp}
+ onValueChange={(val) => setTargetApp(val)}
+ disabled={integrationAuthApps.length === 0}
+ >
+ <SelectTrigger
+ id="WindmillConfigurePage-field-3"
+ aria-describedby="WindmillConfigurePage-field-3-feedback"
+ className="w-full"
>
- {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="Windmill Workspace" className="mt-4">
- <Select
- value={targetApp}
- onValueChange={(val) => setTargetApp(val)}
- className="w-full border border-border-strong"
+ <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 border-t pt-4">
+ <Button
+ onClick={handleButtonClick}
+ isPending={isLoading}
isDisabled={integrationAuthApps.length === 0}
+ variant="project"
>
- {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="secondary"
- className="mt-4"
- isLoading={isLoading}
- isDisabled={integrationAuthApps.length === 0}
- >
- Create Integration
- </Button>
+ Create Integration
+ </Button>
+ </CardFooter>
</Card>
</div>
) : (