diff options
author | jz385p <jegadeesh.babu@att.com> | 2020-07-21 13:57:46 +0530 |
---|---|---|
committer | Jegadeesh Babu <jegadeesh.babu@att.com> | 2020-07-21 16:55:30 +0000 |
commit | 382c506e61f11d9ebf41d2c90fc7794a3bb71900 (patch) | |
tree | 3b503e8f8b09ffb3f9807b930d4b1facf63c1813 /ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers | |
parent | 5b557b51c6e41315ad48727340df8d3247154330 (diff) |
removed AngularJS project from Portal SDK
removed AngularJS code base from the project
Issue-ID: PORTAL-950
Change-Id: I098126e93fd7e6ada8a0babae58524f9d2ac76be
Signed-off-by: jz385p <jegadeesh.babu@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers')
33 files changed, 0 insertions, 5994 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-closed-cloop.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-closed-cloop.js deleted file mode 100644 index 94169ff4..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-closed-cloop.js +++ /dev/null @@ -1,28 +0,0 @@ -appDS2.controller('adminClosedLoopController', ['$scope','$http','$q','$log',function ($scope, $http,$q, $log){ - $scope.camunda_cockpit_url = ''; - var deferred = $q.defer(); - $http({ - method: "GET", - url: "get_camunda_cockpit_link", - }).success( function(res) { - // if the returned response is error HTML page in string format - if(res.link_defined=='false'){ - $log.error('Retrieval of camunda cockpit link failed. Please make sure the variable "camunda_cockpit_url" is defined in the system.properties file.'); - deferred.reject(status); - } - // valid cockpit url - else if(res.camunda_cockpit_link!=null & res.camunda_cockpit_link!= '') { - $scope.camunda_cockpit_url = res.camunda_cockpit_link; - deferred.resolve(res); - // if the defined url is empty; - } else { - $log.error('Please ensure the variable "camunda_cockpit_url" is properly defined in system.properties file (i.e., neither null nor empty).'); - deferred.reject(status); - } - // API call fails - }).error( function(status) { - $log.error('get_camunda_cockpit_link RestAPI call failed.'); - deferred.reject(status); - }); - return deferred.promise; -}]);
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js deleted file mode 100644 index a8b89757..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js +++ /dev/null @@ -1,970 +0,0 @@ -appDS2.controller('adminController', function($scope, $http,AdminService, $modal, $routeParams, $rootScope){ - - $scope.totalPages = 5; - $scope.viewPerPage = 8; - $scope.searchString = ""; - $scope.currentPage = 1; - $scope.nextSort=""; - $scope.showLoader = false; - $scope.tableData=[]; - $scope.showLoader=false; - $scope.routeRoleId = $routeParams.roleId; - $scope.regions = []; - /*function*/ - $scope.getFunctionList = function(){ - $scope.tableData.length=0; - $scope.showLoader=true; - AdminService.getRoleFunctionList().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.availableRoleFunctions); - },function(error){ - console.log("failed"); - }).finally(function() { - $scope.showLoader=false; // Always execute this on both error and success - }); - } - - $scope.getCacheRegionsList = function(){ - AdminService.getCacheRegions().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.regions =$scope.data; - },function(error){ - console.log("failed"); - }); - } - - - $scope.delRoleFunc = function(roleData){ - AdminService.delRoleFunctionList(roleData).then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - $scope.successPopUp(); - $scope.getFunctionList(); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - - $scope.saveRoleFunction = function(roleData){ - AdminService.saveRoleFunctionList(roleData).then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - $scope.successPopUp(); - $scope.getFunctionList(); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - $scope.addRoleFunction = function(roleData){ - if(/[^a-zA-Z0-9\-\.\_]/.test(roleData.type)){ - errorMsg = 'Type can only contain alphanumeric characters, dots(.) and underscores(_)'; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return errorMsg; - } - } - }); - return; - } - if(roleData.action !== '*' && /[^a-zA-Z0-9\-\.\_]/.test(roleData.action)){ - errorMsg = 'Action can only contain alphanumeric characters, hyphens(-), dots(.) and underscores(_) and single asterisk character(*)'; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return errorMsg; - } - } - }); - return; - } - if(/[^a-zA-Z0-9\-\:\_\./*]/.test(roleData.code)){ - errorMsg = 'Code can only contain alphanumeric characters, hyphens(-), dots(.), colons(:), forwardSlash(/) , asterisk(*) and underscores(_)'; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return errorMsg; - } - } - }); - return; - } - if(/[^a-zA-Z0-9\-\_ \.]/.test(roleData.name)){ - errorMsg = 'Name can only contain alphanumeric characters, spaces, hyphens(-), dots(.) and underscores(_)'; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return errorMsg; - } - } - }); - return; - } - AdminService.addRoleFunctionList(roleData).then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - $scope.successPopUp(); - $scope.getFunctionList(); - }else if(status=='"code exists"'){ - $scope.errorPopUp('Code already exists'); - $scope.getFunctionList(); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - /*init*/ - $scope.getFunctionList(); - $scope.getCacheRegionsList(); - /*popup*/ - var ModalInstanceCtrl = function ($scope, $modalInstance, items, AdminService,$rootScope) { - $scope.roleFun=items; - $scope.msg=items; - - $scope.ngRepeatDemo = [ - {id: 'menuradiobutton1', value: 'menu', labelvalue: 'menu'}, - {id: 'urlradiobutton2', value: 'url', labelvalue: 'url'}, - {id: 'otherradiobutton3', value: 'other', labelvalue: 'other'} - ] - $scope.selectedvalueradioButtonGroup = { - type: 'menu' - } - $scope.roleFun = { - action: '*' - } - - $scope.selectedvalueradioButtonOther = { - type: '' - } - - // remove role function associated to a role on Role Edit page - $scope.roleFunRemoveRole = function (roleFunction) { - AdminService.removeRoleFunction(roleFunction, $routeParams.roleId).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.role){ - $rootScope.$broadcast('updateRoleFunctions',{data:message.role,removedRoleFunc: roleFunction.name}); - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - console.log("error"); - }); - } - - //role activation for selected child role - $scope.activateRoleChildConfirmPopUp = function (selected, availableRole) { - $scope.msg.roleFun = availableRole.name; - $scope.msg.selected = selected; - $scope.msg.availableRole = availableRole; - var toggleType = null; - if(selected) { - toggleType = "activate"; - } else { - toggleType = "inactivate"; - } - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-child-add-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return $scope.msg; - } - } - }); - } - - // confirm Child Role Add - $scope.confirmRoleChildAdd = function(selected,availableRole,id){ - AdminService.confirmRoleChildAdd(selected,availableRole,id).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.role){ - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - console.log("error"); - }); - } - - // confirm Child Role Remove - $scope.confirmRoleChildRemove = function(selected,availableRole,id){ - AdminService.confirmRoleChildRemove(selected,availableRole,id).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.role){ - //$rootScope.$broadcast('updateAvailbleRoles',{data:message.availableRoles}); - /*$modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - sizeClass: 'modal-small', - })*/ - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - console.log("error"); - }); - } - - //role activation for role function - $scope.activateRoleConfirmPopUp = function (selected, availableRole) { - $scope.msg.roleFun = availableRole.name; - $scope.msg.selected = selected; - $scope.msg.availableRole = availableRole; - var toggleType = null; - if(selected) { - toggleType = "activate"; - } else { - toggleType = "inactivate"; - } - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-fun-add-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return $scope.msg; - } - } - }); - } - - // confirm Role Function Add - $scope.confirmRoleFunAdd = function(selected,availableRole,id){ - AdminService.confirmRoleFunAdd(selected,availableRole,id).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.role){ - $rootScope.$broadcast('updateRoleFunctions',{data:message.role}); - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - console.log("error"); - }); - } - - // confirm Role Function Remove - $scope.confirmRoleFunRemove = function(selected,availableRole,id){ - AdminService.confirmRoleFunRemove(selected,availableRole,id).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.role){ - $rootScope.$broadcast('updateRoleFunctions',{data:message.role}); - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - console.log("error"); - }); - } - - //role activation - $scope.roleActivate = function(selected,availableRole){ - AdminService.activateRole(selected,availableRole).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.availableRoles){ - $rootScope.$broadcast('updateAvailbleRoles',{data:message.availableRoles}); - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - console.log("error"); - }); - } - - //role deletion - $scope.delRole = function(roleData){ - AdminService.delRoleList(roleData).then(function(msg){ - var message = msg; - $scope.cancel(); - if(message.availableRoles){ - $rootScope.$broadcast('updateAvailbleRoles',{data:message.availableRoles}); - }else{ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }) - } - - },function(error){ - - }); - } - - $scope.save = function (data,type) { - if(type !== 'other'){ - data.type = type ; - } else{ - data.type = $scope.selectedvalueradioButtonOther.type ; - } - $modalInstance.close(data); - }; - - // Cancel for toggle switch on Role Fn - $scope.cancelRoleFunSwitch = function (msg) { - $scope.msg.availableRole.selected = !$scope.msg.availableRole.selected; - $modalInstance.dismiss('cancel'); - }; - - // Cancel for toggle switch on Role List - $scope.cancelRoleSwitch = function (msg) { - $scope.msg.availableRole.active = !$scope.msg.availableRole.active; - $modalInstance.dismiss('cancel'); - }; - - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - - $scope.deleteFun = function(data){ - $modalInstance.close(data); - } - }; - - $scope.successPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return ''; - } - } - }); - }; - - $scope.successTestModelPopUp = function (response) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modalpopup.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-large', - resolve: { - items: function () { - var message = { - title: '', - text: response - }; - return message; - } - } - }); - }; - $scope.errorPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }); - }; - $scope.saveRoleFuncPopUp = function (availableRoleFunction) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-function-edit.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return availableRoleFunction; - } - } - }); - - modalInstance.result.then(function (data) { - $scope.saveRoleFunction(data); - }); - } - - $scope.addRoleFuncPopUp = function (availableRoleFunction) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-function-add.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return availableRoleFunction; - } - } - }); - - modalInstance.result.then(function (data,type) { - $scope.addRoleFunction(data,type); - }); - } - - $scope.delRoleFuncConfirmPopUp = function (availableRoleFunction) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-function-del-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - title: '', - text: availableRoleFunction.name, - content: availableRoleFunction - }; - return message; - } - } - }); - - modalInstance.result.then(function (data) { - $scope.delRoleFunc(data.content); - }); - } - $scope.clearAllFuncPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/cache-menu-clear-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - } - } - }); - - modalInstance.result.then(function () { - $scope.clearAll(); - }); - } - - $scope.clearAll = function(){ - AdminService.clearAdminRegions().then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - $scope.successTestModelPopUp(''); - $scope.getCacheRegionsList(); - }else{ - $scope.errorPopUp(); - } - } - - },function(error){ - - }); - } - $scope.showRegionDetailsFuncPopUp = function (response) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/success_modalpopup.html', - controller: ModalInstanceCtrl, - resolve: { - items: function () { - var message = { - title: '', - text: response, - }; - return message; - } - } - }); - - modalInstance.result.then(function (response) { - $scope.showRegionDetails(response); - }); - } - - $scope.showRegionDetails = function(cacheName) { - AdminService.showRegionDetails(cacheName).then(function(res){ - - var message = res.data; - var msgParsed = JSON.stringify(message); - - var messaged = message.data; - var msgParsedd = JSON.stringify(messaged); - - if(message.data!=null && message.data!=''){ - var status = res.status; - - - if(status==200){ - - - - var htmlstring = message.data.toString(); - var htmlStrReplace = htmlstring.replace(/['"]+/g, ''); - var htmlStrReplaceSplit = htmlStrReplace.split('\n'); - var dataStr = htmlStrReplace.replace(/\\n/g, "\n"); - $scope.successTestModelPopUp(dataStr); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - - $scope.clearRegionFuncPopUp = function (cacheName) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/cache-menu-clear-region-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - title: '', - text: cacheName - }; - return message; - } - } - }); - - modalInstance.result.then(function (cacheName) { - $scope.clearRegionFunction(cacheName); - }); - } - - $scope.clearRegionFunction = function(cacheName){ - AdminService.clearRegionFunction(cacheName).then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - $scope.successPopUp(); - $scope.getCacheRegionsList()(); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - - $scope.clearItemFuncPopUp = function (cacheName, key) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/clearItem-region-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - title: '', - text: cacheName - }; - return message; - } - } - }); - - modalInstance.result.then(function (cacheName, key) { - $scope.clearItemFunction(cacheName, key); - }); - } - - $scope.clearItemFunction = function(cacheName, key){ - AdminService.clearItemnFunction(cacheName, key).then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - $scope.successPopUp(); - $scope.getCacheRegionsList()(); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - - - - $scope.showItemDetails = function(cacheName, key){ - AdminService.showItemDetails(cacheName, key).then(function(msg){ - var message = msg; - if(message.data!=null && message.data!=''){ - var status = message.data; - if(status=='"success"'){ - - $scope.successPopUp(); - $scope.getCacheRegionsList()(); - }else{ - $scope.errorPopUp(''); - } - } - - },function(error){ - - }); - } - - - //role deletion pop up - $scope.delRoleConfirmPopUp = function (availableRole) { - - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-delete-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - availableRole:availableRole, - roleName: availableRole.name - }; - return message; - } - } - }); - } - - // role activation - $scope.activateRoleConfirmPopUp = function (selected, availableRole) { - var toggleType = null; - if(selected) { - toggleType = "activate"; - } else { - toggleType = "inactivate"; - } - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-confirm-activation.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - text: toggleType, - selected:selected, - availableRole:availableRole, - roleName:availableRole.name - }; - return message; - } - } - }); - } - - $scope.roleFnInit = function(){ - $scope.showLoader=true; - AdminService.getRole($routeParams.roleId).then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.role =JSON.parse($scope.data.role); - - $scope.ociavailableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - $scope.availableRoleFunctions=[]; - - if($scope.ociavailableRoleFunctions) - angular.forEach($scope.ociavailableRoleFunctions, function(a,i){ - var availableRoleFunction = a; - availableRoleFunction.selected = false; - angular.forEach($scope.role.roleFunctions, function(b,j){ - if(a.code === b.code) { - availableRoleFunction.selected = true; - } - }); - $scope.availableRoleFunctions.push(availableRoleFunction); - }); - - - $scope.ociavailableRoles=JSON.parse($scope.data.availableRoles); - $scope.availableRoles=[]; - - },function(error){ - console.log("roleControllerDS2 failed: " + error); - // reloadPageOnce(); - }).finally(function() { - $scope.showLoader=false; // Always execute this on both error and success - }); - } - - // updating roles on role list page after deletion of a role - $rootScope.$on('updateAvailbleRoles', function(e,d){ - $scope.ociavailableRoles = d.data; - }) - - // updating role functions on roles page after deletion of a role function - $rootScope.$on('updateRoleFunctions',function(e,d){ - $scope.role = d.data; - if (typeof d.removedRoleFunc != 'undefined' && d.removedRoleFunc!=''){ - for(var i=0;i<$scope.ociavailableRoleFunctions.length;i++){ - if($scope.ociavailableRoleFunctions[i].name==d.removedRoleFunc) - $scope.ociavailableRoleFunctions[i].selected=false; - } - } - }) - - $scope.roleFnInit(); - $scope.updateRoleFunction = function(){ - $scope.role.roleFunctions=[]; - for(var i=0;i<$scope.ociavailableRoleFunctions.length;i++){ - if($scope.ociavailableRoleFunctions[i].selected) - $scope.role.roleFunctions.push($scope.ociavailableRoleFunctions[i]); - } - } - $scope.saveRole = function() { - var errorMsg; - $scope.showLoader=true; - if($scope.role.id == null || $scope.role.id == undefined ){ - $scope.role = { - 'id':null, - 'created':null, - 'modified':null, - 'createdId':null, - 'modifiedId':null, - 'rowNum':null, - 'auditUserId':null, - 'auditTrail':null, - 'name':$scope.role.name, - 'active':false, - 'priority':$scope.role.priority, - 'roleFunctions':null, - 'childRoles':null, - 'toggleActiveAltText':"Click to Activate Role ", - 'toggleActiveImage':" / static fusion images inactive.png ", - 'editUrl':" role.htm ? role_id = null", - }; - } - // Validate non-empty priority as integer - if ($scope.role.priority && $scope.role.priority != '' && isNaN(parseInt($scope.role.priority))) { - errorMsg = 'Priority must be an integer.'; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return errorMsg; - } - } - }); - return; - } - for (x in $scope.availableRoles){ - if ($scope.availableRoles[x].name==$scope.role.name){ - errorMsg = 'Role already exists.'; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return errorMsg; - } - } - }); - return; - } - } - if(!errorMsg){ - var postData={ - role: $scope.role, - childRoles: $scope.role.childRoles, - roleFunctions : $scope.role.roleFunctions - }; - AdminService.saveRole(postData, $routeParams.roleId).then(function(msg){ - if(msg.role){ - sessionStorage.setItem('addCall', true); - location.href='admin#/role/'+msg.role.id; - $scope.availableRoles.push(msg); - $scope.routeRoleId = msg.role.id; - $rootScope.$broadcast('updateAvailbleRoles',{data:$scope.availableRoles}); - //saving the addCall variable in sessionStorage to change the url from AddRole to Edit Role on success of Save and displaying the success pop up - if(sessionStorage.addCall){ - $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - sizeClass: 'modal-small' - }); - sessionStorage.removeItem('addCall'); - } - } else{ - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - msg = 'Error saving Role. Please retry'; - return msg; - } - } - }); - } - },function(error){ - console.log("error msg"); - }).finally(function() { - $scope.showLoader=false; // Always execute this on both error and success - }); - - } - } - - $scope.addNewRoleFunctionModalPopup = function(data, role,info) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-functions-modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-large', - resolve: { - items: function () { - var message = { - role:role, - roleId:info.id, - availableRoleFunctions:$scope.ociavailableRoleFunctions - }; - return message; - } - } - }); - modalInstance.result.finally(function () { - $scope.updateRoleFunction(); - }); - } - - $scope.addNewChildRoleFunctionModalPopup = function(data, role,info) { - data = $scope.role; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-functions-child-roles-modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-large', - resolve: { - items: function () { - var message = { - roleChildFunctions:$scope.ociavailableRoles, - role:role, - roleId:info.id - }; - return message; - } - } - }); - modalInstance.result.finally(function () { - alert(); - }); - } - - // remove role function associated to a role on Role Edit page - $scope.removeRoleFunction= function(roleFunction){ - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-fun-role-del-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - roleFunction:roleFunction - }; - return message; - } - } - }); - } - -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-menu-edit.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-menu-edit.js deleted file mode 100644 index 00cd92d7..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-menu-edit.js +++ /dev/null @@ -1,184 +0,0 @@ -appDS2.controller('AdminMenuEditController', function ($scope, AdminMenuService, $modal, $route,AdminService){ - - $scope.showInput = true; - $scope.totalPages1 = 5; - $scope.viewPerPage1 = 8; - $scope.currentPage1 = 1; - $scope.showLoader = false; - $scope.firstPlay = true; - $scope.tableFnMenuItems = []; - $scope.$watch('viewPerPage1', function(val) { - $scope.showLoader = true; - AdminMenuService.getFnMenuItems($scope.currentPage1, val).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.fnMenuItems = $scope.data.fnMenuItems; - var totalItems = $scope.fnMenuItems.length; - $scope.totalPages1 = Math.ceil(totalItems / $scope.viewPerPage1); - for (x in $scope.fnMenuItems) { - if ($scope.fnMenuItems[x].active_yn=='Y') - $scope.fnMenuItems[x].active_yn=true; - else - $scope.fnMenuItems[x].active_yn=false; - } - $scope.showLoader = false; - $scope.currentPage1=1; - var endIndex = 1 * $scope.viewPerPage1; - var startIndex = endIndex - $scope.viewPerPage1; - $scope.tableFnMenuItems = $scope.fnMenuItems.slice(startIndex, endIndex); - },function(error){ - console.log('AdminMenuEditControler::$watch viewPerPage1 failed', error); - reloadPageOnce(); - }); - - }); - - $scope.customHandler1 = function(num) { - $scope.currentPage1=num; - var endIndex = num * $scope.viewPerPage1; - var startIndex = endIndex - $scope.viewPerPage1; - $scope.tableFnMenuItems = $scope.fnMenuItems.slice(startIndex, endIndex); - }; - - $scope.init = function () { - $scope.numberOfRecordstoShow=20; - AdminMenuService.getFnMenuItems().then(function(data){ - var j = data; - $scope.data =JSON.parse(j.data); - $scope.fnMenuItems =($scope.data.fnMenuItems); - },function(error){ - console.log('AdminMenuEditControler::init failed'); - }); - } - - $scope.init(); - - $scope.mapActiveStatus = function(status){ - if(status) - status = "Y"; - else - status = "N"; - return status; - }; - - $scope.addNewFnMenuItemModalPopup = function(availableFnMenuItem) { - $scope.editFnMenuItem = null; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/popup-modal-fnmenu-add.html', - controller: fn_menu_popupController, - resolve: { - message: function () { - var message = { - availableFnMenuItem: $scope.editFnMenuItem - }; - return message; - } - } - }); - - modalInstance.result.then(function(response){ - // console.log('response', response); - $scope.availableFnMenuItems=response.availableFnMenuItems; - $route.reload(); - }); - - }; - - $scope.removeMenuItem = function (fnMenuItem) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/admin-menu-del-confirm.html', - controller: deletefn_menu_popupController, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - title: '', - text: fnMenuItem.label - }; - return fnMenuItem; - } - } - }); - }; - - - $scope.editRoleFunction = null; - var dialog = null; - $scope.editRoleFunctionPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.editMenuItemModalPopup = function(availableFnMenuItem) { - $scope.editFnMenuItem = availableFnMenuItem; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/modals/popup-modal-fnmenu-add.html', - controller: fn_menu_popupController, - resolve: { - message: function () { - var message = { - availableFnMenuItem: $scope.editFnMenuItem - }; - return message; - } - } - }); - - modalInstance.result.then(function(response){ - $scope.availableFnMenuItems=response.availableFnMenuItems; - $route.reload(); - }); - }; - - $scope.editRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - // console.log('response', response); - $scope.availableRoleFunctions=response.availableRoleFunctions; - }); - }; - - $scope.addNewRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = null; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction - }; - return message; - } - } - }); - - modalInstance.result.then(function(response){ - $scope.availableRoleFunctions=response.availableRoleFunctions; - }); - }; - - $scope.addNewRoleFunctionPopup = function() { - $scope.editRoleFunction = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - - -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-route.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-route.js deleted file mode 100644 index c7c06a7e..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-route.js +++ /dev/null @@ -1,43 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .when('/net_map', { - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-sample-page/net_map.html', - controller: "netMapController" - }) - .when('/jcs_admin', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/jcs_admin.html', - controller: 'adminController' - }) - .when('/admin_menu_edit', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/admin-menu-edit.html', - controller: 'AdminMenuEditController' - }) - .when('/usage_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/usage.html', - controller: 'usageListControllerDS2' - }) - .when('/role_function_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/role-function.html', - controller : "adminController" - }) - .when('/role/:roleId', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/role.html', - controller: 'adminController' - }) - .when('/collaborate_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/collaborate-list.html', - controller: 'collaborateListControllerDS2' - }) - .when('/adminClosedLoop', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/admin_closed_loop.html', - controller: 'adminClosedLoopController' - }) - .when('/all', { - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-listing.html', - controller: 'workflowsController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/role_list.html', - controller : 'adminController' - }); -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-whitelist.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-whitelist.js deleted file mode 100644 index 3e82df8e..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-whitelist.js +++ /dev/null @@ -1,3 +0,0 @@ -appDS2.config(function ($sceDelegateProvider) { - $sceDelegateProvider.resourceUrlWhitelist(['self','**']); -});
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/bootstrap-sample-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/bootstrap-sample-controller.js deleted file mode 100644 index 74a7423e..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/bootstrap-sample-controller.js +++ /dev/null @@ -1,5 +0,0 @@ -appDS2.controller( - 'bootstrapSampleController', - function($scope, $interval, $http, $modal, $log, ManifestService) { - - }); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/bootstrap-sample-route.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/bootstrap-sample-route.js deleted file mode 100644 index ac1ba168..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/bootstrap-sample-route.js +++ /dev/null @@ -1,7 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .otherwise({ - templateUrl: 'app/fusion/scripts/DS2-view-models/bootstrap-sample-content.html', - controller : "bootstrapSampleController" - }); -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate-list-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate-list-controller.js deleted file mode 100644 index 670e8fc1..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate-list-controller.js +++ /dev/null @@ -1,71 +0,0 @@ -appDS2.controller("collaborateListControllerDS2", function ($scope,$http, $modal,AdminService) { - - $scope.showInput = true; - $scope.totalPages1 = 5; - $scope.viewPerPage1 = 8; - $scope.currentPage1 = 1; - $scope.showLoader = false; - $scope.firstPlay = true; - // Start with empty list to silence error in console - $scope.tableData = []; - $scope.tableCollbItems = []; - // $scope.totalPages1 = 20; - $scope.$watch('viewPerPage1', function(val) { - $scope.showLoader = true; - AdminService.getCollaborateList($scope.currentPage1, val).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData = $scope.data; - var totalItems = $scope.tableData.length; - //console.log(totalItems); - $scope.totalPages1 = Math.ceil(totalItems / $scope.viewPerPage1); - $scope.showLoader = false; - $scope.currentPage1=1; - var endIndex = 1 * $scope.viewPerPage1; - var startIndex = endIndex - $scope.viewPerPage1; - $scope.tableCollbItems = $scope.tableData.slice(startIndex, endIndex); - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - }); - - $scope.customHandler1 = function(num) { - $scope.currentPage1=num; - var endIndex = num * $scope.viewPerPage1; - var startIndex = endIndex - $scope.viewPerPage1; - $scope.tableCollbItems = $scope.tableData.slice(startIndex, endIndex); - }; - - $scope.openCollaboration = function(chatId){ - openInNewTab('openCollaboration?chat_id=' + chatId); - } - - $scope.toggleProfileActive = function(profileId) { - modalService.popupConfirmWin("Confirm","You are about to change user's active status. Do you want to continue?", - function(){ - $http.get("profile/toggleProfileActive?profile_id="+profileId).success(function(){}); - }) - }; - -}); - -function openInNewTab(url) { - var win = window.open(url, '_blank'); - win.focus(); -}; - -function downloadScreenCaptureExtenstion() { - - var chromeURL = 'https://chrome.google.com/webstore/detail/icgmlogfeajbfdffajhoebcfbibfhaen'; - var firefoxURL = 'https://addons.mozilla.org/en-US/firefox/addon/screen-capturing-capability'; - var url; - - if(isChrome) - url = chromeURL; - else if(isFirefox) - url = firefoxURL; - - var win = window.open(url); - win.focus(); -}; diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate/collaborate.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate/collaborate.js deleted file mode 100644 index fa9af088..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate/collaborate.js +++ /dev/null @@ -1,7 +0,0 @@ -app.config(function($routeProvider) { - $routeProvider - .when('/collaborate_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/collaborate-list.html', - controller: 'collaborateListControllerDS2' - }) -});
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate/workflowController.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate/workflowController.js deleted file mode 100644 index c43ad8b7..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborate/workflowController.js +++ /dev/null @@ -1,490 +0,0 @@ -app.controller('workflowsController', function($scope, $http, $uibModal, $log, modalService, $modal) { - - $scope.viewPerPage = 5; - $scope.scrollViewsPerPage = 20; - $scope.currentPage = 2; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - $scope.radio = { - value: "" - }; - - - $scope.showModal = false; - $scope.toggleModal = function(){ - $scope.showModal = !$scope.showModal; - }; - - $scope.workflow = {}; - $scope.workflow.active = "true"; - - $scope.updateAllWorkflowStatus = function() { - angular.forEach($scope.workflows,function(value){ - $scope.checkWorkflowStatus(value); - }) - } - - $scope.fetchWorkflowsList = function() { - $http.get('workflows/list').then(function(workflowList){ - console.log('Got new list from server = ' + workflowList.data); - $scope.workflows = workflowList.data; - $scope.updateAllWorkflowStatus(); - }); - }; - - $scope.addNewWorkflow = function(newWorkflow) { - $http.post('workflows/addWorkflow/', JSON.stringify(newWorkflow)).success(function() { - $scope.fetchWorkflowsList(); - }); - - $scope.workflow.name = ''; - - }; - - $scope.updateWorkflow = function (workflowToEdit) { - //workflowToEdit.active='true'; - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-new.html', - //size : modalSize, - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflow = workflowToEdit; - $scope.ok = function() { - console.log('Updating existing workflow ... ' + JSON.stringify($scope.workflow)); - $http.post('workflows/editWorkflow/', JSON.stringify($scope.workflow)).then(function(returnedWorkflow){ - console.log('Returned Workflow = ' + JSON.stringify(returnedWorkflow)); - $uibModalInstance.close($scope.workflow); - }); - }; - - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }], - //End of inner controller - resolve: { - workflow: function() { - console.log('Passing ' + JSON.stringify($scope.workflow)); - return $scope.workflow; - } - } - }); - - modalInstance.result.then(function (editedWorkFlow) { - //Need to convert to proper date - later - delete editedWorkFlow.created; - delete editedWorkFlow.updated; - - delete editedWorkFlow.createdBy; - delete editedWorkFlow.modifiedBy; - - console.log('selected Item ' + JSON.stringify(editedWorkFlow)); - $scope.$emit('workflowAdded', editedWorkFlow); - - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - }; - - $scope.reset = function(){ - console.log("Resetting ...."); - }; - - $scope.update = function(){ - console.log("updating ...."); - }; - - $scope.createWorkflow = function (modalSize) { - - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-new.html', - size : modalSize, - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflow = {}; - $scope.workflow.active = 'true'; - $scope.ok = function() { - console.log('Saving new workflow ... ' + JSON.stringify($scope.workflow)); - $http.post('workflows/addWorkflow/', JSON.stringify($scope.workflow)).then(function(returnedWorkflow){ - console.log('Returned Workflow = ' + JSON.stringify(returnedWorkflow)); - $uibModalInstance.close($scope.workflow); - }); - }; -/* console.log(size);*/ - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }], - //End of inner controller - resolve: { - workflow: function() { - console.log('Passing ' + JSON.stringify($scope.workflow)); - return $scope.workflow; - } - } - }); - - modalInstance.result.then(function (newWorkflow) { - console.log('selected Item ' + JSON.stringify(newWorkflow)); - $scope.$emit('workflowAdded', newWorkflow); - - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - };//End of createWorkflow function - - - $scope.removeWorkflow = function(workflowToRemove){ - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-remove.html', - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflowToRemove = workflowToRemove; - $scope.ok = function() { - console.log('Removing workflow ... ' + JSON.stringify($scope.workflowToRemove) + ' on client request.'); - $http.post('workflows/removeWorkflow/', JSON.stringify($scope.workflowToRemove.id)).then(function(){ - console.log('Workflow successfully removed !!!'); - $uibModalInstance.close(); - }); - }; - - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - - $scope.scheduleWorkflow = function(workflowToSchedule){ - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-schedule.html', - size:'lg', - - controller: ['$scope', '$uibModalInstance', '$http','dateFilter', function ($scope, $uibModalInstance, $http,dateFilter) { - - $scope.workflowToSchedule = workflowToSchedule; - $scope.dt = new Date(); - $scope.dt2 = new Date(); - $scope.dateformat = 'MM/dd/yyyy', - $scope.datetimeformat = "hh:mm a"; - - $scope.recurrenceOptions =[{ - index:0, value:'One-Time', title:'One-Time' - },{ - index:1, value: 'Hourly',title:'Hourly' - },{ - index:2, value: 'Daily',title:'Daily' - },{ - index:3, value: 'Weekly',title:'Weekly' - }] - $scope.selectRecurrenceOpt = $scope.recurrenceOptions[0]; - - $scope.hours = []; - for (var i=0; i<24; i++){ - var newObj={} - newObj.index = i; - newObj.value = ""+i; - newObj.title = ""+i; - $scope.hours.push(newObj); - } - - $scope.minutes = []; - for (var i=0; i<60; i++){ - var newObj={} - newObj.index = i; - newObj.value = ""+i; - newObj.title = ""+i; - $scope.minutes.push(newObj); - } - - $scope.AMPMOptions =[ - { - index:0, value:'AM', title:'AM' - },{ - index:1, value: 'PM',title:'PM' - }] - - $scope.selectFirstHour =$scope.hours[0]; - $scope.selectFirstMinute =$scope.minutes[0]; - - $scope.selectLastHour =$scope.hours[0]; - $scope.selectLastMinute =$scope.minutes[0]; - - $scope.selectStartAMPMOption=$scope.AMPMOptions[0]; - $scope.selectLastAMPMOption=$scope.AMPMOptions[0]; - - var GenerateCronExpression = function(trigger_dt, RecurrenceOpt) { - var CRON_sec = trigger_dt.getSeconds(); - var CRON_min = trigger_dt.getMinutes(); - var CRON_hr = trigger_dt.getHours(); - var CRON_date= trigger_dt.getDate(); - var CRON_month = trigger_dt.toLocaleString('en-US', {month: 'short'}).toUpperCase(); - var CRON_day = trigger_dt.toLocaleString('en-US', {weekday: 'short'}).toUpperCase(); - var CRON_year = trigger_dt.getFullYear(); - if (RecurrenceOpt ==="One-Time") { - CRON_day = '?' - } else { - if (RecurrenceOpt ==="Hourly") { - CRON_hr = '*'; - CRON_date = '*' - CRON_month = '*' - CRON_day = '?' - CRON_year = '*' - } else if (RecurrenceOpt ==="Daily") { - CRON_date = '*' - CRON_month = '*' - CRON_day = '?' - CRON_year = '*' - } else if (RecurrenceOpt ==="Weekly") { - CRON_date = '*' - CRON_month = '*' - CRON_year = '*' - } - } - - var CRON_Expression = [CRON_sec, CRON_min, CRON_hr, CRON_date, CRON_month, CRON_day, CRON_year]; - return CRON_Expression.join(" "); - } - - $scope.ok = function() { - - // DateTime for the start time: it should be noted that the start time - // for a CRON job should be prior to the trigger time. - $scope.trigger_dt = new Date( $scope.dt.getFullYear() + - "-" + ("0"+($scope.dt.getMonth()+1)).slice(-2) + - "-" +("0"+ $scope.dt.getDate()).slice(-2) + - " " + ("0" + $scope.selectFirstHour.value).slice(-2) + - ":" +("0" + $scope.selectFirstMinute.value).slice(-2) + - ":00.0"); - - $scope.startDateTime_CRON = GenerateCronExpression($scope.trigger_dt, $scope.selectRecurrenceOpt.value) - - //roll back the the start date time by 30 seconds (start time should be 30 seconds prior to trigger time) - dt_st = new Date($scope.trigger_dt - 30*1000) - - startDateTime = dt_st.getFullYear() + - "-" + ("0"+(dt_st.getMonth()+1)).slice(-2) + - "-" +("0"+ dt_st.getDate()).slice(-2) + - " " + ("0" + dt_st.getHours()).slice(-2) + - ":" +("0" + dt_st.getMinutes()).slice(-2) + - ":" + ("0" + dt_st.getSeconds()).slice(-2) +".0"; - $scope.startDateTime = startDateTime; - - $scope.endDateTime = $scope.dt2.getFullYear() + - "-" + ("0"+($scope.dt2.getMonth()+1)).slice(-2) + - "-" +("0"+ $scope.dt2.getDate()).slice(-2) + - " " + ("0"+ $scope.selectLastHour.value).slice(-2) + - ":" +("0" + $scope.selectLastMinute.value).slice(-2) + - ":00.0" - - $scope.WorkflowScheduleObject = {}; - $scope.WorkflowScheduleObject['startDateTime_CRON'] = $scope.startDateTime_CRON; - $scope.WorkflowScheduleObject['startDateTime'] = $scope.startDateTime; - $scope.WorkflowScheduleObject['endDateTime'] = $scope.endDateTime; - $scope.WorkflowScheduleObject['workflowKey'] = $scope.workflowToSchedule.workflowKey; - $scope.WorkflowScheduleObject['recurrence'] = $scope.selectRecurrenceOpt.value; - $scope.WorkflowScheduleObject['workflow_arguments'] = "test"; - $scope.WorkflowScheduleObject['workflow_server_url'] = $scope.workflowToSchedule.runLink; - - - TimeFromNowToStart = new Date($scope.startDateTime)-new Date() - TimeStartToEnd = new Date($scope.endDateTime)-new Date($scope.startDateTime) - - if (TimeFromNowToStart<=0) { - console.log("invalid start time input") - alert("Please ensure the scheduled start date time is later than current time.") - return; - } - if (TimeStartToEnd<=0) { - console.log("invalid end time input") - alert("Please ensure the schduled end date time is later than the start time.") - return; - } - // if successful then save and close - $scope.saveCronJob($scope.WorkflowScheduleObject); - $uibModalInstance.close(); - - }; - - $scope.saveCronJob = function(cronJobData){ - - console.log('saving cron job data: ' + cronJobData); - var uuu = "workflows/saveCronJob.htm"; - var postData={cronJobDataObj: cronJobData}; - $.ajax({ - type : 'POST', - url : uuu, - //dataType: 'json', // data type expected from server - contentType: 'application/json', - data: JSON.stringify(postData), // data type sent to server - success : function(data){ - $scope.$apply(function(){ - //$scope.availableRoleFunctions=[];$scope.$apply(); - // new // $scope.availableFnMenuItems=data.availableFnMenuItems; - } - ); - //alert("Update Successful.") ; - //$scope.editRoleFunction = null; - // new /// $modalInstance.close({availableFnMenuItems:$scope.availableRoleFunctions}); - }, - error : function(data){ - alert("Error while saving."); - } - }); - - }; - - $scope.cancel = function() { - console.log("cancel triggered") - $uibModalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - - - - - - - $scope.previewWorkflow = function(workflowToPreview,modalSize){ - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-preview.html', - size:modalSize, - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflowToPreview = workflowToPreview; - console.log('previewWorkFlow invoked'); - console.log($scope.workflowToPreview); - - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - /* change work flow status based on the boolean variable "suspendBool" which corresponds whether - * we would like to suspend or activate a workflow specified by key. */ - $scope.changeWorkflowStatus = function(workflowToChangeStatus,suspendBool){ - if (workflowToChangeStatus!==null) { - var statusUrl= workflowToChangeStatus.runLink+"/engine-rest/process-definition/key/"+workflowToChangeStatus.workflowKey - var suspendedUrl= statusUrl+"/suspended" - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('PUT', suspendedUrl, false); - xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); - xmlHttp.onload = function() { - if (suspendBool) { - console.log("process definition is now suspended"); - workflowToChangeStatus.active="false" - } else { - console.log("process definition is now activated"); - workflowToChangeStatus.active="true" - } - }; - xmlHttp.send(JSON.stringify({ - "suspended" : suspendBool, - "includeProcessInstances" : true, - "executionDate" : "2013-11-21T10:49:45" - })); - } - - }; - - $scope.activateWorkflow = function(workflowToActivate){ - $scope.changeWorkflowStatus(workflowToActivate,false) - - }; - - $scope.suspendWorkflow = function(workflowToActivate){ - $scope.changeWorkflowStatus(workflowToActivate,true) - }; - - $scope.checkWorkflowStatus = function(workflow) { - if (workflow!==null) { - var statusUrl= workflow.runLink+"/engine-rest/process-definition/key/"+workflow.workflowKey - var xmlHttp3 = new XMLHttpRequest(); - xmlHttp3.open('GET', statusUrl, true); - xmlHttp3.withCredentials = true; - xmlHttp3.send(); - xmlHttp3.onreadystatechange = function() { - if (xmlHttp3.readyState == 4 && xmlHttp3.status == 200) { - // do something with the response in the variable data - var temp = JSON.parse(xmlHttp3.responseText) - if (temp.suspended == false){ - console.log("Activated") - workflow.active="true" - } else { - console.log("Suspended") - workflow.active="false" - } - } - } - } - }; - - $scope.StartWorkflowInstance = function(workflowToStart){ - if (workflowToStart!==null) { - var statusUrl= workflowToStart.runLink+"/engine-rest/process-definition/key/"+workflowToStart.workflowKey - var suspendedUrl= statusUrl+"/submit-form" - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('POST', suspendedUrl, false); - xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); - xmlHttp.onload = function() { - }; - xmlHttp.send(JSON.stringify({ - "variables": { - "customerId": {"value":"asdasda","type":"String"}, - "amount":{"value":"100","type":"String"} - } - })); - } - - }; - - - $scope.$on('workflowAdded', function(event, newWorkflow) { - console.log("New Workflow to be added in list scope " + JSON.stringify(newWorkflow)); - //$scope.workflows.push(newWorkflow); - $scope.fetchWorkflowsList(); - console.log('newly added workflow = ' + JSON.stringify(newWorkflow)); - }); - - $scope.$on('workflowRemoved', function(event) { - $scope.fetchWorkflowsList(); - }); - - $scope.fetchWorkflowsList(); - - - -}); - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborateList-route.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborateList-route.js deleted file mode 100644 index d402fd7b..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaborateList-route.js +++ /dev/null @@ -1,19 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .when('/collaborate_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/collaborate-list.html', - controller: 'collaborateListControllerDS2' - }) - .when('/notebook', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-samplePages/notebook-page.html', - controller: 'nbookController' - }) - .when('/leafletMap', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-samplePages/leafletMap.html', - controller: 'leafletController' - }) - .when('/notebook', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-samplePages/notebook-page.html', - controller: 'nbookController' - }) -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaboration-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaboration-controller.js deleted file mode 100644 index a800c009..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/collaboration-controller.js +++ /dev/null @@ -1,266 +0,0 @@ - - -appDS2.controller('collaborationControllerDS2', function ($scope,$http, $modal) { - console.log("modal", $modal); - var popupModalService; - - }); - - - $(document).ready(function () { - - // OUTER-LAYOUT - panelLayout = $('body').layout({ - center__paneSelector: ".outer-center" - , west__paneSelector: ".outer-west" - , east__paneSelector: ".outer-east" - //, west__size: 800 - //, east__size: 125 - , spacing_open: 8 // ALL panes - , spacing_closed: 12 // ALL panes - - , center__childOptions: { - center__paneSelector: ".inner-center" - , west__paneSelector: ".inner-west" - , east__paneSelector: ".inner-east" - , west__size: 75 - , east__size: 75 - , spacing_open: 8 // ALL panes - , spacing_closed: 8 // ALL panes - , west__spacing_closed: 12 - , east__spacing_closed: 12 - } - - - - - }); - - - function initializeConnections() { - - var channelId = null; - channelId = location.href.replace(/\/|:|#|%|\.|\[|\]/g, ''); - var videoChannelId = channelId.concat("video"); - var screenChannelId = channelId.concat("screen"); - - videoConnection = new RTCMultiConnection(videoChannelId); - screenConnection = new RTCMultiConnection(screenChannelId); - - configConnection(videoConnection,true,true,false,true,false); - configConnection(screenConnection,false,false,true,false,true); - - }; - - function configConnection(_connection, _audio, _video, _screen, _data, _oneway) { - _connection.session = { - audio: _audio, // by default, it is true - video: _video, // by default, it is true - screen: _screen, - data: _data, - oneway: _oneway, - broadcast: false - }; - - _connection.direction = "one-to-one"; - - if( _data == true ) { - _connection.onmessage = function(e) { - appendDIV(e.data); - - console.debug(e.userid, 'posted', e.data); - console.log('latency:', e.latency, 'ms'); - }; - } - - - }; - - function assignStreamToDom() { - - - screenConnection.screenbody = document.querySelector('.screenContainer1'); - screenConnection.videobody = document.querySelector('.videoContainer2'); - - videoConnection.screenbody = document.querySelector('.screenContainer2'); - videoConnection.videobody = document.querySelector('.videoContainer1'); - }; - - function maximizeLayout() { - - // open the panes and maximize the window. - top.window.resizeTo(screen.availWidth,screen.availHeight); - panelLayout.open('west'); - // panelLayout.open('south'); is not working due to state initialization problem; debug to find out. so replacing the call with work around below - hack. - $(".ui-layout-toggler-south-closed").first().click(); - - }; - - function minimizeLayout() { - - // close the panes and minimize the window. - top.window.resizeTo(screen.availWidth - 2*screen.availWidth/3, screen.availHeight - screen.availHeight/2); - panelLayout.close('west'); - // panelLayout.close('south'); is not working due to state initialization problem; debug to find out. so replacing the call with work around below - hack. - $(".ui-layout-toggler-south-opened").first().click(); - }; - - function emptyContainers() { - $('.screenContainer1').empty(); - $('.videoContainer2').empty(); - - $('.screenContainer2').empty(); - $('.videoContainer1').empty(); - }; - - function appendDIV(div, parent) { - if (typeof div === 'string') { - var content = div; - div = document.createElement('div'); - div.innerHTML = content; - }; - - var chatOutput = document.getElementById('chat-output'), - fileProgress = document.getElementById('file-progress'); - - if (!parent) chatOutput.insertBefore(div, chatOutput.firstChild); - else fileProgress.insertBefore(div, fileProgress.firstChild); - - div.tabIndex = 0; - $('#chat-input').focus(); - }; - - function confirmClose() { - var message = "Are you sure you want to close the session?"; - - /* if(popupModalService != undefined) { - popupModalService.popupConfirmWin("Confirm", message, function(){ location.reload();}); - } - - else */ - if (confirm(message) == true) { - location.reload(); - //window.opener.location.reload(); // go to the parent window - //close(); - } else { - // do nothing - } - - }; - - function notifyOthers() { - - // var websocket = localStorage.getItem('notifySocket'); - //if( websocket != null) { - // handling websocket peer broadcast session - var currentUser = "${sessionScope.user.sbcid}"; - var initialPageVisit = "${sessionScope.initialPageVisit}"; - var remoteUser = ''; - - var userList = location.search.split('chat_id=')[1].split('-'); - for(var i=0;i<userList.length;i++) { - if(userList[i] !== currentUser) { - remoteUser = userList[i]; - break; - } - } - - socketSetup(initialPageVisit, currentUser, remoteUser,"socketSend"); - - - - - - - }; - - function makeChatVisible() { - - $('#chat-input').css("visibility", 'visible'); - }; - - - - /* on click button enabled*/ - window.onload = function () { - document.getElementById('share-screen').onclick = function() { - - emptyContainers(); - videoConnection.close(); - screenConnection.close(); - - maximizeLayout(); - emptyContainers(); - makeChatVisible(); - - videoConnection.open(); - screenConnection.open(); - - - notifyOthers(); - - - - }; - }; - - document.getElementById('stop-share-screen').onclick = function() { - - emptyContainers(); - - videoConnection.close(); - screenConnection.close(); - - confirmClose(); - - }; - - document.getElementById('view-screen').onclick = function() { - - maximizeLayout(); - emptyContainers(); - makeChatVisible(); - - // timeout is required for the sharing to properly work - setTimeout(function() { - screenConnection.connect(); - },2000); - setTimeout(function() { - videoConnection.connect(); - },1000); - - - }; - - document.getElementById('chat-input').onkeypress = function(e) { - if (e.keyCode !== 13 || !this.value) return; - var message = "<b>${model.name}</b>: " + this.value; - appendDIV(message); - - // sending text message - videoConnection.send(message); - - this.value = ''; - }; - - /* - document.getElementById('file').onchange = function() { - videoConnection.send(this.files[0]); - }; - */ - - - //document.querySelector('.screenContainerPane').appenChild(document.querySelector('.screenContainer')); - //document.querySelector('.videoContainerPane').appendChild(document.querySelector('.videoContainer')); - - //panelLayout.bindButton($('#share-screen'), 'open', 'outer-west'); - //panelLayout.bindButton($('#stop-share-screen'), 'close', 'outer-west'); - var videoConnection = null, screenConnection = null; - initializeConnections(); - assignStreamToDom(); - - // start the share - //document.getElementById('share-screen').click(); - // - }); - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js deleted file mode 100644 index 2c005365..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js +++ /dev/null @@ -1,354 +0,0 @@ -appDS2.controller('selfProfileController', function($scope, $http, $modal, $routeParams, $rootScope,SelfProfileService){ - - /************init values***********************/ - $scope.tableData=[]; - $scope.profile=[]; - $scope.oriProfile=[]; - $scope.ociavailableRoles=[]; - $scope.ociTimeZones; - $scope.ociCountries; - var stateList=[]; - $scope.availableRoles = []; - $scope.timeZones = []; - $scope.selectedTimeZone = {"index":'',"value":"","title":""}; - $scope.countries = []; - $scope.selectedCountry = {"index":'',"value":"","title":""}; - - $scope.isUserSystemAdmin = false; - $scope.profileId=''; - $scope.showLoader=false; - $scope.pageType=1 /*1 for slef page 2 for general profile page*/ - $scope.pageTitle='Self Profile Detail'; - $scope.profileIdParam = $routeParams.profileId; - if (typeof($scope.profileIdParam) != "undefined" && $scope.profileIdParam!=''){ - $scope.pageTitle='Profile Detail'; - $scope.pageType=2; - } - - - - /***********************************************************functions***********************************************/ - $scope.getProfileDetail = function(profileIdParam){ - $scope.showLoader=true; - SelfProfileService.getProfileDetail(profileIdParam).then(function(data){ - $scope.showLoader=false; - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profile =JSON.parse($scope.data.profile); - $scope.oriProfile=JSON.parse($scope.data.profile); /*original value*/ - $scope.profileId = $scope.profile.id; - $scope.ociavailableRoles =JSON.parse($scope.data.availableRoles); - $scope.ociTimeZones=JSON.parse($scope.data.timeZones); - $scope.ociCountries=JSON.parse($scope.data.countries); - stateList=JSON.parse($scope.data.stateList); - - - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - $.each($scope.profile.roles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - if(a.id === 1){ - $scope.isUserSystemAdmin = true; - } - } - }); - $scope.availableRoles.push(availableRole); - }); - ; - if($scope.ociTimeZones){ - $.each($scope.ociTimeZones, function(i, a){ - var timeZone = {"index":i, "value":a.value, "title":a.label}; - $scope.timeZones.push(timeZone); - if($scope.profile.timeZoneId !== null && a.value === $scope.profile.timeZoneId.toString()){ - $scope.selectedTimeZone = timeZone; - } - }); - }; - if($scope.ociCountries) - $.each($scope.ociCountries, function(i, a){ - var country = {"index":i, "value":a.value, "title":a.label}; - $scope.countries.push(country); - if(a.value === $scope.profile.country){ - $scope.selectedCountry = country; - } - }); - ; - stateList = stateList== null? []: stateList; - var selectedState= $scope.profile.state ? $scope.profile.state:""; - $scope.stateList = initDropdownWithLookUp(stateList,selectedState ); - },function(error){ - $scope.errorPopUp(error); - $scope.showLoader=false; - }); - } - - $scope.getSelfProfileDetail = function(){ - $scope.showLoader=true; - SelfProfileService.getSelfProfileDetail().then(function(data){ - $scope.showLoader=false; - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profile =JSON.parse($scope.data.profile); - $scope.oriProfile=JSON.parse($scope.data.profile); /*original value*/ - $scope.profileId = $scope.profile.id; - $scope.ociavailableRoles =JSON.parse($scope.data.availableRoles); - $scope.ociTimeZones=JSON.parse($scope.data.timeZones); - $scope.ociCountries=JSON.parse($scope.data.countries); - stateList=JSON.parse($scope.data.stateList); - - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - $.each($scope.profile.roles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - if(a.id === 1){ - $scope.isUserSystemAdmin = true; - } - } - }); - $scope.availableRoles.push(availableRole); - }); - ; - if($scope.ociTimeZones){ - $.each($scope.ociTimeZones, function(i, a){ - var timeZone = {"index":i, "value":a.value, "title":a.label}; - $scope.timeZones.push(timeZone); - if($scope.profile.timeZoneId !== null && a.value === $scope.profile.timeZoneId.toString()){ - $scope.selectedTimeZone = timeZone; - } - }); - }; - if($scope.ociCountries) - $.each($scope.ociCountries, function(i, a){ - var country = {"index":i, "value":a.value, "title":a.label}; - $scope.countries.push(country); - if(a.value === $scope.profile.country){ - $scope.selectedCountry = country; - } - }); - ; - stateList = stateList== null? []: stateList; - var selectedState= $scope.profile.state ? $scope.profile.state:""; - $scope.stateList = initDropdownWithLookUp(stateList,selectedState ); - },function(error){ - $scope.errorPopUp(error); - $scope.showLoader=false; - }); - } - - - $scope.removeRole = function(data) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/modals/role-del-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - role:data, - roleId:$scope.profileId, - }; - return message; - } - } - }); - }; - $scope.addNewRoleFunctionModalPopup = function(data) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/modals/role-add.html', - controller: ModalInstanceCtrl, - windowClass:'modal-docked', - sizeClass: 'modal-medium', - resolve: { - items: function () { - var message = { - roleFunctions:data, - roleId:$scope.profileId, - availableRoleFunctions:$scope.ociavailableRoles - }; - return message; - } - } - }); - } - - - $scope.successPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return ''; - } - } - }); - }; - - $scope.errorPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return msg; - } - } - }); - }; - $scope.saveProfile = function() { - $scope.errorMsg = ''; - if($scope.oriProfile.orgUserId != $scope.profile.orgUserId){ - $scope.errorPopUp('Organization User ID cannot be changed'); - return; - } - if($scope.oriProfile.orgManagerUserId != $scope.profile.orgManagerUserId){ - $scope.errorPopUp('Organization Manager ID cannot be changed'); - return; - } - if($scope.oriProfile.loginId != $scope.profile.loginId){ - $scope.errorPopUp('Login ID cannot be changed'); - return; - } - if($scope.oriProfile.loginPwd != $scope.profile.loginPwd){ - $scope.errorPopUp('Login Password cannot be changed'); - return; - } - - var postData={ - profile: $scope.profile, - selectedCountry:$scope.selectedCountry!=null?$scope.selectedCountry.value:"", - selectedState:$scope.stateList.selected!=null?$scope.stateList.selected.value:"", - selectedTimeZone:$scope.selectedTimeZone!=null?$scope.selectedTimeZone.value:"" - }; - SelfProfileService.saveProfile(postData, $scope.profileId).then(function(msg){ - $scope.successPopUp(); - },function(error){ - $scope.errorPopUp(error); - }); - } - /* updating role tables after adding or deleting*/ - $rootScope.$on('updateRoles',function(e,d){ - $scope.profile.roles = d.data; - }) - /*****init call*****/ - - if ($scope.pageType==2){ - $scope.getProfileDetail($scope.profileIdParam); - }else{ - $scope.getSelfProfileDetail(); - } - - - /****************************************************************popup modal*************************************************************/ - var ModalInstanceCtrl = function ($scope, $modalInstance, items,$rootScope) { - $scope.roleFun=items; - $scope.msg=items; - $scope.activateRoleConfirmPopUp = function (selected, availableRole) { - $scope.msg.roleFun = availableRole.name; - $scope.msg.selected = selected; - $scope.msg.availableRole = availableRole; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/modals/role-add-confirm.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return $scope.msg; - } - } - }); - } - $scope.confirmRoleDel = function(role,profileId){ - var postData={role:role}; - SelfProfileService.removeRole(postData,profileId).then(function(msg){ - $scope.cancel(); - $scope.roleTableRefresh(profileId); - },function(error){ - $scope.errorPopUp(error); - }); - } - $scope.confirmRoleFunAdd = function(availableRole,profileId){ - var postData={role:availableRole}; - SelfProfileService.addRole(postData,profileId).then(function(msg){ - $scope.cancel(); - $scope.roleTableRefresh(profileId); - },function(error){ - $scope.errorPopUp(error); - }); - } - - // confirm Role Function Remove - $scope.confirmRoleFunRemove = function(availableRole,profileId){ - var postData={role:availableRole}; - SelfProfileService.deRole(postData,profileId).then(function(msg){ - $scope.cancel(); - $scope.roleTableRefresh(profileId); - },function(error){ - $scope.errorPopUp(error); - }); - } - - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - - $scope.cancelRoleFunSwitch = function (msg) { - $scope.msg.availableRole.selected = !$scope.msg.availableRole.selected; - $modalInstance.dismiss('cancel'); - }; - - $scope.selfProfileRoleRefresh = function(){ - SelfProfileService.getSelfProfileDetail().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profileTemp =JSON.parse($scope.data.profile); - $rootScope.$broadcast('updateRoles',{data:$scope.profileTemp.roles}); - }); - } - $scope.profileRoleRefresh = function(profileId){ - SelfProfileService.getProfileDetail(profileId).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profileTemp =JSON.parse($scope.data.profile); - $rootScope.$broadcast('updateRoles',{data:$scope.profileTemp.roles}); - }); - } - $scope.roleTableRefresh = function (profileId) { - if($scope.pageType==1) - $scope.selfProfileRoleRefresh(); - else - $scope.profileRoleRefresh(profileId); - }; - - }; - -}); -function initDropdownWithLookUp(arr,selectedValue){ - var dropdownArray=[]; - var selected = null; - if(arr){ - for(var i = 0,l = arr.length; i < l; i++) { - var option = { - "index" : i , - "value" : arr[i].value, - "title" : arr[i].label - }; - dropdownArray.push(option); - if(arr[i].value === selectedValue){ - selected = option; - } - } - } - var dropDown={}; - dropDown.options = dropdownArray; - dropDown.selected = selected!=null?selected:{"index":'',"value":"","title":""}; - return dropDown; -}; diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js deleted file mode 100644 index b15205fc..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js +++ /dev/null @@ -1,499 +0,0 @@ -appDS2.controller('reportChartController', function ($scope, $rootScope, $timeout, $window, $modal, $http, $routeParams,modalService) { - $scope.showLoader = true; - $scope.commonOptionOpen = false; - $scope.additionalOptionOpen = false; - $scope.barChartOptionOpen = false; - $scope.timeSeriesChartOptionOpen = false; - $scope.selectedChartType = {value:""}; - $scope.chartTypeOptions = [ - {value: 'BarChart3D', text: 'Bar Chart'}, - {value: 'TimeSeriesChart', text: 'Time Series/Area Chart'}, - {value: 'PieChart', text: 'Pie Chart'}, - {value: 'AnnotationChart', text: 'Annotation Chart'}, - {value: 'FlexTimeChart', text: 'Flexible Time Chart'} - ]; - - $scope.populateChrtWzdFields = function() { - $scope.reportRunJson = {}; - $scope.showLoader=true; - $http.get("raptor.htm?action=chart.json&c_master="+$routeParams.reportId).then(function (response) { - $scope.showLoader=false; - $scope.reportRunJson = response.data; - //Set chart type - if($scope.reportRunJson.commonChartOptions!=null){ - $scope.reportRunJson.commonChartOptions.animateAnimatedChart = $scope.reportRunJson.commonChartOptions.animateAnimatedChart+""; - $scope.reportRunJson.commonChartOptions.hideLegend = $scope.reportRunJson.commonChartOptions.hideLegend + ""; - } - - $scope.reportRunJson.showTitle = $scope.reportRunJson.showTitle + ""; - - // if barChartOptions is not null - if ($scope.reportRunJson.barChartOptions) { - $scope.reportRunJson.barChartOptions.displayBarControls = $scope.reportRunJson.barChartOptions.displayBarControls+""; - $scope.reportRunJson.barChartOptions.minimizeXAxisTickers = $scope.reportRunJson.barChartOptions.minimizeXAxisTickers+""; - $scope.reportRunJson.barChartOptions.stackedChart = $scope.reportRunJson.barChartOptions.stackedChart+""; - $scope.reportRunJson.barChartOptions.timeAxis =$scope.reportRunJson.barChartOptions.timeAxis+""; - $scope.reportRunJson.barChartOptions.verticalOrientation = $scope.reportRunJson.barChartOptions.verticalOrientation +""; - $scope.reportRunJson.barChartOptions.xAxisDateType = $scope.reportRunJson.barChartOptions.xAxisDateType +""; - } - - if ($scope.reportRunJson.chartTypeJSON) { - var chrtTypeValue = $scope.reportRunJson.chartType; - for(var i = 0; i < $scope.chartTypes.length; i++) { - if ($scope.chartTypes[i].value==chrtTypeValue) { - $scope.reportRunJson.chartTypeJSON.index=$scope.chartTypes[i].index; - $scope.reportRunJson.chartTypeJSON.value=$scope.chartTypes[i].value; - $scope.reportRunJson.chartTypeJSON.title=$scope.chartTypes[i].title; - } - - } - } - - //Set Domain Axis - if ($scope.reportRunJson.domainAxisJSON) { - var domaninAxisValue = $scope.reportRunJson.domainAxisJSON.value; - for(var i = 0; i < $scope.reportRunJson.chartColumnJSONList.length; i++) { - if ($scope.reportRunJson.chartColumnJSONList[i].value==domaninAxisValue) { - $scope.reportRunJson.domainAxisJSON.index=$scope.reportRunJson.chartColumnJSONList[i].index; - $scope.reportRunJson.domainAxisJSON.title=$scope.reportRunJson.chartColumnJSONList[i].title; - } - - } - } - - //Set Category - if ($scope.reportRunJson.categoryAxisJSON) { - var categoryAxisValue = $scope.reportRunJson.categoryAxisJSON.value; - for(var i = 0; i < $scope.reportRunJson.chartColumnJSONList.length; i++) { - if ($scope.reportRunJson.chartColumnJSONList[i].value==categoryAxisValue) { - $scope.reportRunJson.categoryAxisJSON.index=$scope.reportRunJson.chartColumnJSONList[i].index; - $scope.reportRunJson.categoryAxisJSON.title=$scope.reportRunJson.chartColumnJSONList[i].title; - } - } - } - - //Set range axis label - if ($scope.reportRunJson.rangeAxisList) { - for(var j = 0; j < $scope.reportRunJson.rangeAxisList.length; j++) { - - if ($scope.reportRunJson.rangeAxisList[j].rangeAxisLabelJSON) { - var rangeAxisLabelValue = $scope.reportRunJson.rangeAxisList[j].rangeAxisLabelJSON.value; - for(var i = 0; i < $scope.reportRunJson.chartColumnJSONList.length; i++) { - if ($scope.reportRunJson.chartColumnJSONList[i].value==rangeAxisLabelValue) { - $scope.reportRunJson.rangeAxisList[j].rangeAxisLabelJSON.index=$scope.reportRunJson.chartColumnJSONList[i].index; - $scope.reportRunJson.rangeAxisList[j].rangeAxisLabelJSON.title=$scope.reportRunJson.chartColumnJSONList[i].title; - } - } - } - } - } - - - //set range linetype - if ($scope.reportRunJson.rangeAxisList) { - for(var j = 0; j < $scope.reportRunJson.rangeAxisList.length; j++) { - if ($scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON != null && $scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON.value != "" - && $scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON.value != null) { - var lineTypeValue = $scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON.value; - for(var i = 0; i < $scope.lineTypes.length; i++) { - if ($scope.lineTypes[i].value==lineTypeValue) { - $scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON.index=$scope.lineTypes[i].index; - $scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON.title=$scope.lineTypes[i].title; - } - } - } else { - $scope.reportRunJson.rangeAxisList[j].rangeLineTypeJSON = null; - } - } - } - //set range color - if ($scope.reportRunJson.rangeAxisList) { - for(var j = 0; j < $scope.reportRunJson.rangeAxisList.length; j++) { - if ($scope.reportRunJson.rangeAxisList[j].rangeColorJSON != null && $scope.reportRunJson.rangeAxisList[j].rangeColorJSON.value != "" - && $scope.reportRunJson.rangeAxisList[j].rangeColorJSON.value != null) { - var colorValue = $scope.reportRunJson.rangeAxisList[j].rangeColorJSON.value; - for(var i = 0; i < $scope.rangeColors.length; i++) { - if ($scope.rangeColors[i].value==colorValue) { - $scope.reportRunJson.rangeAxisList[j].rangeColorJSON.index=$scope.rangeColors[i].index; - $scope.reportRunJson.rangeAxisList[j].rangeColorJSON.title=$scope.rangeColors[i].title; - } - } - }else { - $scope.reportRunJson.rangeAxisList[j].rangeColorJSON = null; - } - } - } - $scope.showLoader = false; - }); - - $scope.legend = "true"; - } - - $scope.saveChartData = function() { - $scope.showLoader = true; - if($scope.reportRunJson.commonChartOptions){ - $scope.reportRunJson.commonChartOptions.animateAnimatedChart = ($scope.reportRunJson.commonChartOptions.animateAnimatedChart=="true") - $scope.reportRunJson.commonChartOptions.hideLegend = ($scope.reportRunJson.commonChartOptions.hideLegend=="true"); - } - - $scope.reportRunJson.showTitle = ($scope.reportRunJson.showTitle=="true"); - - $scope.reportRunJson.chartTypeJSON = { - 'index':0,'title':'','value':''}; - - - if (($scope.reportRunJson.chartType == "BarChart3D")&&($scope.reportRunJson.barChartOptions)) { - $scope.reportRunJson.barChartOptions.displayBarControls = ($scope.reportRunJson.barChartOptions.displayBarControls=="true") ; - $scope.reportRunJson.barChartOptions.minimizeXAxisTickers = ($scope.reportRunJson.barChartOptions.minimizeXAxisTickers=="true") ; - $scope.reportRunJson.barChartOptions.stackedChart = ($scope.reportRunJson.barChartOptions.stackedChart=="true") ; - $scope.reportRunJson.barChartOptions.timeAxis= ($scope.reportRunJson.barChartOptions.timeAxi=="true") ; - $scope.reportRunJson.barChartOptions.verticalOrientation = ($scope.reportRunJson.barChartOptions.verticalOrientation=="true") ; - $scope.reportRunJson.barChartOptions.xAxisDateType = ($scope.reportRunJson.barChartOptions.xAxisDateType=="true") ; - } - - for (var i=0;i<$scope.chartTypes.length;i++) { - if ($scope.reportRunJson.chartType==$scope.chartTypes[i].value) { - $scope.reportRunJson.chartTypeJSON = { - 'index':$scope.chartTypes[i].index, - 'title':$scope.chartTypes[i].title, - 'value':$scope.chartTypes[i].value - } - } - } - - $scope.reportRunJson.domainAxisJSON = { - "index":0,"value":$scope.reportRunJson.domainAxis,"title": $scope.reportRunJson.domainAxis - }; - $scope.reportRunJson.categoryAxisJSON = { - "index":0,"value":$scope.reportRunJson.categoryAxis,"title": $scope.reportRunJson.categoryAxis - }; - - // Specifically for DS2 for color - for (var i=0; i<$scope.reportRunJson.rangeAxisList.length; i ++) { - $scope.reportRunJson.rangeAxisList[i].rangeColorJSON = - {"index":0, "value": $scope.reportRunJson.rangeAxisList[i].rangeColor, "title": ""}; - - $scope.reportRunJson.rangeAxisList[i].rangeLineTypeJSON = - {"index":0, "value": "", "title": ""}; - for (var j=0;j<$scope.lineTypes.length;j++) { - if ($scope.reportRunJson.rangeAxisList[i].rangeLineType ==$scope.lineTypes[j].value) { - $scope.reportRunJson.rangeAxisList[i].rangeLineTypeJSON = - {"index":$scope.lineTypes[j].index, "value": $scope.lineTypes[j].value, "title": $scope.lineTypes[j].title}; - } - } - - } - - //Converting string variables to numbers - $scope.reportRunJson.commonChartOptions.rightMargin = Number($scope.reportRunJson.commonChartOptions.rightMargin); - $scope.reportRunJson.commonChartOptions.topMargin = Number($scope.reportRunJson.commonChartOptions.topMargin); - $scope.reportRunJson.commonChartOptions.bottomMargin = Number($scope.reportRunJson.commonChartOptions.bottomMargin); - $scope.reportRunJson.commonChartOptions.leftMargin = Number($scope.reportRunJson.commonChartOptions.leftMargin); - - if ($scope.reportRunJson.categoryAxisJSON == "") { - $scope.reportRunJson.categoryAxisJSON = {}; - $scope.reportRunJson.categoryAxisJSON.value = -1; - } - //add the remove list to the json - $scope.reportRunJson.rangeAxisRemoveList= $scope.rangeAxisRemoveList; - $http.post("save_chart", JSON.stringify($scope.reportRunJson)).success(function(data, status) { - $scope.successSubmit=true; - $scope.showLoader = false; - $scope.reportRunJson.commonChartOptions.animateAnimatedChart = $scope.reportRunJson.commonChartOptions.animateAnimatedChart+""; - $scope.reportRunJson.commonChartOptions.hideLegend = $scope.reportRunJson.commonChartOptions.hideLegend + ""; - $scope.reportRunJson.showTitle = $scope.reportRunJson.showTitle + ""; - if ($scope.reportRunJson.chartType == "BarChart3D" && $scope.reportRunJson.barChartOptions) { - $scope.reportRunJson.barChartOptions.displayBarControls = $scope.reportRunJson.barChartOptions.displayBarControls+""; - $scope.reportRunJson.barChartOptions.minimizeXAxisTickers = $scope.reportRunJson.barChartOptions.minimizeXAxisTickers+""; - $scope.reportRunJson.barChartOptions.stackedChart = $scope.reportRunJson.barChartOptions.stackedChart+""; - $scope.reportRunJson.barChartOptions.timeAxis =$scope.reportRunJson.barChartOptions.timeAxis+""; - $scope.reportRunJson.barChartOptions.verticalOrientation = $scope.reportRunJson.barChartOptions.verticalOrientation +""; - $scope.reportRunJson.barChartOptions.xAxisDateType = $scope.reportRunJson.barChartOptions.xAxisDateType +""; - } - $scope.successPopUp(); - $scope.populateChrtWzdFields(); - }) - } - - - $scope.addRangeAxisRow = function (rangeaxisitem) { - $scope.reportRunJson.rangeAxisList.push({ - }); - }; - - $scope.rangeAxisRemoveList= []; - $scope.removeRangeAxisRow = function (index) { - $scope.rangeAxisRemoveList.push($scope.reportRunJson.rangeAxisList[index]); - $scope.reportRunJson.rangeAxisList[index].removed="true"; - }; - - - $scope.init = function () { - if ($scope) { - $scope.populateChrtWzdFields(); - $scope.reportRunJson.rangeAxisRemoveList= []; - } - }; - - - - $scope.domainItems = [{title:"Domain Axis1", content:"Test1", open: false},{title:"Domain Axis2", content:"Test2", open: false}]; - - $scope.chartTypes = [ - {index: 0, value: 'BarChart3D', title: 'Bar Chart'}, - {index: 1, value: 'TimeSeriesChart', title: 'Time Series/Area Chart'}, - {index: 2, value: 'PieChart', title: 'Pie Chart'}, - {index: 3, value: 'AnnotationChart', title: 'Annotation Chart'}, - {index: 4, value: 'FlexTimeChart', title: 'Flexible Time Chart'} - ]; - - $scope.categories = [ - {index: 0, value: 'scenario_name', title: 'scenario_name'}, - {index: 1, value: 'total_traffic_in_PB', title: 'Total Traffic in PB'}, - {index: 2, value: 'Avg Utilization Day', title: 'Avg Utilization Day'} - ]; - - $scope.rangeColors = [ - {index: 0, value: "#1f77b4",title: "Dodger Blue"}, - {index: 1, value: "#ff7f0e",title: "Vivid orange"}, - {index: 2, value: "#2ca02c",title: "Forest Green"}, - {index: 3, value: "#8c864b",title: "Greenish Red"}, - {index: 4, value: "#9467bd",title: "Desaturated violet"}, - {index: 5, value: "#8c564b",title: "Dark moderate red"}, - {index: 6, value: "#e377c2",title: "Soft pink"}, - {index: 7, value: "#7f7f7f",title: "Dark gray"}, - {index: 8, value: "#bcbd22",title: "Strong yellow"}, - {index: 9, value: "#17becf",title: "Strong cyan"}, - {index: 10, value: "#dc143c",title: "Vivid red"}, - {index: 11, value: "#800080",title: "Dark magenta"}, - {index: 12, value: "#0000FF",title: "Blue"}, - {index: 13, value: "#008000",title: "Dark lime green"}, - {index: 14, value: "#D2691E",title: "Reddish Orange"}, - {index: 15, value: "#FF0000",title: "Red"}, - {index: 16, value: "#000000",title: "Black"}, - {index: 17, value: "#DB7093",title: "Pink"}, - {index: 18, value: "#FF00FF",title: "Pure Magenta"}, - {index: 19, value: "#7B68EE",title: "Soft blue"}, - {index: 20, value: "#1f77b6",title: "Strong blue"}, - {index: 21, value: "#9edae5",title: "Very soft cyan"}, - {index: 22, value: "#393b79",title: "Dark Blue"}, - {index: 23, value: "#5254a3",title: "Dark moderate Blue"}, - {index: 24, value: "#6b6ecf",title: "Slightly desaturated blue"}, - {index: 25, value: "#9c9ede",title: "Very soft blue"}, - {index: 26, value: "#637939",title: "Dark Green"}, - {index: 27, value: "#8ca252",title: "Dark moderate green"}, - {index: 28, value: "#b5cf6b",title: "Slightly desaturated green"}, - {index: 29, value: "#cedb9c",title: "Desaturated Green"}, - - /* Old Colors */ - {index: 30, value: "#00FFFF",title: "Aqua"}, - {index: 31, value: "#000000",title: "Black"}, - {index: 32, value: "#0000FF",title: "Blue"}, - {index: 33, value: "#FF00FF",title: "Fuchsia"}, - {index: 34, value: "#808080",title: "Gray"}, - {index: 35, value: "#008000",title: "Green"}, - {index: 36, value: "#00FF00",title: "Lime"}, - {index: 37, value: "#800000",title: "Maroon"}, - {index: 38, value: "#000080",title: "Navy"}, - {index: 39, value: "#808000",title: "Olive"}, - {index: 40, value: "#FF9900",title: "Orange"}, - {index: 41, value: "#800080",title: "Purple"}, - {index: 42, value: "#FF0000",title: "Red"}, - {index: 43, value: "#C0C0C0",title: "Silver"}, - {index: 44, value: "#008080",title: "Teal"}, - {index: 45, value: "#FFFFFF",title: "White"}, - {index: 46, value: "#FFFF00",title: "Yellow"} - ]; - - - $scope.lineTypes = [ - {index: 0, value: 'default', title: 'Default'}, - {index: 1, value: 'dotted_lines', title: 'Dotted Lines'}, - {index: 2, value: 'dashed_lines', title: 'Dashed Lines'} - ]; - - $scope.hardCodeReport= { - "reportID":"3356", - "reportName":"Test: Line Chart", - "reportDescr":"", - "reportTitle":"", - "reportSubTitle":"", - "formFieldList":[ - ], - "chartColumnJSONList":[ - { - "index":0, - "value":"tr0", - "title":"traffic_date", - "$$hashKey":"056" - }, - { - "index":1, - "value":"ut1", - "title":"util_perc", - "$$hashKey":"057" - } - ], - "formfield_comments":null, - "totalRows":0, - "chartSqlWhole":"SELECT traffic_date tr0, traffic_date tr0_1,util_perc ut1, 1 FROM portal.demo_util_chart ORDER BY 1", - "chartAvailable":true, - "chartType":{"index": "", "value": "Bar Chart", "title": ""}, - "width":"700", - "height":"420", - "animation":false, - "rotateLabels":"90", - "staggerLabels":false, - "showTitle":"false", - "domainAxis":{ - "index":0, - "value":"tr0", - "title":"traffic_date", - "$$hashKey":"11H" - }, - - "categoryAxis":{ - "index":1, - "value":"ut1", - "title":"util_perc", - "$$hashKey":"11I" - }, - - "hasCategoryAxis":false, - "rangeAxisList":[ - { - - "rangeColor":{ - "index":"", - "value":"#bcbd22", - "title":"" - }, - - "rangeLineType":{ - "index":"", - "value":"dotted_lines", - "title":"" - }, - "rangeAxisLabel":{ - "index":0, - "value":"tr0", - "title":"traffic_date", - "$$hashKey":"056" - }, - "YAxis":"10", - "chartTitle":"test" - }, - { - "rangeColor":{ - "index":"", - "value":"#2ca02c", - "title":"" - }, - - "rangeLineType":{ - "index":"", - "value":"dashed_lines", - "title":"" - - - }, - - "rangeAxisLabel":{ - "index":0, - "value":"tr0", - "title":"traffic_date", - "$$hashKey":"056" - }, - "YAxis":"10", - "chartTitle":"test" - } - - - ], - - "primaryAxisLabel":"testlabel", - "secondaryAxisLabel":"testseclabel", - "minRange":"10", - "maxRange":"20", - "topMargin":"6", - "bottomMargin":"5", - "leftMargin":"4", - "rightMargin":"3" - }; - - var colorValue = $scope.hardCodeReport.rangeAxisList[0].rangeColor.value; - - $timeout(function() { - $rootScope.isViewRendering = false; - }); - - $scope.successPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - msg: function () { - var message = { - title: '', - text: msg - }; - return message; - } - } - }); - }; - - $scope.errorPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - msg: function () { - return msg; - } - } - }); - }; - var ModalInstanceCtrl = function ($scope, $modalInstance, msg,$rootScope) { - $scope.msg=msg; - } - -}); - -appDS2.directive('onlyDigits', function () { - - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, element, attrs, ngModel) { - if (!ngModel) return; - ngModel.$parsers.unshift(function (inputValue) { - var digits = inputValue.split('').filter(function (s) { return (!isNaN(s) && s != ' '); }).join(''); - ngModel.$viewValue = digits; - ngModel.$render(); - return digits; - }); - } - }; -}); - -appDS2.directive('onlyCharacters', function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, element, attrs, ngModel) { - if (!ngModel) return; - ngModel.$parsers.unshift(function (inputValue) { - var digits = inputValue.split('').filter(function (s) { return (isNaN(s) && s != ' '); }).join(''); - ngModel.$viewValue = digits; - ngModel.$render(); - return digits; - }); - } - }; -}); - - - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-import-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-import-controller.js deleted file mode 100644 index a8f853fd..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-import-controller.js +++ /dev/null @@ -1,20 +0,0 @@ -appDS2.controller('reportImportController', function($scope,$http,$location, $routeParams, $q, $modal,$log,$window, raptorReportFactory, stepFormFactory, DOMHelper) { - $scope.importXML = function(){ - - var importXMLJSON = { - "tabId":"Import", - "tabName":"Import", - "reportXML":$scope.xmlContent - } - $scope.errorMessage = "" - raptorReportFactory.postImportXml(importXMLJSON).then(function(data){ - if (data.errormessage) { - $scope.errorMessage = data.errormessage; - } else { - $window.location.href = 'report#/report_wizard/-1'; - }; - },function(error){ - $log.error("raptorReportFactory: postImportXml failed."); - }); - } -});
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-router.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-router.js deleted file mode 100644 index 58913a40..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-router.js +++ /dev/null @@ -1,41 +0,0 @@ -appDS2.config(['$routeProvider', - function($routeProvider) { - $routeProvider. - when('/', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/report-search.html', - controller: 'reportSearchController' - }). - when('/report_search', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/report-search.html', - controller: 'reportSearchController' - }). - when('/report_run/:reportUrlParams*', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/report-run.html', - controller: 'reportRunController' - }). - when('/report_chart_wizard/:reportId', { - templateUrl: 'static/fusion/raptor/ebz/report_chart_wizard.html', - controller: 'ChartController' - }). - when('/report_chart/:reportId', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/report-chart-wizard.html', - controller: 'reportChartController' - }). - when("/report_wizard", { - templateUrl : "app/fusion/scripts/DS2-view-models/ds2-reports/report-step.html", - controller: "reportStepController" - }). - when("/report_wizard/:reportId", { - templateUrl : "app/fusion/scripts/DS2-view-models/ds2-reports/report-step.html", - controller: "reportStepController" - }). - when("/report_wizard/:reportMode/:reportId", { - templateUrl : "app/fusion/scripts/DS2-view-models/ds2-reports/report-step.html", - controller: "reportStepController" - }). - when("/report_import", { - templateUrl : "app/fusion/scripts/DS2-view-models/ds2-reports/report-import.html", - controller: "reportImportController" - }) - ; -}]);
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-run-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-run-controller.js deleted file mode 100644 index f5ec623a..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-run-controller.js +++ /dev/null @@ -1,374 +0,0 @@ -appDS2.controller("reportRunController", ['$scope','$rootScope','$routeParams','$http','dateFilter', '$window', '$timeout', 'rowSorter','$modal','$sanitize', - function ($scope,$rootScope,$routeParams,$http,dateFilter,$window,$timeout,rowSorter,$modal,$sanitize) { - $scope.dateformat = "MM/dd/yyyy"; - $scope.datetimeformat = "MM/dd/yyyy hh:mm a"; - $scope.showFormFields = false; - $scope.showGrid = false; - $scope.showChart = false; - $scope.showBackButton = false; - $scope.reportData = {}; - $scope.reportData.allowEdit = false; - $scope.formFieldSelectedValues = {}; - $scope.showFormFieldIds = false; - $scope.showFormFieldId = { - value: false - }; - $scope.isInProgress = true; - $scope.showLoader=false; - if($routeParams.reportUrlParams.indexOf("parent___params===")>-1) { - $scope.showBackButton = true; - $scope.parentReportUrlParams = $routeParams.reportUrlParams.substring($routeParams.reportUrlParams.indexOf("parent___params===")+18); - $scope.currentReportUrlParams = $routeParams.reportUrlParams.substring(0,$routeParams.reportUrlParams.indexOf("parent___params===")); - } else { - $scope.currentReportUrlParams = $routeParams.reportUrlParams; - } - // console.log($routeParams.reportUrlParams); - var parseQueryString = function( queryString ) { - var params = {}, queries, temp, i, l; - // Split into key/value pairs - queries = queryString.split("&"); - // Convert the array of strings into an object - for ( i = 0, l = queries.length; i < l; i++ ) { - temp = queries[i].split('='); - //console.log(temp[0]); - //console.log(temp[0] != "refresh"); - if(temp[0] && temp[0] != "refresh") - params[temp[0]] = temp[1]; - } - return params; - }; - - var convertQueryString = function(queryString) { - var keys = ""; var str = ""; - keys = Object.keys(queryString); - //console.log(keys); - for ( i = 0, l = keys.length; i < l; i++ ) { - str += keys[i]+"="+queryString[keys[i]] + "&"; - - } - return str; - //queryString = - } - - - - $scope.backToParentReport = function (){ - $window.location.href = "report#/report_run/"+$scope.parentReportUrlParams - } - - $scope.urlParams = parseQueryString($scope.currentReportUrlParams); - - $scope.reportChartURL = 'report#/report_chart/'+$scope.urlParams.c_master; - - $scope.reportEditURL = 'report#/report_wizard/'+$scope.urlParams.c_master; - - - $http.get('raptor.htm?action=report.run.container&'+$scope.currentReportUrlParams).then( - function(response){ - // console.log(response); - $scope.isInProgress = false; - if(response.data.errormessage!=null && response.data.errormessage!=''){ - $scope.errorPopUp(response.data.errormessage); - }else{ - $scope.reportData = response.data; - // console.log('reportData report run container response',$scope.reportData); - if ($scope.reportData.reportTitle) { - $scope.reportData.reportHeading = $scope.reportData.reportTitle; - if ($scope.reportData.reportSubTitle) { - $scope.reportData.reportSubTitle = $scope.reportData.reportSubTitle; - } - } - else - $scope.reportData.reportHeading = $scope.reportData.reportName; - if( ($scope.urlParams.hideChart === undefined || $scope.urlParams.hideChart) && $scope.reportData.chartAvailable && $scope.reportData.totalRows>=1){ - //console.log('raptor.htm?action=chart.run&'+convertQueryString($scope.urlParams)); - $http.get('raptor.htm?action=chart.run&'+convertQueryString($scope.urlParams)).then( - function(response){ - $scope.showChart = true; - document.getElementById('chartiframe').contentWindow.document.write(response.data); - document.getElementById('chartiframe').contentWindow.document.close(); - }); - } - - if($scope.reportData.displayForm && $scope.reportData.formFieldList && $scope.reportData.formFieldList.length>0 && !$scope.urlParams.hideFormFields){ - $scope.showFormFields = true; - } - } - - }); - $scope.getFormFieldSelectedValuesAsURL = function(){ - var formFieldsUrl = ''; - $scope.reportData.formFieldList.forEach(function(formField) { - if(formField.fieldType==='LIST_BOX') { - if($scope.formFieldSelectedValues && $scope.formFieldSelectedValues[formField.fieldId] ) { - formFieldsUrl = formFieldsUrl+formField.fieldId+'='+$scope.formFieldSelectedValues[formField.fieldId]+'&'; - } - } else if(formField.fieldType==='LIST_MULTI_SELECT') { - if($scope.formFieldSelectedValues[formField.fieldId].length >0) { - for (var i = 0; i < $scope.formFieldSelectedValues[formField.fieldId].length; i++) { - if($scope.formFieldSelectedValues[formField.fieldId][i].defaultValue){ - formFieldsUrl = formFieldsUrl+formField.fieldId+'='+$scope.formFieldSelectedValues[formField.fieldId][i].value+'&'; - } - } - } - } else if((formField.fieldType === 'text' || formField.fieldType === 'TEXT') && formField.validationType === 'DATE'){ - formFieldsUrl = formFieldsUrl+formField.fieldId+'='+dateFilter($scope.formFieldSelectedValues[formField.fieldId],$scope.dateformat)+'&'; - } else if((formField.fieldType === 'text' || formField.fieldType === 'TEXT') && formField.validationType === 'TIMESTAMP_MIN'){ - formFieldsUrl = formFieldsUrl+formField.fieldId+'='+dateFilter($scope.formFieldSelectedValues[formField.fieldId],$scope.datetimeformat)+'&'; - } else if((formField.fieldType === 'text' || formField.fieldType === 'TEXT') && $scope.formFieldSelectedValues[formField.fieldId] && $scope.formFieldSelectedValues[formField.fieldId] != ''){ - formFieldsUrl = formFieldsUrl+formField.fieldId+'='+$scope.formFieldSelectedValues[formField.fieldId]+'&'; - } - }); - //formFieldsUrl = str.slice(0, -1); - return formFieldsUrl; - - } - - $scope.runReport = function(pagination){ - $scope.showLoader=true; - var formFieldsUrl = $scope.getFormFieldSelectedValuesAsURL(); - /*if ($scope.reportData.reportTitle) - $scope.reportData.reportHeading = $scope.reportData.reportTitle; - else - $scope.reportData.reportHeading = $scope.reportData.reportName;*/ - - // console.log("pagination"); - if(!pagination) { - //console.log("refreshed ..."); - $scope.gridOptions.pageNumber = 1; - paginationOptions.pageNumber = 1; - paginationOptions.pageSize = $scope.reportData.pageSize; - //console.log($scope.gridOptions); - $scope.gridOptions.paginationCurrentPage = 1; - $scope.gridOptions.paginationPageSizes= [$scope.reportData.pageSize]; - $scope.gridOptions.paginationPageSize= $scope.reportData.pageSize; - if($scope.reportData.totalRows<14){ - $scope.gridHeight = ($scope.reportData.totalRows+7)*30+'px'; - } else{ - $scope.gridHeight = '400px'; - } - $scope.gridOptions.totalItems = $scope.reportData.totalRows; - $scope.gridOptions.data= $scope.reportData.reportDataRows; - $scope.gridOptions.exporterPdfHeader.text= $scope.reportData.reportName; - - } - $scope.currentReportUrlParams = 'c_master='+$scope.urlParams.c_master+'&'+formFieldsUrl+'&display_content=Y&r_page='+(paginationOptions.pageNumber-1); - $http.get('raptor.htm?action=report.run.container&c_master='+$scope.urlParams.c_master+'&'+formFieldsUrl+'refresh=Y&display_content=Y&r_page='+(paginationOptions.pageNumber-1)).then( - function(response){ - $scope.showLoader=false; - $scope.reportData = response.data; - if ($scope.reportData.reportTitle) { - $scope.reportData.reportHeading = $scope.reportData.reportTitle; - if ($scope.reportData.reportSubTitle) { - $scope.reportData.reportSubTitle = $scope.reportData.reportSubTitle; - } - } - else - $scope.reportData.reportHeading = $scope.reportData.reportName; - - if($scope.reportData.errormessage) { - //console.log($scope.reportData); - var stacktraceFP = $scope.reportData.stacktrace.substring(0, $scope.reportData.stacktrace.indexOf(":")+1); - document.getElementById('errorDiv').innerHTML = $sanitize(+stacktraceFP + " " + $scope.reportData.errormessage); - //console.log(document.getElementById('errorDiv').innerHtml); - //console.log(stacktraceFP + " " + $scope.reportData.errormessage); - } - if(!pagination) { - if( ($scope.urlParams.hideChart === undefined || $scope.urlParams.hideChart) && $scope.reportData.chartAvailable && $scope.reportData.totalRows>=1){ - // console.log('raptor.htm?action=chart.run&c_master='+$scope.urlParams.c_master+'&'+formFieldsUrl+'display_content=Y&r_page='+(paginationOptions.pageNumber-1)); - $http.get('raptor.htm?action=chart.run&c_master='+$scope.urlParams.c_master+'&'+formFieldsUrl+'display_content=Y&r_page='+(paginationOptions.pageNumber-1)).then( - function(response) { - // console.log(response.data); - $scope.showChart = true; - // console.log('response.data',response.data); - document.getElementById('chartiframe').contentWindow.document.write($sanitize(response.data)); - document.getElementById('chartiframe').contentWindow.document.close(); - }); - } else { - $scope.showChart = false; - } - } - if($scope.reportData.displayForm && $scope.reportData.formFieldList && $scope.reportData.formFieldList.length>0 && !$scope.urlParams.hideFormFields && !$scope.reportData.hideFormFieldsAfterRun){ - $scope.showFormFields = true; - } else { - $scope.showFormFields = false; - } - }); - }; - - var paginationOptions = { - pageNumber: 1, - pageSize: 5, - sort: null - }; - - var correctTotalPaginationTemplate = - //same as normal template, but fixed totals: {{(((grid.options.paginationCurrentPage-1)*grid.options.paginationPageSize)+1)}} {{(grid.options.paginationCurrentPage*grid.options.paginationPageSize>grid.options.totalItems?grid.options.totalItems:grid.options.paginationCurrentPage*grid.options.paginationPageSize)}} - "<div role=\"contentinfo\" class=\"ui-grid-pager-panel\" ui-grid-pager ng-show=\"grid.options.enablePaginationControls\"><div role=\"navigation\" class=\"ui-grid-pager-container\"><div role=\"menubar\" class=\"ui-grid-pager-control\"><button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-first\" ui-grid-one-bind-title=\"aria.pageToFirst\" ui-grid-one-bind-aria-label=\"aria.pageToFirst\" ng-click=\"pageFirstPageClick()\" ng-disabled=\"cantPageBackward()\"><div class=\"first-triangle\"><div class=\"first-bar\"></div></div></button> <button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-previous\" ui-grid-one-bind-title=\"aria.pageBack\" ui-grid-one-bind-aria-label=\"aria.pageBack\" ng-click=\"pagePreviousPageClick()\" ng-disabled=\"cantPageBackward()\"><div class=\"first-triangle prev-triangle\"></div></button> <input type=\"number\" ui-grid-one-bind-title=\"aria.pageSelected\" ui-grid-one-bind-aria-label=\"aria.pageSelected\" class=\"ui-grid-pager-control-input\" ng-model=\"grid.options.paginationCurrentPage\" min=\"1\" max=\"{{ paginationApi.getTotalPages() }}\" required> <span class=\"ui-grid-pager-max-pages-number\" ng-show=\"paginationApi.getTotalPages() > 0\"><abbr ui-grid-one-bind-title=\"paginationOf\">/</abbr> {{ paginationApi.getTotalPages() }}</span> <button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-next\" ui-grid-one-bind-title=\"aria.pageForward\" ui-grid-one-bind-aria-label=\"aria.pageForward\" ng-click=\"pageNextPageClick()\" ng-disabled=\"cantPageForward()\"><div class=\"last-triangle next-triangle\"></div></button> <button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-last\" ui-grid-one-bind-title=\"aria.pageToLast\" ui-grid-one-bind-aria-label=\"aria.pageToLast\" ng-click=\"pageLastPageClick()\" ng-disabled=\"cantPageToLast()\"><div class=\"last-triangle\"><div class=\"last-bar\"></div></div></button></div><div class=\"ui-grid-pager-row-count-picker\" ng-if=\"grid.options.paginationPageSizes.length > 1\"><select ui-grid-one-bind-aria-labelledby-grid=\"'items-per-page-label'\" ng-model=\"grid.options.paginationPageSize\" ng-options=\"o as o for o in grid.options.paginationPageSizes\"></select><span ui-grid-one-bind-id-grid=\"'items-per-page-label'\" class=\"ui-grid-pager-row-count-label\"> {{sizesLabel}}</span></div><span ng-if=\"grid.options.paginationPageSizes.length <= 1\" class=\"ui-grid-pager-row-count-label\">{{grid.options.paginationPageSize}} {{sizesLabel}}</span></div><div class=\"ui-grid-pager-count-container\"><div class=\"ui-grid-pager-count\"><span ng-show=\"grid.options.totalItems > 0\">{{(((grid.options.paginationCurrentPage-1)*grid.options.paginationPageSize)+1)}} <abbr ui-grid-one-bind-title=\"paginationThrough\">-</abbr> {{(grid.options.paginationCurrentPage*grid.options.paginationPageSize>grid.options.totalItems?grid.options.totalItems:grid.options.paginationCurrentPage*grid.options.paginationPageSize)}} {{paginationOf}} {{grid.options.totalItems}} {{totalItemsLabel}}</span></div></div></div>"; - - $scope.gridOptions = { - pageNumber: 1, - useExternalPagination: true, - sort : null, - paginationPageSizes: [5], - paginationPageSize: 5, - paginationTemplate: correctTotalPaginationTemplate, - columnDefs: [], - data: [], - enableSorting: true, - enableGridMenu: true, - enableSelectAll: true, - gridMenuCustomItems : [ - { title : 'All Reports', - action : function($event) { - $window.open('report.htm','_self'); - }, order : 210 }, - { title : 'Edit Report', - action : function($event) { - $window.open($scope.reportEditURL,'_self'); - }, order : 211 }, - /*{ title : 'Export All data as Excel 2007', - action : function($event) { - $window.open('raptor.htm?c_master='+$scope.reportData.reportID+'&r_action=report.download.excel2007.session','_self'); - }, order : 212 },*/ - { title : 'Export All data as Excel', - action : function($event) { - $window.open('raptor.htm?c_master='+$scope.reportData.reportID+'&r_action=report.download.excel.session','_self'); - }, order : 213 }, - { title : 'Export All data as CSV', - action : function($event) { - $window.open('raptor.htm?c_master='+$scope.reportData.reportID+'&r_action=report.download.csv.session','_self'); - }, order : 214 }, - { title : 'Export All data as PDF', - action : function($event) { - $window.open('raptor.htm?c_master='+$scope.reportData.reportID+'&r_action=report.download.pdf.session','_self'); - }, order : 215 } ], - exporterMenuPdf: false, - exporterMenuCsv: false, - exporterCsvFilename: 'myFile.csv', - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi) { - $scope.gridApi = gridApi; - gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) { - paginationOptions.pageNumber = newPage; - paginationOptions.pageSize = pageSize; - $scope.runReport(true); - }); - } - }; - - $scope.uiGridRefresh = function(){ - var columnDefsArray = []; - var columnFreezeEndColumn = $scope.reportData.colIdxTobeFreezed; - var doColumnNeedToFreeze = false; - if(columnFreezeEndColumn && columnFreezeEndColumn.length>0) { - doColumnNeedToFreeze = true; - } - $scope.reportData.reportDataColumns.forEach(function(entry) { - var tempColumnDef = { displayName: entry.columnTitle, field: entry.colId, enableSorting: entry.sortable, - sortingAlgorithm: function(a, b) { - return rowSorter.sortAlpha(a.displayValue, b.displayValue); - }, - cellTemplate: '<div class="ui-grid-cell-contents" style="text-align:{{COL_FIELD.alignment}};" title="TOOLTIP"> '+ - ' <div ng-if="!COL_FIELD.drillDownURL || COL_FIELD.drillDownURL==\'\'">{{COL_FIELD.displayValue}}</div>' + - ' <a ng-if="COL_FIELD.drillDownURL && COL_FIELD.drillDownURL!=\'\'" ng-href="{{COL_FIELD.drillDownURL}}&parent___params==={{grid.appScope.currentReportUrlParams}}" >{{COL_FIELD.displayValue}}</a>' + - '</div>'}; - if(entry.columnWidth && entry.columnWidth!='null' && entry.columnWidth!='pxpx' && entry.columnWidth!='nullpx' && entry.columnWidth!='nullpxpx'){ - tempColumnDef['minWidth'] = entry.columnWidth.substring(0, entry.columnWidth.length - 2); - } else { - tempColumnDef['minWidth'] = '100'; - } - if(doColumnNeedToFreeze) { - tempColumnDef['pinnedLeft']= true; - if(columnFreezeEndColumn === entry.colId){ - doColumnNeedToFreeze = false; - } - } - columnDefsArray.push(tempColumnDef); - }); - - $scope.gridOptions.paginationPageSizes= [$scope.reportData.pageSize]; - $scope.gridOptions.paginationPageSize= $scope.reportData.pageSize; - if($scope.reportData.totalRows<14){ - $scope.gridHeight = ($scope.reportData.totalRows+5)*30+'px'; - }else{ - $scope.gridHeight = '400px'; - } - $scope.gridOptions.totalItems = $scope.reportData.totalRows; - $scope.gridOptions.columnDefs= columnDefsArray; - $scope.gridOptions.data= $scope.reportData.reportDataRows; - $scope.gridOptions.exporterPdfHeader.text= $scope.reportData.reportName; - }; - - $scope.$watch("reportData",function(newValue,oldValue) { - if(!$scope.urlParams.hideGrid){ - if($scope.reportData){ - if($scope.reportData.displayData && $scope.reportData.reportDataColumns){ - $scope.showGrid = true; - $scope.uiGridRefresh(); - } - } - } - }); - - $scope.triggerOtherFormFields = function(){ - // console.log("report_run"); - var formFieldsUrl = $scope.getFormFieldSelectedValuesAsURL(); - $http.get('raptor.htm?action=report.formfields.run.container&c_master='+$scope.reportData.reportID+'&'+formFieldsUrl).then( - function(response){ - $scope.reportData = response.data; - if($scope.reportData.reportHeading==null || $scope.reportData.reportHeading=='') - $scope.reportData.reportHeading = ($scope.reportData.reportTitle=='')?$scope.reportData.reportName:$scope.reportData.reportTitle; - }); - }; - $timeout(function() { - $rootScope.isViewRendering = false; - }); - $scope.successPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - msg: function () { - var message = { - title: '', - text: msg - }; - return message; - } - } - }); - }; - - $scope.errorPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - msg: function () { - return msg; - } - } - }); - }; - var ModalInstanceCtrl = function ($scope, $modalInstance, msg,$rootScope) { - $scope.msg=msg; - } -}]); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-search-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-search-controller.js deleted file mode 100644 index 36a541ed..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-search-controller.js +++ /dev/null @@ -1,244 +0,0 @@ -appDS2.requires.push('ui.grid'); -appDS2.requires.push('ui.grid.pagination'); -appDS2.requires.push('ui.grid.resizeColumns'); -appDS2.controller("reportSearchController", ['$scope','$rootScope','$http','$timeout','uiGridConstants','$modal','$q','$log','raptorReportFactory',function ($scope,$rootScope,$http,$timeout,uiGridConstants,$modal,$q,$log,raptorReportFactory) { - $scope.showLoader=false; - $scope.getSearchData = function(){ - $scope.showLoader=true; - - raptorReportFactory.getSearchData().then(function(data){ - $scope.searchdData = data; - },function(error){ - $log.error("raptorReportFactory: getSearchData failed."); - }).finally(function() { - $scope.showLoader=false;// Always execute this on both error and success - });; - } - - $scope.getSearchData(); - - $scope.runReport = function(){ - var searchParams = ''; - if($scope.reportId && $scope.reportId!=''){ - searchParams = '&rep_id='+$scope.reportId+'&rep_id_options='+$scope.operatorRepId.index; - } - if($scope.reportName && $scope.reportName!=''){ - searchParams = searchParams+'&rep_name='+$scope.reportName+'&rep_name_options='+$scope.operatorRepName.index; - } - $scope.showLoader=true; - var pageSearchParameter = ($scope.paginationOptions.pageNumber-1)+searchParams - raptorReportFactory.getSearchDataAtPage(pageSearchParameter).then(function(data){ - $scope.searchdData = data - },function(error){ - $log.error("raptorReportFactory: getSearchDataAtPage failed."); - }).finally(function() { - $scope.showLoader=false;// Always execute this on both error and success - - }); - }; - - - $scope.paginationOptions = { - pageNumber: 1, - pageSize: 5, - sort: null - }; - - function convertValue(v){ - return parseInt(v.displayValue); - } - - $scope.getSortingAlgorithm= function (columnName) { - return function(a, b, rowA, rowB, direction) { - console.log("sorting by column " + columnName,a,b); - if(columnName=='rep_id'){ - if(a && b && a.displayValue && b.displayValue){ - if (convertValue(a) == convertValue(b)) return 0; - if (convertValue(a) < convertValue(b)) return -1; - if (convertValue(a) > convertValue(b)) return 1; - }else{ - return 0; - } - }else if(columnName=='rep_name'){ - if(a && b && a.displayValue && b.displayValue){ - if (a.displayValue == b.displayValue) return 0; - if (a.displayValue < b.displayValue) return -1; - if (a.displayValue > b.displayValue) return 1; - }else{ - return 0; - } - }else if(columnName=='descr'){ - if(a && b && a.displayValue && b.displayValue){ - if (a.displayValue == b.displayValue) return 0; - if (a.displayValue < b.displayValue) return -1; - if (a.displayValue > b.displayValue) return 1; - }else{ - return 0; - } - }else if(columnName=='owner'){ - if(a && b && a.displayValue && b.displayValue){ - if (a.displayValue == b.displayValue) return 0; - if (a.displayValue < b.displayValue) return -1; - if (a.displayValue > b.displayValue) return 1; - }else{ - return 0; - } - }else if(columnName=='create_date'){ - if(a && b && a.displayValue && b.displayValue){ - if (a.displayValue == b.displayValue) return 0; - if (a.displayValue < b.displayValue) return -1; - if (a.displayValue > b.displayValue) return 1; - }else{ - return 0; - } - } - } - }; - - var correctTotalPaginationTemplate = - //same as normal template, but fixed totals: {{(((grid.options.paginationCurrentPage-1)*grid.options.paginationPageSize)+1)}} {{(grid.options.paginationCurrentPage*grid.options.paginationPageSize>grid.options.totalItems?grid.options.totalItems:grid.options.paginationCurrentPage*grid.options.paginationPageSize)}} - "<div role=\"contentinfo\" class=\"ui-grid-pager-panel\" ui-grid-pager ng-show=\"grid.options.enablePaginationControls\"><div role=\"navigation\" class=\"ui-grid-pager-container\"><div role=\"menubar\" class=\"ui-grid-pager-control\"><button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-first\" ui-grid-one-bind-title=\"aria.pageToFirst\" ui-grid-one-bind-aria-label=\"aria.pageToFirst\" ng-click=\"pageFirstPageClick()\" ng-disabled=\"cantPageBackward()\"><div class=\"first-triangle\"><div class=\"first-bar\"></div></div></button> <button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-previous\" ui-grid-one-bind-title=\"aria.pageBack\" ui-grid-one-bind-aria-label=\"aria.pageBack\" ng-click=\"pagePreviousPageClick()\" ng-disabled=\"cantPageBackward()\"><div class=\"first-triangle prev-triangle\"></div></button> <input type=\"number\" ui-grid-one-bind-title=\"aria.pageSelected\" ui-grid-one-bind-aria-label=\"aria.pageSelected\" class=\"ui-grid-pager-control-input\" ng-model=\"grid.options.paginationCurrentPage\" min=\"1\" max=\"{{ paginationApi.getTotalPages() }}\" required> <span class=\"ui-grid-pager-max-pages-number\" ng-show=\"paginationApi.getTotalPages() > 0\"><abbr ui-grid-one-bind-title=\"paginationOf\">/</abbr> {{ paginationApi.getTotalPages() }}</span> <button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-next\" ui-grid-one-bind-title=\"aria.pageForward\" ui-grid-one-bind-aria-label=\"aria.pageForward\" ng-click=\"pageNextPageClick()\" ng-disabled=\"cantPageForward()\"><div class=\"last-triangle next-triangle\"></div></button> <button type=\"button\" role=\"menuitem\" class=\"ui-grid-pager-last\" ui-grid-one-bind-title=\"aria.pageToLast\" ui-grid-one-bind-aria-label=\"aria.pageToLast\" ng-click=\"pageLastPageClick()\" ng-disabled=\"cantPageToLast()\"><div class=\"last-triangle\"><div class=\"last-bar\"></div></div></button></div><div class=\"ui-grid-pager-row-count-picker\" ng-if=\"grid.options.paginationPageSizes.length > 1\"><select ui-grid-one-bind-aria-labelledby-grid=\"'items-per-page-label'\" ng-model=\"grid.options.paginationPageSize\" ng-options=\"o as o for o in grid.options.paginationPageSizes\"></select><span ui-grid-one-bind-id-grid=\"'items-per-page-label'\" class=\"ui-grid-pager-row-count-label\"> {{sizesLabel}}</span></div><span ng-if=\"grid.options.paginationPageSizes.length <= 1\" class=\"ui-grid-pager-row-count-label\">{{grid.options.paginationPageSize}} {{sizesLabel}}</span></div><div class=\"ui-grid-pager-count-container\"><div class=\"ui-grid-pager-count\"><span ng-show=\"grid.options.totalItems > 0\">{{(((grid.options.paginationCurrentPage-1)*grid.options.paginationPageSize)+1)}} <abbr ui-grid-one-bind-title=\"paginationThrough\">-</abbr> {{(grid.options.paginationCurrentPage*grid.options.paginationPageSize>grid.options.totalItems?grid.options.totalItems:grid.options.paginationCurrentPage*grid.options.paginationPageSize)}} {{paginationOf}} {{grid.options.totalItems}} {{totalItemsLabel}}</span></div></div></div>"; - - $scope.gridOptions = { - paginationPageSizes: [5], - paginationPageSize: 5, - paginationTemplate: correctTotalPaginationTemplate, - columnDefs: [], - enableColumnResizing: true, - data: [], - enableGridMenu: true, - enableSelectAll: true, - exporterMenuPdf: false, - exporterMenuCsv: false, - exporterCsvFilename: 'myFile.csv', - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi) { - gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) { - $scope.paginationOptions.pageNumber = newPage; - $scope.paginationOptions.pageSize = pageSize; - $scope.runReport(); - }); - } - }; - - - var getPage = function() { - $scope.gridOptions.columnDefs = []; - $scope.searchdData.columns[0].forEach(function(entry) { - if(entry.columnTitle=='Run'){ - $scope.gridOptions.columnDefs.push({ displayName: entry.columnTitle, field: entry.columnId, enableSorting: false, - cellTemplate: '<div class="ui-grid-cell-contents"><a ng-href="#/report_run/{{COL_FIELD.drillDownLink.substr(39)}}" class="icon-controls-pointer" style="font-size:20px;"></a></div>' - }); - } else if(entry.columnTitle=='Edit'){ - $scope.gridOptions.columnDefs.push({ displayName: entry.columnTitle, field: entry.columnId, enableSorting: false, - cellTemplate: '<div class="ui-grid-cell-contents"><a ng-href="{{COL_FIELD.drillDownLink}}" class="icon-misc-pen" style="font-size:20px;"></a></div>' - }); - } else if(entry.columnTitle=='Delete'){ - $scope.gridOptions.columnDefs.push({ displayName: entry.columnTitle, field: entry.columnId, enableSorting: false, - cellTemplate: '<div class="ui-grid-cell-contents"><a ng-click="grid.appScope.removeReport(COL_FIELD.drillDownLink,row)" class="icon-misc-trash" style="font-size:20px;"></a></div>' - }); - } else if(entry.columnTitle=='Copy'){ - $scope.gridOptions.columnDefs.push({ displayName: entry.columnTitle, field: entry.columnId, enableSorting: false, - cellTemplate: '<div class="ui-grid-cell-contents"><a ng-href="{{COL_FIELD.drillDownLink}}" class="icon-documents-copy" style="font-size:20px;"></a></div>' - }); - } else if(entry.columnTitle=='Schedule'){ - } else if(entry.columnTitle=='No'){ - } else { - $scope.gridOptions.columnDefs.push({ displayName: entry.columnTitle, field: entry.columnId, - enableSorting: true, - sortingAlgorithm: $scope.getSortingAlgorithm(entry.columnId), - cellTemplate: '<div class="ui-grid-cell-contents" style="text-align:{{COL_FIELD.alignment}};" title="TOOLTIP"> <div>{{COL_FIELD.displayValue}}</div> </div>' - }); - } - }); - $scope.gridOptions.useExternalPagination=true; - $scope.gridOptions.paginationPageSizes= [$scope.searchdData.metaReport.pageSize]; - $scope.gridOptions.paginationPageSize= 50;//$scope.searchdData.metaReport.pageSize; - $scope.gridOptions.totalItems = $scope.searchdData.metaReport.totalSize; - $scope.gridOptions.data = []; - $scope.searchdData.rows[0].forEach(function(entry) { - var localData = {}; - entry.forEach(function(rowData){ - localData[rowData["columnId"]]= rowData["searchresultField"]; - }); - $scope.gridOptions.data.push(localData); - }); - }; - - $scope.$watch("searchdData",function(newValue,oldValue) { - if($scope.searchdData){ - getPage(); - } - }); - - $scope.operatorsRepId = [ - {index: 0, value: 'Equal To', text: 'Equal To', alias:'Equal To'}, - {index: 1, value: 'Less Than', text: 'Less Than', alias:'Less Than'}, - {index: 2, value: 'Greater Than', text: 'Greater Than', alias:'Greater Than'}]; - $scope.operatorRepId = {}; - $scope.operatorRepId.value = $scope.operatorsRepId[0].value; - $scope.operatorRepId.index = $scope.operatorsRepId[0].index; - - $scope.operatorsRepName = [ - {index: 0, value: 'Starts With', text: 'Starts With', alias:'Starts With'}, - {index:1, value: 'Ends With', text: 'Ends With', alias:'Ends With'}, - {index: 2, value: 'Contains', text: 'Contains', alias:'Contains'}]; - - $scope.operatorRepName = {}; - $scope.operatorRepName.value = $scope.operatorsRepName[0].value; - $scope.operatorRepName.index = $scope.operatorsRepName[0].index; - - $scope.removeReport = function(reportDeleteUrl,row) { - var modalInstance = $modal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-del-confirm.html', - sizeClass: 'modal-small', - controller: ['$scope', '$modalInstance', '$http', '$log','raptorReportFactory', function ($scope, $modalInstance, $http, $log, raptorReportFactory) { - $scope.ok = function() { - raptorReportFactory.getReportDeleteStatus(reportDeleteUrl).then(function(data){ - if (!(data.deleted)) { - $log.error("raptorReportFactory: report removal failed.") - } - $modalInstance.close(); - },function(error){ - $log.error("report removal error.") - }); - }; - - $scope.cancel = function() { - $modalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('RefreshGridOptions'); - }, function () { - }); - }; - - $scope.$on('RefreshGridOptions', function(event) { - $scope.getSearchData(); - }); - - $timeout(function() { - $rootScope.isViewRendering = false; - }); - - -}]); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-step-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-step-controller.js deleted file mode 100644 index a23823e3..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-step-controller.js +++ /dev/null @@ -1,786 +0,0 @@ -appDS2.controller('reportStepController', function($scope,$http,$location, $routeParams, $q, $modal,$log,$window, raptorReportFactory, stepFormFactory) { - /*****************Init values*********************/ - $scope.reportIdURL = $routeParams.reportId; - $scope.isEdit = ($scope.reportIdURL==null||$scope.reportIdURL=='')?false:true; - $scope.isCopy = false; - $scope.isDefReady = $scope.isEdit; - $scope.activeTabsId = 'definition'; - $scope.pageMsg ='' - $scope.stepNum = 0; - $scope.stepTabs=[ - { - title: 'Definition', - id: 'definition', - uniqueId: 'uniqueStep1', - tabPanelId: 'definitionTab', - disabled: false - - }, { - title: 'SQL', - id: 'sql', - uniqueId: 'uniqueStep2', - tabPanelId: 'sqlTab', - disabled: (!$scope.isDefReady) - }, { - title: 'Columns', - id: 'columns', - uniqueId: 'uniqueTab3x', - tabPanelId: 'columnsTab', - disabled: (!$scope.isDefReady) - }, { - title: 'Form Fields', - id: 'formFields', - uniqueId: 'uniqueTab4x', - tabPanelId: 'formFieldsTab', - disabled: (!$scope.isDefReady) - }, { - title: 'Security', - id: 'security', - uniqueId: 'uniqueTab5x', - tabPanelId: 'securityTab', - disabled: (!$scope.isDefReady) - }, { - title: 'Log', - id: 'log', - uniqueId: 'uniqueTab6x', - tabPanelId: 'logTab', - disabled: (!$scope.isDefReady) - }, { - title: 'Run', - id: 'run', - uniqueId: 'uniqueTab7x', - tabPanelId: 'runTab', - disabled: (!$scope.isDefReady) - } - - ]; - $scope.$watch('activeTabsId', function (newVal, oldVal) { - if(newVal !== oldVal) { - $scope.init(); - } - }); - - $scope.renderStep = function(stepNum){ - var containerElement = angular.element(document.getElementById("stepView")); - containerElement.empty(); - $scope.stepNum = stepNum; - var jsonSrcName = getJsonSrcName(stepNum); - stepFormFactory.renderForm(jsonSrcName, containerElement, $scope); - } - $scope.next = function(){ - $scope.stepNum = $scope.stepNum +1; - $scope.activeTabsId = $scope.stepTabs[$scope.stepNum].id; - }; - - - $scope.previous = function(){ - $scope.stepNum = $scope.stepNum -1; - $scope.activeTabsId = $scope.stepTabs[$scope.stepNum].id; - } - - /*******************Step 1 Definitions****************/ - $scope.displayOptions={ - hideFormFields:false, - hideChart:false, - hideReportData:false, - hideExcel:false, - hidePdf:false - } - $scope.reportIdURL = $routeParams.reportId; - $scope.definitionData={}; - $scope.definitionData.displayOptions=[ - {name:'HideFormFields', selected:false}, - {name:'HideChart', selected:false}, - {name:'HideReportData', selected:false}, - {name:'HideExcel', selected:false}, - {name:'HidePdf', selected:false} - ] - -/* $scope.definitionData.dbSrcOptions=[ - {text:'local', value:'local', selected:true}, - {text:'e911dev_leto07', value:'e911dev_leto07', selected:false}, - ]*/ - - $scope.pageSizeValues=['10','25','50','100','500']; - $scope.pageSizeOptions =[]; - $scope.dbSrcOptions =[]; - $scope.maxRowValues = ['500','1000','2000','3000','4000','5000','10000','15000','20000','25000','30000','35000','40000','45000','50000','65000'] - $scope.maxRowOptions =[]; - $scope.frozenColValues = ['0','1','2','3','4']; - $scope.frozenColOptions =[]; - $scope.dataGridAlignValues = ['Left','Right','Center']; - $scope.dataGridAlignOptions =[]; - $scope.dataContainerValues = ['10','20','30','40','50','60','70','80','90','100','110','120','130','140','150','160','170','180','190','200']; - $scope.dataContainerOptions =[]; - $scope.runTimeFormNumValues = ['1','2','3','4']; - $scope.runTimeFormNumOptions =[]; - /******create*****/ - if(!$scope.isEdit){ - $scope.definitionData.reportType = 'Linear'; - //$scope.definitionData.dbInfo = 'Local'; - //$scope.definitionData.dbSrcOptions = ['Local']; - } - /****end create***/ - - /*functions*/ - $scope.getDefinitionById = function(id) { - $scope.showLoader=true; - raptorReportFactory.getDefinitionByReportId(id).then(function(data){ - $scope.showLoader=false; - $scope.definitionData = data; - $scope.definitionData.dbSrc=data.dbInfo; - $scope.definitionData.dbSrcOptions = data.dbInfoList; - console.log($scope.definitionData.dbSrcOptions[0].name); - - $scope.showLoader = false; - for(x in data.displayOptions){ - if(data.displayOptions[x].name=='HideFormFields') - $scope.displayOptions.hideFormFields = data.displayOptions[x].selected; - else if(data.displayOptions[x].name=='HideChart') - $scope.displayOptions.hideChart = data.displayOptions[x].selected; - else if(data.displayOptions[x].name=='HideReportData') - $scope.displayOptions.hideReportData = data.displayOptions[x].selected; - else if(data.displayOptions[x].name=='HideExcel') - $scope.displayOptions.hideExcel = data.displayOptions[x].selected; - else if(data.displayOptions[x].name=='HidePdf') - $scope.displayOptions.hidePdf = data.displayOptions[x].selected; - } - - $scope.definitionData.frozenColumns = $scope.definitionData.frozenColumns+''; - $scope.definitionData.numFormCols = $scope.definitionData.numFormCols+''; - $scope.definitionData.allowScheduler = data.allowScheduler=='Y'?true:false; - $scope.definitionData.sizedByContent = data.sizedByContent=='Y'?true:false; - - $scope.definitionData.oneTimeRec = data.oneTimeRec=='Y'?true:false; - $scope.definitionData.hourlyRec = data.hourlyRec=='Y'?true:false; - $scope.definitionData.dailyRec = data.dailyRec=='Y'?true:false; - $scope.definitionData.dailyMFRec = data.dailyMFRec=='Y'?true:false; - $scope.definitionData.weeklyRec = data.weeklyRec=='Y'?true:false; - $scope.definitionData.monthlyRec = data.monthlyRec=='Y'?true:false; - - if($scope.definitionData.reportTitle==null || $scope.definitionData.reportTitle=='') - $scope.definitionData.reportTitle = $scope.definitionData.reportName; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getDefinitionById failed."); - $scope.showLoader = false; - }); - } - - $scope.constructureDefDropDown = function(){ - - for(i in $scope.pageSizeValues){ - var v = { - value :$scope.pageSizeValues[i], - text :$scope.pageSizeValues[i] - } - $scope.pageSizeOptions.push(v); - } - for(i in $scope.maxRowValues){ - var v = { - value :$scope.maxRowValues[i], - text :$scope.maxRowValues[i] - } - $scope.maxRowOptions.push(v); - } - for(i in $scope.frozenColValues){ - var v = { - value :$scope.frozenColValues[i]+'', - text :$scope.frozenColValues[i] - } - $scope.frozenColOptions.push(v); - } - for(i in $scope.dataGridAlignValues){ - var v = { - value :$scope.dataGridAlignValues[i].toLowerCase(), - text :$scope.dataGridAlignValues[i] - } - $scope.dataGridAlignOptions.push(v); - } - for(i in $scope.dataContainerValues){ - var v = { - value :$scope.dataContainerValues[i], - text :$scope.dataContainerValues[i] - } - $scope.dataContainerOptions.push(v); - } - for(i in $scope.runTimeFormNumValues){ - var v = { - value :$scope.runTimeFormNumValues[i], - text :$scope.runTimeFormNumValues[i] - } - $scope.runTimeFormNumOptions.push(v); - } - } - - $scope.constructDef = function(){ - var data =Object.assign({}, $scope.definitionData); - if($scope.definitionData.dbSrc){ - console.log("Hello World ", $scope.definitionData.dbSrc); - data.dbInfo = $scope.definitionData.dbSrc; - } - for(x in $scope.definitionData.displayOptions){ - if($scope.definitionData.displayOptions[x].name=='HideFormFields') - data.displayOptions[x].selected = $scope.displayOptions.hideFormFields - else if($scope.definitionData.displayOptions[x].name=='HideChart') - data.displayOptions[x].selected = $scope.displayOptions.hideChart - else if($scope.definitionData.displayOptions[x].name=='HideReportData') - data.displayOptions[x].selected = $scope.displayOptions.hideReportData - else if($scope.definitionData.displayOptions[x].name=='HideExcel') - data.displayOptions[x].selected = $scope.displayOptions.hideExcel - else if($scope.definitionData.displayOptions[x].name=='HidePdf') - data.displayOptions[x].selected = $scope.displayOptions.hidePdf - } - if(data.pageSize==null || data.pageSize.startsWith("Select")) - data.pageSize = null; - if(data.maxRowsInExcelCSVDownload==null || data.maxRowsInExcelCSVDownload.startsWith("Select")) - data.maxRowsInExcelCSVDownload = null; - if(data.frozenColumns==null || data.frozenColumns.startsWith("Select")) - data.frozenColumns = null; - if(data.dataGridAlign==null || data.dataGridAlign.startsWith("Select")) - data.dataGridAlign = null; - if(data.dataContainerHeight==null || data.dataContainerHeight.startsWith("Select")) - data.dataContainerHeight = null; - if(data.dataContainerWidth ==null || data.dataContainerWidth.startsWith("Select")) - data.dataContainerWidth = null; - if(data.numFormCols ==null || data.numFormCols.startsWith("Select")) - data.numFormCols = null; - - if(!$scope.isEdit) - data.reportId=-1; - if(data.reportTitle==null || data.reportTitle=='') - data.reportTitle = data.reportName; - return data; - } - $scope.updateDef = function(){ - $scope.showLoader=true; - var dataToSave = $scope.constructDef(); - raptorReportFactory.updateDefinition(dataToSave,$scope.isEdit).then(function(data){ - $scope.successPopUp('Definition is updated'); - for(x in $scope.stepTabs){ - $scope.stepTabs[x].disabled=false; - } - $scope.showLoader=false; - if(isCopy){ - var newReportId = data.anyStacktrace.split("-")[0]; - if(newReportId!=null && newReportId!='' && newReportId!=-1) - $window.location.href = "#/report_wizard/"+newReportId; - } - },function(error){ - $scope.errorPopUp(error); - $log.error("report-step-controller: updateDefinition by Id failed."); - }); - } - /*******************Step1 Ends****************/ - /*******************Step2 SQL****************/ - $scope.pageisCreating = false; - $scope.sqlScript={ - value:'' - }; - $scope.sqlTestTableData=''; - /*function*/ - $scope.getSql = function(){ - $scope.showLoader = true; - raptorReportFactory.getSqlInSession().then(function(data){ - $scope.sqlInSessionJSON = data; - $scope.sqlScript.value = data.query; - $scope.showLoader = false; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getSearchData failed."); - }); - } - $scope.testRunSql = function(){ - $scope.showLoader=true; - var queryJSON = {query: $scope.sqlScript.value}; - queryJSON = JSON.stringify(queryJSON); - raptorReportFactory.testRunSQL(queryJSON).then(function(data){ - $scope.showLoader=false; - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-wizard-test-run-sql.html', - windowClass:'modal-docked', - sizeClass: 'modal-large', - controller: testRunSqlController, - resolve:{ - queriedData: function(){ - return data; - } - } - }); - - modalInstance.result.finally(function () { - if(!$scope.isEdit){ - $scope.showLoader=true; - $scope.pageisCreating = true; - $scope.pageMsg = 'Please wait while we are creating the report. Page will be reloaded after the creation is done.' - raptorReportFactory.getDefinitionInSession().then(function(data){ - var newReportId = data.reportId; - if(newReportId!=null && newReportId!='' && newReportId!=-1) - $window.location.href = "#/report_wizard/"+newReportId; - - $scope.showLoader = false; - $scope.pageisCreating = false; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: get Definition In Session failed."); - $scope.showLoader = false; - }); - } - }); - - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: test run SQL failed."); - }); - } - - /*******************Step2 End****************/ - /*******************Step3 Column****************/ - $scope.colTableRowData=''; - $scope.isEditCol= true; - - $scope.getColumn = function(){ - $scope.showLoader = true; - raptorReportFactory.getColumnList().then(function(data){ - $scope.colTableRowData = data; - $scope.showLoader = false; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: get column list failed."); - }); - } - - $scope.openColumnPopup = function (rowData) { - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-wizard-col-edit.html', - windowClass:'modal-docked', - sizeClass: 'modal-jumbo', - controller: openColumnPopupController, - resolve:{ - colData: function(){ - return rowData; - } - } - }); - modalInstance.result.finally(function () { - $scope.getColumn(); - }); - }; - - /*******************Step3 End****************/ - /*******************Step4 Starts Form Fields****************/ - - $scope.dataProcessing = false; - $scope.formFieldData = []; - $scope.getFormFieldList = function(){ - $scope.showLoader= true; - $scope.formFieldData = []; - raptorReportFactory.getFormFieldList().then(function(data){ - $scope.showLoader= false; - $scope.formFieldData = data; - $scope.formFieldData.sort(function(obj1, obj2) { - // Ascending: first age less than the previous - return obj1.orderSeq - obj2.orderSeq; - }); - - $scope.showLoader = false; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: get formfields failed."); - $scope.showLoader = false; - }); - } - - $scope.formFieldReOrder = function(upID, downID){ - - $scope.moveUpFF={}; - $scope.moveDownFF={}; - $scope.showLoader=true; - raptorReportFactory.getFormFieldEditInfoById(upID).then(function(data){ - $scope.moveUpFF = data; - raptorReportFactory.getFormFieldEditInfoById(downID).then(function(data){ - $scope.moveDownFF = data; - var downOrder = $scope.moveDownFF.orderSeq; - $scope.moveDownFF.orderSeq = $scope.moveUpFF.orderSeq; - $scope.moveUpFF.orderSeq = downOrder; - raptorReportFactory.saveFormFieldEditInfo($scope.moveDownFF).then(function(data){ - raptorReportFactory.saveFormFieldEditInfo($scope.moveUpFF).then(function(data){ - $scope.successPopUp(''); - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: saveFormFieldEditInfo failed."); - }).finally(function() { - $scope.showLoader=false; - $scope.getFormFieldList(); - }) - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: saveFormFieldEditInfo failed."); - }); - - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getColumnEditInfoById failed."); - }); - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getColumnEditInfoById failed."); - }) - - - } - - $scope.formFieldVerifySQL= function(sqlScript){ - var queryJSON = {query: sqlScript}; - queryJSON = JSON.stringify(queryJSON); - raptorReportFactory.formFieldVerifySQL(queryJSON).then(function(data){ - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-wizard-test-run-sql.html', - sizeClass: 'modal-large', - controller: formFieldVerifySQLController, - resolve:{ - queriedData: function(){ - return data; - } - } - }) - - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: test run SQL failed."); - }); - } - - - $scope.openFormFieldPopup = function (rowData,type) { - $scope.type= type; - var modalInstance = $modal.open({ - scope: $scope, - animation: true, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-wizard-formfield-edit.html', - sizeClass: 'modal-large', - controller: openFormFieldPopupController, - resolve:{ - fieldData: function(){ - return rowData; - } - } - }); - - modalInstance.result.finally(function () { - $scope.getFormFieldList(); - }); - }; - $scope.addFormField = function(){ - $scope.openFormFieldPopup('','add'); - } - - - $scope.deleteFormField = function(rowData) { - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-formfield-del-confirm.html', - sizeClass: 'modal-small', - controller: deleteFormFieldController, - resolve:{ - rowData: function(){ - return rowData; - } - } - }); - modalInstance.result.then(function () { - $scope.getFormFieldList(); - }, function () { - }); - } - - /*******************Step4 End****************/ - /*******************Step5 Starts Security****************/ - $scope.ynOptions = [ - {value:"true", text:"Yes"}, - {value:"false", text:"No"} - ]; - $scope.addReportUserId={ - id:'' - }; - $scope.addReportRoleId={ - id:'' - }; - $scope.loadSecurityPage = function() { - $scope.showLoader = true; - raptorReportFactory.resetSecurityLoadingCounter(); - - //API call 1: - raptorReportFactory.getSecurityReportOwnerList().then(function(data){ - $scope.reportOwnerList = data; - raptorReportFactory.icrementSecurityLoadingCounter(); - if(raptorReportFactory.checkSecurityLoadingCounter()){$scope.showLoader = false;}; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getSecurityReportOwnerList failed."); - }); - - //API call 2: get report role list - raptorReportFactory.getReportRoleList().then(function(data){ - $scope.reportRoleList = data; - raptorReportFactory.icrementSecurityLoadingCounter(); - if(raptorReportFactory.checkSecurityLoadingCounter()){$scope.showLoader = false;}; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getReportRoleList failed."); - }); - - //API call 3: get security page basic info - raptorReportFactory.getReportSecurityInfo().then(function(data){ - $scope.reportSecurityInfo = data; - $scope.reportOwnerId ={id: $scope.reportSecurityInfo.ownerId}; - raptorReportFactory.icrementSecurityLoadingCounter(); - if(raptorReportFactory.checkSecurityLoadingCounter()){$scope.showLoader = false;}; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getReportSecurityInfo failed."); - $scope.showLoader = false;}); - - //API call 4: retrieve security users - raptorReportFactory.getReportSecurityUsers().then(function(data){ - - $scope.reportSecurityUsers = data; - for (var i=0; i<$scope.reportSecurityUsers.length;i++) { - $scope.reportSecurityUsers[i]["accessAllowed"] = !$scope.reportSecurityUsers[i]["readOnly"]; - $scope.reportSecurityUsers[i].runAccess = true; // need to check why 1702 version is making it true always - } - raptorReportFactory.icrementSecurityLoadingCounter(); - if(raptorReportFactory.checkSecurityLoadingCounter()){$scope.showLoader = false;}; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: reportSecurityUsers failed."); - }); - - //API call 5: retrieve security roles - raptorReportFactory.getReportSecurityRoles().then(function(data){ - $scope.reportSecurityRoles = data; - for (var i=0; i<$scope.reportSecurityRoles.length;i++) { - $scope.reportSecurityRoles[i]["accessAllowed"] = !$scope.reportSecurityRoles[i]["readOnly"]; - $scope.reportSecurityRoles[i].runAccess = true; // need to check why 1702 version is making it true always - } - - raptorReportFactory.icrementSecurityLoadingCounter(); - if(raptorReportFactory.checkSecurityLoadingCounter()){$scope.showLoader = false;}; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: reportSecurityRoles failed."); - }); - } - $scope.addReportSecurityUser = function(userId) { - $scope.showLoader=true; - raptorReportFactory.addReportSecurityUser(userId).then(function(data){ - $scope.loadSecurityPage(); - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: addReportSecurityUser failed."); - }).finally(function() { - $scope.showLoader=false; - }); - } - - $scope.removeReportSecurityUser = function(securityUser) { - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-security-user-del-confirm.html', - sizeClass: 'modal-small', - controller: removeReportSecurityUserController, - resolve:{ - securityUser: function(){ - return securityUser; - } - } - }); - modalInstance.result.then(function () { - $scope.loadSecurityPage(); - }, function () { - }); - }; - $scope.addReportSecurityRole = function(roleId) { - raptorReportFactory.addReportSecurityRole(roleId).then(function(data){ - $scope.loadSecurityPage(); - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: addReportSecurityRole failed."); - }); - } - - - $scope.removeReportSecurityRole = function(securityRole) { - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-security-role-del-confirm.html', - sizeClass: 'modal-small', - controller: removeReportSecurityRoleController, - resolve:{ - securityRole: function(){ - return securityRole; - } - } - }); - modalInstance.result.then(function () { - $scope.loadSecurityPage(); - }, function () { - }); - } - - $scope.saveReportSecurityInfo = function() { - $scope.showLoader = true; - var securityInfo = {'userId':$scope.reportSecurityInfo.ownerId+"",'isPublic':$scope.reportSecurityInfo.isPublic}; - raptorReportFactory.updateReportSecurityInfo(securityInfo).then(function(data){ - $scope.successPopUp(''); - $scope.loadSecurityPage(); - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: updateReportSecurityInfo failed."); - }); - }; - - $scope.toggleUserEditAccessActive = function(rowData) { - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-user-role-confirm-toggle.html', - sizeClass: 'modal-small', - controller: toggleUserEditAccessActiveController, - resolve:{ - rowData: function(){ - return rowData; - } - } - }); - } - - $scope.toggleRoleEditAccessActive = function(rowData) { - var modalInstance = $modal.open({ - scope: $scope, - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-reports/modal/report-user-role-confirm-toggle.html', - sizeClass: 'modal-small', - controller: toggleRoleEditAccessActiveController, - resolve:{ - rowData: function(){ - return rowData; - } - } - }); - } - - /*******************Step5 End****************/ - /*******************Step6 Starts****************/ - $scope.logs = []; - $scope.getReportID = function(){ - $scope.showLoader = true; - raptorReportFactory.getReportLogs($routeParams.reportId).then(function(data){ - $scope.logs = data; - $scope.showLoader = false; - - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getReportID failed."+ error); - }); - } - - - /*******************Step6 End****************/ - /*******************Step7 Starts Run****************/ - $scope.loadDefinitionInSession = function(){ - $scope.showLoader = true; - raptorReportFactory.getDefinitionInSession().then(function(data){ - $scope.reportId = data.reportId; - $scope.showLoader = false; - },function(error){ - $scope.errorPopUp(error); - $log.error("raptorReportFactory: getDefinitionInSession failed."); - $scope.showLoader = false; - }); - } - $scope.runReport = function(){ - $window.location.href = "#/report_run/c_master="+$scope.reportId+"&refresh=Y"; - } - /*******************Step7 End****************/ - - /********************Init*************/ - $scope.init = function(){ - if ($routeParams.reportMode=="copy") { - $scope.isCopy = true; - raptorReportFactory.copyReportById($routeParams.reportId).then(function(data){ - $scope.isEdit = true; - $scope.reportId = -1; - $scope.getDefinitionById(-1); - },function(error){ - $log.error("raptorReportFactory: deleteFormFieldById failed."); - }); - } /*else if ($routeParams.reportMode=="import") { - $scope.$emit('RefreshInsession'); - }*/ - - - if($scope.activeTabsId=='definition'){ /*Step 1*/ - $scope.constructureDefDropDown(); - if($scope.isEdit) - $scope.getDefinitionById($scope.reportIdURL); //edit - else - $scope.getDefinitionById(-1); //create - }else if($scope.activeTabsId=='sql'){ /*Step 2*/ - $scope.getSql(); - }else if($scope.activeTabsId=='columns'){ - $scope.getColumn(); - }else if($scope.activeTabsId=='formFields'){ - $scope.getFormFieldList(); - }else if($scope.activeTabsId=='security'){ - $scope.loadSecurityPage(); - }else if($scope.activeTabsId=='log'){ - $scope.getReportID(); - }else if($scope.activeTabsId=='run'){ - $scope.reportId = $scope.reportIdURL; - if($scope.reportId==null || $scope.reportId=='') - $scope.loadDefinitionInSession(); - } - } - - $scope.successPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - msg: function () { - var message = { - title: '', - text: msg - }; - return message; - } - } - }); - }; - - $scope.errorPopUp = function (msg) { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - msg: function () { - return msg; - } - } - }); - }; - - $scope.init(); -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/drools-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/drools-controller.js deleted file mode 100644 index 1d4659e3..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/drools-controller.js +++ /dev/null @@ -1,53 +0,0 @@ -appDS2.controller('droolsController', function($scope, $modal, $routeParams, DroolsService, modalService) { - $scope.tableDate=[]; - $scope.resultsString = ""; - $scope.postDroolsBean={ - droolsFile:'', - className:'', - selectedRules:'' - }; - $scope.filenameFromUrl = $routeParams.filename; - if($scope.filenameFromUrl!='' && $scope.filenameFromUrl!='0') - $scope.postDroolsBean.droolsFile = $scope.filenameFromUrl - $scope.execute = function(postDroolsBean) { - if($scope.postDroolsBean.droolsFile=='' ||$scope.postDroolsBean.className=='' || $scope.postDroolsBean.selectedRules=='' ){ - modalService.errorPopUp ("Required fields cannot be empty"); - return; - } - var uuu = "post_drools/execute"; - var postData={postDroolsBean:postDroolsBean}; - DroolsService.executeDrools(postData).then(function(data){ - $scope.resultsString=data.resultsString; - modalService.successPopUp($scope.resultsString); - },function(error){ - modalService.errorPopUp (error); - }); - }; -}); - -appDS2.controller('droolsListController', function($scope, $modal, DroolsService, modalService) { - $scope.tableDate=[]; - $scope.resultsString = ""; - $scope.postDroolsBean=""; - - $scope.getDroolsList = function(){ - DroolsService.getDroolsList().then(function(data){ - var j = data; - $scope.tableData = JSON.parse(j.data); - $scope.buildTable(); - },function(error){ - modalService.errorPopUp (error); - }); - } - - $scope.buildTable = function(){ - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - } - -}); - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/nbook-framecontroller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/nbook-framecontroller.js deleted file mode 100644 index ab88aed9..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/nbook-framecontroller.js +++ /dev/null @@ -1,15 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - - //.when('/notebook-frame/:id/:key/:value',{ - //.when('/notebook-frame/:nid/:qprms',{ - /*.when('/notebook-frame',{ - templateUrl: 'app/fusion/notebook-integration/scripts/view-models/notebook-frame.html', - controller: 'notebookFrameController' - })*/ - - .otherwise({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-samplePages/notebook-viz.html', - controller: 'notebookFrameController' - }); -})
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/notebook-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/notebook-controller.js deleted file mode 100644 index efd22f0f..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/notebook-controller.js +++ /dev/null @@ -1,37 +0,0 @@ -appDS2.controller('nbookController', ['$scope', '$location','$window','$http', function ($scope,$location,$window,$http) { - $scope.keyValueList = [{}]; - $scope.submitParameters = function() { - $scope.iframevisibility = false; - $scope.postData = {}; - $scope.additionalqueryParams = {}; - //Use this if there is only one 1 query param key value pair - $scope.additionalqueryParams.paramKey = $scope.qparamKey; - $scope.additionalqueryParams.paramVal = $scope.qparamVal; - var qryStr = ''; - for(var i = 0; i < $scope.keyValueList.length; i++) { - var obj = $scope.keyValueList[i]; - if (obj.qK != undefined && obj.qV != undefined) { - if (qryStr!='') - qryStr = qryStr+'&'+obj.qK+'='+obj.qV; - else - qryStr = obj.qK+'='+obj.qV; - } - } - var queryurl = 'nbooktest.htm?nid='+$scope.notebookvalue+'&'+qryStr; - window.open (queryurl,'_self',false); - } - $scope.addKeyValuePairs = function (kv) { - if ($scope.keyValueList.length < 9) { - $scope.keyValueList.push({ - }); - } else { - document.getElementById("addbtn")["disabled"] = true; - } - } - $scope.removeKeyValuePairs = function (index) { - $scope.keyValueList.splice(index, 1); - if ($scope.keyValueList.length == 8) { - document.getElementById("addbtn")["disabled"] = false; - } - } -}]);
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/notebookFrameController.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/notebookFrameController.js deleted file mode 100644 index 95489918..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-sample/notebookFrameController.js +++ /dev/null @@ -1,24 +0,0 @@ -appDS2.controller('notebookFrameController', function ($scope,$location,$window,$http,$routeParams) { - var nid = $window.location.search.substr($window.location.search.indexOf("=")+1); - $scope.additionalqueryParams={}; - if ($window.location.search.substr($window.location.search.indexOf("=")+1)) { - $scope.queryParams = $window.location.search; - if($window.location.search.substring(0, $window.location.search.length-1).indexOf("&")!=-1) { - $scope.notebookparam = $window.location.search.substring($window.location.search.indexOf("?")+1,$window.location.search.indexOf("&")); - $scope.additionalqueryParams = JSON.parse('{"' + decodeURI($scope.queryParams.substr($scope.queryParams.indexOf("&")+1).replace(/&/g, "\",\"").replace(/=/g,"\":\"")) + '"}'); - } - else { - $scope.notebookparam1 = $window.location.search.substr($window.location.search.indexOf("?")+1); - $scope.notebookparam = $scope.notebookparam1.substring(0, $scope.notebookparam1.length - 1); - } - $scope.notebookvalue = $scope.notebookparam.substr($scope.notebookparam.indexOf("=")+1); - } - else { - $scope.notebookvalue = '833c0a69ec1433fbb2f8752af733cf0e'; - } - $http({method:'POST', url:'rNotebookFE/authCr', data: $scope.notebookvalue, params:{'qparams' : $scope.additionalqueryParams}, transformResponse: [function (data) { - // Do whatever you want! - document.getElementById('itestframe').src = data; - return data; - }]}) -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js deleted file mode 100644 index 2ae2b1b3..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js +++ /dev/null @@ -1,6 +0,0 @@ -/*angular.module('att.abs.helper', []); -angular.module('quantum', []); -//angular.module('ui.bootstrap', []); -appDS2=angular.module("workflowApp", ["ngRoute", 'ngMessages', 'ngCookies', 'b2b.att.tpls', 'ddh.att.tpls','ddh.att.dropdowns', 'ddh.att.switches', 'b2b.att.footer', 'b2b.att.header','gridster','ui.bootstrap']); -*/ -var appDS2=angular.module("workflowApp", ["ngRoute", 'ngMessages','ngCookies','modalServices', 'ngCookies', 'b2b.att','gridster','ui.bootstrap','ui.bootstrap.modal']);
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowController.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowController.js deleted file mode 100644 index f18f00e9..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowController.js +++ /dev/null @@ -1,513 +0,0 @@ - - -appDS2.controller('workflowsControllerDS2', function($scope, $http, $log, $modal) { - $scope.viewPerPage = 5; - $scope.scrollViewsPerPage = 20; - $scope.currentPage = 2; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - $scope.radio = { - value: "" - }; - - - $scope.showModal = false; - $scope.toggleModal = function(){ - $scope.showModal = !$scope.showModal; - }; - - $scope.workflow = {}; - $scope.workflow.active = "true"; - - $scope.updateAllWorkflowStatus = function() { - angular.forEach($scope.workflows,function(value){ - $scope.checkWorkflowStatus(value); - }) - } - - $scope.fetchWorkflowsList = function() { - $http.get('workflows/list').then(function(workflowList){ - console.log('Got new list from server = ' + workflowList.data); - $scope.workflows = workflowList.data; - $scope.updateAllWorkflowStatus(); - }); - }; - - $scope.addNewWorkflow = function(newWorkflow) { - $http.post('workflows/addWorkflow/', JSON.stringify(newWorkflow)).success(function() { - $scope.fetchWorkflowsList(); - }); - - $scope.workflow.name = ''; - - }; - - $scope.updateWorkflow = function (workflowToEdit) { - //workflowToEdit.active='true'; - var modalInstance = $modal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-new.html', - sizeClass: 'modal-small', - controller: ['$scope', '$modalInstance', '$http', function ($scope, $modalInstance, $http) { - $scope.workflow = workflowToEdit; - $scope.ok = function() { - if( - $scope.workflow.name== undefined|| $scope.workflow.name == null|| $scope.workflow.name == "" - ||$scope.workflow.workflowKey == undefined ||$scope.workflow.workflowKey==null||$scope.workflow.workflowKey=="" - ||$scope.workflow.runLink==undefined||$scope.workflow.runLink==null||$scope.workflow.runLink=="" - - ) - { - alert("please provide valid entries !"); - } - else{ - - console.log('Updating existing workflow ... ' + JSON.stringify($scope.workflow)); - $http.post('workflows/editWorkflow/', JSON.stringify($scope.workflow)).then(function(returnedWorkflow){ - console.log('Returned Workflow = ' + JSON.stringify(returnedWorkflow)); - $modalInstance.close($scope.workflow); - }); - } - }; - - $scope.cancel = function() { - $modalInstance.dismiss(); - }; - }], - //End of inner controller - resolve: { - workflow: function() { - console.log('Passing ' + JSON.stringify($scope.workflow)); - return $scope.workflow; - } - } - }); - - modalInstance.result.then(function (editedWorkFlow) { - //Need to convert to proper date - later - delete editedWorkFlow.created; - delete editedWorkFlow.updated; - - delete editedWorkFlow.createdBy; - delete editedWorkFlow.modifiedBy; - - console.log('selected Item ' + JSON.stringify(editedWorkFlow)); - $scope.$emit('workflowAdded', editedWorkFlow); - - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - }; - - $scope.reset = function(){ - console.log("Resetting ...."); - }; - - $scope.update = function(){ - console.log("updating ...."); - }; - - $scope.createWorkflow = function (modalSize) { - - var modalInstance = $modal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-new.html', - sizeClass: 'modal-small', - controller: ['$scope', '$modalInstance', '$http', function ($scope, $modalInstance, $http) { - $scope.workflow = {}; - $scope.workflow.active = 'true'; - $scope.ok = function() { - if($scope.workflow.name== undefined|| $scope.workflow.name == null|| $scope.workflow.name == "" - ||$scope.workflow.workflowKey == undefined ||$scope.workflow.workflowKey==null||$scope.workflow.workflowKey=="" - ||$scope.workflow.runLink==undefined||$scope.workflow.runLink==null||$scope.workflow.runLink=="" - - ) - { - alert("please provide valid entries !"); - } - else{ - console.log('Saving new workflow ... ' + JSON.stringify($scope.workflow)); - $http.post('workflows/addWorkflow/', JSON.stringify($scope.workflow)).then(function(returnedWorkflow){ - console.log('Returned Workflow = ' + JSON.stringify(returnedWorkflow)); - $modalInstance.close($scope.workflow); - }); - } - }; -/* console.log(size);*/ - $scope.cancel = function() { - $modalInstance.dismiss(); - }; - }], - //End of inner controller - resolve: { - workflow: function() { - console.log('Passing ' + JSON.stringify($scope.workflow)); - return $scope.workflow; - } - } - }); - - modalInstance.result.then(function (newWorkflow) { - console.log('selected Item ' + JSON.stringify(newWorkflow)); - $scope.$emit('workflowAdded', newWorkflow); - - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - };//End of createWorkflow function - - - $scope.removeWorkflow = function(workflowToRemove){ - var modalInstance = $modal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-remove.html', - sizeClass: 'modal-small', - controller: ['$scope', '$modalInstance', '$http', function ($scope, $modalInstance, $http) { - $scope.workflowToRemove = workflowToRemove; - $scope.ok = function() { - console.log('Removing workflow ... ' + JSON.stringify($scope.workflowToRemove) + ' on client request.'); - $http.post('workflows/removeWorkflow/', JSON.stringify($scope.workflowToRemove.id)).then(function(){ - console.log('Workflow successfully removed !!!'); - $modalInstance.close(); - }); - }; - - $scope.cancel = function() { - $modalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - - $scope.scheduleWorkflow = function(workflowToSchedule){ - var modalInstance = $modal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-schedule.html', - - controller: ['$scope', '$modalInstance', '$http','dateFilter', function ($scope, $modalInstance, $http,dateFilter) { - - $scope.workflowToSchedule = workflowToSchedule; - $scope.dt = new Date(); - $scope.dt2 = new Date(); - $scope.dateformat = 'MM/dd/yyyy', - $scope.datetimeformat = "hh:mm a"; - - $scope.recurrenceOptions =[{ - index:0, value:'One-Time', title:'One-Time' - },{ - index:1, value: 'Hourly',title:'Hourly' - },{ - index:2, value: 'Daily',title:'Daily' - },{ - index:3, value: 'Weekly',title:'Weekly' - }] - $scope.selectRecurrenceOpt = $scope.recurrenceOptions[0]; - - $scope.hours = []; - for (var i=0; i<24; i++){ - var newObj={} - newObj.index = i; - newObj.value = ""+i; - newObj.title = ""+i; - $scope.hours.push(newObj); - } - - $scope.minutes = []; - for (var i=0; i<60; i++){ - var newObj={} - newObj.index = i; - newObj.value = ""+i; - newObj.title = ""+i; - $scope.minutes.push(newObj); - } - - $scope.AMPMOptions =[ - { - index:0, value:'AM', title:'AM' - },{ - index:1, value: 'PM',title:'PM' - }] - - $scope.selectFirstHour =$scope.hours[0]; - $scope.selectFirstMinute =$scope.minutes[0]; - - $scope.selectLastHour =$scope.hours[0]; - $scope.selectLastMinute =$scope.minutes[0]; - - $scope.selectStartAMPMOption=$scope.AMPMOptions[0]; - $scope.selectLastAMPMOption=$scope.AMPMOptions[0]; - - var GenerateCronExpression = function(trigger_dt, RecurrenceOpt) { - var CRON_sec = trigger_dt.getSeconds(); - var CRON_min = trigger_dt.getMinutes(); - var CRON_hr = trigger_dt.getHours(); - var CRON_date= trigger_dt.getDate(); - var CRON_month = trigger_dt.toLocaleString('en-US', {month: 'short'}).toUpperCase(); - var CRON_day = trigger_dt.toLocaleString('en-US', {weekday: 'short'}).toUpperCase(); - var CRON_year = trigger_dt.getFullYear(); - if (RecurrenceOpt ==="One-Time") { - CRON_day = '?' - } else { - if (RecurrenceOpt ==="Hourly") { - CRON_hr = '*'; - CRON_date = '*' - CRON_month = '*' - CRON_day = '?' - CRON_year = '*' - } else if (RecurrenceOpt ==="Daily") { - CRON_date = '*' - CRON_month = '*' - CRON_day = '?' - CRON_year = '*' - } else if (RecurrenceOpt ==="Weekly") { - CRON_date = '*' - CRON_month = '*' - CRON_year = '*' - } - } - - var CRON_Expression = [CRON_sec, CRON_min, CRON_hr, CRON_date, CRON_month, CRON_day, CRON_year]; - return CRON_Expression.join(" "); - } - - $scope.ok = function() { - - // DateTime for the start time: it should be noted that the start time - // for a CRON job should be prior to the trigger time. - $scope.trigger_dt = new Date( $scope.dt.getFullYear() + - "-" + ("0"+($scope.dt.getMonth()+1)).slice(-2) + - "-" +("0"+ $scope.dt.getDate()).slice(-2) + - " " + ("0" + $scope.selectFirstHour.value).slice(-2) + - ":" +("0" + $scope.selectFirstMinute.value).slice(-2) + - ":00.0"); - - $scope.startDateTime_CRON = GenerateCronExpression($scope.trigger_dt, $scope.selectRecurrenceOpt.value) - - //roll back the the start date time by 30 seconds (start time should be 30 seconds prior to trigger time) - dt_st = new Date($scope.trigger_dt - 30*1000) - - startDateTime = dt_st.getFullYear() + - "-" + ("0"+(dt_st.getMonth()+1)).slice(-2) + - "-" +("0"+ dt_st.getDate()).slice(-2) + - " " + ("0" + dt_st.getHours()).slice(-2) + - ":" +("0" + dt_st.getMinutes()).slice(-2) + - ":" + ("0" + dt_st.getSeconds()).slice(-2) +".0"; - $scope.startDateTime = startDateTime; - - $scope.endDateTime = $scope.dt2.getFullYear() + - "-" + ("0"+($scope.dt2.getMonth()+1)).slice(-2) + - "-" +("0"+ $scope.dt2.getDate()).slice(-2) + - " " + ("0"+ $scope.selectLastHour.value).slice(-2) + - ":" +("0" + $scope.selectLastMinute.value).slice(-2) + - ":00.0" - - $scope.WorkflowScheduleObject = {}; - $scope.WorkflowScheduleObject['startDateTime_CRON'] = $scope.startDateTime_CRON; - $scope.WorkflowScheduleObject['startDateTime'] = $scope.startDateTime; - $scope.WorkflowScheduleObject['endDateTime'] = $scope.endDateTime; - $scope.WorkflowScheduleObject['workflowKey'] = $scope.workflowToSchedule.workflowKey; - $scope.WorkflowScheduleObject['recurrence'] = $scope.selectRecurrenceOpt.value; - $scope.WorkflowScheduleObject['workflow_arguments'] = "test"; - $scope.WorkflowScheduleObject['workflow_server_url'] = $scope.workflowToSchedule.runLink; - - - TimeFromNowToStart = new Date($scope.startDateTime)-new Date() - TimeStartToEnd = new Date($scope.endDateTime)-new Date($scope.startDateTime) - - if (TimeFromNowToStart<=0) { - console.log("invalid start time input") - alert("Please ensure the scheduled start date time is later than current time.") - return; - } - if (TimeStartToEnd<=0) { - console.log("invalid end time input") - alert("Please ensure the schduled end date time is later than the start time.") - return; - } - // if successful then save and close - $scope.saveCronJob($scope.WorkflowScheduleObject); - $modalInstance.close(); - - }; - - $scope.saveCronJob = function(cronJobData){ - - console.log('saving cron job data: ' + cronJobData); - var uuu = "workflows/saveCronJob.htm"; - var postData={cronJobDataObj: cronJobData}; - $http.post({ - - url : uuu, - //dataType: 'json', // data type expected from server - contentType: 'application/json', - data: JSON.stringify(postData), // data type sent to server - success : function(data){ - $scope.$apply(function(){ - //$scope.availableRoleFunctions=[];$scope.$apply(); - // new // $scope.availableFnMenuItems=data.availableFnMenuItems; - } - ); - //alert("Update Successful.") ; - //$scope.editRoleFunction = null; - // new /// $modalInstance.close({availableFnMenuItems:$scope.availableRoleFunctions}); - }, - error : function(data){ - alert("Error while saving."); - } - }); - - }; - - $scope.cancel = function() { - console.log("cancel triggered") - $modalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - - - - - - - $scope.previewWorkflow = function(workflowToPreview,modalSize){ - var modalInstance = $modal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-preview.html', - sizeClass: 'modal-medium', - controller: ['$scope', '$modalInstance', '$http', function ($scope, $modalInstance, $http) { - $scope.workflowToPreview = workflowToPreview; - console.log('previewWorkFlow invoked'); - console.log($scope.workflowToPreview); - - $scope.cancel = function() { - $modalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - /* change work flow status based on the boolean variable "suspendBool" which corresponds whether - * we would like to suspend or activate a workflow specified by key. */ - $scope.changeWorkflowStatus = function(workflowToChangeStatus,suspendBool){ - if (workflowToChangeStatus!==null) { - var statusUrl= workflowToChangeStatus.runLink+"/engine-rest/process-definition/key/"+workflowToChangeStatus.workflowKey - var suspendedUrl= statusUrl+"/suspended" - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('PUT', suspendedUrl, false); - xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); - xmlHttp.onload = function() { - if (suspendBool) { - console.log("process definition is now suspended"); - workflowToChangeStatus.active="false" - } else { - console.log("process definition is now activated"); - workflowToChangeStatus.active="true" - } - }; - xmlHttp.send(JSON.stringify({ - "suspended" : suspendBool, - "includeProcessInstances" : true, - "executionDate" : "2013-11-21T10:49:45" - })); - } - - }; - - $scope.activateWorkflow = function(workflowToActivate){ - $scope.changeWorkflowStatus(workflowToActivate,false) - - }; - - $scope.suspendWorkflow = function(workflowToActivate){ - $scope.changeWorkflowStatus(workflowToActivate,true) - }; - - $scope.checkWorkflowStatus = function(workflow) { - if (workflow!==null) { - var statusUrl= workflow.runLink+"/engine-rest/process-definition/key/"+workflow.workflowKey - var xmlHttp3 = new XMLHttpRequest(); - xmlHttp3.open('GET', statusUrl, true); - xmlHttp3.withCredentials = true; - xmlHttp3.send(); - xmlHttp3.onreadystatechange = function() { - if (xmlHttp3.readyState == 4 && xmlHttp3.status == 200) { - // do something with the response in the variable data - var temp = JSON.parse(xmlHttp3.responseText) - if (temp.suspended == false){ - console.log("Activated") - workflow.active="true" - } else { - console.log("Suspended") - workflow.active="false" - } - } - } - } - }; - - $scope.StartWorkflowInstance = function(workflowToStart){ - if (workflowToStart!==null) { - var statusUrl= workflowToStart.runLink+"/engine-rest/process-definition/key/"+workflowToStart.workflowKey - var suspendedUrl= statusUrl+"/submit-form" - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('POST', suspendedUrl, false); - xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); - xmlHttp.onload = function() { - }; - xmlHttp.send(JSON.stringify({ - "variables": { - "customerId": {"value":"asdasda","type":"String"}, - "amount":{"value":"100","type":"String"} - } - })); - } - - }; - - - $scope.$on('workflowAdded', function(event, newWorkflow) { - console.log("New Workflow to be added in list scope " + JSON.stringify(newWorkflow)); - //$scope.workflows.push(newWorkflow); - $scope.fetchWorkflowsList(); - console.log('newly added workflow = ' + JSON.stringify(newWorkflow)); - }); - - $scope.$on('workflowRemoved', function(event) { - $scope.fetchWorkflowsList(); - }); - - $scope.fetchWorkflowsList(); - - - -}); - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowRouting.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowRouting.js deleted file mode 100644 index f6ffe8f1..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowRouting.js +++ /dev/null @@ -1,8 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .when('/all', { - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-workflows-page/workflow-listing.html', - controller: 'workflowsControllerDS2' - }) -}); - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/fn-menu-add-popup-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/fn-menu-add-popup-controller.js deleted file mode 100644 index 2b3663c0..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/fn-menu-add-popup-controller.js +++ /dev/null @@ -1,339 +0,0 @@ -var deletefn_menu_popupController = function ($scope,$modal, items,$modalInstance, $http){ - $scope.fnMenuItem=items; - console.log("fnMenuItems",$scope.fnMenuItem); - var ModalInstanceCtrl = function ($scope, $modalInstance, items,AdminMenuService,$http,$modal) { - $scope.fnMenuItem=items; - $scope.save = function (data) { - $modalInstance.close(data); - }; - - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - - $scope.deleteFun = function(data){ - $modalInstance.close(data); - } - }; - $scope.successPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return ''; - } - } - }); - }; - $scope.successModelPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modalpopup.html', - controller: ModalInstanceCtrl, - //sizeClass: 'modal-small', - resolve: { - items: function () { - return ''; - } - } - }); - }; - $scope.errorPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return ''; - } - } - }); - }; - $scope.deleteMenuItem= function(fnMenuItem){ - var uuu = "admin_fn_menu/removeMenuItem.htm"; - var postData={fnMenuItem: fnMenuItem}; - $http({ - method :'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData) - - }).then(function(data){ - $scope.successPopUp(); - // $scope.$apply(function(){$scope.fnMenuItem=data.data.fnMenuItem;}); - location.reload(); - },function(data){ - $scope.errorPopUp(); - // console.log(data); - // modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - }); - }/// examine the LeftMenuService -} - var fn_menu_popupController = function ($scope, $modalInstance, message, $http){ /// examine the LeftMenuService - - if(message.availableFnMenuItem==null) - $scope.label='Add New Menu Item' - - else{ - $scope.label='Edit Menu Item' - //$scope.disableParentId=true; - } - - $scope.getParentData = function(){ - var uuu = "admin_fn_menu/get_parent_list" - $http({ - method : 'GET', - url : uuu, - dataType: 'json', // data type expected from server - contentType: 'application/json', - //data: JSON.stringify(postData), // data type sent to server - - }).then(function(data){ - //$scope.$apply(function(){ - //$scope.availableRoleFunctions=[];$scope.$apply(); - $scope.parentListSelectData=data.data; // data from server - menuItems = $scope.parentListSelectData; - var heirarchicalMenuItems = []; - var children = []; - for ( var i=0; i<menuItems.length; i++){ - for(var j=0; j<menuItems.length; j++){ - if(menuItems[j][2]==menuItems[i][0]) - children.push( - { - menuId: menuItems[j][0], - label: menuItems[j][1] - } - ); - } - if(children.length!=0){ - heirarchicalMenuItems.push( - { - - menuId: menuItems[i][0], - label: menuItems[i][1], - children: children.sort($scope.sortItems("label")) - } - - ); - } - children = []; - - } - heirarchicalMenuItems.sort($scope.sortItems("label")); - $scope.childListSelectData = heirarchicalMenuItems; - //console.log(data); - //}); - //$scope.editRoleFunction = null; - ///$modalInstance.close({functionCDselectData:$scope.functionCDselectData}); - },function(data){ - alert("Parent Data not available !"); - }); - - }; - - $scope.sortItems = function(prop){ - return function(a, b) { - if (a[prop] > b[prop]) { - return 1; - } else if (a[prop] < b[prop]) { - return -1; - } - return 0; - } - - }; - - $scope.getParentLabel = function(parentId, parentListSelectData){ - var element; - element = parentListSelectData[0]; - for (var i=0; i<parentListSelectData.length; i++){ - - element = parentListSelectData[i]; - if (element[0] == parentId) - return element[1]; - else "---"; - } - }; - - - $scope.getFunctionCDselectData = function(){ - var uuu = "admin_fn_menu/get_function_cd_list" - $http({ - method : 'GET', - url : uuu, - dataType: 'json', // data type expected from server - contentType: 'application/json', - //data: JSON.stringify(postData), // data type sent to server - - }).then(function(data){ - //$scope.$apply(function(){ - //$scope.availableRoleFunctions=[];$scope.$apply(); - $scope.functionCDselectData=data.data; - //}); - //alert("Update Successful.") ; - //$scope.editRoleFunction = null; - ///$modalInstance.close({functionCDselectData:$scope.functionCDselectData}); - },function(data){ - alert("Function Code Data not available !"); - }); - - }; - - if(message.availableFnMenuItem){ - $scope.addFnMenuItem = message.availableFnMenuItem; - } else { - $scope.addFnMenuItem = {}; - } - $scope.addFnMenuItem.menuSetCode = "APP"; - - $scope.statusOptions = [ - {index: 0, value: 'true', title: 'Y'}, - {index: 1, value: 'false', title: 'N'} - ]; - $scope.selectedValue = $scope.statusOptions[0]; - - $scope.separator = { - availableOptions:[ - {value: 'true', name: 'Y'}, - {value: 'false', name: 'N'} - ], - - selectedOption: {value: 'true', name: 'Y'} - - }; - - - $scope.activeStatusOptions = [ - {index: 0, value: 'true', title: 'Y'}, - {index: 1, value: 'false', title: 'N'} - ]; - $scope.activeSelectedValue = $scope.activeStatusOptions[0]; - - $scope.separatorStatusOptions = [ - {index: 0, value: 'true', title: 'Y'}, - {index: 1, value: 'false', title: 'N'} - ]; - $scope.separatorSelectedValue = $scope.separatorStatusOptions[1]; - - $scope.active = { - availableOptions:[ - {value: 'true', name: 'Y'}, - {value: 'false', name: 'N'} - ], - - selectedOption: {value: 'true', name: 'Y'} - - }; - - - $scope.updateFnMenu = function(availableFnMenuItem) { - // form validation - if( document.getElementById("popupAddMenuItemImageSrc").value == "" ) availableFnMenuItem.imageSrc = "N/A"; - if( document.getElementById("popupAddMenuItemTarget").value == "" ) availableFnMenuItem.target = "N/A"; - if( document.getElementById("popupAddMenuItemExternalUrl").value == "" ) availableFnMenuItem.externalUrl = "N/A"; - if( document.getElementById("popupAddMenuItemQueryString").value == "" ) availableFnMenuItem.queryString = "N/A"; - if( document.getElementById("popupAddMenuItemServlet").value == "" ) availableFnMenuItem.servlet = "N/A"; - - validationRule = /^\S{3,}$/; - var selectedFunction = document.getElementById("repeatSelect"); - var selectedFunctionText = selectedFunction.options[selectedFunction.selectedIndex].text; - if( - (document.getElementById("popupAddMenuItemLabel").value == "" || document.getElementById("popupAddMenuItemLabel").value.replace(" ", "").length == 0 ) ||//!validationRule.test(document.getElementById("popupAddMenuItemLabel").value)) || - $scope.addFnMenuItem.parentIdAsString == "" || - document.getElementById("popupAddMenuItemAction").value == "" || - selectedFunctionText == "" || - document.getElementById("popupAddMenuItemSortOrder").value == "" || - document.getElementById("popupAddMenuItemMenuSetCode").value == "" - ) - { - alert("please provide valid entries !"); - } - - else{ - var uuu = "admin_fn_menu/updateFnMenu.htm"; - availableFnMenuItem.parentId=parseFloat($scope.addFnMenuItem.parentIdAsString); - availableFnMenuItem.active=('true'==$scope.addFnMenuItem.activeAsString); - availableFnMenuItem.separator=('true'==$scope.addFnMenuItem.separatorAsString); - - - var postData={availableFnMenuItem: availableFnMenuItem}; - - $http({ - method :'POST', - url : uuu, - //dataType: 'json', // data type expected from server - contentType: 'application/json', - data: JSON.stringify(postData), // data type sent to server - }).then(function(data){ - //$scope.$apply(function(){ - $scope.availableFnMenuItems=data.availableFnMenuItems; - //}); - - $modalInstance.close({availableFnMenuItems:$scope.availableRoleFunctions}),function(data){ - alert("Error while saving."); - } - },function(data){ - console.log("Error",data); - }); - $scope.getLeftMenuItems(); // get left menu items again from database - - }; - - $scope.getLeftMenuItems = function() { - return $http.get('get_menu') - .then(function(response) { - if (typeof response.data === 'object') { - var leftChildData=[]; - var leftParentData=[]; - var leftMenuItems = []; - var j = response; - try{ - if(j && j !== "null" && j!== "undefined"){ - leftParentData = JSON.parse(j.data); - leftChildData = JSON.parse(j.data2); - }else{ - throw "Get Left Menu respsone is not an object/is empty"; - } - try{ - var leftChildItemList = leftChildData; - var pageUrl = window.location.href.split('/')[window.location.href.split('/').length-1]; - var leftParentList = leftParentData; - for (var i = 0; i < leftParentList.length; i++) { - $scope.item = { - parentLabel : leftParentList[i].label, - parentAction : leftParentList[i].action, - parentImageSrc : leftParentList[i].imageSrc, - open:pageUrl==leftParentList[i].action?true:false, - childItemList : leftChildItemList[i]==null?'x':leftChildItemList[i] - } - leftMenuItems.push($scope.item); - }; - - $scope.leftMenuItems = leftMenuItems; - - }catch(err){ - console.log("error happened while trying to set left menu structure: "+err); - } - }catch (e) { - console.log("error happened while trying to get left menu items: "+e); - reloadPageOnce(); - return; - } - return response.data; - } else { - return $q.reject(response.data); - } - }, function(response) { - // something went wrong - return $q.reject(response.data); - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} - }
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/profile-route.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/profile-route.js deleted file mode 100644 index c82185c0..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/profile-route.js +++ /dev/null @@ -1,19 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .when('/profile/:profileId', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/self_profile.html', - controller: 'selfProfileController' - }) - .when('/self_profile', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/self_profile.html', - controller: 'selfProfileController' - }) - .when('/post_search', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/post.html', - controller: 'postController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/profile_searchDS2.html', - controller : "profileSearchCtrlDS2" - }); -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/profile-search-controller-DS2.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/profile-search-controller-DS2.js deleted file mode 100644 index 5236001f..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/profile-search-controller-DS2.js +++ /dev/null @@ -1,93 +0,0 @@ -appDS2.controller('profileSearchCtrlDS2', function($scope, $log, $modal, ProfileServiceDS2){ - $scope.showInput = true; - $scope.totalPages1 = 0; - $scope.viewPerPage1 = 8; - $scope.currentPage1 = 1; - $scope.showLoader = false; - - var debug = false; - - $scope.$watch('viewPerPage1', function(val) { - $scope.showLoader = true; - ProfileServiceDS2.getProfilePagination($scope.currentPage1, val).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.profileList); - $scope.totalPages1 =JSON.parse($scope.data.totalPage); - $scope.showLoader = false; - },function(error){ - console.log("watch of viewPerPage1 failed"); - reloadPageOnce(); - }); - - }); - - $scope.customHandler = function(num) { - $scope.currentPage1 = num; - $scope.showLoader = true; - ProfileServiceDS2.getProfilePagination($scope.currentPage1,$scope.viewPerPage1).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.profileList); - $scope.totalPages1 =JSON.parse($scope.data.totalPage); - $scope.showLoader = false; - },function(error){ - console.log("customHandler failed"); - reloadPageOnce(); - }); - - }; - - $scope.editRow = function(profileId){ - window.location = 'userProfile#/profile/' + profileId; - }; - - var ModalInstanceCtrl = function ($scope, $log, $modalInstance, items) { - $scope.msg = items; - - $scope.toggleUserStatus = function(id) { - if (debug) - $log.debug('profileSearchCtrlDS2:ModalInstanceCtrl:toggleUserStatus: data is ' + id); - ProfileServiceDS2.toggleProfileStatus(id); - $modalInstance.close(); - }; - - $scope.cancelUserStatusToggle = function(rowData) { - if (debug) - $log.debug('profileSearchCtrlDS2:ModalInstanceCtrl: cancelUserStatusToggle: data is ' + JSON.stringify(rowData)); - // Undo the toggle of the checkbox - rowData.active = ! rowData.active; - $modalInstance.dismiss('cancel'); - } - - } - - // user activation/deactivation - $scope.toggleProfileActive = function(rowData) { - if (debug) - $log.debug('profileSearchCtrlDS2:toggleProfileActive: id is ' + rowData.id - + ', active is ' + rowData.active); - var toggleType = null; - // The checkbox is already in the desired state, - // so the sense of the "if" is reversed here. - if (rowData.active) - toggleType = "activate"; - else - toggleType = "deactivate"; - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/modals/profile-confirm-toggle.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - var message = { - text : toggleType, - rowData : rowData - }; - return message; - } - } - }); - }; - -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/sampleProfileController.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/sampleProfileController.js deleted file mode 100644 index 0f02e46f..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/sampleProfileController.js +++ /dev/null @@ -1,22 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .when('/profile/:profileId', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/profile_detail.html', - controller: 'profileController' - }) - .when('/post_search', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/post_search.html', - controller: 'postSearchCtrl' - }) - .when('/ase', { - templateUrl: 'app/fusion/ase/index.html' - }) - .when('/self_profile', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/self_profile.html', - controller: 'selfProfileController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/DS2-view-models/DS2-profile-page/profile_searchDS2.html', - controller : "profileSearchCtrlDS2" - }); -}); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/usage-list-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/usage-list-controller.js deleted file mode 100644 index ab229714..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/usage-list-controller.js +++ /dev/null @@ -1,39 +0,0 @@ -appDS2.controller('usageListControllerDS2', function ($scope,$interval,$http,$modal, AdminService){ - AdminService.getUsageList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.users =$scope.data; - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.successPopUp = function () { - var modalInstance = $modal.open({ - templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return ''; - } - } - }); - }; - - $scope.removeSession = function(sessionId) { - - $http.get("usage_list/removeSession?deleteSessionId="+sessionId).success(function(response){ - $scope.users=response; - $scope.successPopUp(); - }); -/* modalService.popupConfirmWin("Confirm","You are about to expel this user from the application. All of their unsaved data will be lost. Do you want to continue?", - function(){ - $http.get("usage_list/removeSession?deleteSessionId="+sessionId).success(function(response){$scope.users=response;}); - })*/ - - } -});
\ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/welcome-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/welcome-controller.js deleted file mode 100644 index b2b3a43b..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/welcome-controller.js +++ /dev/null @@ -1,408 +0,0 @@ -appDS2 - .directive( - 'integer', - function() { - return { - require : 'ngModel', - link : function(scope, ele, attr, ctrl) { - ctrl.$parsers.unshift(function(viewValue) { - if (viewValue === '' || viewValue === null - || typeof viewValue === 'undefined') { - return null; - } - return parseInt(viewValue, 10); - }); - } - }; - }) - - .controller( - 'welcomeController', - function($scope, $interval, $http, $modal, $log, ManifestService) { - - $scope.testMsg = "Welcome Page1"; - $scope.gridsterOpts = { - columns : 6, // the width of the grid, in columns - pushing : true, // whether to push other items out of - // the way on move or resize - floating : true, // whether to automatically float - // items up so they stack (you can - // temporarily disable if you are - // adding unsorted items with - // ng-repeat) - width : 'auto', // can be an integer or 'auto'. 'auto' - // scales gridster to be the full width - // of its containing element - colWidth : 'auto', // can be an integer or 'auto'. - // 'auto' uses the pixel width of - // the element divided by 'columns' - rowHeight : 60, // can be an integer or 'match'. Match - // uses the colWidth, giving you square - // widgets. - margins : [ 10, 10 ], // the pixel distance between - // each widget - outerMargin : true, // whether margins apply to outer - // edges of the grid - swapping : true, - draggable : { - enabled : true, // whether dragging items is - // supported - stop : function(event, uiWidget, $element) { - $scope.setCookie(); - } // optional callback fired when item is finished - // dragging - } - - }; - - /* - * $scope.gridsterOpts = { columns: 6, width: 'auto', - * colWidth: '230', rowHeight: '120', margins: [10, 10], - * outerMargin: true, pushing: true, floating: true, - * swapping: true }; - */ - - $scope.toggleMinMax = function(index, tileName) { - if (tileName == '') { - $scope.standardItems[index].max = !$scope.standardItems[index].max; - if ($scope.standardItems[index].max) - $scope.standardItems[index].sizeY = $scope.standardItems[index].maxHeight; - else - $scope.standardItems[index].sizeY = 0; - } else { - $scope.tileTemp = $scope.$eval(tileName); - var tileMax = $parse(tileName + '.max'); - tileMax.assign($scope, !$scope.$eval(tileName).max); - var tileSizeY = $parse(tileName + '.sizeY'); - if ($scope.tileTemp.max) - tileSizeY.assign($scope, - $scope.tileTemp.maxHeight); - else - tileSizeY.assign($scope, 0); - } - }; - - // These map directly to gridsterItem options - // IMPORTANT: Items should be placed in the grid in the - // order in which - // they should appear. - // In most cases the sorting should be by row ASC, col ASC - $scope.standardItems = [ - { - sizeX : 2, - sizeY : 8, - maxHeight : 8, - row : 0, - col : 0, - headerText : 'Dashboard', - max : false - - }, - { - sizeX : 2, - sizeY : 5, - maxHeight : 5, - row : 0, - col : 2, - headerText : 'Donut Chart', - max : false - - },/* - * { sizeX : 1, sizeY : 5, maxHeight : 5, row : - * 0, col : 2, headerText : 'Area Chart', max : - * false }, - */ - { - sizeX : 2, - sizeY : 5, - maxHeight : 5, - row : 8, - col : 0, - headerText : 'Pie Chart', - max : false - }, - /* - * { sizeX : 1, sizeY : 5, maxHeight : 5, row : 8, - * col : 1, headerText : 'Line Chart', max : false }, - */ - { - sizeX : 2, - sizeY : 5, - maxHeight : 5, - row : 8, - col : 4, - headerText : 'Gauges', - max : false - }, - { - sizeX : 2, - sizeY : 8, - maxHeight : 8, - row : 16, - col : 0, - headerText : 'Traffic distribution by day of week', - max : false - }, - { - sizeX : 2, - sizeY : 8, - maxHeight : 8, - row : 16, - col : 2, - headerText : 'Busy hour traffic analysis by day of week', - max : false - }, { - sizeX : 2, - sizeY : 6, - maxHeight : 7, - row : 24, - col : 4, - headerText : 'Additional Samples', - max : false - }, { - sizeX : 2, - sizeY : 8, - maxHeight : 8, - row : 24, - col : 2, - headerText : 'Sticky Notes', - max : false - }, { - sizeX : 6, - sizeY : 10, - maxHeight : 10, - row : 32, - col : 0, - headerText : 'Service Configuration', - max : false - } ]; - - /* - * $.each($scope.standardItems, function(i, a) { - * $scope.toggleMinMax(i, ''); }); - */ - var counter = 0; - angular.forEach($scope.standardItems, function(i, a) { - $scope.toggleMinMax(counter, ''); - counter = counter + 1; - }); - - $scope.activeTabId = 'Monday'; - // for generic tabs - - $scope.selectedTrafficDay = [ { - title : 'Mon', - url : '#Monday' - }, { - title : 'Tue', - url : '#Tuesday' - }, { - title : 'Wed', - url : '#Wednesday' - }, { - title : 'Thu', - url : '#Thursday' - }, { - title : 'Fri', - url : '#Friday' - }, { - title : 'Sat', - url : '#Saturday' - }, { - title : 'Sun', - url : '#Sunday' - } ]; - - $scope.currentSelectedDayTab = '#Monday'; - - $scope.onClickTab1 = function(Daytab) { - $scope.currentSelectedDayTab = Daytab.url; - } - - $scope.isActiveTab1 = function(tabUrl) { - return tabUrl == $scope.currentSelectedDayTab; - } - - $scope.gTabs = [ { - title : 'Monday', - id : 'Monday', - url : '#Monday', - selected : true - }, { - title : 'Tuesday', - id : 'Tuesday', - url : '#Tuesday' - }, { - title : 'Wednesday', - id : 'Wednesday', - url : '#Wednesday' - }, { - title : 'Thursday', - id : 'Thursday', - url : '#Thursday' - }, { - title : 'Friday', - id : 'Friday', - url : '#Friday' - }, { - title : 'Saturday', - id : 'Saturday', - url : '#Saturday' - }, { - title : 'Sunday', - id : 'Sunday', - url : '#Sunday' - } ]; - - $scope.BusyHourTraffic = [ { - title : 'BH SNRC DLSTX - Incoming', - url : '#Incoming' - }, { - title : 'BH SNRC DLSTX - Outgoing', - url : '#Outgoing' - }, { - title : 'BH National - Default', - url : '#Default' - }, { - title : 'BH National - Priority', - url : '#Priority' - }, { - title : 'BH National', - url : '#BHNational' - } - - ]; - - $scope.currentSelectedBusyHourTraffic = '#Incoming'; - - $scope.onClickTab2 = function(TrafficTab) { - $scope.currentSelectedBusyHourTraffic = TrafficTab.url; - } - - $scope.isActiveTab2 = function(tabUrl) { - return tabUrl == $scope.currentSelectedBusyHourTraffic; - } - - $scope.activeTabId2 = 'Incoming'; - // for generic tabs - $scope.gTabs2 = [ { - title : 'BH SNRC DLSTX - Incoming', - id : 'Incoming', - url : '#Incoming', - selected : true - }, { - title : 'BH SNRC DLSTX - Outgoing', - id : 'Outgoing', - url : '#Outgoing' - }, { - title : 'BH National - Default', - id : 'Default', - url : '#Default' - }, { - title : 'BH National - Priority', - id : 'Priority', - url : '#Priority' - }, { - title : 'BH National', - id : 'BHNational', - url : '#BHNational' - } ]; - - $scope.activeTabId3 = 'Incoming'; - // for generic tabs - $scope.gTabs3 = [ { - title : 'BH SNRC DLSTX - Incoming', - id : 'Incoming', - url : '#Incoming', - selected : true - }, { - title : 'BH SNRC DLSTX - Outgoing', - id : 'Outgoing', - url : '#Outgoing' - }, { - title : 'BH National - Default', - id : 'Default', - url : '#Default' - }, { - title : 'BH National - Priority', - id : 'Priority', - url : '#Priority' - }, { - title : 'BH National', - id : 'BHNational', - url : '#BHNational' - } ]; - - /* - * $scope.$watch('activeTabId', function(newVal) { - * alert(newval); $('#'+newval).show(); }, true); - */ - - $scope.toggleEastToWest = function() { - $("#toggle").toggle('slide'); - if ($("#leftIcon").is(":visible")) { - $("#rightIcon").show(); - $("#leftIcon").hide(); - } else if ($("#rightIcon").is(":visible")) { - $("#rightIcon").hide(); - $("#leftIcon").show(); - } - }; - - $scope.group1 = { - open : true - }; - $scope.group2 = { - open : true - }; - $scope.group3 = { - open : true - }; - $scope.group4 = { - open : true - }; - $scope.group5 = { - open : true - }; - $scope.group6 = { - open : true - }; - $scope.group7 = { - open : true - }; - $scope.group71 = { - open : true - }; - $scope.group8 = { - open : true - }; - $scope.group9 = { - open : true - }; - $scope.group10 = { - open : true - }; - $scope.group11 = { - open : true - }; - $scope.group12 = { - open : false - }; - - // Fetch manifest info - $scope.manifest = {}; - ManifestService.getManifest() - .then(function(jsonObj) { - // $log.debug("welcome-controller: getManifest returned " + JSON.stringify(jsonObj)); - if (jsonObj.error) { - $log.error('welcome-controller: failed to get manifest: ' + JSON.stringify(jsonObj)); - } - else { - $scope.manifest=jsonObj; - } - },function(error){ - $log.error("welcome-controller: getManifest failed: " + error); - }); - - - }); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/welcome-route.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/welcome-route.js deleted file mode 100644 index 8f4b1fdb..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/welcome-route.js +++ /dev/null @@ -1,7 +0,0 @@ -appDS2.config(function($routeProvider) { - $routeProvider - .otherwise({ - templateUrl: 'app/fusion/scripts/DS2-view-models/welcome-content.html', - controller : "welcomeController" - }); -}); |