Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
2f19f508
Commit
2f19f508
authored
Apr 15, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:zetaops/ulakbus-ui into develop
parents
e9ec4287
6a43ccd9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
143 additions
and
1 deletion
+143
-1
app_routes.js
app/app_routes.js
+5
-0
form_service_pg.html
app/components/uitemplates/form_service_pg.html
+6
-0
form_service_pg_test.js
app/components/uitemplates/form_service_pg_test.js
+85
-0
uitemplates.js
app/components/uitemplates/uitemplates.js
+47
-1
No files found.
app/app_routes.js
View file @
2f19f508
...
@@ -27,6 +27,10 @@ angular.module('ulakbus')
...
@@ -27,6 +27,10 @@ angular.module('ulakbus')
templateUrl
:
'components/uitemplates/base.html'
,
templateUrl
:
'components/uitemplates/base.html'
,
controller
:
'NewDesignsCtrl'
controller
:
'NewDesignsCtrl'
})
})
.
when
(
'/formservicepg'
,
{
templateUrl
:
'components/uitemplates/form_service_pg.html'
,
controller
:
'FormServicePg'
})
// use crud without selected user
// use crud without selected user
// important: regex urls must be defined later than static ones
// important: regex urls must be defined later than static ones
...
@@ -55,6 +59,7 @@ angular.module('ulakbus')
...
@@ -55,6 +59,7 @@ angular.module('ulakbus')
controller
:
'CRUDListFormController'
controller
:
'CRUDListFormController'
})
})
.
otherwise
({
redirectTo
:
'/dashboard'
});
.
otherwise
({
redirectTo
:
'/dashboard'
});
}])
}])
.
factory
(
'IsOnline'
,
function
()
{
.
factory
(
'IsOnline'
,
function
()
{
...
...
app/components/uitemplates/form_service_pg.html
0 → 100644
View file @
2f19f508
<div>
<select
ng-model=
"selection"
ng-options=
"forms.indexOf(form) as form.name for form in forms"
ng-change=
"selectform(selection)"
>
</select>
<form
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
></form>
</div>
\ No newline at end of file
app/components/uitemplates/form_service_pg_test.js
0 → 100644
View file @
2f19f508
/**
* @license Ulakbus-UI
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
describe
(
"FormServicePg"
,
function
(){
beforeEach
(
module
(
'ulakbus'
));
beforeEach
(
module
(
'ulakbus.uitemplates'
));
beforeEach
(
module
(
'ulakbus.formService'
));
var
$controller
;
beforeEach
(
inject
(
function
(
_$compile_
,
_$controller_
){
// The injector unwraps the underscores (_) from around the parameter names when matching
$compile
=
_$compile_
;
$controller
=
_$controller_
;
}));
describe
(
"Controller is loaded"
,
function
(){
expect
(
"FormServicePG"
).
toBeDefined
();
})
describe
(
'RESTURL'
,
function
(){
it
(
'is Loaded'
,
inject
(
function
(
RESTURL
){
expect
(
RESTURL
).
toBeDefined
();
})
);
})
describe
(
'Generator'
,
function
(){
it
(
'is Loaded'
,
inject
(
function
(
Generator
){
expect
(
Generator
).
toBeDefined
();
})
);
})
describe
(
"$scope.selectform"
,
function
()
{
it
(
"Generates schemaForm structures if $scope.forms parameters implemented properly."
,
inject
(
function
(
Generator
)
{
var
$scope
=
{};
var
controller
=
$controller
(
'FormServicePg'
,
{
$scope
:
$scope
,
Generator
:
Generator
});
$scope
.
forms
=
[
{
name
:
'Deneme Form 1'
,
form
:
[
'email'
,
'id'
,
'name'
],
schema
:
{
properties
:
{
email
:
{
title
:
'email'
,
type
:
'string'
},
id
:
{
title
:
'id'
,
type
:
'int'
},
name
:
{
title
:
'name'
,
type
:
'string'
}
},
required
:
[],
type
:
'object'
,
title
:
'servicetest'
},
model
:
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'travolta'
}
},
{
name
:
'Deneme Form 2'
,
form
:
[
'email'
,
'id'
,
'name'
],
schema
:
{
properties
:
{
email
:
{
title
:
'email'
,
type
:
'string'
},
id
:
{
title
:
'id'
,
type
:
'number'
},
name
:
{
title
:
'name'
,
type
:
'string'
}
},
required
:
[],
type
:
'object'
,
title
:
'servicetest'
},
model
:
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'cageman'
}
}
];
$scope
.
form_params
=
{};
$scope
.
selection
=
0
;
$scope
.
selectform
(
$scope
.
selection
);
expect
(
$scope
.
schema
.
properties
.
id
.
type
).
toEqual
(
'number'
);
})
)}
)
})
app/components/uitemplates/uitemplates.js
View file @
2f19f508
...
@@ -6,9 +6,55 @@
...
@@ -6,9 +6,55 @@
* (GPLv3). See LICENSE.txt for details.
* (GPLv3). See LICENSE.txt for details.
*/
*/
angular
.
module
(
'ulakbus.uitemplates'
,
[
'ngRoute'
])
angular
.
module
(
'ulakbus.uitemplates'
,
[
'ngRoute'
,
'schemaForm'
,
'ulakbus.formService'
])
.
controller
(
'NewDesignsCtrl'
,
function
(
$scope
)
{
.
controller
(
'NewDesignsCtrl'
,
function
(
$scope
)
{
$scope
.
items
=
[
'student'
,
'staff'
,
'academician'
];
$scope
.
items
=
[
'student'
,
'staff'
,
'academician'
];
$scope
.
selection
=
$scope
.
items
[
0
];
$scope
.
selection
=
$scope
.
items
[
0
];
})
/*
This controller is for testing new SchemaForm components. In addition, forms need to have the attribute:
"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
)
{
$scope
.
forms
=
[
{
name
:
'Deneme Form 1'
,
form
:
[
'email'
,
'id'
,
'name'
],
schema
:
{
properties
:
{
email
:
{
title
:
'email'
,
type
:
'string'
},
id
:
{
title
:
'id'
,
type
:
'number'
},
name
:
{
title
:
'name'
,
type
:
'string'
}
},
required
:
[],
type
:
'object'
,
title
:
'servicetest'
},
model
:
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'travolta'
}
},
{
name
:
'Deneme Form 2'
,
form
:
[
'email'
,
'id'
,
'name'
],
schema
:
{
properties
:
{
email
:
{
title
:
'email'
,
type
:
'string'
},
id
:
{
title
:
'id'
,
type
:
'number'
},
name
:
{
title
:
'name'
,
type
:
'string'
}
},
required
:
[],
type
:
'object'
,
title
:
'servicetest'
},
model
:
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'cageman'
}
}
];
$scope
.
form_params
=
{};
$scope
.
selection
=
0
;
$scope
.
selectform
=
function
(
index
)
{
var
form
=
$scope
.
forms
[
index
];
$scope
=
Generator
.
generate
(
$scope
,
{
forms
:
form
});
};
$scope
.
selectform
(
$scope
.
selection
);
});
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment