fix: re-add secret key space support

This commit is contained in:
Daniel Hougaard
2025-09-23 04:08:23 +04:00
parent 294f33bc1e
commit 2fac3c19b1
4 changed files with 17 additions and 11 deletions

View File

@@ -126,7 +126,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
)} )}
/> />
{warningMessage && !rightIcon && ( {warningMessage && !rightIcon && (
<Tooltip className="w-full max-w-64" content={warningMessage}> <Tooltip className="w-full max-w-72" content={warningMessage}>
<FontAwesomeIcon icon={faWarning} className="absolute right-0 mr-3 text-yellow-500" /> <FontAwesomeIcon icon={faWarning} className="absolute right-0 mr-3 text-yellow-500" />
</Tooltip> </Tooltip>
)} )}

View File

@@ -222,9 +222,11 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
<div> <div>
Secret key contains whitespaces. Secret key contains whitespaces.
<br /> <br />
<br /> If this is the desired format, you need to encode it with{" "} <br /> If this is the desired format, you need to provide it as{" "}
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">%20</code> when making API <code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
requests. {secretKey.trim().replaceAll(" ", "%20")}
</code>{" "}
when making API requests.
</div> </div>
) : undefined ) : undefined
} }

View File

@@ -183,9 +183,11 @@ export const CreateSecretForm = ({
<div> <div>
Secret key contains whitespaces. Secret key contains whitespaces.
<br /> <br />
<br /> If this is the desired format, you need to encode it with{" "} <br /> If this is the desired format, you need to provide it as{" "}
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">%20</code> when making API <code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
requests. {secretKey.trim().replaceAll(" ", "%20")}
</code>{" "}
when making API requests.
</div> </div>
) : undefined ) : undefined
} }

View File

@@ -488,13 +488,15 @@ export const SecretItem = memo(
isError={Boolean(error)} isError={Boolean(error)}
onKeyUp={() => trigger("key")} onKeyUp={() => trigger("key")}
warningMessage={ warningMessage={
field.value.includes(" ") ? ( field.value?.includes(" ") ? (
<div> <div>
Secret key contains whitespaces. Secret key contains whitespaces.
<br /> <br />
<br /> If this is the desired format, you need to encode it with{" "} <br /> If this is the desired format, you need to provide it as{" "}
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">%20</code> when <code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
making API requests. {field.value.trim().replaceAll(" ", "%20")}
</code>{" "}
when making API requests.
</div> </div>
) : undefined ) : undefined
} }