Commit f9984444 authored by Evren Kutar's avatar Evren Kutar

ADD refs GH-6 add docstring details

FIX rrefs #5044 refs zetaops/ulakbusGH-153 refs GH-75
parent 608cfdac
......@@ -22,7 +22,7 @@
<span ng-if="value.verbose_name">{{ value.verbose_name }}</span>
<span ng-if="!value.verbose_name">{{key}}</span>
</th>
<th ng-if="action!==False">İşlem</th>
<th ng-if="meta.allow_actions!==false">İşlem</th>
</tr>
</thead>
<tbody ng-class="{hidden: node.lengthModels < 1}">
......@@ -55,7 +55,7 @@
ng-model="node.model[outerIndex][k]"
ng-change="nodeModelChange(this)">
</td>
<td ng-if="action!==False">
<td ng-if="meta.allow_actions!==false">
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}">Düzenle
</button>
<br>
......
......@@ -192,7 +192,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -204,7 +204,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
......@@ -663,7 +663,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -684,9 +684,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -727,7 +727,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -836,8 +836,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -851,7 +851,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -902,9 +902,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -926,10 +926,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -951,8 +951,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -970,14 +970,40 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1039,11 +1065,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1091,9 +1117,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
......@@ -1212,11 +1238,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1292,6 +1318,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -508,7 +508,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @memberof ulakbus.formService
* @ngdoc function
* @name prepareFormItems
* @param scope {object} given scope on which form items prepared
* @param scope {Object} given scope on which form items prepared
* @description
* It looks up fields of schema objects and changes their types to proper type for schemaform.
* To prepare items for schemaform loop items of scope.schema.properties by checking index value's `type` key.
......@@ -520,7 +520,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* For listnode, node and model types it uses templates to generate modal. The modal is aa instance of
* ui.bootstraps modal directive.
*
* @returns scope {object}
* @returns scope {Object}
*/
generator.prepareFormItems = function (scope) {
angular.forEach(scope.form, function (value, key) {
......@@ -932,7 +932,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name dateformatter
* @description dateformatter handles all date fields and returns humanized and jquery datepicker format dates
* @param {object} formObject
* @param {Object} formObject
* @returns {*}
*/
generator.dateformatter = function (formObject) {
......@@ -953,9 +953,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* on same
* 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
* @param {object} $scope
* @param {Object} $scope
* @param {string} key
* @param {object} todo
* @param {Object} todo
* @param {string} mode
* @returns {*}
*/
......@@ -995,7 +995,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_form
* @description Communicates with api with given scope object.
* @param {object} scope
* @param {Object} scope
* @returns {*}
*/
generator.get_form = function (scope) {
......@@ -1097,13 +1097,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
/**
* @memberof ulakbus.formService
* @constructor
* @ngdoc function
* @name pathDecider
* @description pathDecider is used to redirect related path by looking up the data in response
* @param {string} client_cmd
* @param {object} $scope
* @param {object} data
* @param {Object} $scope
* @param {Object} data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
......@@ -1117,7 +1116,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @description redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data
* @param {object} scope
* @param {Object} scope
* @param {string} page
* @return {*}
*/
......@@ -1163,9 +1162,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff
* @description returns diff of the second param to first param
* @param {object} obj1
* @param {object} obj2
* @returns {{object}} diff object of two given objects
* @param {Object} obj1
* @param {Object} obj2
* @returns {Object} diff object of two given objects
*/
generator.get_diff = function (obj1, obj2) {
var result = {};
......@@ -1187,10 +1186,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name get_diff_array
* @description extracts items of second array from the first array
* @param {object} array1
* @param {object} array2
* @param {number} way
* @returns {Array}
* @param {Array} array1
* @param {Array} array2
* @param {Number} way
* @returns {Array} diff of arrays
*/
generator.get_diff_array = function (array1, array2, way) {
var result = [];
......@@ -1212,8 +1211,8 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name item_from_array
* @description gets item unicode name from titleMap
* @param {object} item
* @param {array} array
* @param {Object} item
* @param {Array} array
* @returns {*}
*/
generator.item_from_array = function (item, array) {
......@@ -1230,13 +1229,39 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc function
* @name submit
* @description Submit function is generic function for submiting forms.
* redirectTo param is used for redirect if return value will be evaluated in a new page.
* @param {object} $scope
* @param {object} redirectTo
* - redirectTo param is used for redirect if return value will be evaluated in a new page.
* - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
* - ListNode and Node objects get seperated from model in
* {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model
* key of scope first.
* - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
* - Other parameters we pass to backend API are shown in the example below
* ```
* var data = {
"form": $scope.model,
"token": $scope.token,
"model": $scope.form_params.model,
"cmd": $scope.form_params.cmd,
"flow": $scope.form_params.flow,
"object_id": $scope.object_id,
"filter": $scope.filter,
"query": $scope.form_params.query
};
* ```
* ### Special response object process
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object.
*
* @param {Object} $scope
* @param {Object} redirectTo
* @returns {*}
* @todo diff for all submits to recognize form change. if no change returns to view with no submit
*/
generator.submit = function ($scope, redirectTo) {
/**
* In case of unformatted date object in any key recursively, it must be converted.
* @param model
*/
var convertDate = function (model) {
angular.forEach(model, function (value, key) {
if (value && value.constructor === Date) {
......@@ -1295,11 +1320,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc controller
* @name ModalCtrl
* @description controller for listnode, node and linkedmodel modal and save data of it
* @param {object} items
* @param {object} $scope
* @param {object} $uibModalInstance
* @param {object} $route
* @returns returns value for modal
* @param {Object} items
* @param {Object} $scope
* @param {Object} $uibModalInstance
* @param {Object} $route
* @returns {Object} returns value for modal
*/
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
......@@ -1339,9 +1364,9 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalForNodes
* @description add modal directive for nodes
* @param {module} $uibModal
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('modalForNodes', function ($uibModal, Generator) {
return {
......@@ -1446,11 +1471,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name addModalForLinkedModel
* @description add modal directive for linked models
* @param {module} $uibModal
* @param {object} $rootScope
* @param {module} $route
* @param {service} Generator
* @returns openmodal directive
* @param {Module} $uibModal
* @param {Object} $rootScope
* @param {Module} $route
* @param {Service} Generator
* @returns {Object} openmodal directive
*/
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
......@@ -1524,6 +1549,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
* @ngdoc directive
* @name modalFormLocator
* @description This directive helps to locate form object in modal.
* @returns {Object} form object
*/
.directive('modalFormLocator', function () {
return {
......
......@@ -333,7 +333,7 @@
</h3>
<h1 class="title">
redirectTo
<a class="name-link signature-attributes" href="source/ulakbus.formService~pathDecider.redirectTo.html#line848">source</a>
<a class="name-link signature-attributes" href="source/ulakbus.formService~pathDecider.redirectTo.html#line847">source</a>
</h1>
<div id="main" class="big-container">
<!-- source code html -->
......@@ -359,7 +359,7 @@ otherwise redirected path will call api for its data</p>
<tr>
<td class="name" nowrap="">scope</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr><tr>
......
......@@ -333,7 +333,7 @@
</h3>
<h1 class="title">
ModalCtrl
<a class="name-link signature-attributes" href="source/ulakbus.formService.ModalCtrl.html#line1038">source</a>
<a class="name-link signature-attributes" href="source/ulakbus.formService.ModalCtrl.html#line1063">source</a>
</h1>
<div id="main" class="big-container">
<!-- source code html -->
......@@ -357,25 +357,25 @@
<tr>
<td class="name" nowrap="">items</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr><tr>
<td class="name" nowrap="">$scope</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr><tr>
<td class="name" nowrap="">$uibModalInstance</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr><tr>
<td class="name" nowrap="">$route</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr>
......
......@@ -333,7 +333,7 @@
</h3>
<h1 class="title">
addModalForLinkedModel
<a class="name-link signature-attributes" href="source/ulakbus.formService.addModalForLinkedModel.html#line1211">source</a>
<a class="name-link signature-attributes" href="source/ulakbus.formService.addModalForLinkedModel.html#line1236">source</a>
<a class="name-link signature-attributes" href="templates/shared_templates_filefield.html">template</a>
</h1>
<div id="main" class="big-container">
......@@ -358,25 +358,25 @@
<tr>
<td class="name" nowrap="">$uibModal</td>
<td class="type"><span class="param-type">
module
Module
</span></td>
<td class="description last"></td>
</tr><tr>
<td class="name" nowrap="">$rootScope</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr><tr>
<td class="name" nowrap="">$route</td>
<td class="type"><span class="param-type">
module
Module
</span></td>
<td class="description last"></td>
</tr><tr>
<td class="name" nowrap="">Generator</td>
<td class="type"><span class="param-type">
service
Service
</span></td>
<td class="description last"></td>
</tr>
......
......@@ -357,7 +357,7 @@
<tr>
<td class="name" nowrap="">formObject</td>
<td class="type"><span class="param-type">
object
Object
</span></td>
<td class="description last"></td>
</tr>
......
......@@ -333,7 +333,7 @@
</h3>
<h1 class="title">
dispatchClientCmd
<a class="name-link signature-attributes" href="source/ulakbus.formService.dispatchClientCmd.html#line878">source</a>
<a class="name-link signature-attributes" href="source/ulakbus.formService.dispatchClientCmd.html#line877">source</a>
</h1>
<div id="main" class="big-container">
<!-- source code html -->
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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