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 && (
<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" />
</Tooltip>
)}

View File

@@ -222,9 +222,11 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
<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.
<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">
{secretKey.trim().replaceAll(" ", "%20")}
</code>{" "}
when making API requests.
</div>
) : undefined
}

View File

@@ -183,9 +183,11 @@ export const CreateSecretForm = ({
<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.
<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">
{secretKey.trim().replaceAll(" ", "%20")}
</code>{" "}
when making API requests.
</div>
) : undefined
}

View File

@@ -488,13 +488,15 @@ export const SecretItem = memo(
isError={Boolean(error)}
onKeyUp={() => trigger("key")}
warningMessage={
field.value.includes(" ") ? (
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.
<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">
{field.value.trim().replaceAll(" ", "%20")}
</code>{" "}
when making API requests.
</div>
) : undefined
}