From c808faced55b3886c59fec7ea8a83cd3b9fba2ee Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 18:18:51 +0530 Subject: [PATCH 01/14] Add javascript dependencies in the bower.json --- bower.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index f5d10c0..2bd074b 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { - "name": "CommunityCalendar", + "name": "bower", "version": "0.1", "private": true, "ignore": [ @@ -11,6 +11,9 @@ ], "dependencies": { "angular": "", - "angular-route": "~1.4.8" + "angular-route": "~1.4.8", + "angular-ui-router": "", + "angular-bootstrap": "", + "bootstrap": "" } } From 307c5c8d1192f61e6148ba9d1ff1f3fb2c63cfb9 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 18:25:18 +0530 Subject: [PATCH 02/14] Add the node dependencies in the package.json --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 56b857e..182b929 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,10 @@ "body-parser": "", "serve-static": "", "errorhandler": "", - "bower": "" + "bower": "", + "jasmine-node": "", + "frisby": "", + "karma": "" }, "production_dirs": { "coffee_src": "src/", From 04fbc3df16a7c5c6086edc33474674eac049055d Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 19:15:17 +0530 Subject: [PATCH 03/14] Add the angular-mocks.js for running the e2e tests. --- test/e2e/runner.html | 1 + test/e2e/seed-runner.html | 1 + 2 files changed, 2 insertions(+) diff --git a/test/e2e/runner.html b/test/e2e/runner.html index eca443c..9f241af 100644 --- a/test/e2e/runner.html +++ b/test/e2e/runner.html @@ -4,6 +4,7 @@ End2end Test Runner + diff --git a/test/e2e/seed-runner.html b/test/e2e/seed-runner.html index 9ed5528..e5a8b3c 100644 --- a/test/e2e/seed-runner.html +++ b/test/e2e/seed-runner.html @@ -4,6 +4,7 @@ End2end Test Runner + From b9ec6a3bc996bf96190bd687f4e12262a655a6fa Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 13:38:02 +0530 Subject: [PATCH 04/14] Add support for running tests from npm test command. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 182b929..5a10649 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "devDependencies": { }, "scripts": { - "postinstall": "bower install" + "postinstall": "bower install", + "test": "jasmine-node --verbose test" } } From a8f33b498fcca269c47190903ec89a1ba49154a2 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 13:40:29 +0530 Subject: [PATCH 05/14] Remove the files from test/unit as they are unrelated. --- test/unit/controllersSpec.js | 16 ---------------- test/unit/directivesSpec.js | 19 ------------------- test/unit/filtersSpec.js | 19 ------------------- test/unit/servicesSpec.coffee | 7 ------- 4 files changed, 61 deletions(-) delete mode 100644 test/unit/controllersSpec.js delete mode 100644 test/unit/directivesSpec.js delete mode 100644 test/unit/filtersSpec.js delete mode 100644 test/unit/servicesSpec.coffee diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js deleted file mode 100644 index 23f6b09..0000000 --- a/test/unit/controllersSpec.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/* jasmine specs for controllers go here */ - -describe('controllers', function(){ - beforeEach(module('myApp.controllers')); - - - it('should ....', inject(function() { - //spec body - })); - - it('should ....', inject(function() { - //spec body - })); -}); diff --git a/test/unit/directivesSpec.js b/test/unit/directivesSpec.js deleted file mode 100644 index 6061842..0000000 --- a/test/unit/directivesSpec.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/* jasmine specs for directives go here */ - -describe('directives', function() { - beforeEach(module('myApp.directives')); - - describe('app-version', function() { - it('should print current version', function() { - module(function($provide) { - $provide.value('version', 'TEST_VER'); - }); - inject(function($compile, $rootScope) { - var element = $compile('')($rootScope); - expect(element.text()).toEqual('TEST_VER'); - }); - }); - }); -}); diff --git a/test/unit/filtersSpec.js b/test/unit/filtersSpec.js deleted file mode 100644 index 19af329..0000000 --- a/test/unit/filtersSpec.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/* jasmine specs for filters go here */ - -describe('filter', function() { - beforeEach(module('myApp.filters')); - - - describe('interpolate', function() { - beforeEach(module(function($provide) { - $provide.value('version', 'TEST_VER'); - })); - - - it('should replace VERSION', inject(function(interpolateFilter) { - expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after'); - })); - }); -}); diff --git a/test/unit/servicesSpec.coffee b/test/unit/servicesSpec.coffee deleted file mode 100644 index 79a9888..0000000 --- a/test/unit/servicesSpec.coffee +++ /dev/null @@ -1,7 +0,0 @@ -# jasmine specs for services go here - -describe 'service', -> - beforeEach module 'myApp.services' - describe 'version', -> - it 'should return current version', inject (version) -> - expect(version).toEqual('0.1') From 3c410dc3f05ece1cd49889cf98eab4a7dbb53736 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:00:18 +0530 Subject: [PATCH 06/14] Remove angular-seed files from the project directory. --- .travis.yml | 14 ---------- app/index.html | 2 +- app/js/seed-app.js | 11 -------- app/js/seed-controllers.js | 11 -------- app/js/seed-directives.js | 11 -------- app/js/seed-filters.js | 10 -------- app/js/seed-services.js | 9 ------- app/partials/seed-partial1.html | 1 - app/partials/seed-partial2.html | 5 ---- app/seed-index.html | 28 -------------------- test/e2e/seed-runner.html | 12 --------- test/e2e/seed-scenarios.js | 45 --------------------------------- 12 files changed, 1 insertion(+), 158 deletions(-) delete mode 100644 .travis.yml delete mode 100644 app/js/seed-app.js delete mode 100644 app/js/seed-controllers.js delete mode 100644 app/js/seed-directives.js delete mode 100644 app/js/seed-filters.js delete mode 100644 app/js/seed-services.js delete mode 100644 app/partials/seed-partial1.html delete mode 100644 app/partials/seed-partial2.html delete mode 100644 app/seed-index.html delete mode 100644 test/e2e/seed-runner.html delete mode 100644 test/e2e/seed-scenarios.js diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f55d7f5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - 0.8 - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - npm install --quiet -g karma - - ./scripts/web-server.js > /dev/null & - - sleep 1 # give server time to start - -script: - - karma start config/karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox - - karma start config/karma-e2e.conf.js --reporters=dots --browsers=Firefox diff --git a/app/index.html b/app/index.html index fc3a540..8d9ab40 100644 --- a/app/index.html +++ b/app/index.html @@ -10,11 +10,11 @@ + - diff --git a/app/js/seed-app.js b/app/js/seed-app.js deleted file mode 100644 index d32c16e..0000000 --- a/app/js/seed-app.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -// Declare app level module which depends on filters, and services -angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'myApp.controllers']). - config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/view1', {templateUrl: 'partials/seed-partial1.html', controller: 'MyCtrl1'}); - $routeProvider.when('/view2', {templateUrl: 'partials/seed-partial2.html', controller: 'MyCtrl2'}); - $routeProvider.otherwise({redirectTo: '/view1'}); - }]); - diff --git a/app/js/seed-controllers.js b/app/js/seed-controllers.js deleted file mode 100644 index 35dc54d..0000000 --- a/app/js/seed-controllers.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/* Controllers */ - -angular.module('myApp.controllers', []). - controller('MyCtrl1', [function() { - - }]) - .controller('MyCtrl2', [function() { - - }]); diff --git a/app/js/seed-directives.js b/app/js/seed-directives.js deleted file mode 100644 index 9fc16cc..0000000 --- a/app/js/seed-directives.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/* Directives */ - - -angular.module('myApp.directives', []). - directive('appVersion', ['version', function(version) { - return function(scope, elm, attrs) { - elm.text(version); - }; - }]); diff --git a/app/js/seed-filters.js b/app/js/seed-filters.js deleted file mode 100644 index 259dd4e..0000000 --- a/app/js/seed-filters.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/* Filters */ - -angular.module('myApp.filters', []). - filter('interpolate', ['version', function(version) { - return function(text) { - return String(text).replace(/\%VERSION\%/mg, version); - } - }]); diff --git a/app/js/seed-services.js b/app/js/seed-services.js deleted file mode 100644 index 334d543..0000000 --- a/app/js/seed-services.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -/* Services */ - - -// Demonstrate how to register services -// In this case it is a simple value service. -angular.module('myApp.services', []). - value('version', '0.1'); diff --git a/app/partials/seed-partial1.html b/app/partials/seed-partial1.html deleted file mode 100644 index 89459a6..0000000 --- a/app/partials/seed-partial1.html +++ /dev/null @@ -1 +0,0 @@ -

This is the partial for view 1.

diff --git a/app/partials/seed-partial2.html b/app/partials/seed-partial2.html deleted file mode 100644 index b6503ee..0000000 --- a/app/partials/seed-partial2.html +++ /dev/null @@ -1,5 +0,0 @@ -

This is the partial for view 2.

-

- Showing of 'interpolate' filter: - {{ 'Current version is v%VERSION%.' | interpolate }} -

diff --git a/app/seed-index.html b/app/seed-index.html deleted file mode 100644 index 25d1f4e..0000000 --- a/app/seed-index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - My AngularJS App - - - - - -
- -
Angular seed app: v
- - - - - - - - - - diff --git a/test/e2e/seed-runner.html b/test/e2e/seed-runner.html deleted file mode 100644 index e5a8b3c..0000000 --- a/test/e2e/seed-runner.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - End2end Test Runner - - - - - - - - diff --git a/test/e2e/seed-scenarios.js b/test/e2e/seed-scenarios.js deleted file mode 100644 index eb6e957..0000000 --- a/test/e2e/seed-scenarios.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */ - -describe('my app', function() { - - beforeEach(function() { - browser().navigateTo('/seed-index.html'); - }); - - - it('should automatically redirect to /view1 when location hash/fragment is empty', function() { - expect(browser().location().url()).toBe("/view1"); - }); - - - describe('view1', function() { - - beforeEach(function() { - browser().navigateTo('#/view1'); - }); - - - it('should render view1 when user navigates to /view1', function() { - expect(element('[ng-view] p:first').text()). - toMatch(/partial for view 1/); - }); - - }); - - - describe('view2', function() { - - beforeEach(function() { - browser().navigateTo('#/view2'); - }); - - - it('should render view2 when user navigates to /view2', function() { - expect(element('[ng-view] p:first').text()). - toMatch(/partial for view 2/); - }); - - }); -}); From f9b960951e97f0657616a0071ac6b477b7e3905a Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:03:48 +0530 Subject: [PATCH 07/14] Remove the files related to the Karma test runner. The project makes use of the frisby test runner. Therefore the karma test runner files are removed --- config/karma-e2e.conf.js | 22 ---------------------- config/karma.conf.js | 22 ---------------------- package.json | 3 +-- 3 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 config/karma-e2e.conf.js delete mode 100644 config/karma.conf.js diff --git a/config/karma-e2e.conf.js b/config/karma-e2e.conf.js deleted file mode 100644 index e06b39d..0000000 --- a/config/karma-e2e.conf.js +++ /dev/null @@ -1,22 +0,0 @@ -basePath = '../'; - -files = [ - ANGULAR_SCENARIO, - ANGULAR_SCENARIO_ADAPTER, - 'test/e2e/**/*.js' -]; - -autoWatch = false; - -browsers = ['Firefox']; - -singleRun = true; - -proxies = { - '/': 'http://localhost:8000/' -}; - -junitReporter = { - outputFile: 'test_out/e2e.xml', - suite: 'e2e' -}; diff --git a/config/karma.conf.js b/config/karma.conf.js deleted file mode 100644 index 2ff1c24..0000000 --- a/config/karma.conf.js +++ /dev/null @@ -1,22 +0,0 @@ -basePath = '../'; - -files = [ - JASMINE, - JASMINE_ADAPTER, - 'app/lib/angular/angular.js', - 'app/lib/angular/angular-*.js', - 'test/lib/angular/angular-mocks.js', - 'app/js/**/*.js', - 'src/js/**/*.coffee', - 'test/unit/**/*.js', - 'test/unit/**/*.coffee' -]; - -autoWatch = true; - -browsers = ['Firefox']; - -junitReporter = { - outputFile: 'test_out/unit.xml', - suite: 'unit' -}; diff --git a/package.json b/package.json index 5a10649..bd72657 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "errorhandler": "", "bower": "", "jasmine-node": "", - "frisby": "", - "karma": "" + "frisby": "" }, "production_dirs": { "coffee_src": "src/", From bb55179a28e14e71fd5f627489666e67d3925390 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:10:05 +0530 Subject: [PATCH 08/14] Rename the app from Techgrind to sTeam-REST The Techgrind rename and files related to the Techgrind app are removed. --- app/css/calendar.css | 4 ---- package.json | 2 +- src/js/calendar.coffee | 9 --------- 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 app/css/calendar.css delete mode 100644 src/js/calendar.coffee diff --git a/app/css/calendar.css b/app/css/calendar.css deleted file mode 100644 index 743e694..0000000 --- a/app/css/calendar.css +++ /dev/null @@ -1,4 +0,0 @@ -.community-calendar li { list-style-type: none; } -.cc-event { border: 1px solid black; } -.cc-event-title { font-weight: bold; } -.cc-event-date {} diff --git a/package.json b/package.json index bd72657..b5aacc0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "TechGrind", + "name": "sTeam-REST", "version": "0.1.1", "private": true, "dependencies": { diff --git a/src/js/calendar.coffee b/src/js/calendar.coffee deleted file mode 100644 index 2e092dd..0000000 --- a/src/js/calendar.coffee +++ /dev/null @@ -1,9 +0,0 @@ -app = angular.module 'myapp', ['LocalStorageModule','myapp.services'] - -app.controller "MyCtrl", ($scope, steam) -> - steam.get("techgrind.events/order-by-date").then (data) -> - console.log("we have data!!!") - console.log(JSON.stringify(data['event-list'])) - console.log(JSON.stringify(data)) - $scope.events = data['event-list'] - console.log(JSON.stringify($scope.events)) From dc3bc123dbfd025edc5f7a16e0ece50f40cb6c41 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:15:50 +0530 Subject: [PATCH 09/14] Add the NavCtrl in the app.coffee Remove the HomeCtrl error by assigning the right Controller. --- src/js/app.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/app.coffee b/src/js/app.coffee index 5716f57..20f94df 100644 --- a/src/js/app.coffee +++ b/src/js/app.coffee @@ -14,7 +14,7 @@ app.config ['$urlRouterProvider', '$stateProvider', ($urlRouterProvider, $stateP $stateProvider.state 'home', url: '/home' templateUrl: 'partials/home.html' - controller: 'HomeCtrl' + controller: 'NavCtrl' $stateProvider.state 'register', url: '/register' From f08ac368e69ff51f030bad792a3a354a7c3b0c49 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:18:56 +0530 Subject: [PATCH 10/14] Remove the redundant scripts from the scripts directory --- scripts/e2e-test.bat | 11 ----------- scripts/e2e-test.sh | 9 --------- scripts/test.sh | 9 --------- 3 files changed, 29 deletions(-) delete mode 100644 scripts/e2e-test.bat delete mode 100755 scripts/e2e-test.sh delete mode 100755 scripts/test.sh diff --git a/scripts/e2e-test.bat b/scripts/e2e-test.bat deleted file mode 100644 index 0b2aee6..0000000 --- a/scripts/e2e-test.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off - -REM Windows script for running e2e tests -REM You have to run server and capture some browser first -REM -REM Requirements: -REM - NodeJS (http://nodejs.org/) -REM - Karma (npm install -g karma) - -set BASE_DIR=%~dp0 -karma start "%BASE_DIR%\..\config\karma-e2e.conf.js" %* diff --git a/scripts/e2e-test.sh b/scripts/e2e-test.sh deleted file mode 100755 index 5d8a335..0000000 --- a/scripts/e2e-test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -BASE_DIR=`dirname $0` - -echo "" -echo "Starting Karma Server (http://karma-runner.github.io)" -echo "-------------------------------------------------------------------" - -karma start $BASE_DIR/../config/karma-e2e.conf.js $* diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index 5fe9d02..0000000 --- a/scripts/test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -BASE_DIR=`dirname $0` - -echo "" -echo "Starting Karma Server (http://karma-runner.github.io)" -echo "-------------------------------------------------------------------" - -karma start $BASE_DIR/../config/karma.conf.js $* From 074fcd19bfa844470212723c2fe89461fa62e168 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:41:37 +0530 Subject: [PATCH 11/14] Add travis.yml --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..58e40d8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - "node" + - "6" + - "6.1" + - "5.11" + - "4" + - "0.12" + - "0.6" + - "iojs" From e832314d4dd996951ff2c10e755c1405878da2c2 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 15:14:49 +0530 Subject: [PATCH 12/14] Add build badge for travis ci. --- readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 845c52d..df64f98 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,7 @@ -about this project +[![Build Status](https://travis-ci.org/societyserver/steam-rest.svg?branch=master)](https://travis-ci.org/societyserver/steam-rest) + + +About this project ================== this project contains a set of examples and tests for the RESTful API for the @@ -10,7 +13,7 @@ deployment can be done as static javascript files, and does not need any kind of the back-end is a RESTful API written for the sTeam server as used by techgrind.asia -development instructions +Development instructions ======================== step 1: install node.js From b6d9f2d3736159fe337599a3db7e1db8bdd0332d Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Fri, 8 Jul 2016 03:11:30 +0530 Subject: [PATCH 13/14] Add the home.html page for the app. --- app/partials/home.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 app/partials/home.html diff --git a/app/partials/home.html b/app/partials/home.html new file mode 100644 index 0000000..6671b86 --- /dev/null +++ b/app/partials/home.html @@ -0,0 +1 @@ +

sTeam-REST API

From 70559050a3b7c8af07f18f00db2d94637a41d7d6 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Fri, 8 Jul 2016 03:22:08 +0530 Subject: [PATCH 14/14] Add navigation bar to the app. --- app/index.html | 4 ++-- app/partials/nav.html | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/index.html b/app/index.html index 8d9ab40..74df1ab 100644 --- a/app/index.html +++ b/app/index.html @@ -18,8 +18,8 @@ -
-
+
+
diff --git a/app/partials/nav.html b/app/partials/nav.html index a511ed9..335050b 100644 --- a/app/partials/nav.html +++ b/app/partials/nav.html @@ -1,7 +1,9 @@ -steam-rest examples nav - - +