Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1469047 - Create common React ancestor for PushList and DetailsPa…
…nel (#3673) This will allow better interaction between the two components. As we convert more items (like navbars, etc) we will move them into this umbrella Treeherder component.
- Loading branch information
Cameron Dawson
committed
Jun 18, 2018
1 parent
9ce293f
commit a81e7a8
Showing
7 changed files
with
111 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { react2angular } from 'react2angular/index.es2015'; | ||
|
||
import treeherder from '../js/treeherder'; | ||
import DetailsPanel from './details/DetailsPanel'; | ||
import PushList from './PushList'; | ||
|
||
const JobView = (props) => { | ||
const { user, repoName, revision, currentRepo, selectedJob, $injector } = props; | ||
|
||
return ( | ||
<React.Fragment> | ||
<div id="th-global-content" className="th-global-content"> | ||
<span className="th-view-content"> | ||
<PushList | ||
user={user} | ||
repoName={repoName} | ||
revision={revision} | ||
currentRepo={currentRepo} | ||
$injector={$injector} | ||
/> | ||
</span> | ||
</div> | ||
<DetailsPanel | ||
className={selectedJob ? '' : 'hidden'} | ||
repoName={repoName} | ||
selectedJob={selectedJob} | ||
user={user} | ||
$injector={$injector} | ||
/> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
JobView.propTypes = { | ||
$injector: PropTypes.object.isRequired, | ||
user: PropTypes.object.isRequired, | ||
repoName: PropTypes.string.isRequired, | ||
revision: PropTypes.string, | ||
currentRepo: PropTypes.object, | ||
selectedJob: PropTypes.object, | ||
}; | ||
|
||
JobView.defaultProps = { | ||
revision: null, | ||
currentRepo: {}, | ||
selectedJob: null, | ||
}; | ||
|
||
treeherder.component('jobView', react2angular( | ||
JobView, | ||
['repoName', 'user', 'revision', 'currentRepo', 'selectedJob'], | ||
['$injector'])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters