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

Admin - AAG: link notices in dashboard items to screens where users can solve the issue #5176

Merged
merged 3 commits into from
Nov 8, 2016
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
1 change: 1 addition & 0 deletions _inc/client/at-a-glance/akismet.jsx
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,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 '/appearance':
navComponent = <NavigationSettings route={ this.props.route } />;
Expand Down
18 changes: 10 additions & 8 deletions _inc/client/pro-status/index.jsx
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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