Refactor : Move modules to components directory

This commit is contained in:
Frédéric Vachon 2015-02-03 13:19:49 -05:00
parent de6f9b0689
commit 47c4743723
33 changed files with 23 additions and 23 deletions

View File

@ -9,6 +9,6 @@ angular.module('adagios.sidebar', [])
.directive('adgSidebar', function () { .directive('adgSidebar', function () {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: "sidebar/sidebar.html" templateUrl: "components/sidebar/sidebar.html"
}; };
}); });

View File

@ -14,7 +14,7 @@ describe('Sidebar module', function () {
$controller = _$controller_; $controller = _$controller_;
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.expectGET('sidebar/sidebar.html').respond('<li></li>'); $httpBackend.expectGET('components/sidebar/sidebar.html').respond('<li></li>');
})); }));
describe('SideBarCtrl', function () { describe('SideBarCtrl', function () {

View File

@ -40,7 +40,7 @@ angular.module('adagios.table', ['ngRoute',
scope.generateTable = function () { scope.generateTable = function () {
if (!!attrs.cells) { if (!!attrs.cells) {
tableConfig.dashboardCells = attrs.cells.split(','); tableConfig.dashboardCells = attrs.cells.split(',');
return 'table/table.html'; return 'components/table/table.html';
} }
console.log('<adg-table> "cells" attribute is undefined'); console.log('<adg-table> "cells" attribute is undefined');
}; };
@ -55,7 +55,7 @@ angular.module('adagios.table', ['ngRoute',
link: function (scope, element, attrs) { link: function (scope, element, attrs) {
scope.getTemplateUrl = function () { scope.getTemplateUrl = function () {
if (!!attrs.type) { if (!!attrs.type) {
return 'table/cell_' + attrs.type + '/cell_' + attrs.type + '.html'; return 'components/table/cell_' + attrs.type + '/cell_' + attrs.type + '.html';
} }
console.error('<adg-cell> "type" attribute is undefined'); console.error('<adg-cell> "type" attribute is undefined');
}; };

View File

@ -21,7 +21,7 @@ describe('In Table module', function () {
angular.forEach(cells, function (cell) { angular.forEach(cells, function (cell) {
var elem = angular.element('<adg-cell type="' + cell + '"></adg-cell>'); var elem = angular.element('<adg-cell type="' + cell + '"></adg-cell>');
$compile(elem)($rootScope); $compile(elem)($rootScope);
$httpBackend.expectGET('table/cell_' + cell + '/cell_' + cell + '.html').respond(''); $httpBackend.expectGET('components/table/cell_' + cell + '/cell_' + cell + '.html').respond('');
$httpBackend.flush(); $httpBackend.flush();
}); });
}); });
@ -30,9 +30,9 @@ describe('In Table module', function () {
describe('adgTable directive', function () { describe('adgTable directive', function () {
it('should request table/table.html template', function () { it('should request table/table.html template', function () {
var elem = angular.element('<adg-table></adg-table>'); var elem = angular.element('<adg-table cells="host,service_check,duration,last_check"></adg-table>');
$compile(elem)($rootScope); $compile(elem)($rootScope);
$httpBackend.expectGET('table/table.html').respond(''); $httpBackend.expectGET('components/table/table.html').respond('');
$httpBackend.flush(); $httpBackend.flush();
}); });
}); });

View File

@ -10,6 +10,6 @@ angular.module('adagios.tactical.current_health', ['ngRoute', 'ngJustGage' ])
.directive('adgCurrentHealth', function () { .directive('adgCurrentHealth', function () {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: "tactical/current_health/current_health.html" templateUrl: 'components/tactical/current_health/current_health.html'
}; };
}); });

View File

@ -14,7 +14,7 @@ describe('Current Health tactical submodule', function () {
$controller = _$controller_; $controller = _$controller_;
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.expectGET('tactical/current_health/current_health.html') $httpBackend.expectGET('components/tactical/current_health/current_health.html')
.respond('<th>Current Health</th>'); .respond('<th>Current Health</th>');
})); }));

View File

@ -17,6 +17,6 @@ angular.module('adagios.tactical.status_overview', ['ngRoute' ])
.directive('adgStatusOverview', function () { .directive('adgStatusOverview', function () {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: "tactical/status_overview/status_overview.html" templateUrl: 'components/tactical/status_overview/status_overview.html'
}; };
}); });

View File

@ -14,7 +14,7 @@ describe('Status Overview tactical submodule', function () {
$controller = _$controller_; $controller = _$controller_;
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.expectGET('tactical/status_overview/status_overview.html') $httpBackend.expectGET('components/tactical/status_overview/status_overview.html')
.respond('<td>{{ problems }}</td>'); .respond('<td>{{ problems }}</td>');
})); }));

View File

@ -9,7 +9,7 @@ angular.module('adagios.tactical', ['ngRoute',
.config(['$routeProvider', function ($routeProvider) { .config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/tactical', { $routeProvider.when('/tactical', {
templateUrl: 'tactical/tactical.html', templateUrl: 'components/tactical/tactical.html',
controller: 'TacticalCtrl' controller: 'TacticalCtrl'
}); });
}]) }])

View File

@ -21,6 +21,6 @@ angular.module('adagios.tactical.top_alert_producers', ['ngRoute' ])
.directive('adgTopAlertProducers', function () { .directive('adgTopAlertProducers', function () {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: "tactical/top_alert_producers/top_alert_producers.html" templateUrl: 'components/tactical/top_alert_producers/top_alert_producers.html'
}; };
}); });

View File

@ -14,7 +14,7 @@ describe('Top Alert Producer tactical submodule', function () {
$controller = _$controller_; $controller = _$controller_;
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.expectGET('tactical/top_alert_producers/top_alert_producers.html') $httpBackend.expectGET('components/tactical/top_alert_producers/top_alert_producers.html')
.respond('<td>{{ problems }}</td>'); .respond('<td>{{ problems }}</td>');
})); }));

View File

@ -9,6 +9,6 @@ angular.module('adagios.topbar', ['adagios.live'])
.directive('adgTopbar', function () { .directive('adgTopbar', function () {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: "topbar/topbar.html" templateUrl: 'components/topbar/topbar.html'
}; };
}); });

View File

@ -14,7 +14,7 @@ describe('Topbar module', function () {
$controller = _$controller_; $controller = _$controller_;
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.expectGET('topbar/topbar.html').respond('<a>{{ notifications }}</a>'); $httpBackend.expectGET('components/topbar/topbar.html').respond('<a>{{ notifications }}</a>');
})); }));
describe('TopBarCtrl', function () { describe('TopBarCtrl', function () {

View File

@ -30,16 +30,16 @@
<script src="components/filters/filters.js"></script> <script src="components/filters/filters.js"></script>
<!-- MODULES --> <!-- MODULES -->
<script src="sidebar/sidebar.js"></script> <script src="components/sidebar/sidebar.js"></script>
<script src="topbar/topbar.js"></script> <script src="components/topbar/topbar.js"></script>
<script src="tactical/tactical.js"></script> <script src="components/tactical/tactical.js"></script>
<script src="tactical/status_overview/status_overview.js"></script> <script src="components/tactical/status_overview/status_overview.js"></script>
<script src="tactical/current_health/current_health.js"></script> <script src="components/tactical/current_health/current_health.js"></script>
<script src="tactical/top_alert_producers/top_alert_producers.js"></script> <script src="components/tactical/top_alert_producers/top_alert_producers.js"></script>
<script src="table/table.js"></script> <script src="components/table/table.js"></script>
<script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script> <script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
<script src="bower_components/moment/moment.js"></script> <script src="bower_components/moment/moment.js"></script>