mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 02:49:06 +00:00
fix: allow empty secret names
This commit is contained in:
+11
@@ -217,6 +217,17 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
|
||||
// @ts-expect-error this is for multiple ref single component
|
||||
secretKeyInputRef.current = e;
|
||||
}}
|
||||
warningMessage={
|
||||
secretKey?.includes(" ") ? (
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to encode it with{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">%20</code> when making API
|
||||
requests.
|
||||
</div>
|
||||
) : undefined
|
||||
}
|
||||
placeholder="Type your secret name"
|
||||
onPaste={handlePaste}
|
||||
autoCapitalization={currentProject?.autoCapitalization}
|
||||
|
||||
+11
@@ -178,6 +178,17 @@ export const CreateSecretForm = ({
|
||||
// @ts-expect-error this is for multiple ref single component
|
||||
secretKeyInputRef.current = e;
|
||||
}}
|
||||
warningMessage={
|
||||
secretKey?.includes(" ") ? (
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to encode it with{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">%20</code> when making API
|
||||
requests.
|
||||
</div>
|
||||
) : undefined
|
||||
}
|
||||
placeholder="Type your secret name"
|
||||
onPaste={handlePaste}
|
||||
autoCapitalization={autoCapitalize}
|
||||
|
||||
+11
@@ -487,6 +487,17 @@ export const SecretItem = memo(
|
||||
placeholder={error?.message}
|
||||
isError={Boolean(error)}
|
||||
onKeyUp={() => trigger("key")}
|
||||
warningMessage={
|
||||
field.value.includes(" ") ? (
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to encode it with{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">%20</code> when
|
||||
making API requests.
|
||||
</div>
|
||||
) : undefined
|
||||
}
|
||||
{...field}
|
||||
className="w-full px-0 placeholder:text-red-500 focus:text-bunker-100 focus:ring-transparent"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user