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,
|
||||
as: props.type === 'textarea' && !isHidden ? 'textarea' : undefined,
|
||||
as: props.type === 'textarea' ? 'textarea' : undefined,
|
||||
};
|
||||
return (
|
||||
<>
|
||||
@@ -32,12 +32,19 @@ const SensitiveInput = ({ as = 'input', ...props }: SensitiveInputProps) => {
|
||||
{...componentProps}
|
||||
className={`rounded-l-only ${componentProps.className ?? ''}`}
|
||||
type={
|
||||
isHidden
|
||||
props.type === 'textarea'
|
||||
? undefined
|
||||
: isHidden
|
||||
? 'password'
|
||||
: props.type !== 'password'
|
||||
? (props.type ?? 'text')
|
||||
: 'text'
|
||||
}
|
||||
style={
|
||||
props.type === 'textarea' && isHidden
|
||||
? { WebkitTextSecurity: 'disc', ...props.style }
|
||||
: props.style
|
||||
}
|
||||
/>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
|
||||
@@ -106,7 +106,7 @@ const NotificationsEmail = () => {
|
||||
otherwise: Yup.string().nullable(),
|
||||
})
|
||||
.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)
|
||||
),
|
||||
pgpPassword: Yup.string().when('pgpPrivateKey', {
|
||||
|
||||
Reference in New Issue
Block a user