From a7594d6e572cae1507306d5f3c5765d69e25bcc3 Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Wed, 7 Dec 2016 03:15:21 -0500 Subject: [PATCH] Inject ApiService to be accessible in the body react component --- static/js/directives/components/pages/repo-page/body.tsx | 7 +++++-- static/js/directives/components/pages/repo-page/main.tsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/static/js/directives/components/pages/repo-page/body.tsx b/static/js/directives/components/pages/repo-page/body.tsx index a6145e85b..29db9f3a3 100644 --- a/static/js/directives/components/pages/repo-page/body.tsx +++ b/static/js/directives/components/pages/repo-page/body.tsx @@ -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 { 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 {
{description}
- TODO (IAN): Convert the build directives to angular components +

Repository Builds

diff --git a/static/js/directives/components/pages/repo-page/main.tsx b/static/js/directives/components/pages/repo-page/main.tsx index 91c3422aa..5dd13c624 100644 --- a/static/js/directives/components/pages/repo-page/main.tsx +++ b/static/js/directives/components/pages/repo-page/main.tsx @@ -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}); }); }