From c808faced55b3886c59fec7ea8a83cd3b9fba2ee Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 18:18:51 +0530 Subject: [PATCH 01/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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 - - + From b06673847fe29e4cb7315de666b100935fe3828f Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Fri, 8 Jul 2016 03:27:23 +0530 Subject: [PATCH 15/19] Add support for the angular ui-view --- app/index.html | 7 +++---- app/partials/home.html | 10 +++++++++- app/partials/register.html | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/index.html b/app/index.html index 74df1ab..68907c6 100644 --- a/app/index.html +++ b/app/index.html @@ -19,9 +19,8 @@
-
-
-
-
+
+
+
diff --git a/app/partials/home.html b/app/partials/home.html index 6671b86..8d522d0 100644 --- a/app/partials/home.html +++ b/app/partials/home.html @@ -1 +1,9 @@ -

sTeam-REST API

+
+

sTeam-REST API Examples

+ + +
diff --git a/app/partials/register.html b/app/partials/register.html index ca1cfd0..74cd3ae 100644 --- a/app/partials/register.html +++ b/app/partials/register.html @@ -1,4 +1,4 @@ -
+

Register

@@ -13,6 +13,7 @@

Register


Passwords don't match!
+
From 3a359d7f7b6fa6ecec33479024f2ff0cecf9597d Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Fri, 8 Jul 2016 03:31:05 +0530 Subject: [PATCH 16/19] Modify the footer.html --- app/partials/footer.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/partials/footer.html b/app/partials/footer.html index 8f61401..37d3958 100644 --- a/app/partials/footer.html +++ b/app/partials/footer.html @@ -1 +1,3 @@ -steam-rest examples footer + From 2ab8deeb57218dfe44ad78150d06e4fbe27b8eb4 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Fri, 8 Jul 2016 03:33:28 +0530 Subject: [PATCH 17/19] Add the about.html for more information regarding the app --- app/partials/about.html | 323 ++++++++++++++++++++++++++++++++++++++++ src/js/app.coffee | 4 + 2 files changed, 327 insertions(+) create mode 100644 app/partials/about.html diff --git a/app/partials/about.html b/app/partials/about.html new file mode 100644 index 0000000..0ce9449 --- /dev/null +++ b/app/partials/about.html @@ -0,0 +1,323 @@ +
+

open-sTeam

+ +

Open sTeam is a collaboration platform developed at the University of Paderborn in germany. It is no longer developed at the university, but still in use. The original website http://www.open-steam.org has been closed but the archives can still be accessed at :

+ +
Archive of http://www.open-steam.org
+Archive of http://server.open-steam.org
+Archive of http://steamware.open-steam.org
+http://societyserver.org/
+
+ +

For further questions you can also contact us directly:

+ +
steam.devel @ societyserver.org (Developers mailing list)
+#steam-devel on irc.freenode.net (Developers IRC channel)
+
+ +
+

sTeam-REST API usage

+
+

Base URL: http://hostname

+ +

Resource URI: /REST/

+
+
+

Note: +- Each user has a workroom at /home/{{user.name}}/ and each group has a workarea at /home/{{group.name}}/ +- Groups can be nested. For instance {{maingroup}}.{{subgroup}}

+ +

Register

+ +
    +
  • Method: POST

  • +
  • URL Params: register

  • +
  • Request payload

  • +
+ +

+{ + "email":"xx@yy.com", + "password":"temp", + "password2":"temp", + "group":"techgrind" +} +

+ +
    +
  • Response
  • +
+ +

+{ + "request-method": "POST", + "request": "register", + "me": { + "icon": { + "oid": 159, + "size": 778, + "path": "/images/doctypes/user_unknown.jpg", + "description": "", + "title": "", + "name": "user_unknown.jpg", + "mime_type": "image/jpeg", + "class": "Document" + }, + "documents": 0, + "oid": 88, + "vsession": "0", + "id": "guest", + "path": "/guest", + "fullname": "User 1", + "description": "Guest is the guest user.", + "name": "guest", + "links": 0, + "class": "User" + }, + "error": "request not found", + "__version": [ + "2013-07-09-1", + "20150507 08:28:06" + ], + "__date": "20150520 15:22:30" +} +

+ +

Login

+ +
    +
  • Method: GET

  • +
  • URL Params: login

  • +
  • Example call

  • +
+ +

+curl -D- -u temp:temp -X GET -H "Content-Type: application/json" Base URL : http://hostname/REST/login +

+ +
    +
  • Supplying the Authentication headers

  • +
  • Build a string in form of username:password

  • +
  • Base64 encode the string
  • +
  • Supply an "Authorization" header with content "Basic " followed by the encoded string. For example, the string "temp:temp" encodes to "dGVtcDp0ZW1w" in base64, so you would make the request as follows.
  • +
+ +

+curl -D- -X GET -H "Authorization: Basic dGVtcDp0ZW1w" -H "Content-Type: application/json" "http://hostname/REST/login" +

+ +
    +
  • Response
  • +
+ +

+{ + "request-method": "GET", + "me": { + "icon": { + "oid": 159, + "size": 778, + "path": "/images/doctypes/user_unknown.jpg", + "description": "", + "title": "", + "name": "user_unknown.jpg", + "mime_type": "image/jpeg", + "class": "Document" + }, + "documents": 0, + "oid": 11111, + "vsession": "0", + "id": "username", + "path": "/username", + "fullname": "fullname", + "description": "temp", + "name": "name", + "links": 0, + "class": "User" + }, + "error": "request not found", + "__date": "20150520 15:25:19", + "login": "login successful", + "request": "login", + "__version": [ + "2013-07-09-1", + "20150507 08:28:06" + ] +} +

+ +

Accessing a Room

+ +
    +
  • Method: GET

  • +
  • URL Params: /path/to/room

  • +
  • Response:

  • +
+ +

+{ + "request-method": "GET", + "me": { + "icon": { + "oid": 159, + "size": 778, + "path": "/images/doctypes/user_unknown.jpg", + "description": "", + "title": "", + "name": "user_unknown.jpg", + "mime_type": "image/jpeg", + "class": "Document" + }, + "documents": 0, + "oid": 88, + "vsession": "0", + "id": "guest", + "path": "/guest", + "fullname": "User 1", + "description": "Guest is the guest user.", + "name": "guest", + "links": 0, + "class": "User" + }, + "inventory": [ + { + "icon": { + "oid": 174, + "size": 1435, + "path": "/images/doctypes/type_generic.gif", + "description": "", + "title": "", + "name": "type_generic.gif", + "mime_type": "image/gif", + "class": "Document" + }, + "oid": 8995, + "size": 167, + "path": "/path/to/document/in/a/room", + "description": "this is a simple text file", + "title": "this is a simple text file", + "name": "hello-world", + "mime_type": "text/plain", + "class": "Document" + } + ], + "__date": "20150522 07:00:08", + "request": "/path/to/room", + "__version": [ + "2013-07-09-1", + "20150507 08:28:06" + ], + "object": { + "icon": { + "oid": 179, + "size": 1256, + "path": "/images/doctypes/type_area.gif", + "description": "", + "title": "", + "name": "type_area.gif", + "mime_type": "image/gif", + "class": "Document" + }, + "documents": 1, + "oid": 8989, + "path": "/path/to/room", + "description": "", + "name": "room name", + "links": 0, + "class": "Room" + } +} +

+ +

Access a Document in a room

+ +
    +
  • METHOD: GET

  • +
  • URL Params: /path/to/document

  • +
  • Response:

  • +
+ +

+{ + "request-method": "GET", + "me": { + "icon": { + "oid": 159, + "size": 778, + "path": "/images/doctypes/user_unknown.jpg", + "description": "", + "title": "", + "name": "user_unknown.jpg", + "mime_type": "image/jpeg", + "class": "Document" + }, + "documents": 0, + "oid": 88, + "vsession": "0", + "id": "guest", + "path": "/guest", + "fullname": "User 1", + "description": "Guest is the guest user.", + "name": "guest", + "links": 0, + "class": "User" + }, + "__date": "20150522 08:58:03", + "request": "/path/to/document", + "environment": { + "icon": { + "oid": 179, + "size": 1256, + "path": "/images/doctypes/type_area.gif", + "description": "", + "title": "", + "name": "type_area.gif", + "mime_type": "image/gif", + "class": "Document" + }, + "documents": 3, + "oid": 8989, + "path": "/path/to/room", + "description": "", + "name": "room name", + "links": 0, + "class": "Room" + }, + "__version": [ + "2013-07-09-1", + "20150507 08:28:06" + ], + "object": { + "icon": { + "oid": 174, + "size": 1435, + "path": "/images/doctypes/type_generic.gif", + "description": "", + "title": "", + "name": "type_generic.gif", + "mime_type": "image/gif", + "class": "Document" + }, + "oid": 11198, + "content": "this is test file to become acquainted with the interface.", + "size": 58, + "path": "/path/to/document", + "description": "this is a test document", + "title": "this is a test document", + "name": "test-document", + "mime_type": "text/plain", + "class": "Document" + } +} +

+ +

Creating Room

+ +

Creating Containers

+ +

Creating Documents

+ +

Creating Groups

+ +

Deleting Objects

+
diff --git a/src/js/app.coffee b/src/js/app.coffee index 20f94df..2af26e3 100644 --- a/src/js/app.coffee +++ b/src/js/app.coffee @@ -20,4 +20,8 @@ app.config ['$urlRouterProvider', '$stateProvider', ($urlRouterProvider, $stateP url: '/register' templateUrl: 'partials/register.html' controller: 'RegisterCtrl' + + $stateProvider.state 'about', + url: '/about' + templateUrl: 'partials/about.html' ] From a2d4cafa4e3a7f210d09a90c4fd0da81dcd3e3c9 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Fri, 8 Jul 2016 04:06:33 +0530 Subject: [PATCH 18/19] Change the domain name. --- test/frisby/registration_tests_spec.js | 2 +- test/frisby/rest_spec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/frisby/registration_tests_spec.js b/test/frisby/registration_tests_spec.js index 540fb27..010bc41 100644 --- a/test/frisby/registration_tests_spec.js +++ b/test/frisby/registration_tests_spec.js @@ -15,7 +15,7 @@ function testRegistrationDate (rd) { // Registration Tests frisby.create('Testing Registration API calls') - .post('http://dev-back1.techgrind.asia/scripts/rest.pike?request=register', { + .post('http://steam.realss.com/scripts/rest.pike?request=register', { email: "gcitester@tester.com", fullname: "test user tg gci", group: "techgrind", diff --git a/test/frisby/rest_spec.js b/test/frisby/rest_spec.js index eae0b59..de7ccc3 100644 --- a/test/frisby/rest_spec.js +++ b/test/frisby/rest_spec.js @@ -88,7 +88,7 @@ function toBeDateIfExists (val) { // frisby.create('Test techgrind.events to be well-formed') - .get('http://dev-back1.techgrind.asia/scripts/rest.pike?request=techgrind.events') + .get('http://ngtg.techgrind.asia/scripts/rest.pike?request=techgrind.events') .expectStatus(200) .expectJSON({ "request": "techgrind.events", @@ -104,7 +104,7 @@ frisby.create('Test techgrind.events to be well-formed') frisby.create('Test techgrind.events/order-by-date to be well-formed') - .get('http://dev-back1.techgrind.asia/scripts/rest.pike?request=techgrind.events/order-by-date') + .get('http://ngtg.techgrind.asia/scripts/rest.pike?request=techgrind.events/order-by-date') .expectStatus(200) .expectJSON({ "request": "techgrind.events/order-by-date", @@ -120,7 +120,7 @@ frisby.create('Test techgrind.events/order-by-date to be well-formed') frisby.create('Testing an instance of an event to be well-formed') - .get('http://dev-back1.techgrind.asia/scripts/rest.pike?request=techgrind.events.blug-coding-for-fun') + .get('http://ngtg.techgrind.asia/scripts/rest.pike?request=techgrind.events.blug-coding-for-fun') .expectStatus(200) .expectJSON({ "request": "techgrind.events.blug-coding-for-fun", From 56bd8c8a1a9de3cb571d7a81d23f2f73670b154e Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sun, 10 Jul 2016 23:09:28 +0530 Subject: [PATCH 19/19] Modify the e2e tests. --- test/e2e/scenarios.coffee | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/test/e2e/scenarios.coffee b/test/e2e/scenarios.coffee index 41e64d6..91926c6 100644 --- a/test/e2e/scenarios.coffee +++ b/test/e2e/scenarios.coffee @@ -4,10 +4,18 @@ angular.scenario.dsl 'expectClass', -> (klass, selector, label) -> angular.scenario.dsl 'expectViewText', -> (text, selector, label) -> expect(element("[ng-view] "+ (selector || ''), label).text()).toMatch text -describe 'Tech Grind app', -> +describe 'sTeam REST API app', -> describe 'root page', -> beforeEach -> browser().navigateTo '/' it 'shows the home page', -> expect(browser().location().url()).toBe "/home" + + describe 'Home page', -> + beforeEach -> browser().navigateTo '#/home' + it 'Shows the home page', -> expect(browser().location().url()).toBe "/home" + + describe 'About page', -> + beforeEach -> browser().navigateTo '#/about' + it 'Shows the about page', -> expect(browser().location().url()).toBe "/about" describe 'register and activate', -> beforeEach -> browser().navigateTo '#/register' @@ -21,24 +29,4 @@ describe 'Tech Grind app', -> element('#activation_link').click() expect(element('#activation').text()).toContain 'user is activated' - describe 'home page', -> - beforeEach -> browser().navigateTo '#/home' - it 'shows Top happenings', -> expectViewText "Top Happenings" - it 'shows Latest Content', -> expectViewText "Latest Content" - it 'highlights the home menu and only that', -> - expectClass 'active', '#menu #home' - expect(element('#menu [class="active"]').count()).toBe 1 - - describe 'regions', -> - beforeEach -> browser().navigateTo '#/regions' - - describe 'a specific regions', -> - beforeEach -> browser().navigateTo '#/regions/thailand' - describe 'calendar', -> - describe 'events', -> - describe 'resources', -> - describe 'media', -> - describe 'partners', -> - xit 'shows Global Partners' - xit 'has Connect With Us form'