From 9653cad53cde69b174ee645bd59c693485ffaedd Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Mon, 31 Oct 2016 16:21:45 -0400 Subject: [PATCH] Namespace page directories --- static/js/app.tsx | 6 ++++-- .../body.tsx} | 4 ++-- .../header.tsx | 0 .../components/components-repo-page/main.tsx | 18 ++++++++++++++++ .../sidebar.tsx | 0 .../components/publicRepo/publicRepo.tsx | 21 ------------------- tslint.json | 5 +++++ 7 files changed, 29 insertions(+), 25 deletions(-) rename static/js/directives/components/{publicRepo/main.tsx => components-repo-page/body.tsx} (63%) rename static/js/directives/components/{publicRepo => components-repo-page}/header.tsx (100%) create mode 100644 static/js/directives/components/components-repo-page/main.tsx rename static/js/directives/components/{publicRepo => components-repo-page}/sidebar.tsx (100%) delete mode 100644 static/js/directives/components/publicRepo/publicRepo.tsx create mode 100644 tslint.json diff --git a/static/js/app.tsx b/static/js/app.tsx index 83b4fae76..fd3049bf4 100644 --- a/static/js/app.tsx +++ b/static/js/app.tsx @@ -1,2 +1,4 @@ -import publicRepo from "./directives/components/publicRepo/publicRepo"; -publicRepo(); +import publicRepoDirectives from "./directives/components/components-repo-page/main"; + +// Init for each page +publicRepoDirectives(); diff --git a/static/js/directives/components/publicRepo/main.tsx b/static/js/directives/components/components-repo-page/body.tsx similarity index 63% rename from static/js/directives/components/publicRepo/main.tsx rename to static/js/directives/components/components-repo-page/body.tsx index e3ff322db..6b145c0b1 100644 --- a/static/js/directives/components/publicRepo/main.tsx +++ b/static/js/directives/components/components-repo-page/body.tsx @@ -1,10 +1,10 @@ import * as React from "react"; -class main extends React.Component<{}, {}> { +class body extends React.Component<{}, {}> { render () { return
The component for the main content
; } } -export default main; +export default body; diff --git a/static/js/directives/components/publicRepo/header.tsx b/static/js/directives/components/components-repo-page/header.tsx similarity index 100% rename from static/js/directives/components/publicRepo/header.tsx rename to static/js/directives/components/components-repo-page/header.tsx diff --git a/static/js/directives/components/components-repo-page/main.tsx b/static/js/directives/components/components-repo-page/main.tsx new file mode 100644 index 000000000..0243590d6 --- /dev/null +++ b/static/js/directives/components/components-repo-page/main.tsx @@ -0,0 +1,18 @@ +import * as angular from "angular"; + +import repoHeader from "./header"; +import repoSidebar from "./sidebar"; +import repoMain from "./body"; + +angular.module('quayPages').directive('rpHeader', function(reactDirective) { + return reactDirective(repoHeader); +}); + +angular.module('quayPages').directive('rpSidebar', function(reactDirective) { + return reactDirective(repoSidebar); +}); + +angular.module('quayPages').directive('rpMain', function(reactDirective) { + return reactDirective(repoMain); +}); + \ No newline at end of file diff --git a/static/js/directives/components/publicRepo/sidebar.tsx b/static/js/directives/components/components-repo-page/sidebar.tsx similarity index 100% rename from static/js/directives/components/publicRepo/sidebar.tsx rename to static/js/directives/components/components-repo-page/sidebar.tsx diff --git a/static/js/directives/components/publicRepo/publicRepo.tsx b/static/js/directives/components/publicRepo/publicRepo.tsx deleted file mode 100644 index a6369c4b1..000000000 --- a/static/js/directives/components/publicRepo/publicRepo.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as angular from "angular"; - -import repoHeader from "./header"; -import repoSidebar from "./sidebar"; -import repoMain from "./main"; - -var publicRepo = function(){ - angular.module('quayPages').directive('rpHeader', function(reactDirective) { - return reactDirective(repoHeader); - }); - - angular.module('quayPages').directive('rpSidebar', function(reactDirective) { - return reactDirective(repoSidebar); - }); - - angular.module('quayPages').directive('rpMain', function(reactDirective) { - return reactDirective(repoMain); - }); -} - -export default publicRepo; diff --git a/tslint.json b/tslint.json new file mode 100644 index 000000000..10a4b36d3 --- /dev/null +++ b/tslint.json @@ -0,0 +1,5 @@ +{ + "rules": { + "no-default-export": true + } +} \ No newline at end of file