fix(email): preserve newlines in PGP key textarea fields (#2617)
This commit is contained in:
@@ -20,7 +20,7 @@ const SensitiveInput = ({ as = 'input', ...props }: SensitiveInputProps) => {
|
|||||||
? props
|
? props
|
||||||
: {
|
: {
|
||||||
...props,
|
...props,
|
||||||
as: props.type === 'textarea' && !isHidden ? 'textarea' : undefined,
|
as: props.type === 'textarea' ? 'textarea' : undefined,
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -32,11 +32,18 @@ const SensitiveInput = ({ as = 'input', ...props }: SensitiveInputProps) => {
|
|||||||
{...componentProps}
|
{...componentProps}
|
||||||
className={`rounded-l-only ${componentProps.className ?? ''}`}
|
className={`rounded-l-only ${componentProps.className ?? ''}`}
|
||||||
type={
|
type={
|
||||||
isHidden
|
props.type === 'textarea'
|
||||||
? 'password'
|
? undefined
|
||||||
: props.type !== 'password'
|
: isHidden
|
||||||
? (props.type ?? 'text')
|
? 'password'
|
||||||
: 'text'
|
: props.type !== 'password'
|
||||||
|
? (props.type ?? 'text')
|
||||||
|
: 'text'
|
||||||
|
}
|
||||||
|
style={
|
||||||
|
props.type === 'textarea' && isHidden
|
||||||
|
? { WebkitTextSecurity: 'disc', ...props.style }
|
||||||
|
: props.style
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ const NotificationsEmail = () => {
|
|||||||
otherwise: Yup.string().nullable(),
|
otherwise: Yup.string().nullable(),
|
||||||
})
|
})
|
||||||
.matches(
|
.matches(
|
||||||
/-----BEGIN PGP PRIVATE KEY BLOCK-----.+-----END PGP PRIVATE KEY BLOCK-----/,
|
/-----BEGIN PGP PRIVATE KEY BLOCK-----.+-----END PGP PRIVATE KEY BLOCK-----/s,
|
||||||
intl.formatMessage(messages.validationPgpPrivateKey)
|
intl.formatMessage(messages.validationPgpPrivateKey)
|
||||||
),
|
),
|
||||||
pgpPassword: Yup.string().when('pgpPrivateKey', {
|
pgpPassword: Yup.string().when('pgpPrivateKey', {
|
||||||
|
|||||||
Reference in New Issue
Block a user