Commit 57ad6e98 authored by bahadircyildiz's avatar bahadircyildiz

Merge branch 'feature/5303' into develop

parents 6338143e 57b6d13c
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* (GPLv3). See LICENSE.txt for details. * (GPLv3). See LICENSE.txt for details.
*/ */
angular.module('ulakbus.uitemplates', ['ngRoute', 'schemaForm', 'ulakbus.formService']) var app=angular.module('ulakbus.uitemplates', ['ngRoute', 'ulakbus.formService']);
.controller('NewDesignsCtrl', function ($scope) { app.controller('NewDesignsCtrl', function ($scope) {
$scope.items = ['student', 'staff', 'academician']; $scope.items = ['student', 'staff', 'academician'];
$scope.selection = $scope.items[0]; $scope.selection = $scope.items[0];
}) })
...@@ -18,17 +18,19 @@ angular.module('ulakbus.uitemplates', ['ngRoute', 'schemaForm', 'ulakbus.formSer ...@@ -18,17 +18,19 @@ angular.module('ulakbus.uitemplates', ['ngRoute', 'schemaForm', 'ulakbus.formSer
"name" for defining the name shown in dropdown box. Paste the JSON of form as a member of $scope.forms. "name" for defining the name shown in dropdown box. Paste the JSON of form as a member of $scope.forms.
*/ */
.controller('FormServicePg', function ($scope, Generator) { app.controller('FormServicePg', function ($scope, Generator) {
$scope.forms = [ $scope.forms = [
{ {
name: 'Deneme Form 1', name: 'Deneme Form 1',
form: ['email', 'id', 'name'], form: ['email', 'id', 'name', 'novalid'],
schema: { schema: {
properties: { properties: {
email: {title: 'email', type: 'string'}, email: {title: 'email', type: 'string'},
id: {title: 'id', type: 'number'}, id: {title: 'id', type: 'number'},
name: {title: 'name', type: 'string'} name: {title: 'name', type: 'string'},
}, required: [], type: 'object', title: 'servicetest' novalid: { type: "button", cmd:"list_user2", title: "submit without validation", form_validate: false }
}, required: ["email", "id", "name"], type: 'object', title: 'servicetest'
}, },
model: { model: {
email: 'test@test.com', id: 2, name: 'travolta' email: 'test@test.com', id: 2, name: 'travolta'
...@@ -36,12 +38,7 @@ angular.module('ulakbus.uitemplates', ['ngRoute', 'schemaForm', 'ulakbus.formSer ...@@ -36,12 +38,7 @@ angular.module('ulakbus.uitemplates', ['ngRoute', 'schemaForm', 'ulakbus.formSer
}, },
{ {
name: 'Deneme Form 2', name: 'Deneme Form 2',
form: ['email', 'id', 'name', form: ['email', 'id', 'name'],
{ type:'button', title:'DickButt1DickButt1DickButt1' },
{ type:'button', title:'DickButt2DickButt2DickButt2' },
{ type:'button', title:'DickButt3DickButt3DickButt3' },
],
schema: { schema: {
properties: { properties: {
email: {title: 'email', type: 'string'}, email: {title: 'email', type: 'string'},
......
...@@ -333,11 +333,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap']) ...@@ -333,11 +333,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
if (scope.modalElements) { if (scope.modalElements) {
scope.submitModalForm(); scope.submitModalForm();
} else { } else {
if (v.validation === false || !v.form_validate) { if (!v.form_validate && angular.isDefined(v.form_validate)) {
generator.submit(scope, redirectTo); generator.submit(scope, redirectTo);
} else { } else {
scope.$broadcast('schemaFormValidate'); scope.$broadcast('schemaFormValidate');
if (scope[workOnForm].$valid || !v.form_validate) { if (scope[workOnForm].$valid) {
generator.submit(scope, redirectTo); generator.submit(scope, redirectTo);
scope.$broadcast('disposeModal'); scope.$broadcast('disposeModal');
} else { } else {
......
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