Commit 73d325c1 authored by Evren Kutar's avatar Evren Kutar

Merge branch 'Feature/issue66'

parents f2347c37 8fe86eb6
...@@ -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");
......
<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>
......
...@@ -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);
......
...@@ -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>
......
...@@ -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"
......
...@@ -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 () {
......
...@@ -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);
......
This diff is collapsed.
This diff is collapsed.
...@@ -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;
} }
......
This diff is collapsed.
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