0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Removed onBlur error feedback in Newsletter General settings (#19379)

Fixes PROD-267
This commit is contained in:
Princi Vershwal 2023-12-14 17:14:05 +05:30 committed by GitHub
parent a2ff5a8412
commit bb42faf694
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,7 @@ const ReplyToEmailField: React.FC<{
errors: ErrorMessages; errors: ErrorMessages;
validate: () => void; validate: () => void;
clearError: (field: string) => void; clearError: (field: string) => void;
}> = ({newsletter, updateNewsletter, errors, clearError, validate}) => { }> = ({newsletter, updateNewsletter, errors, clearError}) => {
const {settings, config} = useGlobalData(); const {settings, config} = useGlobalData();
const [defaultEmailAddress, supportEmailAddress] = getSettingValues<string>(settings, ['default_email_address', 'support_email_address']); const [defaultEmailAddress, supportEmailAddress] = getSettingValues<string>(settings, ['default_email_address', 'support_email_address']);
const newEmailAddressesFlag = useFeatureFlag('newEmailAddresses'); const newEmailAddressesFlag = useFeatureFlag('newEmailAddresses');
@ -66,8 +66,6 @@ const ReplyToEmailField: React.FC<{
} }
const onBlur = () => { const onBlur = () => {
validate();
// Update the senderReplyTo to the rendered value again // Update the senderReplyTo to the rendered value again
const rendered = renderReplyToEmail(newsletter, config, supportEmailAddress, defaultEmailAddress) || ''; const rendered = renderReplyToEmail(newsletter, config, supportEmailAddress, defaultEmailAddress) || '';
setSenderReplyTo(rendered); setSenderReplyTo(rendered);
@ -191,7 +189,6 @@ const Sidebar: React.FC<{
placeholder={newsletterAddress || ''} placeholder={newsletterAddress || ''}
title="Sender email address" title="Sender email address"
value={newsletter.sender_email || ''} value={newsletter.sender_email || ''}
onBlur={validate}
onChange={e => updateNewsletter({sender_email: e.target.value})} onChange={e => updateNewsletter({sender_email: e.target.value})}
onKeyDown={() => clearError('sender_email')} onKeyDown={() => clearError('sender_email')}
/> />
@ -218,7 +215,6 @@ const Sidebar: React.FC<{
rightPlaceholder={sendingEmailUsername ? `@${sendingDomain(config)}` : `` } rightPlaceholder={sendingEmailUsername ? `@${sendingDomain(config)}` : `` }
title="Sender email address" title="Sender email address"
value={sendingEmailUsername || ''} value={sendingEmailUsername || ''}
onBlur={validate}
onChange={(e) => { onChange={(e) => {
const username = e.target.value?.split('@')[0]; const username = e.target.value?.split('@')[0];
const newEmail = username ? `${username}@${sendingDomain(config)}` : ''; const newEmail = username ? `${username}@${sendingDomain(config)}` : '';
@ -246,7 +242,6 @@ const Sidebar: React.FC<{
placeholder="Weekly Roundup" placeholder="Weekly Roundup"
title="Name" title="Name"
value={newsletter.name || ''} value={newsletter.name || ''}
onBlur={validate}
onChange={e => updateNewsletter({name: e.target.value})} onChange={e => updateNewsletter({name: e.target.value})}
onKeyDown={() => clearError('name')} onKeyDown={() => clearError('name')}
/> />