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
e521e671
Commit
e521e671
authored
May 02, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate dist
parent
c247db93
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
63 deletions
+53
-63
crud_controller.js
app/components/crud/crud_controller.js
+3
-0
form.html
app/components/crud/templates/form.html
+13
-1
nodeTable.html
app/components/crud/templates/nodeTable.html
+1
-1
foreignKey.html
app/shared/templates/foreignKey.html
+1
-1
form_service.js
app/zetalib/form_service.js
+15
-52
socket.js
app/zetalib/socket.js
+1
-1
app.js
dist/app.js
+3
-3
components.js
dist/bower_components/components.js
+1
-1
templates.js
dist/templates.js
+15
-3
No files found.
app/components/crud/crud_controller.js
View file @
e521e671
...
@@ -60,8 +60,11 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
...
@@ -60,8 +60,11 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
scope
.
form_params
=
{
scope
.
form_params
=
{
//cmd: cmd,
//cmd: cmd,
// model name in ulakbus
model
:
routeParams
.
model
,
model
:
routeParams
.
model
,
// generic value passing by backend. would be any of these: id, personel_id, etc.
param
:
scope
.
param
||
routeParams
.
param
,
param
:
scope
.
param
||
routeParams
.
param
,
// generic value passing by backend. would be the value of param
id
:
scope
.
param_id
||
routeParams
.
param_id
,
id
:
scope
.
param_id
||
routeParams
.
param_id
,
wf
:
routeParams
.
wf
,
wf
:
routeParams
.
wf
,
object_id
:
routeParams
.
key
,
object_id
:
routeParams
.
key
,
...
...
app/components/crud/templates/form.html
View file @
e521e671
...
@@ -2,7 +2,19 @@
...
@@ -2,7 +2,19 @@
<div
class=
"buttons-on-top"
></div>
<div
class=
"buttons-on-top"
></div>
<form
id=
"formgenerated"
name=
"formgenerated"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
<form
id=
"formgenerated"
name=
"formgenerated"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
ng-submit=
"onSubmit(formgenerated)"
form-locator
></form>
ng-submit=
"onSubmit(formgenerated)"
form-locator
>
<!--<div>-->
<!--<uib-tabset active="active">-->
<!--<uib-tab index="0" heading="Static title">-->
<!--<div ng-repeat="field in form">-->
<!--<em>before</em>-->
<!--<div sf-insert-field="[field]"></div>-->
<!--<em>after</em>-->
<!--</div>-->
<!--</uib-tab>-->
<!--</uib-tabset>-->
<!--</div>-->
</form>
<div
ng-repeat=
"node in Node"
>
<div
ng-repeat=
"node in Node"
>
<h3>
{{ node.title }}
<h3>
{{ node.title }}
...
...
app/components/crud/templates/nodeTable.html
View file @
e521e671
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<th
ng-repeat=
"(key,value) in node.items[0] track by $index"
<th
ng-repeat=
"(key,value) in node.items[0] track by $index"
ng-if=
"key!=='idx' && node.schema.properties[key]"
>
ng-if=
"key!=='idx' && node.schema.properties[key]"
>
<span
ng-if=
"value.verbose_name"
>
{{ value.verbose_name }}
</span>
<span
ng-if=
"value.verbose_name"
>
{{ value.verbose_name }}
</span>
<span
ng-if=
"!value.verbose_name"
>
{{key}}
</span>
<span
ng-if=
"!value.verbose_name"
>
{{
node.schema.properties[key]['title']||
key}}
</span>
</th>
</th>
<th
ng-if=
"meta.allow_actions!==false"
>
İşlem
</th>
<th
ng-if=
"meta.allow_actions!==false"
>
İşlem
</th>
</tr>
</tr>
...
...
app/shared/templates/foreignKey.html
View file @
e521e671
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
data-toggle=
"dropdown"
>
data-toggle=
"dropdown"
>
<span
class=
"caret"
></span>
<span
class=
"caret"
></span>
</button>
</button>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
ng-if=
"form.titleMap.length > 0"
>
<li
class=
"text-center"
ng-if=
"form.gettingTitleMap"
><a><span
class=
"loader"
></span></a></li>
<li
class=
"text-center"
ng-if=
"form.gettingTitleMap"
><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.name)"
>
{{item
<a
ng-click=
"form.onDropdownSelect(item, form.name)"
>
{{item
...
...
app/zetalib/form_service.js
View file @
e521e671
...
@@ -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
)
{
if
(
v
.
validation
===
false
||
!
v
.
form_validate
)
{
generator
.
submit
(
scope
,
redirectTo
);
generator
.
submit
(
scope
,
redirectTo
);
}
else
{
}
else
{
scope
.
$broadcast
(
'schemaFormValidate'
);
scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
scope
[
workOnForm
].
$valid
)
{
if
(
scope
[
workOnForm
].
$valid
||
!
v
.
form_validate
)
{
generator
.
submit
(
scope
,
redirectTo
);
generator
.
submit
(
scope
,
redirectTo
);
scope
.
$broadcast
(
'disposeModal'
);
scope
.
$broadcast
(
'disposeModal'
);
}
else
{
}
else
{
...
@@ -369,6 +369,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -369,6 +369,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
};
var
_numbers
=
function
(
scope
,
v
,
k
)
{
var
_numbers
=
function
(
scope
,
v
,
k
)
{
v
.
type
=
'number'
;
v
.
type
=
'number'
;
v
.
validationMessage
=
{
'max'
:
'bu alan -2147483647 ve 2147483647 arasında olmalıdır.'
}
v
.
$validators
=
{
max
:
function
(
value
){
return
2147483647
>
value
>-
2147483647
;
}
};
scope
.
model
[
k
]
=
parseInt
(
scope
.
model
[
k
]);
scope
.
model
[
k
]
=
parseInt
(
scope
.
model
[
k
]);
};
};
var
_node_default
=
function
(
scope
,
v
,
k
)
{
var
_node_default
=
function
(
scope
,
v
,
k
)
{
...
@@ -428,6 +434,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -428,6 +434,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
});
});
$timeout
(
function
()
{
$timeout
(
function
()
{
// todo: needs refactor
if
(
v
.
type
===
'ListNode'
)
{
if
(
v
.
type
===
'ListNode'
)
{
scope
[
v
.
type
][
k
].
items
=
angular
.
copy
(
scope
.
model
[
k
]
||
[]);
scope
[
v
.
type
][
k
].
items
=
angular
.
copy
(
scope
.
model
[
k
]
||
[]);
angular
.
forEach
(
scope
[
v
.
type
][
k
].
items
,
function
(
value
,
key
)
{
angular
.
forEach
(
scope
[
v
.
type
][
k
].
items
,
function
(
value
,
key
)
{
...
@@ -726,7 +733,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -726,7 +733,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
// todo: write a function to refresh titleMap after new item add to linkedModel
// todo: write a function to refresh titleMap after new item add to linkedModel
//});
//});
scope
.
generateTitleMap
=
function
(
modelScope
)
{
var
generateTitleMap
=
function
(
modelScope
)
{
return
generator
.
get_list
(
modelScope
).
then
(
function
(
res
)
{
return
generator
.
get_list
(
modelScope
).
then
(
function
(
res
)
{
formitem
.
titleMap
=
[];
formitem
.
titleMap
=
[];
angular
.
forEach
(
res
.
objects
,
function
(
item
)
{
angular
.
forEach
(
res
.
objects
,
function
(
item
)
{
...
@@ -772,12 +779,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -772,12 +779,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
},
},
getTitleMap
:
function
(
viewValue
)
{
getTitleMap
:
function
(
viewValue
)
{
modelScope
.
form_params
.
query
=
viewValue
;
modelScope
.
form_params
.
query
=
viewValue
;
return
scope
.
generateTitleMap
(
modelScope
);
return
generateTitleMap
(
modelScope
);
},
},
getDropdownTitleMap
:
function
()
{
getDropdownTitleMap
:
function
()
{
delete
modelScope
.
form_params
.
query
;
delete
modelScope
.
form_params
.
query
;
formitem
.
gettingTitleMap
=
true
;
formitem
.
gettingTitleMap
=
true
;
scope
.
generateTitleMap
(
modelScope
)
generateTitleMap
(
modelScope
)
.
then
(
function
(
data
)
{
.
then
(
function
(
data
)
{
formitem
.
titleMap
=
data
;
formitem
.
titleMap
=
data
;
formitem
.
gettingTitleMap
=
false
;
formitem
.
gettingTitleMap
=
false
;
...
@@ -850,7 +857,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -850,7 +857,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
generate_fields
[
v
.
type
][
v
.
widget
||
'default'
](
scope
,
v
,
k
);
generate_fields
[
v
.
type
][
v
.
widget
||
'default'
](
scope
,
v
,
k
);
}
}
catch
(
e
)
{
catch
(
e
)
{
// raise not implemented
//
todo:
raise not implemented
console
.
log
(
v
.
type
)
console
.
log
(
v
.
type
)
}
}
});
});
...
@@ -930,6 +937,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -930,6 +937,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description Changes html disabled and enabled attributes of all buttons on current page.
* @description Changes html disabled and enabled attributes of all buttons on current page.
* @param {boolean} position
* @param {boolean} position
*/
*/
// todo: remove
generator
.
button_switch
=
function
(
position
)
{
generator
.
button_switch
=
function
(
position
)
{
var
buttons
=
angular
.
element
(
document
.
querySelectorAll
(
'button'
));
var
buttons
=
angular
.
element
(
document
.
querySelectorAll
(
'button'
));
var
positions
=
{
true
:
"enabled"
,
false
:
"disabled"
};
var
positions
=
{
true
:
"enabled"
,
false
:
"disabled"
};
...
@@ -957,12 +965,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -957,12 +965,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
generator
.
get_form
(
scope
);
generator
.
get_form
(
scope
);
},
500
);
},
500
);
}
}
//return $http
// .post(generator.makeUrl(scope), scope.form_params)
// .then(function (res) {
// //generator.button_switch(true);
// return generator.generate(scope, res.data);
// });
};
};
/**
/**
* @memberof ulakbus.formService
* @memberof ulakbus.formService
...
@@ -973,12 +975,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -973,12 +975,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @returns {*}
* @returns {*}
*/
*/
generator
.
get_list
=
function
(
scope
)
{
generator
.
get_list
=
function
(
scope
)
{
//return $http
// .post(generator.makeUrl(scope), scope.form_params)
// .then(function (res) {
// //generator.button_switch(true);
// return res;
// });
if
(
$rootScope
.
websocketIsOpen
===
true
)
{
if
(
$rootScope
.
websocketIsOpen
===
true
)
{
return
WSOps
.
request
(
scope
.
form_params
)
return
WSOps
.
request
(
scope
.
form_params
)
...
@@ -1001,6 +997,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -1001,6 +997,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @returns {*}
* @returns {*}
*/
*/
generator
.
get_wf
=
function
(
scope
)
{
generator
.
get_wf
=
function
(
scope
)
{
// todo: remove this condition
if
(
$rootScope
.
websocketIsOpen
===
true
)
{
if
(
$rootScope
.
websocketIsOpen
===
true
)
{
WSOps
.
request
(
scope
.
form_params
)
WSOps
.
request
(
scope
.
form_params
)
.
then
(
function
(
data
)
{
.
then
(
function
(
data
)
{
...
@@ -1012,13 +1009,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -1012,13 +1009,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
generator
.
get_wf
(
scope
);
generator
.
get_wf
(
scope
);
},
500
);
},
500
);
}
}
//return $http
// .post(generator.makeUrl(scope), scope.form_params)
// .then(function (res) {
// return generator.pathDecider(res.data.client_cmd, scope, res.data);
// });
};
};
/**
/**
* @memberof ulakbus.formService
* @memberof ulakbus.formService
...
@@ -1258,33 +1248,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -1258,33 +1248,6 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
generator
.
scope
(
$scope
,
redirectTo
);
generator
.
scope
(
$scope
,
redirectTo
);
},
500
);
},
500
);
}
}
//return $http.post(generator.makeUrl($scope), data)
// .success(function (data, status, headers) {
// if (headers('content-type') === "application/pdf") {
// var a = document.createElement("a");
// document.body.appendChild(a);
// a.style = "display: none";
// var file = new Blob([data], {type: 'application/pdf'});
// var fileURL = URL.createObjectURL(file);
// var fileName = $scope.schema.title;
// a.href = fileURL;
// a.download = fileName;
// a.click();
// }
// if (redirectTo === true) {
// if (data.client_cmd) {
// generator.pathDecider(data.client_cmd, $scope, data);
// }
// if (data.msgbox) {
// $scope.msgbox = data.msgbox;
// var newElement = $compile("<msgbox></msgbox>")($scope);
// // this is the default action, which is removing page items and reload page with msgbox
// angular.element(document.querySelector('.main.ng-scope')).children().remove();
// angular.element(document.querySelector('.main.ng-scope')).append(newElement);
// }
// }
// });
};
};
return
generator
;
return
generator
;
})
})
...
...
app/zetalib/socket.js
View file @
e521e671
...
@@ -102,7 +102,7 @@ angular.module('ulakbus')
...
@@ -102,7 +102,7 @@ angular.module('ulakbus')
};
};
wsOps
.
onClose
=
function
(
event
)
{
wsOps
.
onClose
=
function
(
event
)
{
$rootScope
.
websocketIsOpen
=
false
;
$rootScope
.
websocketIsOpen
=
false
;
$log
.
info
(
"DISCONNE
D
TED"
,
event
);
$log
.
info
(
"DISCONNE
C
TED"
,
event
);
};
};
// two types of data can be come from websocket: with and without callback
// two types of data can be come from websocket: with and without callback
// if callback in callbacks list it will run the callback and delete it
// if callback in callbacks list it will run the callback and delete it
...
...
dist/app.js
View file @
e521e671
This source diff could not be displayed because it is too large. You can
view the blob
instead.
dist/bower_components/components.js
View file @
e521e671
This diff is collapsed.
Click to expand it.
dist/templates.js
View file @
e521e671
...
@@ -182,7 +182,19 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache",
...
@@ -182,7 +182,19 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache",
" <div class=
\"
buttons-on-top
\"
></div>
\n
"
+
" <div class=
\"
buttons-on-top
\"
></div>
\n
"
+
"
\n
"
+
"
\n
"
+
" <form id=
\"
formgenerated
\"
name=
\"
formgenerated
\"
sf-schema=
\"
schema
\"
sf-form=
\"
form
\"
sf-model=
\"
model
\"\n
"
+
" <form id=
\"
formgenerated
\"
name=
\"
formgenerated
\"
sf-schema=
\"
schema
\"
sf-form=
\"
form
\"
sf-model=
\"
model
\"\n
"
+
" ng-submit=
\"
onSubmit(formgenerated)
\"
form-locator></form>
\n
"
+
" ng-submit=
\"
onSubmit(formgenerated)
\"
form-locator>
\n
"
+
" <!--<div>-->
\n
"
+
" <!--<uib-tabset active=
\"
active
\"
>-->
\n
"
+
" <!--<uib-tab index=
\"
0
\"
heading=
\"
Static title
\"
>-->
\n
"
+
" <!--<div ng-repeat=
\"
field in form
\"
>-->
\n
"
+
" <!--<em>before</em>-->
\n
"
+
" <!--<div sf-insert-field=
\"
[field]
\"
></div>-->
\n
"
+
" <!--<em>after</em>-->
\n
"
+
" <!--</div>-->
\n
"
+
" <!--</uib-tab>-->
\n
"
+
" <!--</uib-tabset>-->
\n
"
+
" <!--</div>-->
\n
"
+
" </form>
\n
"
+
"
\n
"
+
"
\n
"
+
" <div ng-repeat=
\"
node in Node
\"
>
\n
"
+
" <div ng-repeat=
\"
node in Node
\"
>
\n
"
+
" <h3>{{ node.title }}
\n
"
+
" <h3>{{ node.title }}
\n
"
+
...
@@ -367,7 +379,7 @@ angular.module("components/crud/templates/nodeTable.html", []).run(["$templateCa
...
@@ -367,7 +379,7 @@ angular.module("components/crud/templates/nodeTable.html", []).run(["$templateCa
" <th ng-repeat=
\"
(key,value) in node.items[0] track by $index
\"\n
"
+
" <th ng-repeat=
\"
(key,value) in node.items[0] track by $index
\"\n
"
+
" ng-if=
\"
key!=='idx' && node.schema.properties[key]
\"
>
\n
"
+
" ng-if=
\"
key!=='idx' && node.schema.properties[key]
\"
>
\n
"
+
" <span ng-if=
\"
value.verbose_name
\"
>{{ value.verbose_name }}</span>
\n
"
+
" <span ng-if=
\"
value.verbose_name
\"
>{{ value.verbose_name }}</span>
\n
"
+
" <span ng-if=
\"
!value.verbose_name
\"
>{{key}}</span>
\n
"
+
" <span ng-if=
\"
!value.verbose_name
\"
>{{
node.schema.properties[key]['title']||
key}}</span>
\n
"
+
" </th>
\n
"
+
" </th>
\n
"
+
" <th ng-if=
\"
meta.allow_actions!==false
\"
>İşlem</th>
\n
"
+
" <th ng-if=
\"
meta.allow_actions!==false
\"
>İşlem</th>
\n
"
+
" </tr>
\n
"
+
" </tr>
\n
"
+
...
@@ -2737,7 +2749,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
...
@@ -2737,7 +2749,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" data-toggle=
\"
dropdown
\"
>
\n
"
+
" data-toggle=
\"
dropdown
\"
>
\n
"
+
" <span class=
\"
caret
\"
></span>
\n
"
+
" <span class=
\"
caret
\"
></span>
\n
"
+
" </button>
\n
"
+
" </button>
\n
"
+
" <ul class=
\"
dropdown-menu
\"
>
\n
"
+
" <ul class=
\"
dropdown-menu
\"
ng-if=
\"
form.titleMap.length > 0
\"
>
\n
"
+
" <li class=
\"
text-center
\"
ng-if=
\"
form.gettingTitleMap
\"
><a><span class=
\"
loader
\"
></span></a></li>
\n
"
+
" <li class=
\"
text-center
\"
ng-if=
\"
form.gettingTitleMap
\"
><a><span class=
\"
loader
\"
></span></a></li>
\n
"
+
" <li ng-repeat=
\"
item in form.titleMap
\"
>
\n
"
+
" <li ng-repeat=
\"
item in form.titleMap
\"
>
\n
"
+
" <a ng-click=
\"
form.onDropdownSelect(item, form.name)
\"
>{{item
\n
"
+
" <a ng-click=
\"
form.onDropdownSelect(item, form.name)
\"
>{{item
\n
"
+
...
...
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