@@ -3,7 +3,9 @@ import React, {Component} from 'react';
33import ClipboardButton from 'react-clipboard.js' ;
44import PropTypes from 'prop-types' ;
55import { connect } from 'react-redux' ;
6+ import { bindActionCreators } from 'redux' ;
67import { get } from 'lodash' ;
8+ import * as actions from '../../../modules/actions' ;
79import { appendQuery } from '../../../modules/query-params' ;
810import viewModes from '../../../../constants/view-modes' ;
911
@@ -40,6 +42,18 @@ class BrowserTitle extends Component {
4042 } ) ;
4143 }
4244
45+ onViewInBrowser = ( e ) => {
46+ e . stopPropagation ( ) ;
47+
48+ this . props . actions . viewInBrowser ( ) ;
49+ }
50+
51+ onCopyTestLink = ( e ) => {
52+ e . stopPropagation ( ) ;
53+
54+ this . props . actions . copyTestLink ( ) ;
55+ }
56+
4357 render ( ) {
4458 const { title, suiteUrl, handler, parsedHost} = this . props ;
4559
@@ -49,13 +63,13 @@ class BrowserTitle extends Component {
4963 < a
5064 className = "button section__icon section__icon_view-local"
5165 href = { this . _buildUrl ( suiteUrl , parsedHost ) }
52- onClick = { ( e ) => e . stopPropagation ( ) }
66+ onClick = { this . onViewInBrowser }
5367 title = "view in browser"
5468 target = "_blank" >
5569 </ a >
5670 < ClipboardButton
5771 className = "button section__icon section__icon_share"
58- onClick = { ( e ) => e . stopPropagation ( ) }
72+ onClick = { this . onCopyTestLink }
5973 button-title = "copy test link"
6074 option-text = { ( ) => this . _getTestUrl ( ) } >
6175 </ ClipboardButton >
@@ -76,5 +90,6 @@ export default connect(
7690 suiteUrl : lastResult . suiteUrl ,
7791 parsedHost : view . parsedHost
7892 } ;
79- }
93+ } ,
94+ ( dispatch ) => ( { actions : bindActionCreators ( actions , dispatch ) } )
8095) ( BrowserTitle ) ;
0 commit comments