Skip to content

Commit

Permalink
Social | Make resharing async in classic editor (#40302)
Browse files Browse the repository at this point in the history
* Social | Make resharing async in classic editor

* Update messaging
  • Loading branch information
manzoorwanijk authored Nov 28, 2024
1 parent 8b04c77 commit ae7252d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Social | Updated messaging for async sharing in block editor
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function showErrorNotice( message = __( 'Unable to share the Post', 'jetpack' )
*/
function showSuccessNotice() {
const { createSuccessNotice } = dispatch( noticesStore );
createSuccessNotice( __( 'Your post will be shared soon.', 'jetpack' ), {
createSuccessNotice( __( 'Request submitted successfully.', 'jetpack' ), {
id: 'publicize-post-share-message',
type: 'snackbar',
} );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Social | Made resharing async in classic editor to fix timeout issues
5 changes: 5 additions & 0 deletions projects/packages/publicize/src/class-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public function register_rest_routes() {
return array_map( 'absint', $param );
},
),
'async' => array(
'description' => __( 'Whether to share the post asynchronously.', 'jetpack-publicize-pkg' ),
'type' => 'boolean',
'default' => false,
),
),
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@ jQuery( function ( $ ) {
data: {
message,
skipped_connections,
async: true,
},
} )
.then( () => {
showNotice( __( 'Your post has been shared!', 'jetpack-publicize-pkg' ), 'success' );
showNotice( __( 'Request submitted successfully.', 'jetpack-publicize-pkg' ), 'success' );
} )
.catch( () => {
showNotice( __( 'An error occurred while sharing your post.', 'jetpack-publicize-pkg' ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public function register_routes() {
return array_map( 'absint', $param );
},
),
'async' => array(
'description' => __( 'Whether to share the post asynchronously.', 'jetpack' ),
'type' => 'boolean',
'default' => false,
),
),
),
// override = true because this API route was commandeered from the file
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Social | Made resharing async in classic editor to fix timeout issues

0 comments on commit ae7252d

Please sign in to comment.