Skip to content

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

improvement(secret-rotations): migrate rotation pickers to Combobox (#8833)

Andrew Huangdf9fb80c3dc7
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConfigurationFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConfigurationFields.tsx
index 0a4f4217e9..c60f929e41 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConfigurationFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConfigurationFields.tsx
@@ -5,12 +5,12 @@ import { TriangleAlertIcon } from "lucide-react";
import {
Alert,
AlertDescription,
+ Combobox,
Field,
FieldContent,
FieldError,
FieldFeedback,
FieldLabel,
- FilterableSelect,
Input,
Label,
Toggle
@@ -44,15 +44,17 @@ export const SecretRotationV2ConfigurationFields = ({ isUpdate, environments }:
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<FieldLabel htmlFor="secret-rotation-environment">Environment</FieldLabel>
- <FilterableSelect
- inputId="secret-rotation-environment"
+ <Combobox
+ id="secret-rotation-environment"
value={value ?? null}
onBlur={onBlur}
- onChange={onChange}
+ onValueChange={onChange}
+ isClearable={false}
options={environments}
placeholder="Select an environment..."
- getOptionLabel={(option) => option?.name}
- getOptionValue={(option) => option?.id}
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/Auth0ClientSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/Auth0ClientSecretRotationParametersFields.tsx
index edec1ba27a..7dae771ec7 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/Auth0ClientSecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/Auth0ClientSecretRotationParametersFields.tsx
@@ -1,19 +1,17 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldFeedback,
- FilterableSelect,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
import { useAuth0ConnectionListClients } from "@app/hooks/api/appConnections/auth0";
-import { TAuth0Client } from "@app/hooks/api/appConnections/auth0/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const Auth0ClientSecretRotationParametersFields = () => {
@@ -37,19 +35,19 @@ export const Auth0ClientSecretRotationParametersFields = () => {
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<FieldLabelWithTooltip htmlFor="auth0-application">Application</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="auth0-application"
+ <Combobox
+ id="auth0-application"
isLoading={isClientsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={clients?.find((client) => client.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TAuth0Client>)?.id ?? null);
- }}
+ onValueChange={(option) => onChange(option.id)}
+ isClearable={false}
options={clients}
placeholder="Select an application..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
aria-describedby="auth0-application-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AwsIamUserSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AwsIamUserSecretRotationParametersFields.tsx
index d83301d612..6a187debc5 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AwsIamUserSecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AwsIamUserSecretRotationParametersFields.tsx
@@ -1,20 +1,19 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import { AwsRegionSelect } from "@app/components/secret-syncs/forms/SecretSyncDestinationFields/shared";
import {
+ Combobox,
Field,
FieldError,
FieldFeedback,
- FilterableSelect,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
-import { TAwsIamUserSecret, useListAwsConnectionIamUsers } from "@app/hooks/api/appConnections/aws";
+import { useListAwsConnectionIamUsers } from "@app/hooks/api/appConnections/aws";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const AwsIamUserSecretRotationParametersFields = () => {
@@ -38,23 +37,18 @@ export const AwsIamUserSecretRotationParametersFields = () => {
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<FieldLabelWithTooltip htmlFor="aws-iam-user">IAM User</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="aws-iam-user"
+ <Combobox
+ id="aws-iam-user"
isLoading={isClientsPending && Boolean(connectionId)}
isDisabled={!connectionId}
- value={clients?.find((client) => client.UserName === value) ?? ""}
+ value={clients?.find((client) => client.UserName === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TAwsIamUserSecret>)?.UserName ?? "");
- }}
+ onValueChange={(option) => onChange(option.UserName)}
+ isClearable={false}
options={clients}
placeholder="Select an IAM user..."
- getOptionLabel={(option) =>
- (option as SingleValue<TAwsIamUserSecret>)?.UserName ?? ""
- }
- getOptionValue={(option) =>
- (option as SingleValue<TAwsIamUserSecret>)?.UserName ?? ""
- }
+ getOptionLabel={(option) => option.UserName}
+ getOptionValue={(option) => option.UserName}
isError={Boolean(error)}
aria-describedby="aws-iam-user-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx
index d895f8c710..ba45202aeb 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/AzureClientSecretRotationParametersFields.tsx
@@ -1,19 +1,17 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldFeedback,
- FilterableSelect,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
import { useAzureConnectionListClients } from "@app/hooks/api/appConnections/azure";
-import { TAzureClient } from "@app/hooks/api/appConnections/azure/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const AzureClientSecretRotationParametersFields = () => {
@@ -37,21 +35,23 @@ export const AzureClientSecretRotationParametersFields = () => {
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<FieldLabelWithTooltip htmlFor="azure-application">Application</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="azure-application"
+ <Combobox
+ id="azure-application"
isLoading={isClientsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={clients?.find((client) => client.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TAzureClient>)?.id ?? null);
- setValue("parameters.appName", (option as SingleValue<TAzureClient>)?.name ?? "");
- setValue("parameters.clientId", (option as SingleValue<TAzureClient>)?.appId ?? "");
+ onValueChange={(option) => {
+ onChange(option.id);
+ setValue("parameters.appName", option.name);
+ setValue("parameters.clientId", option.appId);
}}
+ isClearable={false}
options={clients}
placeholder="Select an application..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
aria-describedby="azure-application-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareApiTokenRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareApiTokenRotationParametersFields.tsx
index ccd623a4f7..3e2535abad 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareApiTokenRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareApiTokenRotationParametersFields.tsx
@@ -1,6 +1,5 @@
import { useEffect, useMemo } from "react";
import { Controller, useFieldArray, useFormContext } from "react-hook-form";
-import { MultiValue, SingleValue } from "react-select";
import { PlusIcon, TrashIcon } from "lucide-react";
import { twMerge } from "tailwind-merge";
import { z } from "zod";
@@ -8,9 +7,9 @@ import { z } from "zod";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
Button,
+ Combobox,
Field,
FieldError,
- FilterableSelect,
IconButton,
Input,
Select,
@@ -24,8 +23,6 @@ import {
TabsTrigger
} from "@app/components/v3";
import {
- TCloudflarePermissionGroup,
- TCloudflareZone,
useCloudflareConnectionListPermissionGroups,
useCloudflareConnectionListZones
} from "@app/hooks/api/appConnections/cloudflare";
@@ -246,21 +243,18 @@ export const CloudflareApiTokenRotationParametersFields = () => {
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field className="mt-3" data-invalid={Boolean(error)}>
<FieldLabelWithTooltip>Zones</FieldLabelWithTooltip>
- <FilterableSelect
- isMulti
+ <Combobox
+ multiple
isLoading={isZonesPending && Boolean(connectionId)}
isDisabled={!connectionId}
options={zones}
placeholder="Select zones..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
value={zones?.filter((zone) => (value ?? []).includes(zone.id)) ?? []}
onBlur={onBlur}
- onChange={(option) =>
- onChange(
- (option as MultiValue<TCloudflareZone>).map((zone) => zone.id)
- )
- }
+ onValueChange={(option) => onChange(option.map((zone) => zone.id))}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
@@ -277,22 +271,20 @@ export const CloudflareApiTokenRotationParametersFields = () => {
data-invalid={Boolean(error)}
>
<FieldLabelWithTooltip>Permission group</FieldLabelWithTooltip>
- <FilterableSelect
+ <Combobox
isLoading={isPermissionGroupsPending && Boolean(connectionId)}
isDisabled={!connectionId}
options={permissionGroupOptions}
placeholder="Select a permission group..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
value={
permissionGroupOptions.find((group) => group.id === value) ?? null
}
onBlur={onBlur}
- onChange={(option) =>
- onChange(
- (option as SingleValue<TCloudflarePermissionGroup>)?.id ?? ""
- )
- }
+ onValueChange={(option) => onChange(option.id)}
+ isClearable={false}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareR2AccessKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareR2AccessKeyRotationParametersFields.tsx
index 21139ae43f..bd5803c870 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareR2AccessKeyRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/CloudflareR2AccessKeyRotationParametersFields.tsx
@@ -1,12 +1,11 @@
import { useMemo } from "react";
import { Controller, useFormContext } from "react-hook-form";
-import { MultiValue } from "react-select";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldError,
- FilterableSelect,
Input,
Select,
SelectContent,
@@ -40,7 +39,7 @@ enum ParameterTab {
Restrictions = "restrictions"
}
-// One source for the picker label's content and order: the JSX dims the jurisdiction, and react-select
+// One source for the picker label's content and order: the JSX dims the jurisdiction, and Combobox
// filters on the plain-text join, so the two must not drift apart.
const bucketLabelParts = ({ name, jurisdiction }: TCloudflareR2BucketSelection) =>
[name, CLOUDFLARE_R2_JURISDICTION_MAP[jurisdiction]] as const;
@@ -115,20 +114,22 @@ export const CloudflareR2AccessKeyRotationParametersFields = () => {
<FieldLabelWithTooltip tooltip="The R2 buckets the generated access key can act on. Buckets are granted by name, so renaming one in Cloudflare requires updating this rotation.">
Buckets
</FieldLabelWithTooltip>
- <FilterableSelect
- isMulti
+ <Combobox
+ multiple
isLoading={isBucketsPending && Boolean(connectionId)}
isDisabled={!connectionId}
options={bucketOptions}
placeholder="Select buckets..."
- formatOptionLabel={formatBucketOptionLabel}
+ renderOption={formatBucketOptionLabel}
+ renderValue={formatBucketOptionLabel}
getOptionLabel={getBucketSearchLabel}
getOptionValue={r2BucketKey}
- // the form field holds the option shape itself, and react-select matches selections by
+ getOptionKeywords={(option) => [r2BucketKey(option)]}
+ // the form field holds the option shape itself, and Combobox matches selections by
// `getOptionValue`, so the stored value can be handed back as-is
value={value ?? []}
onBlur={onBlur}
- onChange={(option) => onChange(option as MultiValue<TCloudflareR2BucketSelection>)}
+ onValueChange={onChange}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServiceAccountSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServiceAccountSecretRotationParametersFields.tsx
index 973c52b65b..4fb4e703b7 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServiceAccountSecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServiceAccountSecretRotationParametersFields.tsx
@@ -1,19 +1,17 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldFeedback,
- FilterableSelect,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
import { useDatabricksConnectionListServicePrincipals } from "@app/hooks/api/appConnections/databricks";
-import { TDatabricksServicePrincipal } from "@app/hooks/api/appConnections/databricks/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const DatabricksServiceAccountSecretRotationParametersFields = () => {
@@ -39,22 +37,23 @@ export const DatabricksServiceAccountSecretRotationParametersFields = () => {
<FieldLabelWithTooltip htmlFor="databricks-service-account-principal">
Service Principal
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="databricks-service-account-principal"
+ <Combobox
+ id="databricks-service-account-principal"
isLoading={isServicePrincipalsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={servicePrincipals?.find((sp) => sp.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- const selectedSp = option as SingleValue<TDatabricksServicePrincipal>;
- onChange(selectedSp?.id ?? null);
- setValue("parameters.servicePrincipalName", selectedSp?.name ?? "");
- setValue("parameters.clientId", selectedSp?.clientId ?? "");
+ onValueChange={(selectedSp) => {
+ onChange(selectedSp.id);
+ setValue("parameters.servicePrincipalName", selectedSp.name);
+ setValue("parameters.clientId", selectedSp.clientId);
}}
+ isClearable={false}
options={servicePrincipals}
placeholder="Select a service principal..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
aria-describedby="databricks-service-account-principal-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServicePrincipalSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServicePrincipalSecretRotationParametersFields.tsx
index 9ab9f41557..34bfcf68ea 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServicePrincipalSecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatabricksServicePrincipalSecretRotationParametersFields.tsx
@@ -1,19 +1,17 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldFeedback,
- FilterableSelect,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
import { useDatabricksConnectionListServicePrincipals } from "@app/hooks/api/appConnections/databricks";
-import { TDatabricksServicePrincipal } from "@app/hooks/api/appConnections/databricks/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const DatabricksServicePrincipalSecretRotationParametersFields = () => {
@@ -39,22 +37,23 @@ export const DatabricksServicePrincipalSecretRotationParametersFields = () => {
<FieldLabelWithTooltip htmlFor="databricks-service-principal">
Service Principal
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="databricks-service-principal"
+ <Combobox
+ id="databricks-service-principal"
isLoading={isServicePrincipalsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={servicePrincipals?.find((sp) => sp.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- const selectedSp = option as SingleValue<TDatabricksServicePrincipal>;
- onChange(selectedSp?.id ?? null);
- setValue("parameters.servicePrincipalName", selectedSp?.name ?? "");
- setValue("parameters.clientId", selectedSp?.clientId ?? "");
+ onValueChange={(selectedSp) => {
+ onChange(selectedSp.id);
+ setValue("parameters.servicePrincipalName", selectedSp.name);
+ setValue("parameters.clientId", selectedSp.clientId);
}}
+ isClearable={false}
options={servicePrincipals}
placeholder="Select a service principal..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
aria-describedby="databricks-service-principal-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatadogApplicationKeySecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatadogApplicationKeySecretRotationParametersFields.tsx
index 9aa110d56f..e6ee4432ea 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatadogApplicationKeySecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DatadogApplicationKeySecretRotationParametersFields.tsx
@@ -1,11 +1,9 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
-import { Field, FieldError, FilterableSelect } from "@app/components/v3";
+import { Combobox, Field, FieldError } from "@app/components/v3";
import { useListDatadogConnectionServiceAccounts } from "@app/hooks/api/appConnections/datadog";
-import { TDatadogServiceAccount } from "@app/hooks/api/appConnections/datadog/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const DatadogApplicationKeySecretRotationParametersFields = () => {
@@ -31,19 +29,19 @@ export const DatadogApplicationKeySecretRotationParametersFields = () => {
<FieldLabelWithTooltip htmlFor="datadog-service-account">
Service Account
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="datadog-service-account"
+ <Combobox
+ id="datadog-service-account"
isLoading={isServiceAccountsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={serviceAccounts?.find((serviceAccount) => serviceAccount.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TDatadogServiceAccount>)?.id ?? "");
- }}
+ onValueChange={(option) => onChange(option.id)}
+ isClearable={false}
options={serviceAccounts}
placeholder="Select a service account..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DbtServiceTokenRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DbtServiceTokenRotationParametersFields.tsx
index 28d7445ce1..a6f497c413 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DbtServiceTokenRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/DbtServiceTokenRotationParametersFields.tsx
@@ -1,6 +1,5 @@
import { useEffect, useMemo } from "react";
import { Controller, useFieldArray, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { PlusIcon, TrashIcon } from "lucide-react";
import { twMerge } from "tailwind-merge";
@@ -9,10 +8,10 @@ import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms
import {
Badge,
Button,
+ Combobox,
Field,
FieldError,
FieldLabel,
- FilterableSelect,
IconButton,
Input,
Select,
@@ -140,20 +139,23 @@ export const DbtServiceTokenRotationParametersFields = () => {
name={`parameters.permissionGrants.${i}.projectId`}
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field className="min-w-0" data-invalid={Boolean(error)}>
- <FilterableSelect
+ <Combobox
isLoading={isProjectsPending && Boolean(connectionId)}
isDisabled={!connectionId}
options={selectableProjects}
getOptionLabel={(option) => option.name}
getOptionValue={(option) =>
- typeof option.id === "undefined" ? option.id : option.id.toString()
+ typeof option.id === "undefined" ? "" : option.id.toString()
}
- value={selectableProjects?.find((p) => p.id === value) ?? undefined}
+ getOptionKeywords={(option) =>
+ typeof option.id === "undefined" ? [] : [option.id.toString()]
+ }
+ value={selectableProjects.find((p) => p.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- const v = (option as SingleValue<TDbtProject>)?.id;
- onChange(v ? Number(v) : undefined);
- }}
+ onValueChange={(option) =>
+ onChange(option.id ? Number(option.id) : undefined)
+ }
+ isClearable={false}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx
index d2938a3e9a..1a863e3105 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx
@@ -1,9 +1,8 @@
import { Controller, useFormContext, useWatch } from "react-hook-form";
-import { SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
-import { Field, FieldError, FilterableSelect } from "@app/components/v3";
+import { Combobox, Field, FieldError } from "@app/components/v3";
import {
TFireworksServiceAccount,
useFireworksConnectionListServiceAccounts
@@ -44,21 +43,20 @@ export const FireworksApiKeyRotationParametersFields = () => {
>
Service Account
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="fireworks-service-account"
+ <Combobox
+ id="fireworks-service-account"
isLoading={isServiceAccountsLoading && Boolean(connectionId)}
isDisabled={!connectionId}
value={serviceAccounts.find((sa) => getUserId(sa.name) === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- const selected = option as SingleValue<TFireworksServiceAccount>;
- onChange(selected ? getUserId(selected.name) : null);
- }}
+ onValueChange={(selected) => onChange(getUserId(selected.name))}
+ isClearable={false}
options={serviceAccounts}
placeholder="Select a service account..."
getOptionLabel={(option) => `${option.displayName} (${getUserId(option.name)})`}
getOptionValue={(option) => getUserId(option.name)}
- formatOptionLabel={formatServiceAccountLabel}
+ renderOption={formatServiceAccountLabel}
+ renderValue={formatServiceAccountLabel}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LiteLLMApiKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LiteLLMApiKeyRotationParametersFields.tsx
index a5c0db62b8..c0bc2aee13 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LiteLLMApiKeyRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LiteLLMApiKeyRotationParametersFields.tsx
@@ -1,13 +1,12 @@
import { useEffect, useState } from "react";
import { Controller, useFormContext } from "react-hook-form";
-import { MultiValue, SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldError,
- FilterableSelect,
Input,
Tabs,
TabsContent,
@@ -21,11 +20,7 @@ import {
useListLiteLLMConnectionTeams,
useListLiteLLMConnectionUsers
} from "@app/hooks/api/appConnections/litellm";
-import {
- TLiteLLMModel,
- TLiteLLMTeam,
- TLiteLLMUser
-} from "@app/hooks/api/appConnections/litellm/types";
+import { TLiteLLMTeam, TLiteLLMUser } from "@app/hooks/api/appConnections/litellm/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
/** Max length for the key name (matches backend schema). */
@@ -176,25 +171,20 @@ export const LiteLLMApiKeyRotationParametersFields = () => {
>
User <span className="font-normal text-muted">(optional)</span>
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="litellm-user"
- isClearable
+ <Combobox
+ id="litellm-user"
isLoading={
(userSearch !== debouncedUserSearch || isUsersFetching) && Boolean(connectionId)
}
isDisabled={!connectionId}
value={selectedValue}
onBlur={onBlur}
- onChange={(option) => {
- const newValue = (option as SingleValue<TLiteLLMUser>) ?? null;
+ onValueChange={(newValue) => {
setSelectedUser(newValue);
onChange(newValue?.id);
}}
options={withSelectedOption(users, selectedValue)}
- filterOption={() => true}
- onInputChange={(newSearch, meta) => {
- if (meta.action === "input-change") setUserSearch(newSearch);
- }}
+ onSearchChange={setUserSearch}
placeholder="Search for a user..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
@@ -218,25 +208,20 @@ export const LiteLLMApiKeyRotationParametersFields = () => {
>
Team <span className="font-normal text-muted">(optional)</span>
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="litellm-team"
- isClearable
+ <Combobox
+ id="litellm-team"
isLoading={
(teamSearch !== debouncedTeamSearch || isTeamsFetching) && Boolean(connectionId)
}
isDisabled={!connectionId}
value={selectedValue}
onBlur={onBlur}
- onChange={(option) => {
- const newValue = (option as SingleValue<TLiteLLMTeam>) ?? null;
+ onValueChange={(newValue) => {
setSelectedTeam(newValue);
onChange(newValue?.id);
}}
options={withSelectedOption(teams, selectedValue)}
- filterOption={() => true}
- onInputChange={(newSearch, meta) => {
- if (meta.action === "input-change") setTeamSearch(newSearch);
- }}
+ onSearchChange={setTeamSearch}
placeholder="Search for a team..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
@@ -258,20 +243,19 @@ export const LiteLLMApiKeyRotationParametersFields = () => {
>
Models <span className="font-normal text-muted">(optional)</span>
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="litellm-models"
- isMulti
+ <Combobox
+ id="litellm-models"
+ multiple
isLoading={isModelsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={models?.filter((model) => (value ?? []).includes(model.id)) ?? []}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as MultiValue<TLiteLLMModel>).map((model) => model.id));
- }}
+ onValueChange={(option) => onChange(option.map((model) => model.id))}
options={models}
placeholder="Select models..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OktaClientSecretRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OktaClientSecretRotationParametersFields.tsx
index 306539a45f..18f46af372 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OktaClientSecretRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OktaClientSecretRotationParametersFields.tsx
@@ -1,11 +1,9 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
-import { Field, FieldError, FilterableSelect } from "@app/components/v3";
+import { Combobox, Field, FieldError } from "@app/components/v3";
import { useOktaConnectionListApps } from "@app/hooks/api/appConnections/okta";
-import { TOktaApp } from "@app/hooks/api/appConnections/okta/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const OktaClientSecretRotationParametersFields = () => {
@@ -30,20 +28,22 @@ export const OktaClientSecretRotationParametersFields = () => {
<FieldLabelWithTooltip htmlFor="okta-application">
OpenID Connect Application
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="okta-application"
+ <Combobox
+ id="okta-application"
isLoading={isAppsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={apps?.find((app) => app.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TOktaApp>)?.id ?? null);
- setValue("parameters.clientId", (option as SingleValue<TOktaApp>)?.id ?? "");
+ onValueChange={(option) => {
+ onChange(option.id);
+ setValue("parameters.clientId", option.id);
}}
+ isClearable={false}
options={apps}
placeholder="Select an application..."
getOptionLabel={(option) => option.label}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenAIServiceAccountRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenAIServiceAccountRotationParametersFields.tsx
index 1ccb6f2361..cda6e155d1 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenAIServiceAccountRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenAIServiceAccountRotationParametersFields.tsx
@@ -1,12 +1,10 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { OPENAI_SERVICE_ACCOUNT_NAME_MAX_LENGTH } from "@app/components/secret-rotations-v2/forms/schemas/openai-service-account-rotation-schema";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
-import { Field, FieldError, FilterableSelect, Input } from "@app/components/v3";
+import { Combobox, Field, FieldError, Input } from "@app/components/v3";
import { useListOpenAIConnectionProjects } from "@app/hooks/api/appConnections/openai";
-import { TOpenAIProject } from "@app/hooks/api/appConnections/openai/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const OpenAIServiceAccountRotationParametersFields = () => {
@@ -38,19 +36,19 @@ export const OpenAIServiceAccountRotationParametersFields = () => {
>
Project
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="openai-project"
+ <Combobox
+ id="openai-project"
isLoading={isProjectsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={projects?.find((project) => project.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TOpenAIProject>)?.id ?? "");
- }}
+ onValueChange={(option) => onChange(option.id)}
+ isClearable={false}
options={projects}
placeholder="Select a project..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx
index 33fc17682c..4de86f50f1 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx
@@ -1,14 +1,13 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldContent,
FieldError,
FieldFeedback,
- FilterableSelect,
Input,
Label,
Select,
@@ -18,10 +17,7 @@ import {
SelectValue,
Toggle
} from "@app/components/v3";
-import {
- TOpenRouterWorkspace,
- useListOpenRouterConnectionWorkspaces
-} from "@app/hooks/api/appConnections/open-router";
+import { useListOpenRouterConnectionWorkspaces } from "@app/hooks/api/appConnections/open-router";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
import { OpenRouterLimitReset } from "@app/hooks/api/secretRotationsV2/types/open-router-api-key-rotation";
@@ -66,9 +62,8 @@ export const OpenRouterApiKeyRotationParametersFields = () => {
>
Workspace <span className="font-normal text-muted">(optional)</span>
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="openrouter-workspace"
- isClearable
+ <Combobox
+ id="openrouter-workspace"
isLoading={isWorkspacesPending && Boolean(connectionId)}
isDisabled={!connectionId || isUpdate}
value={
@@ -76,13 +71,12 @@ export const OpenRouterApiKeyRotationParametersFields = () => {
(value ? { id: value, name: value, slug: value } : null)
}
onBlur={onBlur}
- onChange={(option) => {
- onChange((option as SingleValue<TOpenRouterWorkspace>)?.id || undefined);
- }}
+ onValueChange={(option) => onChange(option?.id || undefined)}
options={workspaces}
placeholder="Select a workspace..."
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
+ getOptionKeywords={(option) => [option.id]}
isError={Boolean(error)}
/>
{(isUpdate || error?.message) && (
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SalesforceOauthCredentialsRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SalesforceOauthCredentialsRotationParametersFields.tsx
index 71685cc993..80458a04a6 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SalesforceOauthCredentialsRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SalesforceOauthCredentialsRotationParametersFields.tsx
@@ -1,19 +1,17 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
+ Combobox,
Field,
FieldFeedback,
- FilterableSelect,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
import { useSalesforceConnectionListOauthApps } from "@app/hooks/api/appConnections/salesforce";
-import { TSalesforceOauthApp } from "@app/hooks/api/appConnections/salesforce/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
export const SalesforceOauthCredentialsRotationParametersFields = () => {
@@ -39,24 +37,25 @@ export const SalesforceOauthCredentialsRotationParametersFields = () => {
<FieldLabelWithTooltip htmlFor="salesforce-external-client-app">
External Client App
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="salesforce-external-client-app"
+ <Combobox
+ id="salesforce-external-client-app"
isLoading={isAppsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={apps?.find((app) => app.identifier === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- const selected = option as SingleValue<TSalesforceOauthApp>;
- onChange(selected?.identifier ?? "");
- setValue("parameters.appName", selected?.developerName ?? "", {
+ onValueChange={(selected) => {
+ onChange(selected.identifier);
+ setValue("parameters.appName", selected.developerName, {
shouldDirty: true,
shouldValidate: true
});
}}
+ isClearable={false}
options={apps}
placeholder="Select an external client app..."
getOptionLabel={(option) => option.developerName}
getOptionValue={(option) => option.identifier}
+ getOptionKeywords={(option) => [option.identifier]}
isError={Boolean(error)}
aria-describedby="salesforce-external-client-app-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SnowflakeUserKeyPairRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SnowflakeUserKeyPairRotationParametersFields.tsx
index cd29f693e6..6d9c91efa0 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SnowflakeUserKeyPairRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SnowflakeUserKeyPairRotationParametersFields.tsx
@@ -1,11 +1,10 @@
import { Controller, useFormContext } from "react-hook-form";
-import { SingleValue } from "react-select";
import { InfoIcon } from "lucide-react";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
import {
- CreatableSelect,
+ Combobox,
Field,
FieldError,
FieldFeedback,
@@ -19,12 +18,8 @@ import {
TooltipTrigger
} from "@app/components/v3";
import { useSnowflakeConnectionListUsers } from "@app/hooks/api/appConnections/snowflake";
-import { TSnowflakeUser } from "@app/hooks/api/appConnections/snowflake/types";
import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
-// The create-option row shows its own label ("Add user ...") while the form value stays the raw username.
-type TUserOption = TSnowflakeUser & { label?: string };
-
const RSA_MODULUS_LENGTHS = [2048, 4096] as const;
export const SnowflakeUserKeyPairRotationParametersFields = () => {
@@ -49,27 +44,23 @@ export const SnowflakeUserKeyPairRotationParametersFields = () => {
render={({ field: { value, onChange, onBlur }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<FieldLabelWithTooltip htmlFor="snowflake-user">User</FieldLabelWithTooltip>
- <CreatableSelect<TUserOption>
- inputId="snowflake-user"
+ <Combobox
+ id="snowflake-user"
isLoading={isUsersPending && Boolean(connectionId) && !isUpdate}
isDisabled={!connectionId || isUpdate}
value={users?.find((user) => user.name === value) ?? (value ? { name: value } : null)}
onBlur={onBlur}
- onChange={(option) => {
- const selectedUser = option as SingleValue<TUserOption>;
- onChange(selectedUser?.name ?? null);
+ onValueChange={(selectedUser) => onChange(selectedUser?.name ?? null)}
+ creation={{
+ mode: "inline",
+ onCreate: (inputValue) => onChange(inputValue),
+ formatLabel: (inputValue) => `Add user "${inputValue}"`,
+ emptyLabel: "Add user"
}}
- onCreateOption={(inputValue) => onChange(inputValue)}
- getNewOptionData={(inputValue) => ({
- name: inputValue,
- label: `Add user "${inputValue}"`
- })}
- isValidNewOption={(inputValue) => inputValue.trim().length > 0}
options={users}
placeholder="Select or add a new user..."
- getOptionLabel={(option) => option.label ?? option.name}
+ getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.name}
- isClearable
isError={Boolean(error)}
aria-describedby="snowflake-user-feedback"
/>
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SupabaseApiKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SupabaseApiKeyRotationParametersFields.tsx
index 8ce01d0b3b..a32c2ec12f 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SupabaseApiKeyRotationParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SupabaseApiKeyRotationParametersFields.tsx
@@ -1,9 +1,8 @@
import { Controller, useFormContext, useWatch } from "react-hook-form";
-import { SingleValue } from "react-select";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { FieldLabelWithTooltip } from "@app/components/secret-rotations-v2/forms/shared";
-import { Field, FieldError, FilterableSelect } from "@app/components/v3";
+import { Combobox, Field, FieldError } from "@app/components/v3";
import {
TSupabaseProject,
useSupabaseConnectionListProjects
@@ -51,21 +50,20 @@ export const SupabaseApiKeyRotationParametersFields = () => {
>
Project
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="supabase-project"
+ <Combobox
+ id="supabase-project"
isLoading={isProjectsLoading && Boolean(connectionId)}
isDisabled={!connectionId}
value={projects.find((p) => p.id === value) ?? null}
onBlur={onBlur}
- onChange={(option) => {
- const v = option as SingleValue<TSupabaseProject>;
- onChange(v?.id ?? null);
- }}
+ onValueChange={(option) => onChange(option.id)}
+ isClearable={false}
options={projects}
placeholder="Select a project..."
getOptionLabel={(option) => `${option.name} (id: ${option.id})`}
getOptionValue={(option) => option.id}
- formatOptionLabel={formatProjectOptionLabel}
+ renderOption={formatProjectOptionLabel}
+ renderValue={formatProjectOptionLabel}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
@@ -83,16 +81,12 @@ export const SupabaseApiKeyRotationParametersFields = () => {
>
Key Type
</FieldLabelWithTooltip>
- <FilterableSelect
- inputId="supabase-key-type"
+ <Combobox
+ id="supabase-key-type"
value={KEY_TYPE_OPTIONS.find((o) => o.value === value) ?? null}
onBlur={onBlur}
- onChange={(option) =>
- onChange(
- (option as SingleValue<{ label: string; value: SupabaseApiKeyType }>)?.value ??
- null
- )
- }
+ onValueChange={(option) => onChange(option.value)}
+ isClearable={false}
options={KEY_TYPE_OPTIONS}
getOptionLabel={(option) => option.label}
getOptionValue={(option) => option.value}