Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement(secret-manager): migrate native integration creation pages to V3 (S12) (#8617)
Andrew Huang91d39ff0e003
diff --git a/frontend/src/pages/secret-manager/integrations/CloudflarePagesAuthorizePage/CloudflarePagesAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/CloudflarePagesAuthorizePage/CloudflarePagesAuthorizePage.tsxindex b46c8cd122..dfdd0f7d7b 100644--- a/frontend/src/pages/secret-manager/integrations/CloudflarePagesAuthorizePage/CloudflarePagesAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/CloudflarePagesAuthorizePage/CloudflarePagesAuthorizePage.tsx@@ -1,7 +1,19 @@import { useState } from "react";import { useNavigate } from "@tanstack/react-router";-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";+import {+ Button,+ Card,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useOrganization, useProject } from "@app/context";import { useSaveIntegrationAccessToken } from "@app/hooks/api";@@ -38,7 +50,6 @@ export const CloudflarePagesAuthorizePage = () => {setAccessKey("");setAccountId("");- setIsLoading(false);navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/cloudflare-pages/create",@@ -52,50 +63,74 @@ export const CloudflarePagesAuthorizePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};return (<div className="flex h-full w-full items-center justify-center">- <Card className="mb-12 max-w-lg rounded-md border border-border-control">- <CardTitle- className="px-6 text-left"- subTitle="After adding your API-key, you will be prompted to set up an integration for a particular Infisical project and environment."- >- Cloudflare Pages Integration- </CardTitle>- <FormControl- label="Cloudflare Pages API token"- errorText={accessKeyErrorText}- isError={accessKeyErrorText !== ""}- className="mx-6"- >- <Input- placeholder=""- value={accessKey}- type="password"- autoComplete="new-password"- onChange={(e) => setAccessKey(e.target.value)}- />- </FormControl>- <FormControl- label="Cloudflare Pages Account ID"- errorText={accountIdErrorText}- isError={accountIdErrorText !== ""}- className="mx-6"- >- <Input placeholder="" value={accountId} onChange={(e) => setAccountId(e.target.value)} />- </FormControl>- <Button- onClick={handleButtonClick}- colorSchema="secondary"- variant="outline_bg"- className="mt-2 mr-6 mb-6 ml-auto w-min"- isFullWidth={false}- isLoading={isLoading}- >- Connect to Cloudflare Pages- </Button>+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>Cloudflare Pages Integration</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-5">+ <Field data-invalid={accessKeyErrorText !== ""}>+ <FieldLabel htmlFor="cloudflarepages-cloudflare-pages-api-token">+ Cloudflare Pages API token+ </FieldLabel>+ <Input+ placeholder=""+ value={accessKey}+ type="password"+ autoComplete="new-password"+ onChange={(e) => setAccessKey(e.target.value)}+ id="cloudflarepages-cloudflare-pages-api-token"+ isError={accessKeyErrorText !== ""}+ aria-describedby={+ accessKeyErrorText !== ""+ ? "cloudflarepages-cloudflare-pages-api-token-error"+ : undefined+ }+ />+ {accessKeyErrorText !== "" && (+ <FieldError id="cloudflarepages-cloudflare-pages-api-token-error">+ {accessKeyErrorText}+ </FieldError>+ )}+ </Field>+ <Field data-invalid={accountIdErrorText !== ""}>+ <FieldLabel htmlFor="cloudflarepages-cloudflare-pages-account-id">+ Cloudflare Pages Account ID+ </FieldLabel>+ <Input+ placeholder=""+ value={accountId}+ onChange={(e) => setAccountId(e.target.value)}+ id="cloudflarepages-cloudflare-pages-account-id"+ isError={accountIdErrorText !== ""}+ aria-describedby={+ accountIdErrorText !== ""+ ? "cloudflarepages-cloudflare-pages-account-id-error"+ : undefined+ }+ />+ {accountIdErrorText !== "" && (+ <FieldError id="cloudflarepages-cloudflare-pages-account-id-error">+ {accountIdErrorText}+ </FieldError>+ )}+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">+ Connect to Cloudflare Pages+ </Button>+ </CardFooter></Card></div>);diff --git a/frontend/src/pages/secret-manager/integrations/CloudflarePagesConfigurePage/CloudflarePagesConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/CloudflarePagesConfigurePage/CloudflarePagesConfigurePage.tsxindex 049ec20e8b..7d72458cb7 100644--- a/frontend/src/pages/secret-manager/integrations/CloudflarePagesConfigurePage/CloudflarePagesConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/CloudflarePagesConfigurePage/CloudflarePagesConfigurePage.tsx@@ -4,13 +4,21 @@ import { useNavigate, useSearch } from "@tanstack/react-router";import {Button,Card,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,CardTitle,- FormControl,+ Field,+ 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, useGetWorkspaceById } from "@app/hooks/api";@@ -113,97 +121,121 @@ export const CloudflarePagesConfigurePage = () => {targetEnvironment &&targetApp ? (<div className="flex h-full w-full items-center justify-center bg-linear-to-tr from-surface-base to-page-deep">- <Card className="max-w-lg rounded-md border border-border-control p-0">- <CardTitle- className="px-6 text-left"- subTitle="Choose which environment in Infisical you want to sync with your Cloudflare Pages project."- >- Cloudflare Pages Integration- </CardTitle>- <FormControl label="Infisical Project Environment" className="mt-2 px-6">- <Select- value={selectedSourceEnvironment}- onValueChange={(val) => setSelectedSourceEnvironment(val)}- className="w-full border border-border-strong"- >- {workspace?.environments.map((sourceEnvironment) => (- <SelectItem- value={sourceEnvironment.slug}- key={`source-environment-${sourceEnvironment.slug}`}- >- {sourceEnvironment.name}- </SelectItem>- ))}- </Select>- </FormControl>- <FormControl label="Infisical Secret Path" className="mt-2 px-6">- <SecretPathInput- value={secretPath}- onChange={(value) => setSecretPath(value)}- environment={selectedSourceEnvironment}- placeholder="Provide a path, default is /"- />- </FormControl>- <FormControl label="Cloudflare Pages Project" className="mt-4 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 apps found- </SelectItem>- )}- </Select>- </FormControl>- <FormControl label="Cloudflare Pages Environment" className="mt-4 px-6">- <Select- value={targetEnvironment}- onValueChange={(val) => setTargetEnvironment(val)}- className="w-full border border-border-strong"- >- {cloudflareEnvironments.map((cloudflareEnvironment) => (- <SelectItem- value={cloudflareEnvironment.slug}- key={`target-environment-${cloudflareEnvironment.slug}`}- >- {cloudflareEnvironment.name}- </SelectItem>- ))}- </Select>- </FormControl>- {targetEnvironment === "production" && (- <div className="mb-[2.36rem] ml-1 px-6">- <Switch- id="redeploy-cloudflare-pages"- onCheckedChange={(isChecked: boolean) => setShouldAutoRedeploy(isChecked)}- isChecked={shouldAutoRedeploy}+ <Card className="w-full max-w-lg">+ <CardHeader>+ <CardTitle>Cloudflare Pages Integration</CardTitle>+ <CardDescription>+ Choose which environment in Infisical you want to sync with your Cloudflare Pages+ project.+ </CardDescription>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field className="mt-2" data-invalid={false}>+ <FieldLabel htmlFor="cloudflarepages-infisical-project-environment">+ Infisical Project Environment+ </FieldLabel>+ <Select+ value={selectedSourceEnvironment}+ onValueChange={(val) => setSelectedSourceEnvironment(val)}>- Auto-redeploy service upon secret change- </Switch>- </div>- )}- <Button- onClick={handleButtonClick}- colorSchema="secondary"- variant="outline_bg"- className="mt-2 mr-6 mb-6 ml-auto"- isFullWidth={false}- isLoading={isLoading}- >- Create Integration- </Button>+ <SelectTrigger className="w-full" id="cloudflarepages-infisical-project-environment">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {workspace?.environments.map((sourceEnvironment) => (+ <SelectItem+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}+ >+ {sourceEnvironment.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>+ <Field className="mt-2" data-invalid={false}>+ <FieldLabel htmlFor="cloudflarepages-infisical-secret-path">+ Infisical Secret Path+ </FieldLabel>+ <SecretPathInput+ value={secretPath}+ onChange={(value) => setSecretPath(value)}+ environment={selectedSourceEnvironment}+ placeholder="Provide a path, default is /"+ id="cloudflarepages-infisical-secret-path"+ />+ </Field>+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="cloudflarepages-cloudflare-pages-project">+ Cloudflare Pages Project+ </FieldLabel>+ <Select+ value={targetApp}+ onValueChange={(val) => setTargetApp(val)}+ disabled={integrationAuthApps.length === 0}+ >+ <SelectTrigger className="w-full" id="cloudflarepages-cloudflare-pages-project">+ <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 apps found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ </Field>+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="cloudflarepages-cloudflare-pages-environment">+ Cloudflare Pages Environment+ </FieldLabel>+ <Select value={targetEnvironment} onValueChange={(val) => setTargetEnvironment(val)}>+ <SelectTrigger className="w-full" id="cloudflarepages-cloudflare-pages-environment">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {cloudflareEnvironments.map((cloudflareEnvironment) => (+ <SelectItem+ value={cloudflareEnvironment.slug}+ key={`target-environment-${cloudflareEnvironment.slug}`}+ >+ {cloudflareEnvironment.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>+ {targetEnvironment === "production" && (+ <div className="mb-[2.36rem] ml-1">+ <Field orientation="horizontal">+ <FieldLabel htmlFor="redeploy-cloudflare-pages">+ Auto-redeploy service upon secret change+ </FieldLabel>+ <Toggle+ id="redeploy-cloudflare-pages"+ onCheckedChange={(isChecked: boolean) => setShouldAutoRedeploy(isChecked)}+ checked={shouldAutoRedeploy}+ variant="project"+ />+ </Field>+ </div>+ )}+ </CardContent>+ <CardFooter className="justify-end">+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">+ Create Integration+ </Button>+ </CardFooter></Card></div>) : (diff --git a/frontend/src/pages/secret-manager/integrations/CloudflareWorkersAuthorizePage/CloudflareWorkersAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/CloudflareWorkersAuthorizePage/CloudflareWorkersAuthorizePage.tsxindex 07be06ba67..428419331b 100644--- a/frontend/src/pages/secret-manager/integrations/CloudflareWorkersAuthorizePage/CloudflareWorkersAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/CloudflareWorkersAuthorizePage/CloudflareWorkersAuthorizePage.tsx@@ -1,7 +1,19 @@import { useState } from "react";import { useNavigate } from "@tanstack/react-router";-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";+import {+ Button,+ Card,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useOrganization, useProject } from "@app/context";import { useSaveIntegrationAccessToken } from "@app/hooks/api";@@ -38,7 +50,6 @@ export const CloudflareWorkersAuthorizePage = () => {setAccessKey("");setAccountId("");- setIsLoading(false);navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/cloudflare-workers/create",@@ -52,50 +63,74 @@ export const CloudflareWorkersAuthorizePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};return (<div className="flex h-full w-full items-center justify-center">- <Card className="mb-12 max-w-lg rounded-md border border-border-control">- <CardTitle- className="px-6 text-left"- subTitle="After adding your API-key, you will be prompted to set up an integration for a particular Infisical project and environment."- >- Cloudflare Workers Integration- </CardTitle>- <FormControl- label="Cloudflare Workers API token"- errorText={accessKeyErrorText}- isError={accessKeyErrorText !== ""}- className="mx-6"- >- <Input- placeholder=""- value={accessKey}- type="password"- autoComplete="new-password"- onChange={(e) => setAccessKey(e.target.value)}- />- </FormControl>- <FormControl- label="Cloudflare Workers Account ID"- errorText={accountIdErrorText}- isError={accountIdErrorText !== ""}- className="mx-6"- >- <Input placeholder="" value={accountId} onChange={(e) => setAccountId(e.target.value)} />- </FormControl>- <Button- onClick={handleButtonClick}- colorSchema="secondary"- variant="outline_bg"- className="mt-2 mr-6 mb-6 ml-auto w-min"- isFullWidth={false}- isLoading={isLoading}- >- Connect to Cloudflare Workers- </Button>+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>Cloudflare Workers Integration</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-5">+ <Field data-invalid={accessKeyErrorText !== ""}>+ <FieldLabel htmlFor="cloudflareworkers-cloudflare-workers-api-token">+ Cloudflare Workers API token+ </FieldLabel>+ <Input+ placeholder=""+ value={accessKey}+ type="password"+ autoComplete="new-password"+ onChange={(e) => setAccessKey(e.target.value)}+ id="cloudflareworkers-cloudflare-workers-api-token"+ isError={accessKeyErrorText !== ""}+ aria-describedby={+ accessKeyErrorText !== ""+ ? "cloudflareworkers-cloudflare-workers-api-token-error"+ : undefined+ }+ />+ {accessKeyErrorText !== "" && (+ <FieldError id="cloudflareworkers-cloudflare-workers-api-token-error">+ {accessKeyErrorText}+ </FieldError>+ )}+ </Field>+ <Field data-invalid={accountIdErrorText !== ""}>+ <FieldLabel htmlFor="cloudflareworkers-cloudflare-workers-account-id">+ Cloudflare Workers Account ID+ </FieldLabel>+ <Input+ placeholder=""+ value={accountId}+ onChange={(e) => setAccountId(e.target.value)}+ id="cloudflareworkers-cloudflare-workers-account-id"+ isError={accountIdErrorText !== ""}+ aria-describedby={+ accountIdErrorText !== ""+ ? "cloudflareworkers-cloudflare-workers-account-id-error"+ : undefined+ }+ />+ {accountIdErrorText !== "" && (+ <FieldError id="cloudflareworkers-cloudflare-workers-account-id-error">+ {accountIdErrorText}+ </FieldError>+ )}+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">+ Connect to Cloudflare Workers+ </Button>+ </CardFooter></Card></div>);diff --git a/frontend/src/pages/secret-manager/integrations/CloudflareWorkersConfigurePage/CloudflareWorkersConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/CloudflareWorkersConfigurePage/CloudflareWorkersConfigurePage.tsxindex 6cf0169bf9..f3f62928f3 100644--- a/frontend/src/pages/secret-manager/integrations/CloudflareWorkersConfigurePage/CloudflareWorkersConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/CloudflareWorkersConfigurePage/CloudflareWorkersConfigurePage.tsx@@ -1,8 +1,23 @@import { useEffect, useState } from "react";import { useNavigate, useSearch } from "@tanstack/react-router";-import { Button, Card, CardTitle, FormControl, Select, SelectItem } from "@app/components/v2";-import { SecretPathInput } from "@app/components/v2/SecretPathInput";+import {+ Button,+ Card,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldLabel,+ SecretPathInput,+ Select,+ 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";@@ -81,70 +96,89 @@ export const CloudflareWorkersConfigurePage = () => {return integrationAuth && selectedSourceEnvironment && integrationAuthApps && targetApp ? (<div className="flex h-full w-full items-center justify-center bg-linear-to-tr from-surface-base to-page-deep">- <Card className="max-w-lg rounded-md border border-border-control p-0">- <CardTitle- className="px-6 text-left"- subTitle="Choose which environment in Infisical you want to sync with your Cloudflare Workers project."- >- Cloudflare Workers Integration- </CardTitle>- <FormControl label="Infisical Project Environment" className="mt-2 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}`}+ <Card className="w-full max-w-lg">+ <CardHeader>+ <CardTitle>Cloudflare Workers Integration</CardTitle>+ <CardDescription>+ Choose which environment in Infisical you want to sync with your Cloudflare Workers+ project.+ </CardDescription>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field className="mt-2" data-invalid={false}>+ <FieldLabel htmlFor="cloudflareworkers-infisical-project-environment">+ Infisical Project Environment+ </FieldLabel>+ <Select+ value={selectedSourceEnvironment}+ onValueChange={(val) => setSelectedSourceEnvironment(val)}+ >+ <SelectTrigger+ className="w-full"+ id="cloudflareworkers-infisical-project-environment">- {sourceEnvironment.name}- </SelectItem>- ))}- </Select>- </FormControl>- <FormControl label="Infisical Secret Path" className="mt-2 px-6">- <SecretPathInput- value={secretPath}- onChange={(value) => setSecretPath(value)}- environment={selectedSourceEnvironment}- placeholder="Provide a path, default is /"- />- </FormControl>- <FormControl label="Cloudflare Workers Project" className="mt-4 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 apps found- </SelectItem>- )}- </Select>- </FormControl>- <Button- onClick={handleButtonClick}- colorSchema="secondary"- variant="outline_bg"- className="mt-2 mr-6 mb-6 ml-auto"- isFullWidth={false}- isLoading={isLoading}- >- Create Integration- </Button>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {currentProject?.environments.map((sourceEnvironment) => (+ <SelectItem+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}+ >+ {sourceEnvironment.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>+ <Field className="mt-2" data-invalid={false}>+ <FieldLabel htmlFor="cloudflareworkers-infisical-secret-path">+ Infisical Secret Path+ </FieldLabel>+ <SecretPathInput+ value={secretPath}+ onChange={(value) => setSecretPath(value)}+ environment={selectedSourceEnvironment}+ placeholder="Provide a path, default is /"+ id="cloudflareworkers-infisical-secret-path"+ />+ </Field>+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="cloudflareworkers-cloudflare-workers-project">+ Cloudflare Workers Project+ </FieldLabel>+ <Select+ value={targetApp}+ onValueChange={(val) => setTargetApp(val)}+ disabled={integrationAuthApps.length === 0}+ >+ <SelectTrigger className="w-full" id="cloudflareworkers-cloudflare-workers-project">+ <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 apps found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button onClick={handleButtonClick} isPending={isLoading} variant="project">+ Create Integration+ </Button>+ </CardFooter></Card></div>) : (diff --git a/frontend/src/pages/secret-manager/integrations/CodefreshAuthorizePage/CodefreshAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/CodefreshAuthorizePage/CodefreshAuthorizePage.tsxindex a4dde487bf..e91135c4b7 100644--- a/frontend/src/pages/secret-manager/integrations/CodefreshAuthorizePage/CodefreshAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/CodefreshAuthorizePage/CodefreshAuthorizePage.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";@@ -30,8 +41,6 @@ export const CodefreshAuthorizePage = () => {accessToken: apiKey});- setIsLoading(false);-navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/codefresh/create",params: {@@ -44,28 +53,40 @@ export const CodefreshAuthorizePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};return (<div className="flex h-full w-full items-center justify-center">- <Card className="max-w-md rounded-md p-8">- <CardTitle className="text-center">Codefresh Integration</CardTitle>- <FormControl- label="Codefresh API Key"- 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 Codefresh- </Button>+ <Card className="w-full max-w-md">+ <CardHeader>+ <CardTitle>Codefresh Integration</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field data-invalid={apiKeyErrorText !== ""}>+ <FieldLabel htmlFor="codefresh-codefresh-api-key">Codefresh API Key</FieldLabel>+ <Input+ placeholder=""+ value={apiKey}+ onChange={(e) => setApiKey(e.target.value)}+ id="codefresh-codefresh-api-key"+ isError={apiKeyErrorText !== ""}+ aria-describedby={+ apiKeyErrorText !== "" ? "codefresh-codefresh-api-key-error" : undefined+ }+ />+ {apiKeyErrorText !== "" && (+ <FieldError id="codefresh-codefresh-api-key-error">{apiKeyErrorText}</FieldError>+ )}+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button onClick={handleButtonClick} isPending={isLoading} variant="outline">+ Connect to Codefresh+ </Button>+ </CardFooter></Card></div>);diff --git a/frontend/src/pages/secret-manager/integrations/CodefreshConfigurePage/CodefreshConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/CodefreshConfigurePage/CodefreshConfigurePage.tsxindex bd9aa764e9..b1c36f1b7d 100644--- a/frontend/src/pages/secret-manager/integrations/CodefreshConfigurePage/CodefreshConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/CodefreshConfigurePage/CodefreshConfigurePage.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";@@ -68,8 +75,6 @@ export const CodefreshConfigurePage = () => {secretPath});- setIsLoading(false);-navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",params: {@@ -82,68 +87,87 @@ export const CodefreshConfigurePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};return integrationAuth && selectedSourceEnvironment && integrationAuthApps && targetApp ? (<div className="flex h-full w-full items-center justify-center">- <Card className="max-w-md rounded-md p-8">- <CardTitle className="text-center">Codefresh Integration</CardTitle>- <FormControl label="Project Environment" className="mt-4">- <Select- value={selectedSourceEnvironment}- onValueChange={(val) => setSelectedSourceEnvironment(val)}- className="w-full border border-border-strong"- >- {currentProject?.environments.map((sourceEnvironment) => (- <SelectItem- value={sourceEnvironment.slug}- key={`source-environment-${sourceEnvironment.slug}`}- >- {sourceEnvironment.name}- </SelectItem>- ))}- </Select>- </FormControl>- <FormControl label="Secrets Path">- <Input- value={secretPath}- onChange={(evt) => setSecretPath(evt.target.value)}- placeholder="Provide a path, default is /"- />- </FormControl>- <FormControl label="Codefresh Service" className="mt-4">- <Select- value={targetApp}- onValueChange={(val) => setTargetApp(val)}- className="w-full border border-border-strong"+ <Card className="w-full max-w-md">+ <CardHeader>+ <CardTitle>Codefresh Integration</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="codefresh-project-environment">Project Environment</FieldLabel>+ <Select+ value={selectedSourceEnvironment}+ onValueChange={(val) => setSelectedSourceEnvironment(val)}+ >+ <SelectTrigger className="w-full" id="codefresh-project-environment">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {currentProject?.environments.map((sourceEnvironment) => (+ <SelectItem+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}+ >+ {sourceEnvironment.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>+ <Field data-invalid={false}>+ <FieldLabel htmlFor="codefresh-secrets-path">Secrets Path</FieldLabel>+ <Input+ value={secretPath}+ onChange={(evt) => setSecretPath(evt.target.value)}+ placeholder="Provide a path, default is /"+ id="codefresh-secrets-path"+ />+ </Field>+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="codefresh-codefresh-service">Codefresh Service</FieldLabel>+ <Select+ value={targetApp}+ onValueChange={(val) => setTargetApp(val)}+ disabled={integrationAuthApps.length === 0}+ >+ <SelectTrigger className="w-full" id="codefresh-codefresh-service">+ <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 services found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ onClick={handleButtonClick}+ isPending={isLoading}isDisabled={integrationAuthApps.length === 0}+ variant="outline">- {integrationAuthApps.length > 0 ? (- integrationAuthApps.map((integrationAuthApp) => (- <SelectItem- value={integrationAuthApp.name}- key={`target-app-${integrationAuthApp.name}`}- >- {integrationAuthApp.name}- </SelectItem>- ))- ) : (- <SelectItem value="none" key="target-app-none">- No services 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/DatabricksAuthorizePage/DatabricksAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/DatabricksAuthorizePage/DatabricksAuthorizePage.tsxindex 4a8ee9df6b..cd187ac5d0 100644--- a/frontend/src/pages/secret-manager/integrations/DatabricksAuthorizePage/DatabricksAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/DatabricksAuthorizePage/DatabricksAuthorizePage.tsx@@ -4,7 +4,21 @@ import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svimport { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate } from "@tanstack/react-router";-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";+import {+ Badge,+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useOrganization, useProject } from "@app/context";import { useSaveIntegrationAccessToken } from "@app/hooks/api";@@ -59,72 +73,84 @@ export const DatabricksAuthorizePage = () => {<Helmet><title>Authorize Databricks 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 Access Token, you will be prompted to set up an integration for a particular Infisical project and environment."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img- src="/images/integrations/Databricks.png"- height={30}- width={30}- alt="Databricks logo"- />- </div>- <span className="ml-1.5">Databricks Integration </span>- <a- target="_blank"- rel="noopener noreferrer"- href="https://infisical.com/docs/integrations/cloud/databricks"- >- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img+ src="/images/integrations/Databricks.png"+ height={30}+ width={30}+ alt="Databricks logo"+ />+ <span>Databricks Integration</span>+ </CardTitle>+ <CardDescription>+ After adding your Access Token, you will be prompted to set up an integration for a+ particular Infisical project and environment.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ target="_blank"+ rel="noopener noreferrer"+ href="https://infisical.com/docs/integrations/cloud/databricks"+ >+ <FontAwesomeIcon icon={faBookOpen} />Docs- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="text-xxs mb-[0.07rem] ml-1.5"- />- </div>- </a>- </div>- </CardTitle>- <FormControl- label="Databricks Instance URL"- errorText={instanceURLErrorText}- isError={instanceURLErrorText !== ""}- className="px-6"- >- <Input- value={instanceURL}- onChange={(e) => setInstanceURL(e.target.value)}- placeholder="https://xxxx.cloud.databricks.com"- />- </FormControl>- <FormControl- label="Access Token"- errorText={apiKeyErrorText}- isError={apiKeyErrorText !== ""}- className="px-6"- >- <Input- placeholder=""- value={apiKey}- onChange={(e) => setApiKey(e.target.value)}- type="password"- />- </FormControl>- <Button- onClick={handleButtonClick}- colorSchema="primary"- variant="outline_bg"- className="mt-2 mr-6 mb-6 ml-auto w-min"- isLoading={isPending}- isDisabled={isPending}- >- Connect to Databricks- </Button>+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field data-invalid={instanceURLErrorText !== ""}>+ <FieldLabel htmlFor="databricks-databricks-instance-url">+ Databricks Instance URL+ </FieldLabel>+ <Input+ value={instanceURL}+ onChange={(e) => setInstanceURL(e.target.value)}+ placeholder="https://xxxx.cloud.databricks.com"+ id="databricks-databricks-instance-url"+ isError={instanceURLErrorText !== ""}+ aria-describedby={+ instanceURLErrorText !== "" ? "databricks-databricks-instance-url-error" : undefined+ }+ />+ {instanceURLErrorText !== "" && (+ <FieldError id="databricks-databricks-instance-url-error">+ {instanceURLErrorText}+ </FieldError>+ )}+ </Field>+ <Field data-invalid={apiKeyErrorText !== ""}>+ <FieldLabel htmlFor="databricks-access-token">Access Token</FieldLabel>+ <Input+ placeholder=""+ value={apiKey}+ onChange={(e) => setApiKey(e.target.value)}+ type="password"+ id="databricks-access-token"+ isError={apiKeyErrorText !== ""}+ aria-describedby={+ apiKeyErrorText !== "" ? "databricks-access-token-error" : undefined+ }+ />+ {apiKeyErrorText !== "" && (+ <FieldError id="databricks-access-token-error">{apiKeyErrorText}</FieldError>+ )}+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ onClick={handleButtonClick}+ isPending={isPending}+ isDisabled={isPending}+ variant="project"+ >+ Connect to Databricks+ </Button>+ </CardFooter></Card></div>);diff --git a/frontend/src/pages/secret-manager/integrations/DatabricksConfigurePage/DatabricksConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/DatabricksConfigurePage/DatabricksConfigurePage.tsxindex 231c0cb5cd..efe51fece4 100644--- a/frontend/src/pages/secret-manager/integrations/DatabricksConfigurePage/DatabricksConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/DatabricksConfigurePage/DatabricksConfigurePage.tsx@@ -11,14 +11,24 @@ import { useNavigate, useSearch } from "@tanstack/react-router";import { createNotification } from "@app/components/notifications";import {+ Badge,Button,Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,CardTitle,- FormControl,+ Field,+ FieldLabel,Input,Select,- SelectItem-} from "@app/components/v2";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization, useProject } from "@app/context";import { useCreateIntegration } from "@app/hooks/api";@@ -102,99 +112,110 @@ export const DatabricksConfigurePage = () => {<Helmet><title>Set Up Databricks 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 which Databricks secrets scope."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img- src="/images/integrations/Databricks.png"- height={30}- width={30}- alt="Databricks logo"- />- </div>- <span className="ml-1.5">Databricks Integration </span>- <a- href="https://infisical.com/docs/integrations/cloud/databricks"- target="_blank"- rel="noopener noreferrer"- >- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />- Docs- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="text-xxs mb-[0.07rem] ml-1.5"- />- </div>- </a>- </div>- </CardTitle>-- <FormControl label="Project Environment" className="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}`}+ <Card className="w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img+ src="/images/integrations/Databricks.png"+ height={30}+ width={30}+ alt="Databricks logo"+ />+ <span>Databricks Integration</span>+ </CardTitle>+ <CardDescription>+ Choose which environment or folder in Infisical you want to sync to which Databricks+ secrets scope.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ href="https://infisical.com/docs/integrations/cloud/databricks"+ target="_blank"+ rel="noopener noreferrer">- {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>-- {integrationAuthScopes && (- <FormControl label="Databricks Scope" className="px-6">+ <FontAwesomeIcon icon={faBookOpen} />+ Docs+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field data-invalid={false}>+ <FieldLabel htmlFor="databricks-project-environment">Project Environment</FieldLabel><Select- value={targetScope}- onValueChange={(val) => {- setTargetScope(val);- }}- className="w-full border border-border-strong"- placeholder={- integrationAuthScopes.length === 0 ? "No scopes found." : "Select scope..."- }- isDisabled={integrationAuthScopes.length === 0}+ value={selectedSourceEnvironment}+ onValueChange={(val) => setSelectedSourceEnvironment(val)}>- {integrationAuthScopes.length > 0 ? (- integrationAuthScopes.map((scope) => (- <SelectItem value={scope.name!} key={`target-scope-${scope.name}`}>- {scope.name}+ <SelectTrigger className="w-full" id="databricks-project-environment">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {currentProject?.environments.map((sourceEnvironment) => (+ <SelectItem+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}+ >+ {sourceEnvironment.name}</SelectItem>- ))- ) : (- <SelectItem value="none" key="target-app-none">- No scopes found- </SelectItem>- )}+ ))}+ </SelectContent></Select>- </FormControl>- )}- <Button- onClick={handleButtonClick}- colorSchema="primary"- variant="outline_bg"- className="mt-2 mr-6 mb-6 ml-auto w-min"- isLoading={isPending}- isDisabled={integrationAuthScopes.length === 0 || isPending}- >- Create Integration- </Button>+ </Field>+ <Field data-invalid={false}>+ <FieldLabel htmlFor="databricks-secrets-path">Secrets Path</FieldLabel>+ <Input+ value={secretPath}+ onChange={(evt) => setSecretPath(evt.target.value)}+ placeholder="Provide a path, default is /"+ id="databricks-secrets-path"+ />+ </Field>+ {integrationAuthScopes && (+ <Field data-invalid={false}>+ <FieldLabel htmlFor="databricks-databricks-scope">Databricks Scope</FieldLabel>+ <Select+ value={targetScope}+ onValueChange={(val) => {+ setTargetScope(val);+ }}+ disabled={integrationAuthScopes.length === 0}+ >+ <SelectTrigger className="w-full" id="databricks-databricks-scope">+ <SelectValue+ placeholder={+ integrationAuthScopes.length === 0 ? "No scopes found." : "Select scope..."+ }+ />+ </SelectTrigger>+ <SelectContent>+ {integrationAuthScopes.length > 0 ? (+ integrationAuthScopes.map((scope) => (+ <SelectItem value={scope.name!} key={`target-scope-${scope.name}`}>+ {scope.name}+ </SelectItem>+ ))+ ) : (+ <SelectItem value="none" key="target-app-none">+ No scopes found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ </Field>+ )}+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ onClick={handleButtonClick}+ isPending={isPending}+ isDisabled={integrationAuthScopes.length === 0 || isPending}+ variant="project"+ >+ Create Integration+ </Button>+ </CardFooter></Card><div className="mt-6 w-full max-w-md border-t border-border-faint" /><div className="mt-6 flex w-full max-w-lg flex-col rounded-md border border-border-control bg-surface-raised p-4">diff --git a/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformAuthorizePage/DigitalOceanAppPlatformAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformAuthorizePage/DigitalOceanAppPlatformAuthorizePage.tsxindex 23a7f8d135..6de2c7e592 100644--- a/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformAuthorizePage/DigitalOceanAppPlatformAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformAuthorizePage/DigitalOceanAppPlatformAuthorizePage.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";@@ -30,8 +41,6 @@ export const DigitalOceanAppPlatformAuthorizePage = () => {accessToken: apiKey});- setIsLoading(false);-navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/digital-ocean-app-platform/create",params: {@@ -44,28 +53,46 @@ export const DigitalOceanAppPlatformAuthorizePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};return (<div className="flex h-full w-full items-center justify-center">- <Card className="max-w-md rounded-md p-8">- <CardTitle className="text-center">Digital Ocean App Platform Integration</CardTitle>- <FormControl- label="Digital Ocean API Key"- 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 Digital Ocean App Platform- </Button>+ <Card className="w-full max-w-md">+ <CardHeader>+ <CardTitle>Digital Ocean App Platform Integration</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field data-invalid={apiKeyErrorText !== ""}>+ <FieldLabel htmlFor="digitaloceanappplatform-digital-ocean-api-key">+ Digital Ocean API Key+ </FieldLabel>+ <Input+ placeholder=""+ value={apiKey}+ onChange={(e) => setApiKey(e.target.value)}+ id="digitaloceanappplatform-digital-ocean-api-key"+ isError={apiKeyErrorText !== ""}+ aria-describedby={+ apiKeyErrorText !== ""+ ? "digitaloceanappplatform-digital-ocean-api-key-error"+ : undefined+ }+ />+ {apiKeyErrorText !== "" && (+ <FieldError id="digitaloceanappplatform-digital-ocean-api-key-error">+ {apiKeyErrorText}+ </FieldError>+ )}+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button onClick={handleButtonClick} isPending={isLoading} variant="outline">+ Connect to Digital Ocean App Platform+ </Button>+ </CardFooter></Card></div>);diff --git a/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformConfigurePage/DigitalOceanAppPlatformConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformConfigurePage/DigitalOceanAppPlatformConfigurePage.tsxindex 43e620241f..8f44f039b4 100644--- a/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformConfigurePage/DigitalOceanAppPlatformConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/DigitalOceanAppPlatformConfigurePage/DigitalOceanAppPlatformConfigurePage.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";@@ -69,8 +76,6 @@ export const DigitalOceanAppPlatformConfigurePage = () => {secretPath});- setIsLoading(false);-navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",params: {@@ -83,68 +88,94 @@ export const DigitalOceanAppPlatformConfigurePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};return integrationAuth && selectedSourceEnvironment && integrationAuthApps && targetApp ? (<div className="flex h-full w-full items-center justify-center">- <Card className="max-w-md rounded-md p-8">- <CardTitle className="text-center">Digital Ocean App Platform 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-md">+ <CardHeader>+ <CardTitle>Digital Ocean App Platform Integration</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="digitaloceanappplatform-project-environment">+ Project Environment+ </FieldLabel>+ <Select+ value={selectedSourceEnvironment}+ onValueChange={(val) => setSelectedSourceEnvironment(val)}+ >+ <SelectTrigger className="w-full" id="digitaloceanappplatform-project-environment">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {currentProject?.environments.map((sourceEnvironment) => (+ <SelectItem+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}+ >+ {sourceEnvironment.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>+ <Field data-invalid={false}>+ <FieldLabel htmlFor="digitaloceanappplatform-secrets-path">Secrets Path</FieldLabel>+ <Input+ value={secretPath}+ onChange={(evt) => setSecretPath(evt.target.value)}+ placeholder="Provide a path, default is /"+ id="digitaloceanappplatform-secrets-path"+ />+ </Field>+ <Field className="mt-4" data-invalid={false}>+ <FieldLabel htmlFor="digitaloceanappplatform-digital-ocean-app-platform-service">+ Digital Ocean App Platform Service+ </FieldLabel>+ <Select+ value={targetApp}+ onValueChange={(val) => setTargetApp(val)}+ disabled={integrationAuthApps.length === 0}+ >+ <SelectTrigger+ className="w-full"+ id="digitaloceanappplatform-digital-ocean-app-platform-service">- {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="Digital Ocean App Platform Service" 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-app-${integrationAuthApp.name}`}+ >+ {integrationAuthApp.name}+ </SelectItem>+ ))+ ) : (+ <SelectItem value="none" key="target-app-none">+ No services found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ onClick={handleButtonClick}+ isPending={isLoading}isDisabled={integrationAuthApps.length === 0}+ variant="outline">- {integrationAuthApps.length > 0 ? (- integrationAuthApps.map((integrationAuthApp) => (- <SelectItem- value={integrationAuthApp.name}- key={`target-app-${integrationAuthApp.name}`}- >- {integrationAuthApp.name}- </SelectItem>- ))- ) : (- <SelectItem value="none" key="target-app-none">- No services 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/FlyioAuthorizePage/FlyioAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/FlyioAuthorizePage/FlyioAuthorizePage.tsxindex 31fc354bf1..b4ccee2d25 100644--- a/frontend/src/pages/secret-manager/integrations/FlyioAuthorizePage/FlyioAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/FlyioAuthorizePage/FlyioAuthorizePage.tsx@@ -7,7 +7,21 @@ 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 {+ Badge,+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useOrganization, useProject } from "@app/context";import { useSaveIntegrationAccessToken } from "@app/hooks/api";@@ -64,56 +78,59 @@ export const FlyioAuthorizePage = () => {<Helmet><title>Authorize Fly.io 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 access token, you will be prompted to set up an integration for a particular Infisical project and environment."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img src="/images/integrations/Flyio.svg" height={30} width={30} alt="Fly.io logo" />- </div>- <span className="ml-2.5">Fly.io 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="px-6 pb-8 text-right">- <Controller- control={control}- name="accessToken"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Fly.io Access Token"- errorText={error?.message}- isError={Boolean(error)}+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img src="/images/integrations/Flyio.svg" height={30} width={30} alt="Fly.io logo" />+ <span>Fly.io Integration</span>+ </CardTitle>+ <CardDescription>+ After adding your access token, you will be prompted to set up an integration for a+ particular Infisical project and environment.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ href="https://infisical.com/docs/integrations/cloud/flyio"+ target="_blank"+ rel="noopener noreferrer">- <Input {...field} placeholder="" type="password" autoComplete="new-password" />- </FormControl>- )}- />- <Button- colorSchema="primary"- variant="outline_bg"- className="mt-2 w-min"- size="sm"- type="submit"- isLoading={isLoading}- >- Connect to Fly.io- </Button>+ <FontAwesomeIcon icon={faBookOpen} />+ Docs+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <form onSubmit={handleSubmit(onFormSubmit)} className="flex flex-col gap-5">+ <CardContent>+ <Controller+ control={control}+ name="accessToken"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="flyio-accesstoken">Fly.io Access Token</FieldLabel>+ <Input+ {...field}+ placeholder=""+ type="password"+ autoComplete="new-password"+ id="flyio-accesstoken"+ isError={Boolean(error)}+ aria-describedby={error ? "flyio-accesstoken-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="flyio-accesstoken-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ </CardContent>+ <CardFooter className="justify-end">+ <Button size="sm" type="submit" isPending={isLoading} variant="project">+ Connect to Fly.io+ </Button>+ </CardFooter></form></Card></div>diff --git a/frontend/src/pages/secret-manager/integrations/FlyioConfigurePage/FlyioConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/FlyioConfigurePage/FlyioConfigurePage.tsxindex a2330fc407..da70a857ce 100644--- a/frontend/src/pages/secret-manager/integrations/FlyioConfigurePage/FlyioConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/FlyioConfigurePage/FlyioConfigurePage.tsx@@ -8,18 +8,29 @@ import {} from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate, useSearch } from "@tanstack/react-router";+import { TriangleAlertIcon } from "lucide-react";import {Alert,AlertDescription,+ Badge,Button,Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,CardTitle,- FormControl,+ Field,+ FieldLabel,Input,Select,- SelectItem-} from "@app/components/v2";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization, useProject } from "@app/context";import { useCreateIntegration } from "@app/hooks/api";@@ -83,8 +94,6 @@ export const FlyioConfigurePage = () => {secretPath});- setIsLoading(false);-navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",params: {@@ -97,6 +106,8 @@ export const FlyioConfigurePage = () => {});} catch (err) {console.error(err);+ } finally {+ setIsLoading(false);}};@@ -105,96 +116,109 @@ export const FlyioConfigurePage = () => {<Helmet><title>Set Up Fly.io 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 Fly.io environment variables."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img src="/images/integrations/Flyio.svg" height={30} width={30} alt="Fly.io logo" />- </div>- <span className="ml-2.5">Fly.io 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" />+ <Card className="w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img src="/images/integrations/Flyio.svg" height={30} width={30} alt="Fly.io logo" />+ <span>Fly.io Integration</span>+ </CardTitle>+ <CardDescription>+ Choose which environment or folder in Infisical you want to sync to Fly.io environment+ variables.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ href="https://infisical.com/docs/integrations/cloud/flyio"+ target="_blank"+ rel="noopener noreferrer"+ >+ <FontAwesomeIcon icon={faBookOpen} />Docs- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="text-xxs mb-[0.07rem] ml-1.5"- />- </div>- </a>+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <div className="pb-4">+ <Alert variant="warning">+ <TriangleAlertIcon />+ <AlertDescription>+ All current secrets linked to the related Fly.io project will be deleted before+ Infisical secrets are pushed to your Fly.io project.+ </AlertDescription>+ </Alert></div>- </CardTitle>- <div className="px-6 pb-4">- <Alert hideTitle variant="warning">- <AlertDescription>- All current secrets linked to the related Fly.io project will be deleted before- Infisical secrets are pushed to your Fly.io project.- </AlertDescription>- </Alert>- </div>- <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}`}- >- {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="Fly.io App" className="px-6">- <Select- value={targetApp}- onValueChange={(val) => setTargetApp(val)}- className="w-full border border-border-strong"+ <Field data-invalid={false}>+ <FieldLabel htmlFor="flyio-project-environment">Project Environment</FieldLabel>+ <Select+ value={selectedSourceEnvironment}+ onValueChange={(val) => setSelectedSourceEnvironment(val)}+ >+ <SelectTrigger className="w-full" id="flyio-project-environment">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {currentProject?.environments.map((sourceEnvironment) => (+ <SelectItem+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}+ >+ {sourceEnvironment.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </Field>+ <Field data-invalid={false}>+ <FieldLabel htmlFor="flyio-secrets-path">Secrets Path</FieldLabel>+ <Input+ value={secretPath}+ onChange={(evt) => setSecretPath(evt.target.value)}+ placeholder="Provide a path, default is /"+ id="flyio-secrets-path"+ />+ </Field>+ <Field data-invalid={false}>+ <FieldLabel htmlFor="flyio-fly-io-app">Fly.io App</FieldLabel>+ <Select+ value={targetApp}+ onValueChange={(val) => setTargetApp(val)}+ disabled={integrationAuthApps.length === 0}+ >+ <SelectTrigger className="w-full" id="flyio-fly-io-app">+ <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 apps found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ onClick={handleButtonClick}+ isPending={isLoading}isDisabled={integrationAuthApps.length === 0}+ variant="project">- {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 apps 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 className="mt-6 w-full max-w-md border-t border-border-faint" /><div className="mt-6 flex w-full max-w-lg flex-col rounded-md border border-border-control bg-surface-raised p-4">diff --git a/frontend/src/pages/secret-manager/integrations/GcpSecretManagerAuthorizePage/GcpSecretManagerAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/GcpSecretManagerAuthorizePage/GcpSecretManagerAuthorizePage.tsxindex 4edd15a1d0..a45b52e6e3 100644--- a/frontend/src/pages/secret-manager/integrations/GcpSecretManagerAuthorizePage/GcpSecretManagerAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/GcpSecretManagerAuthorizePage/GcpSecretManagerAuthorizePage.tsx@@ -10,7 +10,21 @@ import { zodResolver } from "@hookform/resolvers/zod";import { useNavigate } from "@tanstack/react-router";import { z } from "zod";-import { Button, Card, CardTitle, FormControl, TextArea } from "@app/components/v2";+import {+ Badge,+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldError,+ FieldLabel,+ TextArea+} from "@app/components/v3";import { useOrganization, useProject } from "@app/context";import { localStorageService } from "@app/helpers/localStorage";import { useGetCloudIntegrations, useSaveIntegrationAccessToken } from "@app/hooks/api";@@ -90,80 +104,79 @@ export const GcpSecretManagerAuthorizePage = () => {<Helmet><title>Authorize GCP Secret Manager 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="Connect Infisical to GCP Secret Manager to sync secrets."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img- src="/images/integrations/Google Cloud Platform.png"- height={30}- width={30}- alt="GCP logo"- />- </div>- <span className="ml-1.5">GCP Secret Manager Integration </span>- <a- target="_blank"- rel="noopener noreferrer"- href="https://infisical.com/docs/integrations/cloud/gcp-secret-manager"- >- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img+ src="/images/integrations/Google Cloud Platform.png"+ height={30}+ width={30}+ alt="GCP logo"+ />+ <span>GCP Secret Manager Integration</span>+ </CardTitle>+ <CardDescription>+ Connect Infisical to GCP Secret Manager to sync secrets.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ target="_blank"+ rel="noopener noreferrer"+ href="https://infisical.com/docs/integrations/cloud/gcp-secret-manager"+ >+ <FontAwesomeIcon icon={faBookOpen} />Docs- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="text-xxs mb-[0.07rem] ml-1.5"- />- </div>- </a>- </div>- </CardTitle>- <div className="px-6">- <Button- colorSchema="primary"- variant="outline_bg"- onClick={handleIntegrateWithOAuth}- leftIcon={<FontAwesomeIcon icon={faGoogle} className="mr-2" />}- className="mx-0 mt-4 h-11 w-full"- >- Continue with OAuth- </Button>- <div className="my-4 flex w-full flex-row items-center py-2">- <div className="w-full border-t border-border-emphasis/40" />- <span className="mx-2 text-xs text-muted">or</span>- <div className="w-full border-t border-border-emphasis/40" />- </div>- </div>- <form onSubmit={handleSubmit(onFormSubmit)} className="px-6 pb-8 text-right">- <Controller- control={control}- name="accessToken"- render={({ field, fieldState: { error } }) => (- <FormControl- label="GCP Service Account JSON"- errorText={error?.message}- isError={Boolean(error)}+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <form onSubmit={handleSubmit(onFormSubmit)} className="flex flex-col gap-5">+ <CardContent className="flex flex-col gap-5">+ <div>+ <Button+ onClick={handleIntegrateWithOAuth}+ className="mx-0 mt-4 w-full"+ variant="project">- <TextArea- {...field}- className="h-48 border border-border-control bg-page-deep/80"- />- </FormControl>- )}- />- <Button- colorSchema="primary"- variant="outline_bg"- className="mt-2 w-min"- size="sm"- type="submit"- isLoading={isLoading}- >- Connect to GCP Secret Manager- </Button>+ <FontAwesomeIcon icon={faGoogle} className="mr-2" />+ Continue with OAuth+ </Button>+ <div className="my-4 flex w-full flex-row items-center py-2">+ <div className="w-full border-t border-border-emphasis/40" />+ <span className="mx-2 text-xs text-muted">or</span>+ <div className="w-full border-t border-border-emphasis/40" />+ </div>+ </div>+ <Controller+ control={control}+ name="accessToken"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gcpsecretmanager-accesstoken">+ GCP Service Account JSON+ </FieldLabel>+ <TextArea+ {...field}+ id="gcpsecretmanager-accesstoken"+ isError={Boolean(error)}+ aria-describedby={error ? "gcpsecretmanager-accesstoken-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="gcpsecretmanager-accesstoken-error">+ {error?.message}+ </FieldError>+ )}+ </Field>+ )}+ />+ </CardContent>+ <CardFooter className="justify-end">+ <Button size="sm" type="submit" isPending={isLoading} variant="project">+ Connect to GCP Secret Manager+ </Button>+ </CardFooter></form></Card></div>diff --git a/frontend/src/pages/secret-manager/integrations/GithubAuthorizePage/GithubAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/GithubAuthorizePage/GithubAuthorizePage.tsxindex a8788ce495..6d56b77b62 100644--- a/frontend/src/pages/secret-manager/integrations/GithubAuthorizePage/GithubAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/GithubAuthorizePage/GithubAuthorizePage.tsx@@ -7,15 +7,24 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate } from "@tanstack/react-router";import {+ Badge,Button,Card,- CardBody,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,CardTitle,- FormControl,+ Field,+ FieldLabel,+ ProviderIcon,Select,- SelectItem-} from "@app/components/v2";-import { ProviderIcon } from "@app/components/v3";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { useOrganization, useProject } from "@app/context";import { localStorageService } from "@app/helpers/localStorage";import { useGetCloudIntegrations } from "@app/hooks/api";@@ -39,85 +48,88 @@ export const GithubAuthorizePage = () => {<Helmet><title>Select GitHub Integration Auth</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 how you'd like to integrate with GitHub. We recommend using the GitHub App method for fine-grained access."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <ProviderIcon icon="GitHub.png" height={30} width={30} alt="GitHub logo" />- </div>- <span className="ml-2.5">GitHub Integration </span>- <a- href="https://infisical.com/docs/integrations/cicd/githubactions"- target="_blank"- rel="noopener noreferrer"- >- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <ProviderIcon icon="GitHub.png" height={30} width={30} alt="GitHub logo" />+ <span>GitHub Integration</span>+ </CardTitle>+ <CardDescription>+ Select how you'd like to integrate with GitHub. We recommend using the GitHub App+ method for fine-grained access.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ href="https://infisical.com/docs/integrations/cicd/githubactions"+ target="_blank"+ rel="noopener noreferrer"+ >+ <FontAwesomeIcon icon={faBookOpen} />Docs- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="text-xxs mb-[0.07rem] ml-1.5"- />- </div>- </a>- </div>- </CardTitle>- <CardBody>- <FormControl label="Select authentication method">+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <CardContent>+ <Field className="mb-4" data-invalid={false}>+ <FieldLabel htmlFor="github-select-authentication-method">+ Select authentication method+ </FieldLabel><Selectvalue={selectedAuthMethod}onValueChange={(val) => {setSelectedAuthMethod(val as AuthMethod);}}- className="w-full border border-border-strong">- <SelectItem value={AuthMethod.APP}>GitHub App (Recommended)</SelectItem>- <SelectItem value={AuthMethod.OAUTH}>OAuth</SelectItem>+ <SelectTrigger className="w-full" id="github-select-authentication-method">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value={AuthMethod.APP}>GitHub App (Recommended)</SelectItem>+ <SelectItem value={AuthMethod.OAUTH}>OAuth</SelectItem>+ </SelectContent></Select>- </FormControl>- <div className="flex items-end">- <Button- onClick={() => {- if (selectedAuthMethod === AuthMethod.APP) {- navigate({- to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth",- params: {- orgId: currentOrg.id,- projectId: currentProject.id- },- search: {- integrationSlug: "github"- }- });- } else {- if (!githubIntegration?.clientId) {- createIntegrationMissingEnvVarsNotification(- "githubactions",- "cicd",- "connecting-with-github-oauth"- );- return;+ </Field>+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ onClick={() => {+ if (selectedAuthMethod === AuthMethod.APP) {+ navigate({+ to: "/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth",+ params: {+ orgId: currentOrg.id,+ projectId: currentProject.id+ },+ search: {+ integrationSlug: "github"}-- const state = crypto.randomBytes(16).toString("hex");- localStorage.setItem("latestCSRFToken", state);- localStorageService.setIntegrationProjectId(currentProject.id);- window.location.assign(- `https://github.com/login/oauth/authorize?client_id=${githubIntegration?.clientId}&response_type=code&scope=repo,admin:org&redirect_uri=${window.location.origin}/integrations/github/oauth2/callback&state=${state}`+ });+ } else {+ if (!githubIntegration?.clientId) {+ createIntegrationMissingEnvVarsNotification(+ "githubactions",+ "cicd",+ "connecting-with-github-oauth");+ return;}- }}- colorSchema="primary"- variant="outline_bg"- className="mt-4 ml-auto w-min"- >- Connect to GitHub- </Button>- </div>- </CardBody>++ const state = crypto.randomBytes(16).toString("hex");+ localStorage.setItem("latestCSRFToken", state);+ localStorageService.setIntegrationProjectId(currentProject.id);+ window.location.assign(+ `https://github.com/login/oauth/authorize?client_id=${githubIntegration?.clientId}&response_type=code&scope=repo,admin:org&redirect_uri=${window.location.origin}/integrations/github/oauth2/callback&state=${state}`+ );+ }+ }}+ variant="project"+ >+ Connect to GitHub+ </Button>+ </CardFooter></Card></div>);diff --git a/frontend/src/pages/secret-manager/integrations/GithubConfigurePage/GithubConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/GithubConfigurePage/GithubConfigurePage.tsxindex de59b82c6c..50fd9a8a3d 100644--- a/frontend/src/pages/secret-manager/integrations/GithubConfigurePage/GithubConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/GithubConfigurePage/GithubConfigurePage.tsx@@ -13,28 +13,41 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { zodResolver } from "@hookform/resolvers/zod";import { useNavigate, useSearch } from "@tanstack/react-router";import { motion } from "motion/react";-import { twMerge } from "tailwind-merge";import { z, ZodIssueCode } from "zod";import {+ Badge,Button,Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,CardTitle,DropdownMenu,DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- FormControl,+ Field,+ FieldError,+ FieldLabel,Input,+ ProviderIcon,Select,+ SelectContent,SelectItem,- Switch,- Tab,- TabList,- TabPanel,- Tabs-} from "@app/components/v2";-import { ProviderIcon } from "@app/components/v3";+ SelectTrigger,+ SelectValue,+ Tabs,+ TabsContent,+ TabsList,+ TabsTrigger,+ Toggle,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization, useProject } from "@app/context";import {@@ -264,7 +277,6 @@ export const GithubConfigurePage = () => {throw new Error("Invalid scope");}- setIsLoading(false);navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",params: {@@ -276,6 +288,8 @@ export const GithubConfigurePage = () => {}});} catch {+ return;+ } finally {setIsLoading(false);}};@@ -294,468 +308,566 @@ export const GithubConfigurePage = () => {<Helmet><title>Set Up GitHub Integration</title></Helmet>- <Card className="max-w-lg rounded-md border border-border-control p-0">- <form onSubmit={handleSubmit(onFormSubmit)} className="px-6">- <CardTitle- className="px-0 text-left text-xl"- subTitle="Choose which environment in Infisical you want to sync to environment variables in GitHub."- >- <div className="flex flex-row items-center">- <div className="flex items-center rounded-full bg-foreground-secondary">- <ProviderIcon icon="GitHub.png" height={30} width={30} alt="GitHub logo" />- </div>- <span className="ml-2.5">GitHub Integration </span>+ <Card className="w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <ProviderIcon icon="GitHub.png" height={30} width={30} alt="GitHub logo" />+ <span>GitHub Integration</span>+ </CardTitle>+ <CardDescription>+ Choose which environment in Infisical you want to sync to environment variables in+ GitHub.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild><atarget="_blank"rel="noopener noreferrer"href="https://infisical.com/docs/integrations/cicd/githubactions">- <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>+ <FontAwesomeIcon icon={faBookOpen} />+ Docs+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} /></a>- </div>- </CardTitle>- <Tabs defaultValue={TabSections.Connection}>- <TabList>- <div className="flex w-full flex-row border-b border-border-control">- <Tab value={TabSections.Connection}>Connection</Tab>- <Tab value={TabSections.Options}>Options</Tab>- </div>- </TabList>- <TabPanel value={TabSections.Connection}>- <motion.div- key="panel-1"- transition={{ duration: 0.15 }}- initial={{ opacity: 0, translateX: 30 }}- animate={{ opacity: 1, translateX: 0 }}- exit={{ opacity: 0, translateX: 30 }}- >- <Controller- control={control}- name="selectedSourceEnvironment"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Project Environment"- errorText={error?.message}- isError={Boolean(error)}- >- <Select- defaultValue={field.value}- onValueChange={onChange}- className="w-full border border-border-strong"- >- {currentProject?.environments.map((sourceEnvironment) => (- <SelectItem- value={sourceEnvironment.slug}- key={`source-environment-${sourceEnvironment.slug}`}+ </Badge>+ </CardAction>+ </CardHeader>+ <form className="flex flex-col gap-5" onSubmit={handleSubmit(onFormSubmit)}>+ <CardContent className="flex flex-col gap-5">+ <Tabs defaultValue={TabSections.Connection}>+ <TabsList variant="project">+ <TabsTrigger value={TabSections.Connection}>Connection</TabsTrigger>+ <TabsTrigger value={TabSections.Options}>Options</TabsTrigger>+ </TabsList>+ <TabsContent value={TabSections.Connection}>+ <motion.div+ key="panel-1"+ transition={{ duration: 0.15 }}+ initial={{ opacity: 0, translateX: 30 }}+ animate={{ opacity: 1, translateX: 0 }}+ exit={{ opacity: 0, translateX: 30 }}+ >+ <Controller+ control={control}+ name="selectedSourceEnvironment"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="github-selectedsourceenvironment">+ Project Environment+ </FieldLabel>+ <Select defaultValue={field.value} onValueChange={onChange}>+ <SelectTrigger+ className="w-full"+ id="github-selectedsourceenvironment"+ isError={Boolean(error)}+ aria-describedby={+ error ? "github-selectedsourceenvironment-error" : undefined+ }>- {sourceEnvironment.name}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <Controller- control={control}- name="secretPath"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Secrets Path"- errorText={error?.message}- isError={Boolean(error)}- >- <Input {...field} placeholder="Provide a path, default is /" />- </FormControl>- )}- />- <Controller- control={control}- name="scope"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl label="Scope" errorText={error?.message} isError={Boolean(error)}>- <Select- defaultValue={field.value}- onValueChange={(e) => {- setValue("repoIds", []);- onChange(e);- }}- className="w-full border border-border-strong"- >- <SelectItem value="github-org">Organization</SelectItem>- <SelectItem value="github-repo">Repository</SelectItem>- <SelectItem value="github-env">Repository Environment</SelectItem>- </Select>- </FormControl>- )}- />- {scope === "github-repo" && (+ <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="github-selectedsourceenvironment-error">+ {error?.message}+ </FieldError>+ )}+ </Field>+ )}+ /><Controllercontrol={control}- name="repoIds"- render={({ field: { onChange }, fieldState: { error } }) => (- <FormControl- label="Repositories"- isError={Boolean(error?.message)}- errorText={error?.message}- >- <DropdownMenu>- <DropdownMenuTrigger asChild>- {integrationAuthApps.length > 0 ? (- <div className="inline-flex w-full cursor-pointer items-center justify-between rounded-md border border-border-control bg-surface-base px-3 py-2 font-sans text-sm font-normal text-foreground-soft outline-hidden data-placeholder:text-foreground-secondary">- {repoIds?.length === 1- ? integrationAuthApps?.reduce(- (acc, { appId, name, owner }) =>- repoIds?.[0] === appId ? `${owner}/${name}` : acc,- ""- )- : `${repoIds?.length} repositories selected`}- <FontAwesomeIcon icon={faAngleDown} className="text-xs" />- </div>- ) : (- <div className="inline-flex w-full cursor-default items-center justify-between rounded-md border border-border-control bg-surface-base px-3 py-2 font-sans text-sm font-normal text-foreground-soft outline-hidden data-placeholder:text-foreground-secondary">- No repositories found- </div>- )}- </DropdownMenuTrigger>- <DropdownMenuContent- align="start"- className="z-100 max-h-80 thin-scrollbar overflow-y-scroll"+ name="secretPath"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="github-secretpath">Secrets Path</FieldLabel>+ <Input+ {...field}+ placeholder="Provide a path, default is /"+ id="github-secretpath"+ isError={Boolean(error)}+ aria-describedby={error ? "github-secretpath-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="github-secretpath-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ <Controller+ control={control}+ name="scope"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="github-scope">Scope</FieldLabel>+ <Select+ defaultValue={field.value}+ onValueChange={(e) => {+ setValue("repoIds", []);+ onChange(e);+ }}+ >+ <SelectTrigger+ className="w-full"+ id="github-scope"+ isError={Boolean(error)}+ aria-describedby={error ? "github-scope-error" : undefined}>- {integrationAuthApps.length > 0 ? (- integrationAuthApps.map((integrationAuthApp) => {- const isSelected = repoIds?.includes(- String(integrationAuthApp.appId)- );+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="github-org">Organization</SelectItem>+ <SelectItem value="github-repo">Repository</SelectItem>+ <SelectItem value="github-env">Repository Environment</SelectItem>+ </SelectContent>+ </Select>+ {Boolean(error) && (+ <FieldError id="github-scope-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ {scope === "github-repo" && (+ <Controller+ control={control}+ name="repoIds"+ render={({ field: { onChange }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error?.message)}>+ <FieldLabel htmlFor="github-repoids">Repositories</FieldLabel>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ {integrationAuthApps.length > 0 ? (+ <Button+ variant="outline"+ className="w-full justify-between"+ id="github-repoids"+ aria-invalid={Boolean(error?.message)}+ aria-describedby={+ error?.message ? "github-repoids-error" : undefined+ }+ >+ {repoIds?.length === 1+ ? integrationAuthApps?.reduce(+ (acc, { appId, name, owner }) =>+ repoIds?.[0] === appId ? `${owner}/${name}` : acc,+ ""+ )+ : `${repoIds?.length} repositories selected`}+ <FontAwesomeIcon icon={faAngleDown} className="text-xs" />+ </Button>+ ) : (+ <Button+ variant="outline"+ className="w-full justify-between"+ id="github-repoids"+ aria-invalid={Boolean(error?.message)}+ aria-describedby={+ error?.message ? "github-repoids-error" : undefined+ }+ >+ No repositories found+ </Button>+ )}+ </DropdownMenuTrigger>+ <DropdownMenuContent+ align="start"+ className="min-w-(--radix-dropdown-menu-trigger-width)"+ >+ {integrationAuthApps.length > 0 ? (+ integrationAuthApps.map((integrationAuthApp) => {+ const isSelected = repoIds?.includes(+ String(integrationAuthApp.appId)+ );- return (- <DropdownMenuItem- onClick={() => {- if (repoIds?.includes(String(integrationAuthApp.appId))) {- onChange(- repoIds.filter(- (appId: string) =>- appId !== String(integrationAuthApp.appId)- )- );- } else {- onChange([- ...(repoIds || []),- String(integrationAuthApp.appId)- ]);- }- }}- key={`repos-id-${integrationAuthApp.appId}`}- icon={- isSelected ? (+ return (+ <DropdownMenuItem+ onClick={() => {+ if (repoIds?.includes(String(integrationAuthApp.appId))) {+ onChange(+ repoIds.filter(+ (appId: string) =>+ appId !== String(integrationAuthApp.appId)+ )+ );+ } else {+ onChange([+ ...(repoIds || []),+ String(integrationAuthApp.appId)+ ]);+ }+ }}+ key={`repos-id-${integrationAuthApp.appId}`}+ >+ {isSelected ? (<FontAwesomeIconicon={faCheckCircle}className="pr-0.5 text-project"/>) : (<div className="pl-[1.01rem]" />- )- }- iconPos="left"- className="w-[28.4rem] text-sm"- >- {integrationAuthApp.owner}/{integrationAuthApp.name}- </DropdownMenuItem>- );- })- ) : (- <div />- )}- </DropdownMenuContent>- </DropdownMenu>- </FormControl>- )}- />- )}- {scope === "github-org" && (- <>- <Controller- control={control}- name="orgId"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Organization"- errorText={- integrationAuthOrgs?.length ? error?.message : "No organizations found"- }- isError={Boolean(integrationAuthOrgs?.length || error?.message)}- >- <Select- value={field.value}- onValueChange={onChange}- className="w-full border border-border-strong"- >- {integrationAuthOrgs &&- integrationAuthOrgs.map(({ name, orgId }) => (- <SelectItem key={`github-organization-${orgId}`} value={orgId}>- {name}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />-- <Controller- control={control}- name="visibility"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- tooltipText="Select which type of repositories that the secrets should be synced to."- label="Visibility"- errorText={error?.message}- isError={Boolean(error?.message)}- >- <Select- value={field.value}- onValueChange={onChange}- className="w-full border border-border-strong"- >- {secretsVisibility.map(({ label, value }) => (- <SelectItem key={`github-visibility-${value}`} value={value}>- {label}- </SelectItem>- ))}- </Select>- </FormControl>+ )}+ {integrationAuthApp.owner}/{integrationAuthApp.name}+ </DropdownMenuItem>+ );+ })+ ) : (+ <div />+ )}+ </DropdownMenuContent>+ </DropdownMenu>+ {Boolean(error?.message) && (+ <FieldError id="github-repoids-error">{error?.message}</FieldError>+ )}+ </Field>)}/>+ )}+ {scope === "github-org" && (+ <>+ <Controller+ control={control}+ name="orgId"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error?.message)}>+ <FieldLabel htmlFor="github-orgid">Organization</FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger+ className="w-full"+ id="github-orgid"+ isError={Boolean(error?.message)}+ aria-describedby={error?.message ? "github-orgid-error" : undefined}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {integrationAuthOrgs &&+ integrationAuthOrgs.map(({ name, orgId }) => (+ <SelectItem key={`github-organization-${orgId}`} value={orgId}>+ {name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ {Boolean(error?.message) && (+ <FieldError id="github-orgid-error">+ {integrationAuthOrgs?.length+ ? error?.message+ : "No organizations found"}+ </FieldError>+ )}+ </Field>+ )}+ />- {watch("visibility") === "selected" && (<Controllercontrol={control}- name="repoIds"- render={({ field: { onChange }, fieldState: { error } }) => (- <FormControl- label="Selected Repositories"- isError={Boolean(error?.message)}- errorText={error?.message}- >- <DropdownMenu>- <DropdownMenuTrigger asChild>- {integrationAuthApps.length > 0 ? (- <div className="inline-flex w-full cursor-pointer items-center justify-between rounded-md border border-border-control bg-surface-base px-3 py-2 font-sans text-sm font-normal text-foreground-soft outline-hidden data-placeholder:text-foreground-secondary">- {repoIds?.length === 1- ? integrationAuthApps?.reduce(- (acc, { appId, name, owner }) =>- repoIds?.[0] === appId ? `${owner}/${name}` : acc,- ""- )- : `${repoIds?.length} repositories selected`}- <FontAwesomeIcon icon={faAngleDown} className="text-xs" />- </div>- ) : (- <div className="inline-flex w-full cursor-default items-center justify-between rounded-md border border-border-control bg-surface-base px-3 py-2 font-sans text-sm font-normal text-foreground-soft outline-hidden data-placeholder:text-foreground-secondary">- No repositories found- </div>- )}- </DropdownMenuTrigger>- <DropdownMenuContent- align="start"- className="z-100 max-h-80 thin-scrollbar overflow-y-scroll"+ name="visibility"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error?.message)}>+ <FieldLabel htmlFor="github-visibility">+ Visibility+ <Tooltip>+ <TooltipTrigger asChild>+ <button type="button" aria-label="More information">+ ?+ </button>+ </TooltipTrigger>+ <TooltipContent>+ Select which type of repositories that the secrets should be+ synced to.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger+ className="w-full"+ id="github-visibility"+ isError={Boolean(error?.message)}+ aria-describedby={+ error?.message ? "github-visibility-error" : undefined+ }>- {selectedOrganization ? (- selectedOrganization.map((integrationAuthApp) => {- const isSelected = repoIds?.includes(- String(integrationAuthApp.appId)- );+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {secretsVisibility.map(({ label, value }) => (+ <SelectItem key={`github-visibility-${value}`} value={value}>+ {label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ {Boolean(error?.message) && (+ <FieldError id="github-visibility-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />++ {watch("visibility") === "selected" && (+ <Controller+ control={control}+ name="repoIds"+ render={({ field: { onChange }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error?.message)}>+ <FieldLabel htmlFor="github-repoids">+ Selected Repositories+ </FieldLabel>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ {integrationAuthApps.length > 0 ? (+ <Button+ variant="outline"+ className="w-full justify-between"+ id="github-repoids"+ aria-invalid={Boolean(error?.message)}+ aria-describedby={+ error?.message ? "github-repoids-error" : undefined+ }+ >+ {repoIds?.length === 1+ ? integrationAuthApps?.reduce(+ (acc, { appId, name, owner }) =>+ repoIds?.[0] === appId ? `${owner}/${name}` : acc,+ ""+ )+ : `${repoIds?.length} repositories selected`}+ <FontAwesomeIcon icon={faAngleDown} className="text-xs" />+ </Button>+ ) : (+ <Button+ variant="outline"+ className="w-full justify-between"+ id="github-repoids"+ aria-invalid={Boolean(error?.message)}+ aria-describedby={+ error?.message ? "github-repoids-error" : undefined+ }+ >+ No repositories found+ </Button>+ )}+ </DropdownMenuTrigger>+ <DropdownMenuContent+ align="start"+ className="min-w-(--radix-dropdown-menu-trigger-width)"+ >+ {selectedOrganization ? (+ selectedOrganization.map((integrationAuthApp) => {+ const isSelected = repoIds?.includes(+ String(integrationAuthApp.appId)+ );- return (- <DropdownMenuItem- onClick={() => {- if (repoIds?.includes(String(integrationAuthApp.appId))) {- onChange(- repoIds?.filter(- (appId: string) =>- appId !== String(integrationAuthApp.appId)- )- );- } else {- onChange([- ...repoIds,- String(integrationAuthApp.appId)- ]);- }- }}- key={`repos-id-${integrationAuthApp.appId}`}- icon={- isSelected ? (+ return (+ <DropdownMenuItem+ onClick={() => {+ if (+ repoIds?.includes(String(integrationAuthApp.appId))+ ) {+ onChange(+ repoIds?.filter(+ (appId: string) =>+ appId !== String(integrationAuthApp.appId)+ )+ );+ } else {+ onChange([+ ...repoIds,+ String(integrationAuthApp.appId)+ ]);+ }+ }}+ key={`repos-id-${integrationAuthApp.appId}`}+ >+ {isSelected ? (<FontAwesomeIconicon={faCheckCircle}className="pr-0.5 text-project"/>) : (<div className="pl-[1.01rem]" />- )- }- iconPos="left"- className="w-[28.4rem] text-sm"- >- {integrationAuthApp.owner}/{integrationAuthApp.name}- </DropdownMenuItem>- );- })- ) : (- <div />- )}- </DropdownMenuContent>- </DropdownMenu>- </FormControl>- )}- />- )}- </>- )}- {scope === "github-env" && (- <Controller- control={control}- name="repoId"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Repository"- errorText={error?.message}- isError={Boolean(error)}- >- <Select- value={field.value}- onValueChange={(e) => {- const selectedRepo = integrationAuthApps.find((app) => app.appId === e);- setValue("repoName", selectedRepo?.name);- setValue("repoOwner", selectedRepo?.owner);- onChange(e);- }}- className="w-full border border-border-strong"- >- {integrationAuthApps?.length ? (- integrationAuthApps.map((app) => {- return (- <SelectItem- value={app.appId as string}- key={`repo-id-${app.appId}`}- className="w-[28.4rem] text-sm"- >- {app.owner}/{app.name}- </SelectItem>- );- })- ) : (- <div />- )}- </Select>- </FormControl>- )}- />- )}- {scope === "github-env" && (- <Controller- control={control}- name="envId"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Environment"- errorText={- integrationAuthGithubEnvs?.length- ? error?.message- : "No Environment found"- }- isError={Boolean(integrationAuthGithubEnvs?.length || error?.message)}- >- <Select- value={field.value}- onValueChange={onChange}- isDisabled={!repoId}- className={twMerge(- "w-full border border-border-strong",- !repoId && "h-10 cursor-not-allowed"+ )}+ {integrationAuthApp.owner}/{integrationAuthApp.name}+ </DropdownMenuItem>+ );+ })+ ) : (+ <div />+ )}+ </DropdownMenuContent>+ </DropdownMenu>+ {Boolean(error?.message) && (+ <FieldError id="github-repoids-error">{error?.message}</FieldError>+ )}+ </Field>)}- >- {integrationAuthGithubEnvs?.length ? (- integrationAuthGithubEnvs.map((githubEnv) => {- return (- <SelectItem- value={githubEnv.name as string}- key={`env-id-${githubEnv.envId}`}- className="w-[28.4rem] text-sm"- >- {githubEnv.name}- </SelectItem>+ />+ )}+ </>+ )}+ {scope === "github-env" && (+ <Controller+ control={control}+ name="repoId"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="github-repoid">Repository</FieldLabel>+ <Select+ value={field.value}+ onValueChange={(e) => {+ const selectedRepo = integrationAuthApps.find(+ (app) => app.appId === e);- })- ) : (- <div />+ setValue("repoName", selectedRepo?.name);+ setValue("repoOwner", selectedRepo?.owner);+ onChange(e);+ }}+ >+ <SelectTrigger+ className="w-full"+ id="github-repoid"+ isError={Boolean(error)}+ aria-describedby={error ? "github-repoid-error" : undefined}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {integrationAuthApps?.length ? (+ integrationAuthApps.map((app) => {+ return (+ <SelectItem+ value={app.appId as string}+ key={`repo-id-${app.appId}`}+ >+ {app.owner}/{app.name}+ </SelectItem>+ );+ })+ ) : (+ <div />+ )}+ </SelectContent>+ </Select>+ {Boolean(error) && (+ <FieldError id="github-repoid-error">{error?.message}</FieldError>)}- </Select>- </FormControl>- )}- />- )}- </motion.div>- </TabPanel>- <TabPanel value={TabSections.Options}>- <motion.div- key="panel-1"- transition={{ duration: 0.15 }}- initial={{ opacity: 0, translateX: -30 }}- animate={{ opacity: 1, translateX: 0 }}- exit={{ opacity: 0, translateX: 30 }}- >- <div className="mb-5 ml-1">+ </Field>+ )}+ />+ )}+ {scope === "github-env" && (+ <Controller+ control={control}+ name="envId"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error?.message)}>+ <FieldLabel htmlFor="github-envid">Environment</FieldLabel>+ <Select value={field.value} onValueChange={onChange} disabled={!repoId}>+ <SelectTrigger+ className="w-full"+ id="github-envid"+ isError={Boolean(error?.message)}+ aria-describedby={error?.message ? "github-envid-error" : undefined}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {integrationAuthGithubEnvs?.length ? (+ integrationAuthGithubEnvs.map((githubEnv) => {+ return (+ <SelectItem+ value={githubEnv.name as string}+ key={`env-id-${githubEnv.envId}`}+ >+ {githubEnv.name}+ </SelectItem>+ );+ })+ ) : (+ <div />+ )}+ </SelectContent>+ </Select>+ {Boolean(error?.message) && (+ <FieldError id="github-envid-error">+ {integrationAuthGithubEnvs?.length+ ? error?.message+ : "No Environment found"}+ </FieldError>+ )}+ </Field>+ )}+ />+ )}+ </motion.div>+ </TabsContent>+ <TabsContent value={TabSections.Options}>+ <motion.div+ key="panel-1"+ transition={{ duration: 0.15 }}+ initial={{ opacity: 0, translateX: -30 }}+ animate={{ opacity: 1, translateX: 0 }}+ exit={{ opacity: 0, translateX: 30 }}+ >+ <div className="mb-5 ml-1">+ <Controller+ control={control}+ name="shouldEnableDelete"+ render={({ field: { onChange, value } }) => (+ <Field orientation="horizontal">+ <FieldLabel htmlFor="delete-github-option">+ Delete secrets in Github that are not in Infisical+ </FieldLabel>+ <Toggle+ id="delete-github-option"+ onCheckedChange={(isChecked) => onChange(isChecked)}+ checked={value}+ variant="project"+ />+ </Field>+ )}+ />+ </div><Controllercontrol={control}- name="shouldEnableDelete"- render={({ field: { onChange, value } }) => (- <Switch- id="delete-github-option"- onCheckedChange={(isChecked) => onChange(isChecked)}- isChecked={value}- >- Delete secrets in Github that are not in Infisical- </Switch>+ name="secretSuffix"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="github-secretsuffix">+ Append Secret Names with...+ </FieldLabel>+ <Input+ {...field}+ placeholder="Provide a suffix for secret names, default is no suffix"+ id="github-secretsuffix"+ isError={Boolean(error)}+ aria-describedby={error ? "github-secretsuffix-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="github-secretsuffix-error">{error?.message}</FieldError>+ )}+ </Field>)}/>- </div>- <Controller- control={control}- name="secretSuffix"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Append Secret Names with..."- className="pb-39"- errorText={error?.message}- isError={Boolean(error)}- >- <Input- {...field}- placeholder="Provide a suffix for secret names, default is no suffix"- />- </FormControl>- )}- />- </motion.div>- </TabPanel>- </Tabs>- <div className="flex w-full justify-end">- <Button- type="submit"- colorSchema="secondary"- variant="outline_bg"- className="mb-6"- isLoading={isLoading}- >+ </motion.div>+ </TabsContent>+ </Tabs>+ </CardContent>+ <CardFooter className="justify-end">+ <Button type="submit" isPending={isLoading} variant="project">Create Integration</Button>- </div>+ </CardFooter></form></Card><div className="mt-6 w-full max-w-md border-t border-border-faint" />diff --git a/frontend/src/pages/secret-manager/integrations/GitlabAuthorizePage/GitlabAuthorizePage.tsx b/frontend/src/pages/secret-manager/integrations/GitlabAuthorizePage/GitlabAuthorizePage.tsxindex e790e2279b..032f67b92b 100644--- a/frontend/src/pages/secret-manager/integrations/GitlabAuthorizePage/GitlabAuthorizePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/GitlabAuthorizePage/GitlabAuthorizePage.tsx@@ -7,7 +7,21 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";-import { Button, Card, CardTitle, FormControl, Input } from "@app/components/v2";+import {+ Badge,+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useProject } from "@app/context";import { localStorageService } from "@app/helpers/localStorage";import { useGetCloudIntegrations } from "@app/hooks/api";@@ -65,55 +79,57 @@ export const GitlabAuthorizePage = () => {<Helmet><title>Authorize GitLab 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="Authorize this integration to sync secrets from Infisical to GitLab. If no self-hosted GitLab URL is specified, then Infisical will connect you to GitLab Cloud."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img src="/images/integrations/GitLab.png" height={28} width={28} alt="Gitlab logo" />- </div>- <span className="ml-2.5">GitLab Integration </span>- <a- href="https://infisical.com/docs/integrations/cicd/gitlab"- 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="gitLabURL"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Self-hosted URL (optional)"- errorText={error?.message}- isError={Boolean(error)}+ <Card className="mb-12 w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img src="/images/integrations/GitLab.png" height={28} width={28} alt="Gitlab logo" />+ <span>GitLab Integration</span>+ </CardTitle>+ <CardDescription>+ Authorize this integration to sync secrets from Infisical to GitLab. If no self-hosted+ GitLab URL is specified, then Infisical will connect you to GitLab Cloud.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ href="https://infisical.com/docs/integrations/cicd/gitlab"+ target="_blank"+ rel="noopener noreferrer">- <Input {...field} placeholder="https://self-hosted-gitlab.com" />- </FormControl>- )}- />- <Button- colorSchema="primary"- variant="outline_bg"- className="mt-2 w-min"- size="sm"- type="submit"- >- Continue with OAuth- </Button>+ <FontAwesomeIcon icon={faBookOpen} />+ Docs+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <form onSubmit={handleSubmit(onFormSubmit)} className="flex flex-col gap-5">+ <CardContent>+ <Controller+ control={control}+ name="gitLabURL"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-gitlaburl">Self-hosted URL (optional)</FieldLabel>+ <Input+ {...field}+ placeholder="https://self-hosted-gitlab.com"+ id="gitlab-gitlaburl"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-gitlaburl-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="gitlab-gitlaburl-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ </CardContent>+ <CardFooter className="justify-end">+ <Button size="sm" type="submit" variant="project">+ Continue with OAuth+ </Button>+ </CardFooter></form></Card></div>diff --git a/frontend/src/pages/secret-manager/integrations/GitlabConfigurePage/GitlabConfigurePage.tsx b/frontend/src/pages/secret-manager/integrations/GitlabConfigurePage/GitlabConfigurePage.tsxindex 6f97d8aa57..bc0a63d3fc 100644--- a/frontend/src/pages/secret-manager/integrations/GitlabConfigurePage/GitlabConfigurePage.tsx+++ b/frontend/src/pages/secret-manager/integrations/GitlabConfigurePage/GitlabConfigurePage.tsx@@ -9,22 +9,38 @@ import { motion } from "motion/react";import { z } from "zod";import {+ Badge,Button,Card,+ CardAction,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,CardTitle,- FormControl,+ Dialog,+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldLabel,Input,- Modal,- ModalContent,+ SecretPathInput,Select,+ SelectContent,SelectItem,- Switch,- Tab,- TabList,- TabPanel,- Tabs-} from "@app/components/v2";-import { SecretPathInput } from "@app/components/v2/SecretPathInput";+ SelectTrigger,+ SelectValue,+ Tabs,+ TabsContent,+ TabsList,+ TabsTrigger,+ Toggle+} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization, useProject } from "@app/context";import { usePopUp } from "@app/hooks";@@ -73,9 +89,7 @@ type FormData = z.infer<typeof schema>;export const GitlabConfigurePage = () => {const navigate = useNavigate();- const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([- "confirmIntegration"- ] as const);+ const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["confirmIntegration"] as const);const { currentProject } = useProject();const { currentOrg } = useOrganization();const { control, handleSubmit, setValue, watch } = useForm<FormData>({@@ -173,7 +187,6 @@ export const GitlabConfigurePage = () => {}});- setIsLoading(false);navigate({to: "/organizations/$orgId/projects/secret-management/$projectId/integrations",params: {@@ -186,6 +199,7 @@ export const GitlabConfigurePage = () => {});} catch (err) {console.error(err);+ } finally {setIsLoading(false);}};@@ -212,336 +226,444 @@ export const GitlabConfigurePage = () => {<Helmet><title>Set Up GitLab Integration</title></Helmet>- <Card className="max-w-lg rounded-md border border-border-control">- <CardTitle- className="px-6 text-left text-xl"- subTitle="Select which environment or folder in Infisical you want to sync to GitLab's environment variables."- >- <div className="flex flex-row items-center">- <div className="flex items-center pb-0.5">- <img src="/images/integrations/GitLab.png" height={28} width={28} alt="Gitlab logo" />- </div>- <span className="ml-2.5">GitLab Integration </span>- <a- href="https://infisical.com/docs/integrations/cicd/gitlab"- target="_blank"- rel="noopener noreferrer"- >- <div className="mb-1 ml-2 inline-block cursor-default rounded-md bg-warning/20 px-1.5 pt-[0.04rem] pb-[0.03rem] text-sm text-warning opacity-80 hover:opacity-100">- <FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />+ <Card className="w-full max-w-lg">+ <CardHeader>+ <CardTitle>+ <img src="/images/integrations/GitLab.png" height={28} width={28} alt="Gitlab logo" />+ <span>GitLab Integration</span>+ </CardTitle>+ <CardDescription>+ Select which environment or folder in Infisical you want to sync to GitLab's+ environment variables.+ </CardDescription>+ <CardAction>+ <Badge variant="info" asChild>+ <a+ href="https://infisical.com/docs/integrations/cicd/gitlab"+ target="_blank"+ rel="noopener noreferrer"+ >+ <FontAwesomeIcon icon={faBookOpen} />Docs- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="text-xxs mb-[0.07rem] ml-1.5"- />- </div>- </a>- </div>- </CardTitle>- <Tabs defaultValue={TabSections.Connection} className="px-6">- <TabList>- <div className="flex w-full flex-row border-b border-border-control">- <Tab value={TabSections.Connection}>Connection</Tab>- <Tab value={TabSections.Options}>Options</Tab>- </div>- </TabList>- <TabPanel value={TabSections.Connection}>- <motion.div- key="panel-1"- transition={{ duration: 0.15 }}- initial={{ opacity: 0, translateX: 30 }}- animate={{ opacity: 1, translateX: 0 }}- exit={{ opacity: 0, translateX: 30 }}- >- <Controller- control={control}- name="selectedSourceEnvironment"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Project Environment"- errorText={error?.message}- isError={Boolean(error)}- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- >- {currentProject?.environments.map((sourceEnvironment) => (- <SelectItem- value={sourceEnvironment.slug}- key={`source-environment-${sourceEnvironment.slug}`}- >- {sourceEnvironment.name}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <Controller- control={control}- defaultValue=""- name="secretPath"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Secrets Path"- isError={Boolean(error)}- errorText={error?.message}- >- <SecretPathInput- {...field}- placeholder="/"- environment={selectedSourceEnvironment}- />- </FormControl>- )}- />- <Controller- control={control}- name="targetEntity"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="GitLab Integration Type"- errorText={error?.message}- isError={Boolean(error)}- >- <Select {...field} onValueChange={(e) => onChange(e)} className="w-full">- {gitLabEntities.map((entity) => {- return (- <SelectItem value={entity.value} key={`target-entity-${entity.value}`}>- {entity.name}- </SelectItem>- );- })}- </Select>- </FormControl>- )}- />- {targetEntity === "group" && targetTeamId && (+ <FontAwesomeIcon icon={faArrowUpRightFromSquare} />+ </a>+ </Badge>+ </CardAction>+ </CardHeader>+ <CardContent className="flex flex-col gap-5">+ <Tabs defaultValue={TabSections.Connection}>+ <TabsList variant="project">+ <TabsTrigger value={TabSections.Connection}>Connection</TabsTrigger>+ <TabsTrigger value={TabSections.Options}>Options</TabsTrigger>+ </TabsList>+ <TabsContent value={TabSections.Connection}>+ <motion.div+ key="panel-1"+ transition={{ duration: 0.15 }}+ initial={{ opacity: 0, translateX: 30 }}+ animate={{ opacity: 1, translateX: 0 }}+ exit={{ opacity: 0, translateX: 30 }}+ ><Controllercontrol={control}- name="targetTeamId"+ name="selectedSourceEnvironment"render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="GitLab Group"- errorText={error?.message}- isError={Boolean(error)}- >- <Select {...field} onValueChange={(e) => onChange(e)} className="w-full">- {integrationAuthTeams.length > 0 ? (- integrationAuthTeams.map((integrationAuthTeam) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-selectedsourceenvironment">+ Project Environment+ </FieldLabel>+ <Select+ defaultValue={field.value}+ onValueChange={(e) => onChange(e)}+ name={field.name}+ disabled={field.disabled}+ value={field.value}+ >+ <SelectTrigger+ className="w-full"+ id="gitlab-selectedsourceenvironment"+ isError={Boolean(error)}+ aria-describedby={+ error ? "gitlab-selectedsourceenvironment-error" : undefined+ }+ ref={field.ref}+ onBlur={field.onBlur}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {currentProject?.environments.map((sourceEnvironment) => (<SelectItem- value={String(integrationAuthTeam.id as string)}- key={`target-team-${String(integrationAuthTeam.id)}`}+ value={sourceEnvironment.slug}+ key={`source-environment-${sourceEnvironment.slug}`}>- {integrationAuthTeam.name}+ {sourceEnvironment.name}</SelectItem>- ))- ) : (- <SelectItem value="none" key="target-team-none">- No groups found- </SelectItem>- )}+ ))}+ </SelectContent></Select>- </FormControl>+ {Boolean(error) && (+ <FieldError id="gitlab-selectedsourceenvironment-error">+ {error?.message}+ </FieldError>+ )}+ </Field>)}/>- )}- <Controller- control={control}- name="targetAppId"- render={({ field: { onChange, ...field }, fieldState: { error } }) => {- return (- <FormControl- label="GitLab Project"- errorText={error?.message}- isError={Boolean(error)}- >- <Select+ <Controller+ control={control}+ defaultValue=""+ name="secretPath"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-secretpath">Secrets Path</FieldLabel>+ <SecretPathInput{...field}- onValueChange={(e) => {- if (e === "") return;- onChange(e);- }}- className="w-full"+ placeholder="/"+ environment={selectedSourceEnvironment}+ id="gitlab-secretpath"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-secretpath-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="gitlab-secretpath-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ <Controller+ control={control}+ name="targetEntity"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-targetentity">GitLab Integration Type</FieldLabel>+ <Select+ onValueChange={(e) => onChange(e)}+ name={field.name}+ disabled={field.disabled}+ value={field.value}>- {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 projects found- </SelectItem>- )}+ <SelectTrigger+ className="w-full"+ id="gitlab-targetentity"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-targetentity-error" : undefined}+ ref={field.ref}+ onBlur={field.onBlur}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {gitLabEntities.map((entity) => {+ return (+ <SelectItem+ value={entity.value}+ key={`target-entity-${entity.value}`}+ >+ {entity.name}+ </SelectItem>+ );+ })}+ </SelectContent></Select>- </FormControl>- );- }}- />- <Controller- control={control}- defaultValue=""- name="targetEnvironment"- render={({ field, fieldState: { error } }) => (- <FormControl- label="GitLab Environment Scope (Optional)"- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="*" />- </FormControl>- )}- />- <Controller- control={control}- name="initialSyncBehavior"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Initial Sync Behavior"- errorText={error?.message}- isError={Boolean(error)}- >- <Select- defaultValue={field.value}- onValueChange={(e) => onChange(e)}- className="w-full border border-border-strong"- dropdownContainerClassName="max-w-full"- >- {initialSyncBehaviors.map((b) => {- return (- <SelectItem- value={b.value}- key={`sync-behavior-${b.value}`}+ {Boolean(error) && (+ <FieldError id="gitlab-targetentity-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ {targetEntity === "group" && targetTeamId && (+ <Controller+ control={control}+ name="targetTeamId"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-targetteamid">GitLab Group</FieldLabel>+ <Select+ onValueChange={(e) => onChange(e)}+ name={field.name}+ disabled={field.disabled}+ value={field.value}+ >+ <SelectTriggerclassName="w-full"+ id="gitlab-targetteamid"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-targetteamid-error" : undefined}+ ref={field.ref}+ onBlur={field.onBlur}>- {b.label}- </SelectItem>- );- })}- </Select>- </FormControl>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {integrationAuthTeams.length > 0 ? (+ integrationAuthTeams.map((integrationAuthTeam) => (+ <SelectItem+ value={String(integrationAuthTeam.id as string)}+ key={`target-team-${String(integrationAuthTeam.id)}`}+ >+ {integrationAuthTeam.name}+ </SelectItem>+ ))+ ) : (+ <SelectItem value="none" key="target-team-none">+ No groups found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ {Boolean(error) && (+ <FieldError id="gitlab-targetteamid-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />)}- />- </motion.div>- </TabPanel>- <TabPanel value={TabSections.Options}>- <motion.div- key="panel-1"- transition={{ duration: 0.15 }}- initial={{ opacity: 0, translateX: -30 }}- animate={{ opacity: 1, translateX: 0 }}- exit={{ opacity: 0, translateX: 30 }}- className="pb-57"- >- <div className="ml-1"><Controllercontrol={control}- name="shouldMaskSecrets"- render={({ field: { onChange, value } }) => (- <Switch- id="should-mask-secrets"- onCheckedChange={(isChecked) => onChange(isChecked)}- isChecked={value}- >- <div className="max-w-md">- Mark Infisical secrets in Gitlab as 'Masked' secrets- </div>- </Switch>+ name="targetAppId"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => {+ return (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-targetappid">GitLab Project</FieldLabel>+ <Select+ onValueChange={(e) => {+ if (e === "") return;+ onChange(e);+ }}+ name={field.name}+ disabled={field.disabled}+ value={field.value}+ >+ <SelectTrigger+ className="w-full"+ id="gitlab-targetappid"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-targetappid-error" : undefined}+ 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 projects found+ </SelectItem>+ )}+ </SelectContent>+ </Select>+ {Boolean(error) && (+ <FieldError id="gitlab-targetappid-error">{error?.message}</FieldError>+ )}+ </Field>+ );+ }}+ />+ <Controller+ control={control}+ defaultValue=""+ name="targetEnvironment"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-targetenvironment">+ GitLab Environment Scope (Optional)+ </FieldLabel>+ <Input+ {...field}+ placeholder="*"+ id="gitlab-targetenvironment"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-targetenvironment-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="gitlab-targetenvironment-error">+ {error?.message}+ </FieldError>+ )}+ </Field>)}/>- </div>- <div className="mt-4 mb-5 ml-1"><Controllercontrol={control}- name="shouldProtectSecrets"- render={({ field: { onChange, value } }) => (- <Switch- id="should-protect-secrets"- onCheckedChange={(isChecked) => onChange(isChecked)}- isChecked={value}- >- Mark Infisical secrets in Gitlab as 'Protected' secrets- </Switch>+ name="initialSyncBehavior"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-initialsyncbehavior">+ Initial Sync Behavior+ </FieldLabel>+ <Select defaultValue={field.value} onValueChange={(e) => onChange(e)}>+ <SelectTrigger+ className="w-full"+ id="gitlab-initialsyncbehavior"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-initialsyncbehavior-error" : undefined}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {initialSyncBehaviors.map((b) => {+ return (+ <SelectItem value={b.value} key={`sync-behavior-${b.value}`}>+ {b.label}+ </SelectItem>+ );+ })}+ </SelectContent>+ </Select>+ {Boolean(error) && (+ <FieldError id="gitlab-initialsyncbehavior-error">+ {error?.message}+ </FieldError>+ )}+ </Field>)}/>- </div>- <Controller- control={control}- name="secretPrefix"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Secret Prefix"- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="INFISICAL_" />- </FormControl>- )}- />- <Controller- control={control}- name="secretSuffix"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Secret Suffix"- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="_INFISICAL" />- </FormControl>- )}- />- </motion.div>- </TabPanel>- </Tabs>- <Button- colorSchema="primary"- variant="outline_bg"- className="mr-6 mb-8 ml-auto w-min"- size="sm"- type="submit"- isLoading={isLoading}- isDisabled={targetAppIdValue === "none"}- >- Create Integration- </Button>+ </motion.div>+ </TabsContent>+ <TabsContent value={TabSections.Options}>+ <motion.div+ key="panel-1"+ transition={{ duration: 0.15 }}+ initial={{ opacity: 0, translateX: -30 }}+ animate={{ opacity: 1, translateX: 0 }}+ exit={{ opacity: 0, translateX: 30 }}+ className="pb-57"+ >+ <div className="ml-1">+ <Controller+ control={control}+ name="shouldMaskSecrets"+ render={({ field: { onChange, value } }) => (+ <Field orientation="horizontal">+ <FieldLabel htmlFor="should-mask-secrets">+ <div className="max-w-md">+ Mark Infisical secrets in Gitlab as 'Masked' secrets+ </div>+ </FieldLabel>+ <Toggle+ id="should-mask-secrets"+ onCheckedChange={(isChecked) => onChange(isChecked)}+ checked={value}+ variant="project"+ />+ </Field>+ )}+ />+ </div>+ <div className="mt-4 mb-5 ml-1">+ <Controller+ control={control}+ name="shouldProtectSecrets"+ render={({ field: { onChange, value } }) => (+ <Field orientation="horizontal">+ <FieldLabel htmlFor="should-protect-secrets">+ Mark Infisical secrets in Gitlab as 'Protected' secrets+ </FieldLabel>+ <Toggle+ id="should-protect-secrets"+ onCheckedChange={(isChecked) => onChange(isChecked)}+ checked={value}+ variant="project"+ />+ </Field>+ )}+ />+ </div>+ <Controller+ control={control}+ name="secretPrefix"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-secretprefix">Secret Prefix</FieldLabel>+ <Input+ {...field}+ placeholder="INFISICAL_"+ id="gitlab-secretprefix"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-secretprefix-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="gitlab-secretprefix-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ <Controller+ control={control}+ name="secretSuffix"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4" data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gitlab-secretsuffix">Secret Suffix</FieldLabel>+ <Input+ {...field}+ placeholder="_INFISICAL"+ id="gitlab-secretsuffix"+ isError={Boolean(error)}+ aria-describedby={error ? "gitlab-secretsuffix-error" : undefined}+ />+ {Boolean(error) && (+ <FieldError id="gitlab-secretsuffix-error">{error?.message}</FieldError>+ )}+ </Field>+ )}+ />+ </motion.div>+ </TabsContent>+ </Tabs>+ </CardContent>+ <CardFooter className="justify-end">+ <Button+ size="sm"+ type="submit"+ isPending={isLoading}+ isDisabled={targetAppIdValue === "none"}+ variant="project"+ >+ Create Integration+ </Button>+ </CardFooter></Card>- <Modal- isOpen={popUp.confirmIntegration?.isOpen}+ <Dialog+ open={popUp.confirmIntegration?.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("confirmIntegration", isOpen)}>- <ModalContent- title="Heads Up"- footerContent={- <div className="flex items-center space-x-2">- <Button onClick={() => onFormSubmit(popUp.confirmIntegration?.data as FormData)}>- Continue Anyway- </Button>- <Button- onClick={() => handlePopUpClose("confirmIntegration")}- variant="outline_bg"- colorSchema="secondary"- >- Cancel- </Button>- </div>- }- >- <p>You're about to overwrite any existing secrets in GitLab.</p>- <p className="mt-4">- To avoid this behavior, you may consider adding a secret prefix/suffix in the options- tab.- </p>- </ModalContent>- </Modal>+ <DialogContent isPending={isLoading}>+ <DialogHeader>+ <DialogTitle>Heads Up</DialogTitle>+ <DialogDescription asChild>+ <div>+ <p>You're about to overwrite any existing secrets in GitLab.</p>+ <p className="mt-4">+ To avoid this behavior, you may consider adding a secret prefix/suffix in the+ options tab.+ </p>+ </div>+ </DialogDescription>+ </DialogHeader>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost">Cancel</Button>+ </DialogClose>+ <Button+ onClick={() => onFormSubmit(popUp.confirmIntegration?.data as FormData)}+ variant="project"+ isPending={isLoading}+ >+ Continue Anyway+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog></form>) : (<div className="flex h-full w-full items-center justify-center">