Skip to content

Commit

Permalink
Jetpack Cloud: Move Activity Log menu item under Jetpack section (#43109
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mattgawarecki authored Jun 10, 2020
1 parent b939d24 commit cbb2525
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions client/my-sites/sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ export class MySitesSidebar extends Component {
return null;
}

// When the new Jetpack section is active,
// Activity Log goes there instead of here
if ( isEnabled( 'jetpack/features-section' ) ) {
return null;
}

let activityLink = '/activity-log' + siteSuffix,
activityLabel = translate( 'Activity' );

Expand Down Expand Up @@ -373,7 +379,12 @@ export class MySitesSidebar extends Component {
}

jetpack() {
const { isJetpackSectionOpen, site, translate } = this.props;
const { isJetpack, isJetpackSectionOpen, site, siteSuffix, path, translate } = this.props;

let activityLogUrl = '/activity-log' + siteSuffix;
if ( isJetpack && isEnabled( 'manage/themes-jetpack' ) ) {
activityLogUrl += '?group=rewind';
}

return (
<ExpandableSidebarMenu
Expand All @@ -386,9 +397,10 @@ export class MySitesSidebar extends Component {
label={ translate( 'Activity Log', {
comment: 'Jetpack Cloud / Activity Log status sidebar navigation item',
} ) }
link={ backupActivityPath( site.slug ) }
onNavigate={ this.onNavigate( 'Jetpack Cloud Backup / Activity Log' ) }
selected={ itemLinkMatches( backupActivityPath(), this.props.path ) }
link={ activityLogUrl }
onNavigate={ this.trackActivityClick }
selected={ itemLinkMatches( [ '/activity-log' ], path ) }
expandSection={ this.expandJetpackSection }
/>
<SidebarItem
label={ translate( 'Backup', {
Expand All @@ -397,8 +409,8 @@ export class MySitesSidebar extends Component {
link={ backupMainPath( site.slug ) }
onNavigate={ this.onNavigate( 'Jetpack Cloud Backup / Latest backups' ) }
selected={
itemLinkMatches( backupMainPath(), this.props.path ) &&
! itemLinkMatches( backupActivityPath(), this.props.path )
itemLinkMatches( backupMainPath(), path ) &&
! itemLinkMatches( backupActivityPath(), path )
}
/>
<SidebarItem
Expand All @@ -408,8 +420,7 @@ export class MySitesSidebar extends Component {
link={ site?.slug ? `/scan/${ site.slug }` : '/scan' }
onNavigate={ this.onNavigate( 'Jetpack Cloud Scan / Scanner' ) }
selected={
itemLinkMatches( '/scan', this.props.path ) &&
! itemLinkMatches( '/scan/history', this.props.path )
itemLinkMatches( '/scan', path ) && ! itemLinkMatches( '/scan/history', path )
}
></SidebarItem>
</ExpandableSidebarMenu>
Expand Down

0 comments on commit cbb2525

Please sign in to comment.