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

Update Security section links on Jetpack Dashboard #10846

Merged
merged 2 commits into from
Dec 6, 2018
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
4 changes: 2 additions & 2 deletions _inc/client/at-a-glance/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ class AtAGlance extends Component {
settingsPath={ this.props.userCanManageModules ? '#security' : undefined }
externalLink={ this.props.isDevMode || ! this.props.userCanManageModules
? ''
: __( 'Manage security on WordPress.com' )
: __( 'Manage security settings' )
}
externalLinkPath={ this.props.isDevMode
? ''
: 'https://wordpress.com/settings/security/' + this.props.siteRawUrl
: '#security'
}
externalLinkClick={ trackSecurityClick }
/>;
Expand Down
15 changes: 0 additions & 15 deletions _inc/client/components/dash-section-header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import Gridicon from 'components/gridicon';
import { translate as __ } from 'i18n-calypso';
import analytics from 'lib/analytics';

export class DashSectionHeader extends React.Component {
Expand Down Expand Up @@ -35,7 +33,6 @@ export class DashSectionHeader extends React.Component {
};

render() {
let settingsIcon;
let externalLink;
let children;

Expand All @@ -44,17 +41,6 @@ export class DashSectionHeader extends React.Component {
'jp-dash-section-header'
);

if ( this.props.settingsPath ) {
settingsIcon = (
<a className="jp-dash-section-header__settings" href={ this.props.settingsPath }>
<span className="screen-reader-text">
{ __( 'Settings', { context: 'Noun. Displayed to screen readers.' } ) }
</span>
<Gridicon onClick={ this.trackCogClick } icon="cog" size={ 16 } />
</a>
);
}

if ( this.props.externalLink ) {
externalLink = (
<a
Expand All @@ -81,7 +67,6 @@ export class DashSectionHeader extends React.Component {
<h2 className="jp-dash-section-header__name">
{ this.props.label }
</h2>
{ settingsIcon }
</div>
{ externalLink }
{ children }
Expand Down
9 changes: 0 additions & 9 deletions _inc/client/components/dash-section-header/test/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ describe( 'DashSectionHeader', () => {

const wrapper = shallow( <DashSectionHeader { ...testProps } /> );

it( 'displays an icon for Security', () => {
expect( wrapper.find( 'Gridicon' ) ).to.have.length( 1 );
} );

it( 'the icon is linked to a section', () => {
expect( wrapper.find( 'a.jp-dash-section-header__settings' ) ).to.have.length( 1 );
expect( wrapper.find( 'a.jp-dash-section-header__settings' ).props().href ).to.be.equal( '#security' );
} );

it( 'there is an external link', () => {
expect( wrapper.find( 'a.jp-dash-section-header__external-link' ) ).to.have.length( 1 );
expect( wrapper.find( 'a.jp-dash-section-header__external-link' ).props().href ).to.be.equal( externalPath );
Expand Down