mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 15:40:47 +00:00
requested changes
This commit is contained in:
@@ -18,9 +18,6 @@ import { TSecretSyncForm } from "./schemas";
|
||||
|
||||
type Props = {
|
||||
onChange?: VoidFunction;
|
||||
filterConnections?: (
|
||||
connections?: TAvailableAppConnection[]
|
||||
) => TAvailableAppConnection[] | undefined;
|
||||
};
|
||||
|
||||
export const SecretSyncConnectionField = ({ onChange: callback, filterConnections }: Props) => {
|
||||
@@ -30,7 +27,7 @@ export const SecretSyncConnectionField = ({ onChange: callback, filterConnection
|
||||
const destination = watch("destination");
|
||||
const app = SECRET_SYNC_CONNECTION_MAP[destination];
|
||||
|
||||
const { data: allConnections, isLoading } = useListAvailableAppConnections(app);
|
||||
const { data: availableConnections, isLoading } = useListAvailableAppConnections(app);
|
||||
|
||||
const connectionName = APP_CONNECTION_MAP[app].name;
|
||||
|
||||
@@ -39,10 +36,6 @@ export const SecretSyncConnectionField = ({ onChange: callback, filterConnection
|
||||
OrgPermissionSubjects.AppConnections
|
||||
);
|
||||
|
||||
const availableConnections = useMemo(() => {
|
||||
return filterConnections ? filterConnections(allConnections) : allConnections;
|
||||
}, [allConnections]);
|
||||
|
||||
const appName = APP_CONNECTION_MAP[SECRET_SYNC_CONNECTION_MAP[destination]].name;
|
||||
|
||||
return (
|
||||
|
||||
-11
@@ -2,8 +2,6 @@ import { Controller, useFormContext } from "react-hook-form";
|
||||
|
||||
import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
|
||||
import { FormControl, Input } from "@app/components/v2";
|
||||
import { AzureResources } from "@app/hooks/api/appConnections";
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
import { SecretSync } from "@app/hooks/api/secretSyncs";
|
||||
|
||||
import { TSecretSyncForm } from "../schemas";
|
||||
@@ -19,15 +17,6 @@ export const AzureAppConfigurationSyncFields = () => {
|
||||
onChange={() => {
|
||||
setValue("destinationConfig.configurationUrl", "");
|
||||
}}
|
||||
filterConnections={(connections) => {
|
||||
if (!connections) return connections;
|
||||
|
||||
return connections.filter(
|
||||
(connection) =>
|
||||
connection.app === AppConnection.Azure &&
|
||||
connection.azureResource === AzureResources.AppConfiguration
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<Controller
|
||||
name="destinationConfig.configurationUrl"
|
||||
|
||||
-11
@@ -2,8 +2,6 @@ import { Controller, useFormContext } from "react-hook-form";
|
||||
|
||||
import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
|
||||
import { FormControl, Input } from "@app/components/v2";
|
||||
import { AzureResources } from "@app/hooks/api/appConnections";
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
import { SecretSync } from "@app/hooks/api/secretSyncs";
|
||||
|
||||
import { TSecretSyncForm } from "../schemas";
|
||||
@@ -19,15 +17,6 @@ export const AzureKeyVaultSyncFields = () => {
|
||||
onChange={() => {
|
||||
setValue("destinationConfig.vaultBaseUrl", "");
|
||||
}}
|
||||
filterConnections={(connections) => {
|
||||
if (!connections) return connections;
|
||||
|
||||
return connections.filter(
|
||||
(connection) =>
|
||||
connection.app === AppConnection.Azure &&
|
||||
connection.azureResource === AzureResources.KeyVault
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<Controller
|
||||
name="destinationConfig.vaultBaseUrl"
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ import { SecretSync } from "@app/hooks/api/secretSyncs";
|
||||
export const AzureKeyVaultSyncDestinationSchema = z.object({
|
||||
destination: z.literal(SecretSync.AzureKeyVault),
|
||||
destinationConfig: z.object({
|
||||
vaultBaseUrl: z.string().min(1, "Vault Base URL required")
|
||||
vaultBaseUrl: z.string().url("Invalid vault base URL format").min(1, "Vault base URL required")
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user