Skip to content

Commit

Permalink
Update Security section links on Jetpack Dashboard (#10846)
Browse files Browse the repository at this point in the history
* Update Security section links on Jetpack Dashboard

* Remove failing tests
  • Loading branch information
joanrho authored Dec 6, 2018
1 parent 22f9a68 commit c824fae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
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

0 comments on commit c824fae

Please sign in to comment.