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';
// 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';
......
/**
* 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', []);
......@@ -7,8 +10,10 @@ var form_generator = angular.module('FormGenerator', []);
form_generator.factory('Generator', function(){
var generator ={};
generator.generate = function(modelObject){
var form = modelObject;
return form;
return generator.group(modelObject);
};
generator.group = function(form_items){
return form_items;
};
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';
// TODO: clean console log items
......@@ -10,7 +17,7 @@ login.config(['$routeProvider', function ($routeProvider) {
// templateUrl: 'login/login.html',
// controller: 'LoginCtrl'
//});
}]);
}]);
login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location, $rootScope, AUTH_EVENTS, LoginService, FormDiff) {
$scope.schema =
{
......@@ -49,9 +56,9 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location,
'emailNotValid': 'Email is not valid!'
},
$asyncValidators: {
emailNotValid: function(value){
emailNotValid: function (value) {
var deferred = $q.defer();
$timeout(function(){
$timeout(function () {
if (LoginService.isValidEmail(value)) {
deferred.resolve();
} else {
......@@ -73,9 +80,9 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location,
title: "Save"
}
];
$scope.onSubmit = function(form){
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid){
if (form.$valid) {
var credentials = {email: form.email.$modelValue, password: form.password.$modelValue};
LoginService.login(credentials);
}
......@@ -83,4 +90,4 @@ login.controller('LoginCtrl', function ($scope, $q, $timeout, $http, $location,
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";
......
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict';
// 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', [])
......
/**
* 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 () {
......
/**
* 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) {
config.set({
......@@ -34,10 +41,11 @@ module.exports = function (config) {
frameworks: ['jasmine'],
browsers: ['Chrome'],
browsers: ['Opera'],
plugins: [
'karma-chrome-launcher',
'karma-opera-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'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