mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 15:27:46 +00:00
feat: added referencing autocomplete to remaining components
This commit is contained in:
+2
-4
@@ -13,9 +13,9 @@ import {
|
|||||||
Input,
|
Input,
|
||||||
Modal,
|
Modal,
|
||||||
ModalContent,
|
ModalContent,
|
||||||
SecretInput,
|
|
||||||
Tooltip
|
Tooltip
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
|
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput/InfisicalSecretInput";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
import { useCreateFolder, useCreateSecretV3, useUpdateSecretV3 } from "@app/hooks/api";
|
import { useCreateFolder, useCreateSecretV3, useUpdateSecretV3 } from "@app/hooks/api";
|
||||||
import { DecryptedSecret, UserWsKeyPair } from "@app/hooks/api/types";
|
import { DecryptedSecret, UserWsKeyPair } from "@app/hooks/api/types";
|
||||||
@@ -64,8 +64,6 @@ export const CreateSecretForm = ({
|
|||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
const environments = currentWorkspace?.environments || [];
|
const environments = currentWorkspace?.environments || [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
|
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
|
||||||
const { mutateAsync: updateSecretV3 } = useUpdateSecretV3();
|
const { mutateAsync: updateSecretV3 } = useUpdateSecretV3();
|
||||||
const { mutateAsync: createFolder } = useCreateFolder();
|
const { mutateAsync: createFolder } = useCreateFolder();
|
||||||
@@ -163,7 +161,7 @@ export const CreateSecretForm = ({
|
|||||||
isError={Boolean(errors?.value)}
|
isError={Boolean(errors?.value)}
|
||||||
errorText={errors?.value?.message}
|
errorText={errors?.value?.message}
|
||||||
>
|
>
|
||||||
<SecretInput
|
<InfisicalSecretInput
|
||||||
{...field}
|
{...field}
|
||||||
containerClassName="text-bunker-300 hover:border-primary-400/50 border border-mineshaft-600 bg-mineshaft-900 px-2 py-1.5"
|
containerClassName="text-bunker-300 hover:border-primary-400/50 border border-mineshaft-600 bg-mineshaft-900 px-2 py-1.5"
|
||||||
/>
|
/>
|
||||||
|
|||||||
+12
-4
@@ -4,7 +4,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { Button, FormControl, FormLabel, SecretInput, Tooltip } from "@app/components/v2";
|
import { Button, FormControl, FormLabel, Tooltip } from "@app/components/v2";
|
||||||
|
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput/InfisicalSecretInput";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onSubmit: (data: Record<string, string>) => void;
|
onSubmit: (data: Record<string, string>) => void;
|
||||||
@@ -19,7 +20,13 @@ type Props = {
|
|||||||
|
|
||||||
const formSchema = z.record(z.string().trim().optional());
|
const formSchema = z.record(z.string().trim().optional());
|
||||||
|
|
||||||
export const RotationInputForm = ({ onSubmit, onCancel, inputSchema, secretPath, environment }: Props) => {
|
export const RotationInputForm = ({
|
||||||
|
onSubmit,
|
||||||
|
onCancel,
|
||||||
|
inputSchema,
|
||||||
|
secretPath,
|
||||||
|
environment
|
||||||
|
}: Props) => {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -58,11 +65,12 @@ export const RotationInputForm = ({ onSubmit, onCancel, inputSchema, secretPath,
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<SecretInput
|
<InfisicalSecretInput
|
||||||
{...field}
|
{...field}
|
||||||
containerClassName="normal-case text-bunker-300 hover:border-primary-400/50 border border-mineshaft-600 bg-bunker-800 px-2 py-1.5"
|
containerClassName="normal-case text-bunker-300 hover:border-primary-400/50 border border-mineshaft-600 bg-bunker-800 px-2 py-1.5"
|
||||||
required={inputSchema.required.includes(inputName)}
|
required={inputSchema.required.includes(inputName)}
|
||||||
secretPath={secretPath} environment={environment}
|
secretPath={secretPath}
|
||||||
|
environment={environment}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user