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
ui: move components to v3
adilson2f4d5e91d27e
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/TriggerDevConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/TriggerDevConnectionForm.tsxindex 2223a335fd..db27816265 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/TriggerDevConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/TriggerDevConnectionForm.tsx@@ -1,16 +1,23 @@import { Controller, FormProvider, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";+import { Info } from "lucide-react";import { z } from "zod";import {- Button,- FormControl,+ Field,+ FieldError,+ FieldLabel,Input,- ModalClose,SecretInput,Select,- SelectItem-} from "@app/components/v2";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";import { AppConnection } from "@app/hooks/api/appConnections/enums";import {@@ -18,6 +25,7 @@ import {TTriggerDevConnection} from "@app/hooks/api/appConnections/types/trigger-dev-connection";+import { AppConnectionFormFooter } from "./AppConnectionFormFooter";import {genericAppConnectionFieldsSchema,GenericAppConnectionsFields@@ -25,7 +33,7 @@ import {type Props = {appConnection?: TTriggerDevConnection;- onSubmit: (formData: FormData) => void;+ onSubmit: (formData: FormData) => Promise<void>;};const rootSchema = genericAppConnectionFieldsSchema.extend({@@ -55,11 +63,7 @@ export const TriggerDevConnectionForm = ({ appConnection, onSubmit }: Props) =>}});- const {- handleSubmit,- control,- formState: { isSubmitting, isDirty }- } = form;+ const { handleSubmit, control } = form;return (<FormProvider {...form}>@@ -70,51 +74,63 @@ export const TriggerDevConnectionForm = ({ appConnection, onSubmit }: Props) =>control={control}shouldUnregisterrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- isOptional- errorText={error?.message}- isError={Boolean(error?.message)}- label="Instance URL"- tooltipClassName="max-w-sm"- tooltipText="Will default to Trigger.dev Cloud if not specified."- >+ <Field className="mb-4">+ <FieldLabel htmlFor="instance-url">+ Instance URL <span className="text-muted">(optional)</span>+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ Will default to Trigger.dev Cloud if not specified.+ </TooltipContent>+ </Tooltip>+ </FieldLabel><Input- value={value}- onChange={(e) => onChange(e.target.value)}+ id="instance-url"placeholder="https://api.trigger.dev"+ value={value || ""}+ onChange={(e) => onChange(e.target.value)}+ isError={Boolean(error?.message)}/>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/><Controllername="method"control={control}render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- tooltipText={`The method you would like to use to connect with ${- APP_CONNECTION_MAP[AppConnection.TriggerDev].name- }. This field cannot be changed after creation.`}- errorText={error?.message}- isError={Boolean(error?.message)}- label="Method"- >- <Select- isDisabled={isUpdate}- value={value}- onValueChange={(val) => onChange(val)}- className="w-full border border-mineshaft-500"- position="popper"- dropdownContainerClassName="max-w-none"- >- {Object.values(TriggerDevConnectionMethod).map((method) => {- return (- <SelectItem value={method} key={method}>- {getAppConnectionMethodDetails(method).name}{" "}- </SelectItem>- );- })}+ <Field className="mb-4">+ <FieldLabel htmlFor="method">+ Method+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ The method you would like to use to connect with{" "}+ {APP_CONNECTION_MAP[AppConnection.TriggerDev].name}. This field cannot be+ changed after creation.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <Select disabled={isUpdate} value={value} onValueChange={(val) => onChange(val)}>+ <SelectTrigger className="w-full" isError={Boolean(error)}>+ <SelectValue placeholder="Select a method..." />+ </SelectTrigger>+ <SelectContent position="popper">+ {Object.values(TriggerDevConnectionMethod).map((method) => {+ return (+ <SelectItem value={method} key={method}>+ {getAppConnectionMethodDetails(method).name}{" "}+ </SelectItem>+ );+ })}+ </SelectContent></Select>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -122,36 +138,16 @@ export const TriggerDevConnectionForm = ({ appConnection, onSubmit }: Props) =>control={control}shouldUnregisterrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Personal Access Token"- >- <SecretInput- containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"- value={value}- onChange={(e) => onChange(e.target.value)}- />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="api-key">Personal Access Token</FieldLabel>+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />+ <FieldError errors={[error]} />+ </Field>)}/>- <div className="mt-8 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isDirty}- >- {isUpdate ? "Update Credentials" : "Connect to Trigger.dev"}- </Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ <AppConnectionFormFooter+ submitLabel={isUpdate ? "Update Credentials" : "Connect to Trigger.dev"}+ /></form></FormProvider>);