Commit 0e302e32 authored by Evren Kutar's avatar Evren Kutar

copyright text changed

parent fd284d7a
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'; 'use strict';
// Declare app level module which depends on views, and components // Declare app level module which depends on views, and components
......
/** /**
* Created by evren kutar on 12/05/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
'use strict'; 'use strict';
......
/** /**
* Created by evren kutar on 12/05/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
\ No newline at end of file
/** /**
* Created by Evren Kutar on 09/06/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
var form_generator = angular.module('FormGenerator', []); var form_generator = angular.module('FormGenerator', []);
...@@ -7,8 +10,10 @@ var form_generator = angular.module('FormGenerator', []); ...@@ -7,8 +10,10 @@ var form_generator = angular.module('FormGenerator', []);
form_generator.factory('Generator', function(){ form_generator.factory('Generator', function(){
var generator ={}; var generator ={};
generator.generate = function(modelObject){ generator.generate = function(modelObject){
var form = modelObject; return generator.group(modelObject);
return form; };
generator.group = function(form_items){
return form_items;
}; };
return generator; return generator;
}); });
\ No newline at end of file
/** /**
* Created by Evren Kutar on 09/06/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
'use strict';
describe('general module', function () {
beforeEach(module('general'));
describe('form diff factory', function () {
it('should return diff object', inject(['FormDiff',
function (FormDiff) {
expect(FormDiff.get_diff).not.toBe(null);
// test cases - testing for success
var same_json = [
{email:'test@test.com', id:2, name:'travolta'},
{email:'test@test.com', id:2, name:'travolta'}
];
// test cases - testing for failure
var different_json = [
{email:'test@test.com', id:2, name:'travolta'},
{email:'test1@test.com', id:2, name:'john'}
];
var diff = {email:'test1@test.com', name:'john'};
var nodiff = {};
var same = FormDiff.get_diff(same_json[0], same_json[1]);
expect(same).toEqual(nodiff);
var different = FormDiff.get_diff(different_json[0], different_json[1]);
expect(different).toEqual(diff);
}])
);
});
});
\ No newline at end of file
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'; 'use strict';
// TODO: clean console log items // TODO: clean console log items
...@@ -10,7 +17,7 @@ login.config(['$routeProvider', function ($routeProvider) { ...@@ -10,7 +17,7 @@ login.config(['$routeProvider', function ($routeProvider) {
// templateUrl: 'login/login.html', // templateUrl: 'login/login.html',
// controller: 'LoginCtrl' // controller: 'LoginCtrl'
//}); //});
}]); }]);
login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location, $rootScope, AUTH_EVENTS, LoginService, FormDiff) { login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location, $rootScope, AUTH_EVENTS, LoginService, FormDiff) {
$scope.schema = $scope.schema =
{ {
...@@ -49,9 +56,9 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location, ...@@ -49,9 +56,9 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location,
'emailNotValid': 'Email is not valid!' 'emailNotValid': 'Email is not valid!'
}, },
$asyncValidators: { $asyncValidators: {
emailNotValid: function(value){ emailNotValid: function (value) {
var deferred = $q.defer(); var deferred = $q.defer();
$timeout(function(){ $timeout(function () {
if (LoginService.isValidEmail(value)) { if (LoginService.isValidEmail(value)) {
deferred.resolve(); deferred.resolve();
} else { } else {
...@@ -73,9 +80,9 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location, ...@@ -73,9 +80,9 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location,
title: "Save" title: "Save"
} }
]; ];
$scope.onSubmit = function(form){ $scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate'); $scope.$broadcast('schemaFormValidate');
if (form.$valid){ if (form.$valid) {
var credentials = {email: form.email.$modelValue, password: form.password.$modelValue}; var credentials = {email: form.email.$modelValue, password: form.password.$modelValue};
LoginService.login(credentials); LoginService.login(credentials);
} }
...@@ -83,4 +90,4 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location, ...@@ -83,4 +90,4 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location,
console.log("not valid"); console.log("not valid");
} }
} }
}); });
\ No newline at end of file \ No newline at end of file
/** /**
* Created by evren kutar on 12/05/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
"use strict"; "use strict";
......
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'; 'use strict';
// TODO: fill up the test cases correctly // TODO: fill up the test cases correctly
......
/** /**
* Created by Evren Kutar on 09/06/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
//angular.module('FormDiff', []) //angular.module('FormDiff', [])
......
/** /**
* Created by Evren Kutar on 09/06/15. * Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/ */
'use strict'; 'use strict';
describe('general module', function () { describe('general module', function () {
......
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
...@@ -34,10 +41,11 @@ module.exports = function (config) { ...@@ -34,10 +41,11 @@ module.exports = function (config) {
frameworks: ['jasmine'], frameworks: ['jasmine'],
browsers: ['Chrome'], browsers: ['Opera'],
plugins: [ plugins: [
'karma-chrome-launcher', 'karma-chrome-launcher',
'karma-opera-launcher',
'karma-firefox-launcher', 'karma-firefox-launcher',
'karma-jasmine', 'karma-jasmine',
'karma-junit-reporter', 'karma-junit-reporter',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment