mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 16:27:46 +00:00
@@ -1,4 +1,4 @@
|
|||||||
import { ClipboardEvent } from 'react';
|
import { ClipboardEvent } from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
@@ -6,9 +6,9 @@ import { z } from "zod";
|
|||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||||
|
import { getKeyValue } from "@app/helpers/parseEnvVar";
|
||||||
import { useCreateSecretV3 } from "@app/hooks/api";
|
import { useCreateSecretV3 } from "@app/hooks/api";
|
||||||
import { SecretType } from "@app/hooks/api/types";
|
import { SecretType } from "@app/hooks/api/types";
|
||||||
import { getKeyValue } from '@app/helpers/parseEnvVar';
|
|
||||||
|
|
||||||
import { PopUpNames, usePopUpAction, usePopUpState } from "../../SecretMainPage.store";
|
import { PopUpNames, usePopUpAction, usePopUpState } from "../../SecretMainPage.store";
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ export const CreateSecretForm = ({
|
|||||||
|
|
||||||
setValue("key", key);
|
setValue("key", key);
|
||||||
setValue("value", value);
|
setValue("value", value);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
@@ -96,7 +96,12 @@ export const CreateSecretForm = ({
|
|||||||
subTitle="Add a secret to the particular environment and folder"
|
subTitle="Add a secret to the particular environment and folder"
|
||||||
>
|
>
|
||||||
<form onSubmit={handleSubmit(handleFormSubmit)} noValidate>
|
<form onSubmit={handleSubmit(handleFormSubmit)} noValidate>
|
||||||
<FormControl label="Key" isRequired isError={Boolean(errors?.key)} errorText={errors?.key?.message}>
|
<FormControl
|
||||||
|
label="Key"
|
||||||
|
isRequired
|
||||||
|
isError={Boolean(errors?.key)}
|
||||||
|
errorText={errors?.key?.message}
|
||||||
|
>
|
||||||
<Input
|
<Input
|
||||||
{...register("key")}
|
{...register("key")}
|
||||||
placeholder="Type your secret name"
|
placeholder="Type your secret name"
|
||||||
|
|||||||
+10
-5
@@ -1,4 +1,4 @@
|
|||||||
import { ClipboardEvent } from 'react';
|
import { ClipboardEvent } from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { faWarning } from "@fortawesome/free-solid-svg-icons";
|
import { faWarning } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
@@ -18,9 +18,9 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
|
import { getKeyValue } from "@app/helpers/parseEnvVar";
|
||||||
import { useCreateFolder, useCreateSecretV3, useUpdateSecretV3 } from "@app/hooks/api";
|
import { useCreateFolder, useCreateSecretV3, useUpdateSecretV3 } from "@app/hooks/api";
|
||||||
import { SecretType,SecretV3RawSanitized } from "@app/hooks/api/types";
|
import { SecretType, SecretV3RawSanitized } from "@app/hooks/api/types";
|
||||||
import { getKeyValue } from '@app/helpers/parseEnvVar';
|
|
||||||
|
|
||||||
const typeSchema = z
|
const typeSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -145,7 +145,7 @@ export const CreateSecretForm = ({
|
|||||||
|
|
||||||
setValue("key", key);
|
setValue("key", key);
|
||||||
setValue("value", value);
|
setValue("value", value);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal isOpen={isOpen} onOpenChange={onTogglePopUp}>
|
<Modal isOpen={isOpen} onOpenChange={onTogglePopUp}>
|
||||||
@@ -155,7 +155,12 @@ export const CreateSecretForm = ({
|
|||||||
subTitle="Create & update a secret across many environments"
|
subTitle="Create & update a secret across many environments"
|
||||||
>
|
>
|
||||||
<form onSubmit={handleSubmit(handleFormSubmit)} noValidate>
|
<form onSubmit={handleSubmit(handleFormSubmit)} noValidate>
|
||||||
<FormControl label="Key" isRequired isError={Boolean(errors?.key)} errorText={errors?.key?.message}>
|
<FormControl
|
||||||
|
label="Key"
|
||||||
|
isRequired
|
||||||
|
isError={Boolean(errors?.key)}
|
||||||
|
errorText={errors?.key?.message}
|
||||||
|
>
|
||||||
<Input
|
<Input
|
||||||
{...register("key")}
|
{...register("key")}
|
||||||
placeholder="Type your secret name"
|
placeholder="Type your secret name"
|
||||||
|
|||||||
Reference in New Issue
Block a user