From 46ef804ae40798011f4247b79afbf4b125f7e5dd Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 19 Jun 2019 16:23:32 -0300 Subject: [PATCH] open external note action links in a new tab --- .../client/header/activity-panel/panels/inbox.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/header/activity-panel/panels/inbox.js b/plugins/woocommerce-admin/client/header/activity-panel/panels/inbox.js index 51765784538..20612dcb971 100644 --- a/plugins/woocommerce-admin/client/header/activity-panel/panels/inbox.js +++ b/plugins/woocommerce-admin/client/header/activity-panel/panels/inbox.js @@ -33,6 +33,18 @@ class InboxPanel extends Component { this.props.updateCurrentUserData( userDataFields ); } + handleActionClick( event, note_id, action_id ) { + const { triggerNoteAction } = this.props; + const href = event.target.href || ''; + + if ( 'http' === href.substr( 0, 4 ).toLowerCase() ) { + event.preventDefault(); + window.open( href, '_blank' ); + } + + triggerNoteAction( note_id, action_id ); + } + renderEmptyCard() { return ( triggerNoteAction( note.id, action.id ) } + onClick={ e => this.handleActionClick( e, note.id, action.id ) } > { action.label }