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

Add error message from api request. #15657

Merged
merged 10 commits into from Jun 28, 2019

More linting fixes

  • Loading branch information...
spacedmonkey committed Jun 25, 2019
commit 074c25a953ea3197723e5e3faa89310293ed654b
@@ -109,7 +109,6 @@ export function getNotificationArgumentsForSaveFail( data ) {
if ( error.message && ! ( /<\/?[^>]*>/.test( error.message ) ) ) {
noticeMessage = sprintf( __( '%1$s Error message: %2$s' ), noticeMessage, error.message );

This comment has been minimized.

Copy link
@swissspidy

swissspidy Jul 1, 2019

Member

This is missing a translator comment to explain the parameters.

This comment has been minimized.

Copy link
@spacedmonkey

spacedmonkey Jul 1, 2019

Author Contributor

Should this be another PR?

This comment has been minimized.

Copy link
@swissspidy
}

return [ noticeMessage, {
id: SAVE_POST_NOTICE_ID,
} ];
@@ -28,7 +28,7 @@ describe( 'getNotificationArgumentsForSaveSuccess()', () => {
link: 'some_link',
};
const post = { ...previousPost };
const defaultExpectedAction = { id: SAVE_POST_NOTICE_ID, actions: [], type: 'snackbar' };
const defaultExpectedAction = { id: SAVE_POST_NOTICE_ID, actions: [] };
[
[
'when previous post is not published and post will not be published',
@@ -108,25 +108,25 @@ describe( 'getNotificationArgumentsForSaveFail()', () => {
'when post is not published and edits is published',
'',
[ 'draft', 'publish' ],
[ 'Publishing failed', defaultExpectedAction ],
[ 'Publishing failed.', defaultExpectedAction ],
],
[
'when post is published and edits is privately published',
'',
[ 'draft', 'private' ],
[ 'Publishing failed', defaultExpectedAction ],
[ 'Publishing failed.', defaultExpectedAction ],
],
[
'when post is published and edits is scheduled to be published',
'',
[ 'draft', 'future' ],
[ 'Scheduling failed', defaultExpectedAction ],
[ 'Scheduling failed.', defaultExpectedAction ],
],
[
'when post is published and edits is published',
'',
[ 'publish', 'publish' ],
[ 'Updating failed', defaultExpectedAction ],
[ 'Updating failed.', defaultExpectedAction ],
],
].forEach( ( [
description,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.