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
7694ca14
Commit
7694ca14
authored
Nov 24, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reload and reset commands first implementation
parent
4360b1a5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
+32
-10
crud_controller.js
app/components/crud/crud_controller.js
+22
-0
form_service.js
app/zetalib/form_service.js
+7
-7
app.js
dist/app.js
+2
-2
components.js
dist/bower_components/components.js
+1
-1
No files found.
app/components/crud/crud_controller.js
View file @
7694ca14
...
...
@@ -81,7 +81,13 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
})
/**
* @name CRUDCtrl
* @description
* CRUDCtrl controller is base controller for crud module to redirect to related controller
* This controller play an empty role for api calls.
* With response data, location path change to related controller
*
* @returns {object}
*/
.
controller
(
'CRUDCtrl'
,
function
(
$scope
,
$routeParams
,
Generator
,
CrudUtility
)
{
// get required params by calling CrudUtility.generateParam function
...
...
@@ -97,6 +103,12 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
* client_cmd can be in ['show', 'list', 'form', 'reload', 'refresh']
* There are 3 directives to manipulate controllers scope objects in crud.html
*
* The controller works in 2 ways, with and without pageData.
* If pageData has set, using Generator's getPageData() function, sets its scope items. After getting pageData
* pageData must be set to `{pageData: false}` for clear scope of next job.
*
* If pageData has not set using Generator's get_wf() function gets scope items from api call.
*
* @returns {object}
*/
.
controller
(
'CRUDListFormCtrl'
,
function
(
$scope
,
$rootScope
,
$location
,
$http
,
$log
,
$modal
,
$timeout
,
Generator
,
$routeParams
,
CrudUtility
)
{
...
...
@@ -184,6 +196,16 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
//}
}
if
(
$routeParams
.
cmd
===
'reload'
)
{
$scope
.
cmd
=
'reload'
;
Generator
.
get_wf
(
$scope
);
}
if
(
$routeParams
.
cmd
===
'reset'
)
{
delete
$scope
.
token
;
$scope
.
cmd
=
'reset'
;
Generator
.
get_wf
(
$scope
);
}
})
.
directive
(
'crudListDirective'
,
function
()
{
...
...
app/zetalib/form_service.js
View file @
7694ca14
...
...
@@ -99,13 +99,13 @@ angular.module('formService', [])
*/
// todo: remove after backend fix
angular
.
forEach
(
scope
.
form
,
function
(
value
,
key
)
{
if
(
value
.
type
===
'select'
)
{
scope
.
schema
.
properties
[
value
.
key
].
type
=
'select'
;
scope
.
schema
.
properties
[
value
.
key
].
titleMap
=
value
.
titleMap
;
scope
.
form
[
key
]
=
value
.
key
;
}
});
//
angular.forEach(scope.form, function (value, key) {
//
if (value.type === 'select') {
//
scope.schema.properties[value.key].type = 'select';
//
scope.schema.properties[value.key].titleMap = value.titleMap;
//
scope.form[key] = value.key;
//
}
//
});
angular
.
forEach
(
scope
.
schema
.
properties
,
function
(
v
,
k
)
{
...
...
dist/app.js
View file @
7694ca14
This diff is collapsed.
Click to expand it.
dist/bower_components/components.js
View file @
7694ca14
This diff is collapsed.
Click to expand it.
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