Skip to content

Commit

Permalink
Newsletter: Remove newsletter byline setting feature flag (#37997)
Browse files Browse the repository at this point in the history
  • Loading branch information
enejb authored Jun 26, 2024
1 parent c0d34ef commit d031950
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 112 deletions.
218 changes: 106 additions & 112 deletions projects/plugins/jetpack/_inc/client/newsletter/email-settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ const EmailSettings = props => {
const exampleEmail =
subscriptionReplyTo !== 'author' ? '[email protected]' : '[email protected]';

//Check for feature flag
const urlParams = new URLSearchParams( window.location.search );
const isBylineEnabled = urlParams.get( 'enable-byline' ) === 'true';

return (
<SettingsCard
{ ...props }
Expand Down Expand Up @@ -199,123 +195,121 @@ const EmailSettings = props => {
onChange={ handleEnableFeaturedImageInEmailToggleChange }
/>
</SettingsGroup>
{ isBylineEnabled && (
<SettingsGroup
hasChild
disableInOfflineMode
disableInSiteConnectionMode
module={ subscriptionsModule }
className="newsletter-group"
>
<FormLegend className="jp-form-label-wide">
{ __( 'Email byline', 'jetpack' ) }
<Chip type="new" text={ __( 'New', 'jetpack' ) } />
</FormLegend>
<p>
{ __(
'Customize the information you want to display below your post title in emails.',
'jetpack'
) }
</p>
<BylinePreview
isGravatarEnabled={ bylineState.isGravatarEnabled }
isAuthorEnabled={ bylineState.isAuthorEnabled }
isPostDateEnabled={ bylineState.isPostDateEnabled }
gravatar={ gravatar }
displayName={ displayName }
dateExample={ dateExample }
/>
<div className="email-settings__gravatar">
<ToggleControl
disabled={ gravatarInputDisabled }
checked={ isGravatarEnabled }
toogling={ isSavingAnyOption( [ GRAVATER_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Show author avatar on your emails', 'jetpack' ) }
</span>
}
onChange={ handleEnableGravatarToggleChange }
/>
{ bylineState.isGravatarEnabled && (
<div className="email-settings__help-info">
<div className="email-settings__gravatar-help-info">
<img src={ gravatar } className="email-settings__gravatar-image" alt="" />
<div>
<div className="email-settings__gravatar-help-text">
{ __(
'We use Gravatar, a service that associates an avatar image with your primary email address.',
'jetpack'
) }
</div>
<JetpackButton
isExternalLink={ true }
href="https://gravatar.com/profile/avatars"
variant="secondary"
size="small"
>
{ __( 'Update your Gravatar', 'jetpack' ) }
</JetpackButton>
</div>
</div>
</div>
) }
<SupportInfo
text={ sprintf(
// translators: %s is the user's email address
__(
"The avatar comes from Gravatar, a universal avatar service. Your image may also appear on other sites using Gravatar when you're logged in with %s.",
'jetpack'
),
email
) }
privacyLink="https://support.gravatar.com/account/data-privacy/"
/>
</div>
<ToggleControl
disabled={ authorInputDisabled }
checked={ isAuthorEnabled }
toogling={ isSavingAnyOption( [ AUTHOR_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Show author display name', 'jetpack' ) }
</span>
}
onChange={ handleEnableAuthorToggleChange }
/>

<SettingsGroup
hasChild
disableInOfflineMode
disableInSiteConnectionMode
module={ subscriptionsModule }
className="newsletter-group"
>
<FormLegend className="jp-form-label-wide">
{ __( 'Email byline', 'jetpack' ) }
<Chip type="new" text={ __( 'New', 'jetpack' ) } />
</FormLegend>
<p>
{ __(
'Customize the information you want to display below your post title in emails.',
'jetpack'
) }
</p>
<BylinePreview
isGravatarEnabled={ bylineState.isGravatarEnabled }
isAuthorEnabled={ bylineState.isAuthorEnabled }
isPostDateEnabled={ bylineState.isPostDateEnabled }
gravatar={ gravatar }
displayName={ displayName }
dateExample={ dateExample }
/>
<div className="email-settings__gravatar">
<ToggleControl
disabled={ postDateInputDisabled }
checked={ isPostDateEnabled }
toogling={ isSavingAnyOption( [ POST_DATE_OPTION ] ) }
disabled={ gravatarInputDisabled }
checked={ isGravatarEnabled }
toogling={ isSavingAnyOption( [ GRAVATER_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Add the post date', 'jetpack' ) }
{ __( 'Show author avatar on your emails', 'jetpack' ) }
</span>
}
onChange={ handleEnablePostDateToggleChange }
onChange={ handleEnableGravatarToggleChange }
/>
{ bylineState.isPostDateEnabled && (
{ bylineState.isGravatarEnabled && (
<div className="email-settings__help-info">
{ createInterpolateElement(
__(
'You can customize the date format in your site’s <settingsLink>general settings</settingsLink>',
'jetpack'
),
{
settingsLink: (
<JetpackButton
variant="link"
isExternalLink={ true }
href={ adminUrl + 'options-general.php' }
/>
),
}
) }
<div className="email-settings__gravatar-help-info">
<img src={ gravatar } className="email-settings__gravatar-image" alt="" />
<div>
<div className="email-settings__gravatar-help-text">
{ __(
'We use Gravatar, a service that associates an avatar image with your primary email address.',
'jetpack'
) }
</div>
<JetpackButton
isExternalLink={ true }
href="https://gravatar.com/profile/avatars"
variant="secondary"
size="small"
>
{ __( 'Update your Gravatar', 'jetpack' ) }
</JetpackButton>
</div>
</div>
</div>
) }
</SettingsGroup>
) }
<SupportInfo
text={ sprintf(
// translators: %s is the user's email address
__(
"The avatar comes from Gravatar, a universal avatar service. Your image may also appear on other sites using Gravatar when you're logged in with %s.",
'jetpack'
),
email
) }
privacyLink="https://support.gravatar.com/account/data-privacy/"
/>
</div>
<ToggleControl
disabled={ authorInputDisabled }
checked={ isAuthorEnabled }
toogling={ isSavingAnyOption( [ AUTHOR_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Show author display name', 'jetpack' ) }
</span>
}
onChange={ handleEnableAuthorToggleChange }
/>

<ToggleControl
disabled={ postDateInputDisabled }
checked={ isPostDateEnabled }
toogling={ isSavingAnyOption( [ POST_DATE_OPTION ] ) }
label={
<span className="jp-form-toggle-explanation">
{ __( 'Add the post date', 'jetpack' ) }
</span>
}
onChange={ handleEnablePostDateToggleChange }
/>
{ bylineState.isPostDateEnabled && (
<div className="email-settings__help-info">
{ createInterpolateElement(
__(
'You can customize the date format in your site’s <settingsLink>general settings</settingsLink>',
'jetpack'
),
{
settingsLink: (
<JetpackButton
variant="link"
isExternalLink={ true }
href={ adminUrl + 'options-general.php' }
/>
),
}
) }
</div>
) }
</SettingsGroup>
<SettingsGroup
hasChild
disableInOfflineMode
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

Newsletter: Now you can manage how your newsletter byline appears to your users

0 comments on commit d031950

Please sign in to comment.