Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social | Make resharing async in classic editor #40302

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading