Inject ApiService to be accessible in the body react component
This commit is contained in:
parent
eb363876cd
commit
a7594d6e57
2 changed files with 7 additions and 4 deletions
|
@ -1,16 +1,19 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
interface IBody {
|
interface IBody {
|
||||||
description: string
|
description: string,
|
||||||
|
api: Object
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Component for the main body of the repo page
|
* The Component for the main body of the repo page
|
||||||
* @param {string} description - The description of the repository
|
* @param {string} description - The description of the repository
|
||||||
|
* @param {object} api - The ApiService injected from Angular
|
||||||
*/
|
*/
|
||||||
class body extends React.Component<IBody, {}> {
|
class body extends React.Component<IBody, {}> {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
description: React.PropTypes.string.isRequired,
|
description: React.PropTypes.string.isRequired,
|
||||||
|
api: React.PropTypes.object.isRequired
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
let description: string = this.props.description;
|
let description: string = this.props.description;
|
||||||
|
@ -33,7 +36,7 @@ class body extends React.Component<IBody, {}> {
|
||||||
<div className="rp-description">{description}</div>
|
<div className="rp-description">{description}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="tab-pane" id="tab2">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,8 +14,8 @@ export function rpDirectives(){
|
||||||
return reactDirective(repoSidebar);
|
return reactDirective(repoSidebar);
|
||||||
});
|
});
|
||||||
|
|
||||||
angular.module('quayPages').directive('rpBody', function(reactDirective) {
|
angular.module('quayPages').directive('rpBody', function(reactDirective, ApiService) {
|
||||||
return reactDirective(repoBody);
|
return reactDirective(repoBody, undefined, {}, {api: ApiService});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue