Skip to content

Commit

Permalink
Admin - AAG: link notices in dashboard items to screens where users c…
Browse files Browse the repository at this point in the history
…an solve the issue (#5176)

* Admin - AAG: link notice in Plugin Updates card to Plugins screen in WP Admin or Calypso Plugin management, based on whether the site is in Dev more or not, so user can solve the issue.

* Admin - AAG: link invalid key notice in Akismet (dash item, card and search card) to its screen so user can solve it.

* Admin - AAG: italicize only links in the card body content
  • Loading branch information
eliorivero authored and samhotchkiss committed Nov 8, 2016
1 parent 7c24905 commit 3c201cd
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 21 deletions.
1 change: 1 addition & 0 deletions _inc/client/at-a-glance/akismet.jsx
Expand Up @@ -101,6 +101,7 @@ const DashAkismet = React.createClass( {
status="is-warning"
statusText={ __( 'Invalid Key' ) }
pro={ true }
siteAdminUrl={ this.props.siteAdminUrl }
>
<p className="jp-dash-item__description">
{
Expand Down
5 changes: 4 additions & 1 deletion _inc/client/at-a-glance/plugins.jsx
Expand Up @@ -54,7 +54,10 @@ const DashPluginUpdates = React.createClass( {
<DashItem
label={ labelName }
module="manage"
status="is-warning" >
status="is-warning"
siteRawUrl={ this.props.siteRawUrl }
siteAdminUrl={ this.props.siteAdminUrl }
>
<h2 className="jp-dash-item__count">
{
__( '%(number)s plugin', '%(number)s plugins', {
Expand Down
20 changes: 12 additions & 8 deletions _inc/client/components/dash-item/index.jsx
Expand Up @@ -70,13 +70,17 @@ const DashItem = React.createClass( {
if ( 'manage' === this.props.module ) {
if ( 'is-warning' === this.props.status ) {
toggle = (
<SimpleNotice
showDismiss={ false }
status={ this.props.status }
isCompact={ true }
>
{ __( 'Updates Needed' ) }
</SimpleNotice>
<a href={ this.props.isModuleActivated( 'manage' )
? 'https://wordpress.com/plugins/' + this.props.siteRawUrl
: this.props.siteAdminUrl + 'plugins.php' } >
<SimpleNotice
showDismiss={ false }
status={ this.props.status }
isCompact={ true }
>
{ __( 'Updates Needed' ) }
</SimpleNotice>
</a>
);
}
if ( 'is-working' === this.props.status ) {
Expand All @@ -95,7 +99,7 @@ const DashItem = React.createClass( {
</Button>
;

toggle = <ProStatus proFeature={ this.props.module } />;
toggle = <ProStatus proFeature={ this.props.module } siteAdminUrl={ this.props.siteAdminUrl } />;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion _inc/client/components/dash-item/style.scss
@@ -1,5 +1,5 @@
.jp-dash-item {
a {
.jp-dash-item__content a {
font-style: italic;
}
.dops-section-header__card-badge .dops-button {
Expand Down
2 changes: 1 addition & 1 deletion _inc/client/main.jsx
Expand Up @@ -176,7 +176,7 @@ const Main = React.createClass( {
break;
case '/security':
navComponent = <NavigationSettings route={ this.props.route } />;
pageComponent = <Security route={ this.props.route } />;
pageComponent = <Security route={ this.props.route } siteAdminUrl={ this.props.siteAdminUrl } />;
break;
case '/traffic':
navComponent = <NavigationSettings route={ this.props.route } />;
Expand Down
18 changes: 10 additions & 8 deletions _inc/client/pro-status/index.jsx
Expand Up @@ -70,14 +70,16 @@ const ProStatus = React.createClass( {
if ( 'akismet' === feature ) {
const akismetData = this.props.getAkismetData();
if ( 'invalid_key' === akismetData ) {
return(
<SimpleNotice
showDismiss={ false }
status='is-warning'
isCompact={ true }
>
{ __( 'Invalid Key' ) }
</SimpleNotice>
return (
<a href={ this.props.siteAdminUrl + 'admin.php?page=akismet-key-config' } >
<SimpleNotice
showDismiss={ false }
status='is-warning'
isCompact={ true }
>
{ __( 'Invalid Key' ) }
</SimpleNotice>
</a>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion _inc/client/search/index.jsx
Expand Up @@ -108,7 +108,7 @@ export const SearchResults = ( {
module: element[0],
configure_url: ''
};
toggle = <ProStatus proFeature={ element[0] } />;
toggle = <ProStatus proFeature={ element[0] } siteAdminUrl={ siteAdminUrl } />;

// Add a "pro" button next to the header title
element[1] = <span>
Expand Down
2 changes: 1 addition & 1 deletion _inc/client/security/index.jsx
Expand Up @@ -69,7 +69,7 @@ export const Page = ( props ) => {
module: element[0],
configure_url: ''
};
toggle = <ProStatus proFeature={ element[0] } />;
toggle = <ProStatus proFeature={ element[0] } siteAdminUrl={ props.siteAdminUrl } />;

// Add a "pro" button next to the header title
element[1] = <span>
Expand Down

0 comments on commit 3c201cd

Please sign in to comment.