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
73d325c1
Commit
73d325c1
authored
Dec 14, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/issue66'
parents
f2347c37
8fe86eb6
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
181 additions
and
108 deletions
+181
-108
auth_controller.js
app/components/auth/auth_controller.js
+5
-0
login.html
app/components/auth/login.html
+1
-2
crud_controller.js
app/components/crud/crud_controller.js
+2
-4
list.html
app/components/crud/templates/list.html
+2
-2
foreignKey.html
app/shared/templates/foreignKey.html
+2
-1
form_service.js
app/zetalib/form_service.js
+13
-1
form_service_test.js
app/zetalib/form_service_test.js
+40
-0
app.js
dist/app.js
+3
-3
components.js
dist/bower_components/components.js
+1
-1
app.css
dist/css/app.css
+23
-2
templates.js
dist/templates.js
+89
-92
No files found.
app/components/auth/auth_controller.js
View file @
73d325c1
...
@@ -20,14 +20,19 @@ auth.controller('LoginCtrl', function ($scope, $q, $timeout, $routeParams, $root
...
@@ -20,14 +20,19 @@ auth.controller('LoginCtrl', function ($scope, $q, $timeout, $routeParams, $root
{
type
:
'submit'
,
title
:
'Giriş Yap'
}
{
type
:
'submit'
,
title
:
'Giriş Yap'
}
];
];
});
});
$scope
.
loggingIn
=
false
;
$scope
.
onSubmit
=
function
(
form
)
{
$scope
.
onSubmit
=
function
(
form
)
{
$scope
.
$broadcast
(
'schemaFormValidate'
);
$scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
form
.
$valid
)
{
if
(
form
.
$valid
)
{
$scope
.
loggingIn
=
true
;
$rootScope
.
loginAttempt
=
1
;
$rootScope
.
loginAttempt
=
1
;
LoginService
.
login
(
$scope
.
url
,
$scope
.
model
)
LoginService
.
login
(
$scope
.
url
,
$scope
.
model
)
.
error
(
function
(
data
){
.
error
(
function
(
data
){
$scope
.
message
=
data
.
title
;
$scope
.
message
=
data
.
title
;
})
})
.
then
(
function
()
{
$scope
.
loggingIn
=
false
;
})
}
}
else
{
else
{
$log
.
debug
(
"not valid"
);
$log
.
debug
(
"not valid"
);
...
...
app/components/auth/login.html
View file @
73d325c1
<loaderdiv><div></div></loaderdiv>
<div
ng-app=
"ulakbus.auth"
class=
"container"
>
<div
ng-app=
"ulakbus.auth"
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-md-offset-4"
>
<div
class=
"col-md-4 col-md-offset-4"
>
<div
class=
"login-panel panel panel-default"
>
<div
class=
"login-panel panel panel-default"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
Giriş Yap
</h3>
<h3
class=
"panel-title"
>
Giriş Yap
<span
ng-if=
"loggingIn"
class=
"loader pull-right"
></span>
</h3>
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<span
class=
"label label-warning"
>
{{message}}
</span>
<span
class=
"label label-warning"
>
{{message}}
</span>
...
...
app/components/crud/crud_controller.js
View file @
73d325c1
...
@@ -172,16 +172,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
...
@@ -172,16 +172,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}
}
};
};
$scope
.
do_action
=
function
(
key
,
cmd
,
mode
)
{
$scope
.
do_action
=
function
(
key
,
todo
)
{
Generator
.
doItemAction
(
$scope
,
key
,
cmd
,
mode
||
'normal'
);
Generator
.
doItemAction
(
$scope
,
key
,
todo
.
cmd
,
todo
.
wf
,
todo
.
mode
||
'normal'
);
};
};
$scope
.
getNumber
=
function
(
num
)
{
$scope
.
getNumber
=
function
(
num
)
{
return
new
Array
(
num
);
return
new
Array
(
num
);
};
};
;
//
//
$scope
.
showCmd
=
function
()
{
$scope
.
showCmd
=
function
()
{
CrudUtility
.
generateParam
(
$scope
,
$routeParams
,
$routeParams
.
cmd
);
CrudUtility
.
generateParam
(
$scope
,
$routeParams
,
$routeParams
.
cmd
);
...
...
app/components/crud/templates/list.html
View file @
73d325c1
...
@@ -34,14 +34,14 @@
...
@@ -34,14 +34,14 @@
<td
ng-repeat=
"field in object.fields track by $index"
>
<td
ng-repeat=
"field in object.fields track by $index"
>
<a
role=
"button"
ng-if=
"field.type==='link'"
<a
role=
"button"
ng-if=
"field.type==='link'"
ng-click=
"do_action(object.key, field
.cmd, field.mode
)"
>
{{field.content}}
</a>
ng-click=
"do_action(object.key, field)"
>
{{field.content}}
</a>
<span
ng-if=
"field.type==='str'"
>
{{field.content}}
</span>
<span
ng-if=
"field.type==='str'"
>
{{field.content}}
</span>
</td>
</td>
<td>
<td>
<button
class=
"btn btn-info"
style=
"margin-right: 5px;"
ng-repeat=
"action in object.actions"
<button
class=
"btn btn-info"
style=
"margin-right: 5px;"
ng-repeat=
"action in object.actions"
ng-if=
"action.show_as==='button'"
ng-if=
"action.show_as==='button'"
ng-click=
"do_action(object.key, action
.cmd, action.mode
)"
>
{{action
ng-click=
"do_action(object.key, action)"
>
{{action
.name}}
.name}}
</button>
</button>
<br>
<br>
...
...
app/shared/templates/foreignKey.html
View file @
73d325c1
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<span
class=
"caret"
></span>
<span
class=
"caret"
></span>
</button>
</button>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
<li
class=
"text-center"
><a><span
class=
"loader"
></span></a></li>
<li
ng-repeat=
"item in form.titleMap"
>
<li
ng-repeat=
"item in form.titleMap"
>
<a
ng-click=
"form.onDropdownSelect(item, form.model_name)"
>
{{item
<a
ng-click=
"form.onDropdownSelect(item, form.model_name)"
>
{{item
.name}}
</a>
.name}}
</a>
...
@@ -20,7 +21,7 @@
...
@@ -20,7 +21,7 @@
</span>
</span>
<input
type=
"text"
<input
type=
"text"
ng-model=
"$$value$$"
ng-model=
"$$value$$"
uib-typeahead=
"item as item.name for item in form.
titleMap
| filter:{name:$viewValue}"
uib-typeahead=
"item as item.name for item in form.
getTitleMap($viewValue)
| filter:{name:$viewValue}"
typeahead-on-select=
"form.onSelect($item)"
typeahead-on-select=
"form.onSelect($item)"
placeholder=
"{{form.title}}"
placeholder=
"{{form.title}}"
ng-model-options=
"form.ngModelOptions"
ng-model-options=
"form.ngModelOptions"
...
...
app/zetalib/form_service.js
View file @
73d325c1
...
@@ -150,6 +150,10 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -150,6 +150,10 @@ angular.module('formService', ['ui.bootstrap'])
if
(
v
.
flow
)
{
if
(
v
.
flow
)
{
scope
.
form_params
[
"flow"
]
=
v
.
flow
;
scope
.
form_params
[
"flow"
]
=
v
.
flow
;
}
}
if
(
v
.
wf
)
{
delete
scope
.
form_params
[
"cmd"
];
scope
.
form_params
[
"wf"
]
=
v
.
wf
;
}
scope
.
model
[
k
]
=
1
;
scope
.
model
[
k
]
=
1
;
// todo: test it
// todo: test it
if
(
scope
.
modalElements
)
{
if
(
scope
.
modalElements
)
{
...
@@ -484,7 +488,7 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -484,7 +488,7 @@ angular.module('formService', ['ui.bootstrap'])
return
newdatearray
.
join
(
'.'
);
return
newdatearray
.
join
(
'.'
);
}
}
};
};
generator
.
doItemAction
=
function
(
$scope
,
key
,
cmd
,
mode
)
{
generator
.
doItemAction
=
function
(
$scope
,
key
,
cmd
,
wf
,
mode
)
{
// mode could be in ['normal', 'modal', 'new'] . the default mode is 'normal' and it loads data on same
// mode could be in ['normal', 'modal', 'new'] . the default mode is 'normal' and it loads data on same
// tab without modal. 'modal' will use modal to manipulate data and do all actions in that modal. 'new'
// tab without modal. 'modal' will use modal to manipulate data and do all actions in that modal. 'new'
// will be open new page with response data
// will be open new page with response data
...
@@ -492,10 +496,18 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -492,10 +496,18 @@ angular.module('formService', ['ui.bootstrap'])
normal
:
function
()
{
normal
:
function
()
{
$log
.
debug
(
'normal mode starts'
);
$log
.
debug
(
'normal mode starts'
);
$scope
.
form_params
.
cmd
=
cmd
;
$scope
.
form_params
.
cmd
=
cmd
;
if
(
wf
)
{
$scope
.
url
=
wf
;
$scope
.
form_params
.
wf
=
wf
;
delete
$scope
.
token
;
delete
$scope
.
form_params
.
model
;
delete
$scope
.
form_params
.
cmd
}
$scope
.
form_params
.
object_id
=
key
;
$scope
.
form_params
.
object_id
=
key
;
$scope
.
form_params
.
param
=
$scope
.
param
;
$scope
.
form_params
.
param
=
$scope
.
param
;
$scope
.
form_params
.
id
=
$scope
.
param_id
;
$scope
.
form_params
.
id
=
$scope
.
param_id
;
$scope
.
form_params
.
token
=
$scope
.
token
;
$scope
.
form_params
.
token
=
$scope
.
token
;
return
generator
.
get_wf
(
$scope
);
return
generator
.
get_wf
(
$scope
);
},
},
modal
:
function
()
{
modal
:
function
()
{
...
...
app/zetalib/form_service_test.js
View file @
73d325c1
...
@@ -386,6 +386,46 @@ describe('form service module', function () {
...
@@ -386,6 +386,46 @@ describe('form service module', function () {
})
})
);
);
it
(
'doItemAction should do given action'
,
inject
(
function
(
Generator
,
$httpBackend
,
RESTURL
)
{
$httpBackend
.
expectPOST
(
RESTURL
.
url
+
'otherwf'
)
.
respond
(
200
,
{
"client_cmd"
:
"form"
,
"object"
:
{
"ad"
:
"name"
,
"soyad"
:
"lastname"
,},
forms
:
{
schema
:
{
type
:
"object"
,
properties
:
{
name
:
{
type
:
"string"
,
minLength
:
2
,
title
:
"Name"
,
description
:
"Name or alias"
},
title
:
{
type
:
"string"
,
title
:
"title"
}
}
},
form
:
[
"*"
],
model
:
{}
},
"msgbox"
:
"test message"
,
"token"
:
"da73993f439549e7855fd82deafbbc99"
,
"is_login"
:
true
});
//scope.url = 'test';
scope
.
form_params
=
{
param
:
'test'
,
id
:
'xyz123'
,
model
:
'testModel'
,
object_id
:
'xxx11'
,
wf
:
'testModel'
};
scope
.
url
=
'test'
;
Generator
.
doItemAction
(
scope
,
'testkey123'
,
'list'
,
'otherwf'
,
'normal'
);
$httpBackend
.
flush
();
expect
(
location
.
path
()).
toEqual
(
'/otherwf/do/f'
);
})
);
it
(
'should return diff object'
,
it
(
'should return diff object'
,
inject
(
function
(
Generator
)
{
inject
(
function
(
Generator
)
{
expect
(
Generator
.
get_diff
).
not
.
toBe
(
null
);
expect
(
Generator
.
get_diff
).
not
.
toBe
(
null
);
...
...
dist/app.js
View file @
73d325c1
This diff is collapsed.
Click to expand it.
dist/bower_components/components.js
View file @
73d325c1
This diff is collapsed.
Click to expand it.
dist/css/app.css
View file @
73d325c1
...
@@ -87,6 +87,23 @@ a:hover {
...
@@ -87,6 +87,23 @@ a:hover {
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
.buttons-on-bottom
{
float
:
left
;
}
.filter-inner
{
background-color
:
#fff
;
padding
:
15px
;
margin-top
:
104px
;
border
:
1px
solid
#E6E6E6
;
}
.filter-inner
h4
{
font-family
:
'robotobold'
;
color
:
#333
;
letter-spacing
:
0.5px
;
}
/** BRAND **/
/** BRAND **/
.brand-bg
{
.brand-bg
{
...
@@ -570,6 +587,7 @@ select {
...
@@ -570,6 +587,7 @@ select {
margin
:
10px
auto
;
margin
:
10px
auto
;
float
:
left
;
float
:
left
;
margin-right
:
10px
;
margin-right
:
10px
;
border
:
1px
solid
#E4E4E4
;
}
}
.sidebar-person-info
.identity
p
.identity-name
{
.sidebar-person-info
.identity
p
.identity-name
{
...
@@ -1476,7 +1494,6 @@ table.dataTable thead .sorting:after {
...
@@ -1476,7 +1494,6 @@ table.dataTable thead .sorting:after {
padding
:
15px
;
padding
:
15px
;
width
:
100%
;
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
background
:
whitesmoke
;
}
}
footer
span
{
footer
span
{
...
@@ -1565,6 +1582,10 @@ table.dataTable thead .sorting:after {
...
@@ -1565,6 +1582,10 @@ table.dataTable thead .sorting:after {
}
}
@media
(
max-width
:
1000px
)
{
@media
(
max-width
:
1000px
)
{
.personnel-info-container
{
.personnel-info-container
{
width
:
500px
;
width
:
500px
;
...
@@ -1612,7 +1633,7 @@ table.dataTable thead .sorting:after {
...
@@ -1612,7 +1633,7 @@ table.dataTable thead .sorting:after {
.tablescroll
{
.tablescroll
{
width
:
100%
;
width
:
100%
;
overflow-x
:
scroll
;
overflow-x
:
auto
;
overflow-y
:
visible
;
overflow-y
:
visible
;
padding-bottom
:
1px
;
padding-bottom
:
1px
;
}
}
...
...
dist/templates.js
View file @
73d325c1
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