@@ -7,11 +7,14 @@ import LoadingOverlay from '../../LoadingOverlay';
77import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
88import { Row , Col , Button , ButtonGroup , Modal , ModalHeader , ModalBody , ModalFooter , Form , FormGroup , Label , Input , FormText } from 'reactstrap' ;
99import { Media } from 'reactstrap' ;
10+ import Video from '../../Video' ;
1011const propTypes = {
1112 open : PropTypes . bool ,
1213 loading : PropTypes . bool ,
1314 route : PropTypes . object ,
14- className : PropTypes . string
15+ className : PropTypes . string ,
16+ git_repo : PropTypes . string ,
17+ git_commit_short : PropTypes . string
1518} ;
1619
1720class RouteModal extends React . Component {
@@ -34,7 +37,7 @@ class RouteModal extends React.Component {
3437 this . props . HIDE_ROUTE ( ) ;
3538 }
3639 render ( ) {
37- const { open, loading, route, className } = this . props ;
40+ const { open, loading, git_repo , git_commit_short , route, className } = this . props ;
3841 let modalHeader = "Opening..." ;
3942 let modalBody = < div > </ div > ;
4043 let segmentsList ;
@@ -62,7 +65,24 @@ class RouteModal extends React.Component {
6265 < h3 > { modalHeader } </ h3 >
6366 < Button onClick = { ( evt ) => { this . close ( ) ; } } className = { "command-close" } > < FontAwesomeIcon icon = "times" > </ FontAwesomeIcon > </ Button >
6467 < div className = { "command-body" } >
65- { segmentsList }
68+ < div className = { "video-outer" } >
69+ < div className = { "route-metadata" } >
70+ < div > { git_repo } </ div >
71+ < div > { route . git_branch } { git_commit_short } { route . git_dirty && "modified" } </ div >
72+ < div > { route . version } </ div >
73+ </ div >
74+ < Video />
75+ </ div >
76+ < div className = { "cabana-url" } >
77+ < FormGroup >
78+ < Label for = { "cabana-link" } > Sharable Cabana Link</ Label >
79+ < Input type = { "textarea" } value = { route . sharable_cabana_url } />
80+ </ FormGroup >
81+ < FormGroup >
82+ < Label for = { "segments" } > Segments</ Label >
83+ { segmentsList }
84+ </ FormGroup >
85+ </ div >
6686 </ div >
6787 < ButtonGroup className = { "command-button-bar" } >
6888 < Button onClick = { ( evt ) => { this . close ( ) ; } } > Close</ Button >
@@ -79,8 +99,17 @@ function mapDispatchToProps(dispatch) {
7999
80100const mapStateToProps = ( { eonDetail } ) => {
81101 const { activeRouteId, activeRouteLoading, activeRouteError, routes } = eonDetail ;
102+ let activeRoute ;
103+
104+ if ( activeRouteId ) {
105+ activeRoute = routes [ activeRouteId ]
106+ }
107+ const git_repo = activeRoute . git_remote . replace ( '[email protected] :' , '' ) . replace ( 'https://github.com/' ) . replace ( ".git" , "" ) ; 108+ const git_commit_short = activeRoute . git_commit . slice ( 0 , 7 ) ;
82109 return {
83- route : activeRouteId ? routes [ activeRouteId ] : null ,
110+ route : activeRoute ,
111+ git_repo,
112+ git_commit_short,
84113 loading : activeRouteLoading ,
85114 error : activeRouteError ,
86115 open : ( activeRouteId && activeRouteId . length > 0 )
0 commit comments