Skip to content

Commit

Permalink
Adjust copy on Connection banner (#35401)
Browse files Browse the repository at this point in the history
* Update copy to clarify that user connection is required

* changelog

* Fix notice status

* Update changelog

* Fix logic to display message for one product
  • Loading branch information
IanRamosC authored Feb 2, 2024
1 parent a9cd697 commit 8bf3d3c
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,17 @@ export default function useConnectionWatcher() {
);

const needsUserConnectionMessage =
productsThatRequiresUserConnection.length > 1
? __(
productsThatRequiresUserConnection.length === 1
? oneProductMessage
: __(
'Some products need a user connection to WordPress.com to be able to work.',
'jetpack-my-jetpack'
)
: oneProductMessage;
const needsSiteConnectionMessage = __(
'Some products need a connection to WordPress.com to be able to work.',
'jetpack-my-jetpack'
);
);

useEffect( () => {
if ( ! isSiteConnected ) {
setGlobalNotice( needsSiteConnectionMessage, {
status: 'warning',
actions: [
{
label: __( 'Connect your site to fix this', 'jetpack-my-jetpack' ),
onClick: navToConnection,
variant: 'link',
noDefaultClasses: true,
},
],
} );
return;
}
if ( requiresUserConnection ) {
if ( ! isSiteConnected || requiresUserConnection ) {
setGlobalNotice( needsUserConnectionMessage, {
status: 'error',
status: 'warning',
actions: [
{
label: __( 'Connect your user account to fix this', 'jetpack-my-jetpack' ),
Expand All @@ -71,7 +53,6 @@ export default function useConnectionWatcher() {
}
}, [
isSiteConnected,
needsSiteConnectionMessage,
needsUserConnectionMessage,
requiresUserConnection,
navToConnection,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Update CTA copy on the connection banner to make it clear which type of connection we are going to request
5 changes: 5 additions & 0 deletions projects/plugins/backup/changelog/fix-welcome-banner-cta-copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


5 changes: 5 additions & 0 deletions projects/plugins/boost/changelog/fix-welcome-banner-cta-copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Updated composer.lock.


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


5 changes: 5 additions & 0 deletions projects/plugins/search/changelog/fix-welcome-banner-cta-copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


5 changes: 5 additions & 0 deletions projects/plugins/social/changelog/fix-welcome-banner-cta-copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


0 comments on commit 8bf3d3c

Please sign in to comment.