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

Activity Log: Fix data layer on credentials save error #32180

Merged
merged 1 commit into from
Apr 11, 2019
Merged
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
Expand Up @@ -116,7 +116,6 @@ export const failure = ( action, error ) => ( dispatch, getState ) => {
return canChat ? dispatch( openChat() ) : navigateTo( '/help' );
};

const { translate } = i18n;
const baseOptions = { duration: 10000, id: action.noticeId };

const announce = ( message, options ) =>
Expand Down Expand Up @@ -146,10 +145,10 @@ export const failure = ( action, error ) => ( dispatch, getState ) => {
switch ( error.error ) {
case 'service_unavailable':
announce(
translate(
i18n.translate(
'A error occurred when we were trying to validate your site information. Please make sure your credentials and host URL are correct and try again. If you need help, please click on the support chat link.'
),
{ button: translate( 'Support chat' ), onClick: getHelp }
{ button: i18n.translate( 'Support chat' ), onClick: getHelp }
);
spreadHappiness(
'Rewind Credentials: update request failed on timeout (could be us or remote site)'
Expand All @@ -158,14 +157,14 @@ export const failure = ( action, error ) => ( dispatch, getState ) => {

case 'missing_args':
announce(
translate( 'Something seems to be missing — please fill out all the required fields.' )
i18n.translate( 'Something seems to be missing — please fill out all the required fields.' )
);
spreadHappiness( 'Rewind Credentials: missing API args (contact a dev)' );
break;

case 'invalid_args':
announce(
translate(
i18n.translate(
"The information you entered seems to be incorrect. Let's take " +
'another look to ensure everything is in the right place.'
)
Expand All @@ -175,7 +174,7 @@ export const failure = ( action, error ) => ( dispatch, getState ) => {

case 'invalid_credentials':
announce(
translate(
i18n.translate(
"We couldn't connect to your site. Please verify your credentials and give it another try."
)
);
Expand All @@ -184,29 +183,29 @@ export const failure = ( action, error ) => ( dispatch, getState ) => {

case 'invalid_wordpress_path':
announce(
translate(
i18n.translate(
'We looked for `wp-config.php` in the WordPress installation ' +
"path you provided but couldn't find it."
),
{ button: translate( 'Get help' ), onClick: getHelp }
{ button: i18n.translate( 'Get help' ), onClick: getHelp }
);
spreadHappiness( "Rewind Credentials: can't find WordPress installation files" );
break;

case 'read_only_install':
announce(
translate(
i18n.translate(
'It looks like your server is read-only. ' +
'To create backups and rewind your site, we need permission to write to your server.'
),
{ button: translate( 'Get help' ), onClick: getHelp }
{ button: i18n.translate( 'Get help' ), onClick: getHelp }
);
spreadHappiness( 'Rewind Credentials: creds only seem to provide read-only access' );
break;

case 'unreachable_path':
announce(
translate(
i18n.translate(
'We tried to access your WordPress installation through its publicly available URL, ' +
"but it didn't work. Please make sure the directory is accessible and try again."
)
Expand All @@ -215,7 +214,7 @@ export const failure = ( action, error ) => ( dispatch, getState ) => {
break;

default:
announce( translate( 'Error saving. Please check your credentials and try again.' ) );
announce( i18n.translate( 'Error saving. Please check your credentials and try again.' ) );
spreadHappiness( 'Rewind Credentials: unknown failure saving credentials' );
}
};
Expand Down