Merge pull request #2215 from iminoso/services

Inject ApiService to be accessible in the body react component
This commit is contained in:
Ian Minoso 2016-12-07 12:01:32 -05:00 committed by GitHub
commit 548bae0384
2 changed files with 7 additions and 4 deletions

View file

@ -1,16 +1,19 @@
import * as React from "react";
interface IBody {
description: string
description: string,
api: Object
}
/**
* The Component for the main body of the repo page
* @param {string} description - The description of the repository
* @param {object} api - The ApiService injected from Angular
*/
class body extends React.Component<IBody, {}> {
static propTypes = {
description: React.PropTypes.string.isRequired,
api: React.PropTypes.object.isRequired
}
render () {
let description: string = this.props.description;
@ -33,7 +36,7 @@ class body extends React.Component<IBody, {}> {
<div className="rp-description">{description}</div>
</div>
<div className="tab-pane" id="tab2">
TODO (IAN): Convert the build directives to angular components
<h3 className="tab-header">Repository Builds</h3>
</div>
</div>
</div>

View file

@ -14,8 +14,8 @@ export function rpDirectives(){
return reactDirective(repoSidebar);
});
angular.module('quayPages').directive('rpBody', function(reactDirective) {
return reactDirective(repoBody);
angular.module('quayPages').directive('rpBody', function(reactDirective, ApiService) {
return reactDirective(repoBody, undefined, {}, {api: ApiService});
});
}