diff --git a/src/app/components/githubContributor/githubContributor.service.js b/src/app/components/githubContributor/githubContributor.service.js deleted file mode 100644 index 9e10661..0000000 --- a/src/app/components/githubContributor/githubContributor.service.js +++ /dev/null @@ -1,37 +0,0 @@ -(function() { - 'use strict'; - - angular - .module('angular') - .factory('githubContributor', githubContributor); - - /** @ngInject */ - function githubContributor($log, $http) { - var apiHost = 'https://api.github.com/repos/Swiip/generator-gulp-angular'; - - var service = { - apiHost: apiHost, - getContributors: getContributors - }; - - return service; - - function getContributors(limit) { - if (!limit) { - limit = 30; - } - - return $http.get(apiHost + '/contributors?per_page=' + limit) - .then(getContributorsComplete) - .catch(getContributorsFailed); - - function getContributorsComplete(response) { - return response.data; - } - - function getContributorsFailed(error) { - $log.error('XHR Failed for getContributors.\n' + angular.toJson(error.data, true)); - } - } - } -})(); diff --git a/src/app/components/githubContributor/githubContributor.service.spec.js b/src/app/components/githubContributor/githubContributor.service.spec.js deleted file mode 100644 index 6f874d0..0000000 --- a/src/app/components/githubContributor/githubContributor.service.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -(function() { - 'use strict'; - - describe('service githubContributor', function() { - var githubContributor; - var $httpBackend; - var $log; - - beforeEach(module('angular')); - beforeEach(inject(function(_githubContributor_, _$httpBackend_, _$log_) { - githubContributor = _githubContributor_; - $httpBackend = _$httpBackend_; - $log = _$log_; - })); - - it('should be registered', function() { - expect(githubContributor).not.toEqual(null); - }); - - describe('apiHost variable', function() { - it('should exist', function() { - expect(githubContributor.apiHost).not.toEqual(null); - }); - }); - - describe('getContributors function', function() { - it('should exist', function() { - expect(githubContributor.getContributors).not.toEqual(null); - }); - - it('should return data', function() { - $httpBackend.when('GET', githubContributor.apiHost + '/contributors?per_page=1').respond(200, [{pprt: 'value'}]); - var data; - githubContributor.getContributors(1).then(function(fetchedData) { - data = fetchedData; - }); - $httpBackend.flush(); - expect(data).toEqual(jasmine.any(Array)); - expect(data.length === 1).toBeTruthy(); - expect(data[0]).toEqual(jasmine.any(Object)); - }); - - it('should define a limit per page as default value', function() { - $httpBackend.when('GET', githubContributor.apiHost + '/contributors?per_page=30').respond(200, new Array(30)); - var data; - githubContributor.getContributors().then(function(fetchedData) { - data = fetchedData; - }); - $httpBackend.flush(); - expect(data).toEqual(jasmine.any(Array)); - expect(data.length === 30).toBeTruthy(); - }); - - it('should log a error', function() { - $httpBackend.when('GET', githubContributor.apiHost + '/contributors?per_page=1').respond(500); - githubContributor.getContributors(1); - $httpBackend.flush(); - expect($log.error.logs).toEqual(jasmine.stringMatching('XHR Failed for')); - }); - }); - }); -})(); diff --git a/src/app/components/noosfero/noosfero.service.js b/src/app/components/noosfero/noosfero.service.js new file mode 100644 index 0000000..6d1fa36 --- /dev/null +++ b/src/app/components/noosfero/noosfero.service.js @@ -0,0 +1,9 @@ +(function() { + 'use strict'; + + angular.module('angular').service('noosfero', noosfero); + + function noosfero() { + + } +})(); diff --git a/src/app/components/webDevTec/webDevTec.service.js b/src/app/components/webDevTec/webDevTec.service.js deleted file mode 100644 index 531cf9e..0000000 --- a/src/app/components/webDevTec/webDevTec.service.js +++ /dev/null @@ -1,74 +0,0 @@ -(function() { - 'use strict'; - - angular - .module('angular') - .service('webDevTec', webDevTec); - - /** @ngInject */ - function webDevTec() { - var data = [ - { - 'title': 'AngularJS', - 'url': 'https://angularjs.org/', - 'description': 'HTML enhanced for web apps!', - 'logo': 'angular.png' - }, - { - 'title': 'BrowserSync', - 'url': 'http://browsersync.io/', - 'description': 'Time-saving synchronised browser testing.', - 'logo': 'browsersync.png' - }, - { - 'title': 'GulpJS', - 'url': 'http://gulpjs.com/', - 'description': 'The streaming build system.', - 'logo': 'gulp.png' - }, - { - 'title': 'Jasmine', - 'url': 'http://jasmine.github.io/', - 'description': 'Behavior-Driven JavaScript.', - 'logo': 'jasmine.png' - }, - { - 'title': 'Karma', - 'url': 'http://karma-runner.github.io/', - 'description': 'Spectacular Test Runner for JavaScript.', - 'logo': 'karma.png' - }, - { - 'title': 'Protractor', - 'url': 'https://github.com/angular/protractor', - 'description': 'End to end test framework for AngularJS applications built on top of WebDriverJS.', - 'logo': 'protractor.png' - }, - { - 'title': 'Bootstrap', - 'url': 'http://getbootstrap.com/', - 'description': 'Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.', - 'logo': 'bootstrap.png' - }, - { - 'title': 'Angular UI Bootstrap', - 'url': 'http://angular-ui.github.io/bootstrap/', - 'description': 'Bootstrap components written in pure AngularJS by the AngularUI Team.', - 'logo': 'ui-bootstrap.png' - }, - { - 'title': 'Sass (Node)', - 'url': 'https://github.com/sass/node-sass', - 'description': 'Node.js binding to libsass, the C version of the popular stylesheet preprocessor, Sass.', - 'logo': 'node-sass.png' - } - ]; - - this.getTec = getTec; - - function getTec() { - return data; - } - } - -})(); diff --git a/src/app/components/webDevTec/webDevTec.service.spec.js b/src/app/components/webDevTec/webDevTec.service.spec.js deleted file mode 100644 index 5401eef..0000000 --- a/src/app/components/webDevTec/webDevTec.service.spec.js +++ /dev/null @@ -1,29 +0,0 @@ -(function() { - 'use strict'; - - describe('service webDevTec', function() { - var webDevTec; - - beforeEach(module('angular')); - beforeEach(inject(function(_webDevTec_) { - webDevTec = _webDevTec_; - })); - - it('should be registered', function() { - expect(webDevTec).not.toEqual(null); - }); - - describe('getTec function', function() { - it('should exist', function() { - expect(webDevTec.getTec).not.toEqual(null); - }); - - it('should return array of object', function() { - var data = webDevTec.getTec(); - expect(data).toEqual(jasmine.any(Array)); - expect(data[0]).toEqual(jasmine.any(Object)); - expect(data.length > 5).toBeTruthy(); - }); - }); - }); -})(); diff --git a/src/app/main/main.controller.js b/src/app/main/main.controller.js index b73da83..c07be92 100644 --- a/src/app/main/main.controller.js +++ b/src/app/main/main.controller.js @@ -6,34 +6,13 @@ .controller('MainController', MainController); /** @ngInject */ - function MainController($timeout, webDevTec, toastr) { + function MainController($timeout, noosfero, toastr) { var vm = this; - - vm.awesomeThings = []; - vm.classAnimation = ''; - vm.creationDate = 1452020281605; - vm.showToastr = showToastr; - + vm.boxes = []; activate(); function activate() { - getWebDevTec(); - $timeout(function() { - vm.classAnimation = 'rubberBand'; - }, 4000); - } - - function showToastr() { - toastr.info('Fork generator-gulp-angular'); - vm.classAnimation = ''; - } - - function getWebDevTec() { - vm.awesomeThings = webDevTec.getTec(); - - angular.forEach(vm.awesomeThings, function(awesomeThing) { - awesomeThing.rank = Math.random(); - }); + // vm.boxes = noosfero.getBoxes(); } } })(); diff --git a/src/app/main/main.controller.spec.js b/src/app/main/main.controller.spec.js index 4931234..587817d 100644 --- a/src/app/main/main.controller.spec.js +++ b/src/app/main/main.controller.spec.js @@ -7,8 +7,7 @@ var toastr; beforeEach(module('angular')); - beforeEach(inject(function(_$controller_, _$timeout_, _webDevTec_, _toastr_) { - spyOn(_webDevTec_, 'getTec').and.returnValue([{}, {}, {}, {}, {}]); + beforeEach(inject(function(_$controller_, _$timeout_, _toastr_) { spyOn(_toastr_, 'info').and.callThrough(); vm = _$controller_('MainController'); diff --git a/src/app/main/main.html b/src/app/main/main.html index b586245..c0e8c4b 100644 --- a/src/app/main/main.html +++ b/src/app/main/main.html @@ -1,33 +1,12 @@
-
- Always a pleasure scaffolding your apps.
-
- -
-
- With ♥ thanks to the contributions of