From 3982f4f67314ec37fd9b22ae54049958af777c1b Mon Sep 17 00:00:00 2001 From: jimmydot Date: Sun, 7 May 2017 14:58:24 -0400 Subject: [VID-6] Initial rebase push Change-Id: I9077be9663754d9b22f77c6a7b3109b361b39346 Signed-off-by: jimmydot --- .../fusion/scripts/controllers/adminController.js | 65 --- .../fusion/scripts/controllers/admin_menu_edit.js | 230 ---------- .../fusion/scripts/controllers/ase-controller.js | 22 - .../scripts/controllers/broadcast-controller.js | 79 ---- .../controllers/broadcast-list-controller.js | 120 ----- .../controllers/collaborate-list-controller.js | 63 --- .../app/fusion/scripts/controllers/dummy.txt | 0 .../controllers/fn_menu_add_popup_controller.js | 281 ------------ .../scripts/controllers/jcs-admin-controller.js | 83 ---- .../scripts/controllers/modelpopupController.js | 40 -- .../scripts/controllers/post-search-controller.js | 202 -------- .../scripts/controllers/profile-controller.js | 286 ------------ .../controllers/profile-search-controller.js | 80 ---- .../scripts/controllers/profileController.js | 38 -- .../fusion/scripts/controllers/role-controller.js | 226 --------- .../controllers/role-function-list-controller.js | 157 ------- .../scripts/controllers/role-list-controller.js | 102 ----- .../controllers/rolefunctionpopupController.js | 84 ---- .../controllers/rolepopupmodelController.js | 205 --------- .../scripts/controllers/self-profile-controller.js | 284 ------------ .../scripts/controllers/usage-list-controller.js | 41 -- .../scripts/controllers/workflows/workflowApp.js | 24 - .../controllers/workflows/workflowController.js | 509 --------------------- .../controllers/workflows/workflowRouting.js | 26 -- 24 files changed, 3247 deletions(-) delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/adminController.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/dummy.txt delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/jcs-admin-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/modelpopupController.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/post-search-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/profileController.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/role-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js delete mode 100644 vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js (limited to 'vid/src/main/webapp/app/fusion/scripts/controllers') diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/adminController.js b/vid/src/main/webapp/app/fusion/scripts/controllers/adminController.js deleted file mode 100644 index a99be9fe..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/adminController.js +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - - - .when('/role_function_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/role_function_list.html', - controller: 'roleFunctionListController' - }) - - .when('/admin_menu_edit', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/admin_menu_edit.html', - controller: 'AdminMenuEditController' - }) - .when('/role/:roleId', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/role.html', - controller: 'roleController' - }) - .when('/jcs_admin', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/jcs_admin.html', - controller: 'cacheAdminController' - }) - .when('/broadcast_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/broadcast_list.html', - controller: 'broadcastListController' - }) - .when('/broadcast/:messageLocationId/:messageLocation/:messageId', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/broadcast.html', - controller: 'broadcastController' - }) - .when('/broadcast/:messageLocationId/:messageLocation', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/broadcast.html', - controller: 'broadcastController' - }) - .when('/collaborate_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/collaborate_list.html', - controller: 'collaborateListController' - }) - .when('/usage_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/usage_list.html', - controller: 'usageListController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/view-models/profile-page/role_list.html', - controller : "roleListController" - }); -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js b/vid/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js deleted file mode 100644 index 54d58a45..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js +++ /dev/null @@ -1,230 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('AdminMenuEditController', function ($scope, AdminService, modalService, $modal, $route){ - $( "#dialog" ).hide(); - -/* AdminService.getRoleFunctionList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - });*/ - $scope.init = function () { - $scope.numberOfRecordstoShow=20; - AdminService.getFnMenuItems().then(function(data){ - var j = data; - $scope.data =JSON.parse(j.data); - $scope.fnMenuItems =($scope.data.fnMenuItems); - - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - } - $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: 'fn_menu_add_popup.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) { - modalService.popupConfirmWin("Confirm","You are about to delete the menu item "+fnMenuItem.label+". Do you want to continue?", - function(){ - var uuu = "admin_fn_menu/removeMenuItem.htm"; - var postData={fnMenuItem: fnMenuItem}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.fnMenuItem=data.fnMenuItem;}); - $route.reload(); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; - - $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: 'fn_menu_add_popup.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){ - console.log('response', response); - $scope.availableRoleFunctions=response.availableRoleFunctions; - }); - }; - - $scope.addNewRoleFunctionPopup = function() { - $scope.editRoleFunction = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.saveRoleFunction = function(availableRoleFunction) { - var uuu = "role_function_list/saveRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.availableRoleFunctions=[];$scope.$apply(); - $scope.availableRoleFunctions=data.availableRoleFunctions;}); - //alert("Update Successful.") ; - console.log($scope.availableRoleFunctions); - - $scope.editRoleFunction = null; - $( "#dialog" ).dialog("close"); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - - $scope.removeRole = function(availableRoleFunction) { - modalService.popupConfirmWin("Confirm","You are about to delete the role function "+availableRoleFunction.name+". Do you want to continue?", - function(){ - var uuu = "role_function_list/removeRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.availableRoleFunctions=data.availableRoleFunctions;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js deleted file mode 100644 index 45fc31ac..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('aseCtrl', function ($scope){ -/* do nothing yet*/ -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js deleted file mode 100644 index 77ee22f5..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('broadcastController', function ($scope, modalService, $modal,AdminService,$routeParams){ - //$scope.broadcastMessage=${broadcastMessage}; - //$scope.broadcastSites=${broadcastSites}; - //console.log($scope.broadcastMessage); - $scope.broadcastMessage=[]; - $scope.broadcastSites=[]; - AdminService.getBroadcast($routeParams.messageLocationId, $routeParams.messageLocation, $routeParams.messageId).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.broadcastMessage=JSON.parse($scope.data.broadcastMessage); - $scope.broadcastSites=JSON.parse($scope.data.broadcastSites); - console.log($scope.broadcastMessage); - console.log($scope.broadcastMessage.id); - console.log($scope.broadcastSites); - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.save = function() { - var uuu = "broadcast/save"; - var postData={broadcastMessage: $scope.broadcastMessage}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - window.location.href = "admin#/broadcast_list"; - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - $scope.close = function() { - window.location.href = "admin#/broadcast_list"; -}; - -}); - -$(function() { - $( "#startDatepicker" ).datepicker(); - $( "#endDatepicker" ).datepicker(); - - $( "#startDatepicker" ).change(function() { - var tempStartDate = moment($( "#startDatepicker" ).val()).format('YYYY-MM-DD hh:mm:ss.S'); - $( "#startDateHidden" ).val(tempStartDate.toString()); - //alert( $( "#startDateHidden" ).val() ); - }); - $( "#endDatepicker" ).change(function() { - var tempEndDate = moment($( "#endDatepicker" ).val()).format('YYYY-MM-DD hh:mm:ss.S'); - $( "#endDateHidden" ).val(tempEndDate.toString()); - //alert( $( "#endDateHidden" ).val() ); - }); -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js deleted file mode 100644 index cb10a29b..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('broadcastListController', function ($scope, modalService, $modal,AdminService){ - //$scope.broadcastMessage=${broadcastMessage}; - //$scope.broadcastSites=${broadcastSites}; - //console.log($scope.broadcastMessage); - var messagesMap = {}; - AdminService.getBroadcastList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.messagesList=(($scope.data.messagesList===null) ? [""]:$scope.data.messagesList); - $scope.messageLocations=(($scope.data.messageLocations===null) ? [""]:$scope.data.messageLocations); - console.log("messages: "+$scope.messagesList); - console.log("location: "+$scope.messageLocations); - $.each($scope.messageLocations, function(i, a){ - //var result = []; - angular.forEach($scope.messagesList, function(value, key) { - if (key+'' === a.value+'') { - //var objsJSON = JSON.parse(value); - - $.each(value, function(i, a){ - var startDateLong = a.startDate; - var tempStartDate = new Date(startDateLong); - tempStartDate = moment(tempStartDate).format('DD MMM YYYY hh:mmA zz');//03 Jun 2013 04:15PM EDT - a.displayStartDate=tempStartDate.toString(); - - var endDateLong = a.endDate; - var tempEndDate = new Date(endDateLong); - tempEndDate = moment(tempEndDate).format('DD MMM YYYY hh:mmA zz');//03 Jun 2013 04:15PM EDT - a.displayEndDate=tempEndDate.toString(); - }); - a.messages = value; - } - }); - console.log(a.messages); - }); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - - $scope.editMessage = function(location) { - - editMessage(location.value, location.label); - }; - - $scope.toggleActive = function(broadcastMessage) { - - //alert('deleted'+role.name); - var uuu = "broadcast_list/toggleActive"; - var postData={broadcastMessage:broadcastMessage}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - //window.location.reload(); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while toggling: "+ data.responseText); - - } - }); - - - }; - - $scope.remove = function(broadcastMessage) { - - //alert('deleted'+role.name); - var uuu = "broadcast_list/remove"; - var postData={broadcastMessage:broadcastMessage}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - window.location.reload(); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - - }; - -}); - -function editMessage(messageLocationId, messageLocation, messageId) { - window.location='admin#/broadcast/'+messageLocationId + '/' + messageLocation + ((messageId != null) ? '/' + messageId : ''); -} diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js deleted file mode 100644 index 5b0b9342..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller("collaborateListController", function ($scope,$http,modalService, $modal,AdminService) { - // Table Data - AdminService.getCollaborateList().then(function(data){ - - var j = data; - $scope.tableData = JSON.parse(j.data); - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.viewPerPage = 20; - $scope.scrollViewsPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - /* modalService.showSuccess('','Modal Sample') ; */ - 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; - } - $scope.openCollaboration = function(chatId){ - openInNewTab('collaboration?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(); -}; diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/dummy.txt b/vid/src/main/webapp/app/fusion/scripts/controllers/dummy.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js deleted file mode 100644 index e0179946..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js +++ /dev/null @@ -1,281 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -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" - $.ajax({ - type : 'GET', - 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(); - $scope.parentListSelectData=data; // data from server - menuItems = $scope.parentListSelectData; - var heirarchicalMenuItems = []; - var children = []; - for ( var i=0; i 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=0) - $scope.importProfileList.splice(index, 1); - } - }; - - $scope.prepareProfileSelection = function() { - if($scope.importProfileList) - $.each($scope.importProfileList, function(i, profile){ - $scope.preparePostSearchBean(profile); - }); - ; - } - - $scope.preparePostSearchBean = function(profile) { - //console.log('Importing: '+profile.orgUserId); - //console.log('ngexistinguser:'+$scope.ngexistingUsers[profile.orgUserId]) - if($scope.postSearchBean.selected==null){ - $scope.postSearchBean.selected=[]; - $scope.postSearchBean.postOrgUserId=[]; - $scope.postSearchBean.postHrid=[]; - $scope.postSearchBean.postFirstName=[]; - $scope.postSearchBean.postLastName=[]; - $scope.postSearchBean.postOrgCode=[]; - $scope.postSearchBean.postPhone=[]; - $scope.postSearchBean.postEmail=[]; - $scope.postSearchBean.postAddress1=[]; - $scope.postSearchBean.postAddress2=[]; - $scope.postSearchBean.postCity=[]; - $scope.postSearchBean.postState=[]; - $scope.postSearchBean.postZipCode=[]; - $scope.postSearchBean.postLocationClli=[]; - $scope.postSearchBean.postBusinessCountryCode=[]; - $scope.postSearchBean.postBusinessCountryName=[]; - $scope.postSearchBean.postDepartment=[]; - $scope.postSearchBean.postDepartmentName=[]; - $scope.postSearchBean.postBusinessUnit=[]; - $scope.postSearchBean.postBusinessUnitName=[]; - $scope.postSearchBean.postJobTitle=[]; - $scope.postSearchBean.postOrgManagerUserId=[]; - $scope.postSearchBean.postCommandChain=[]; - $scope.postSearchBean.postCompanyCode=[]; - $scope.postSearchBean.postCompany=[]; - $scope.postSearchBean.postCostCenter=[]; - $scope.postSearchBean.postSiloStatus=[]; - $scope.postSearchBean.postFinancialLocCode=[]; - } - - $scope.postSearchBean.selected.push(profile.orgUserId); - $scope.postSearchBean.postOrgUserId.push(profile.orgUserId); - $scope.postSearchBean.postHrid.push(profile.hrid); - $scope.postSearchBean.postFirstName.push(profile.firstName); - $scope.postSearchBean.postLastName.push(profile.lastName); - $scope.postSearchBean.postOrgCode.push(profile.orgCode); - $scope.postSearchBean.postPhone.push(profile.phone); - $scope.postSearchBean.postEmail.push(profile.email); - $scope.postSearchBean.postAddress1.push(profile.address1); - $scope.postSearchBean.postAddress2.push(profile.address2); - $scope.postSearchBean.postCity.push(profile.city); - $scope.postSearchBean.postState.push(profile.state); - if(profile.zipCodeSuffix==null) - $scope.postSearchBean.postZipCode.push(profile.zipCode); - else - $scope.postSearchBean.postZipCode.push(profile.zipCode+'-'+profile.zipCodeSuffix); - $scope.postSearchBean.postLocationClli.push(profile.locationClli); - $scope.postSearchBean.postBusinessCountryCode.push(profile.businessCountryCode); - $scope.postSearchBean.postBusinessCountryName.push(profile.businessCountryName); - $scope.postSearchBean.postDepartment.push(profile.department); - $scope.postSearchBean.postDepartmentName.push(profile.departmentName); - $scope.postSearchBean.postBusinessUnit.push(profile.businessUnit); - $scope.postSearchBean.postBusinessUnitName.push(profile.businessUnitName); - $scope.postSearchBean.postJobTitle.push(profile.jobTitle); - $scope.postSearchBean.postOrgManagerUserId.push(profile.orgManagerUserId); - $scope.postSearchBean.postCommandChain.push(profile.commandChain); - $scope.postSearchBean.postCompanyCode.push(profile.companyCode); - $scope.postSearchBean.postCompany.push(profile.company); - $scope.postSearchBean.postCostCenter.push(profile.costCenter); - $scope.postSearchBean.postSiloStatus.push(profile.siloStatus); - $scope.postSearchBean.postFinancialLocCode.push(profile.financialLocCode); - }; - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js deleted file mode 100644 index aa0066b0..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js +++ /dev/null @@ -1,286 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('profileController', function ($scope,$http,ProfileService,$routeParams,modalService){ - $scope.tableData=[]; - $scope.profile=[]; - $scope.ociavailableRoles=[]; - $scope.ociTimeZones; - $scope.ociCountries; - var stateList=[]; - $scope.availableRoles = []; - $scope.timeZones = []; - $scope.selectedTimeZone = null; - $scope.countries = []; - $scope.selectedCountry = null; - - ProfileService.getProfileDetail($routeParams.profileId).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profile =JSON.parse($scope.data.profile); - $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); - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - - 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; - } - }); - $scope.availableRoles.push(availableRole); - }); - ; - - /*$scope.ociTimeZones = ${model.timeZones};*/ - - 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; - } - }); - }; - - /*$scope.ociCountries = ${model.countries};*/ - - //alert($scope.ociCountries[0].label); - 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; - } - }); - ; - - /*var stateList=${model.stateList};*/ - //alert(stateList[0].label); - stateList = stateList== null? []: stateList; - var selectedState= $scope.profile.state ? $scope.profile.state:""; - $scope.stateList = initDropdownWithLookUp(stateList,selectedState ); - - //$scope.resetMenu(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - /*$scope.profile=${model.profile};*/ - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - $scope.viewPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - - $( "#dialog" ).hide(); - - /*$scope.ociavailableRoles=${model.availableRoles};*/ - //modalService.showFailure('Error','') ; - - - $scope.saveProfile = function() { - var uuu = "profile/saveProfile?profile_id=" + $routeParams.profileId; - 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:"" - }; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - modalService.showSuccess("Success","Update Successful."); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - $scope.addNewRolePopup = function(role) { - $( "#dialog" ).dialog({ - modal: true, - width: 500, - height:600 - }); - $(".ui-dialog").css("z-index",2001); - $(".ui-dialog-titlebar").hide(); - }; - - $scope.toggleRole = function(selected,availableRole) { - $scope.profileTemp=$scope.profile; - $scope.profile={}; - //alert('toggleRole: '+selected); - if(!selected) { - //remove role - var uuu = "profile/removeRole?profile_id=" + $routeParams.profileId; - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - $scope.$apply(function(){$scope.profile=$scope.profileTemp;}); - modalService.showFailure("Fail","Error while saving."); - } - }); - }, - function(){ - availableRole.selected=!availableRole.selected; - }); - - - } else { - //add role - var uuu = "profile/addNewRole?profile_id=" + $routeParams.profileId; - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - $scope.$apply(function(){$scope.profile=$scope.profileTemp;}); - modalService.showFailure("Fail","Error while saving."); - } - }); - - },function(){ - availableRole.selected=!availableRole.selected; - }) - - } - - - }; - - $scope.removeRole = function(role) { - - - modalService.popupConfirmWin("Confirm","You are about to remove the role "+role.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - $scope.profileTemp=$scope.profile; - $scope.profile={}; - var uuu = "profile/removeRole?profile_id=" + $routeParams.profileId; - var postData={role:role}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.profile=data; - $.each($scope.availableRoles, function(k, c){ - if(c.id === role.id) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - $scope.$apply(function(){$scope.profile=$scope.profileTemp;}); - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - - }; - - 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; - return dropDown; - }; - - $scope.doRolePopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'roles_popup.html', - controller: 'rolepopupController', - resolve: { - message: function () { - var message ={ - availableRoles: $scope.availableRoles - }; - return message; - } - } - }); - modalInstance.result.then(function (opts) { - if(opts!=null){ - $scope.profile=opts.profile; - } - }); - } - - $scope.close = function(){ - $('#dialog').dialog('close'); - } - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js deleted file mode 100644 index 6da82dcc..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('profileSearchCtrl', function($scope, $http,ProfileService,modalService){ - - $scope.showInput = true; - $scope.totalPages1 = 5; - $scope.viewPerPage1 = 8; - $scope.currentPage1 = 1; - - $scope.$watch('viewPerPage1', function(val) { - ProfileService.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); - 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; - } - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - }); - - $scope.customHandler = function(num) { - $scope.currentPage1 = num; - ProfileService.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); - 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; - } - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - }; - - $scope.editRow = function(profileId){ - window.location = 'userProfile#/profile/' + profileId; - }; - - $scope.toggleProfileActive = function(rowData) { - modalService.popupConfirmWinWithCancel("Confirm","You are about to change user's active status. Do you want to continue?", - function(){ - $http.get("profile/toggleProfileActive?profile_id="+rowData.id).success(function(){}); - }, - function(){ - rowData.active=!rowData.active; - }) - }; - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/profileController.js b/vid/src/main/webapp/app/fusion/scripts/controllers/profileController.js deleted file mode 100644 index 4b30e40e..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/profileController.js +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.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('/self_profile', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/self_profile.html', - controller: 'selfProfileController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/view-models/profile-page/profile_search.html', - controller : "profileSearchCtrl" - }); -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/role-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/role-controller.js deleted file mode 100644 index 50913af8..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/role-controller.js +++ /dev/null @@ -1,226 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('roleController', function ($scope, modalService, $modal, AdminService,$routeParams){ - //$scope.role=${role}; - //console.log($scope.role.roleFunctions); - - $( "#dialogRoleFunction" ).hide(); - $( "#dialogChildRole" ).hide(); - - //$scope.ociavailableRoleFunctions=${availableRoleFunctions}; - - AdminService.getRole($routeParams.roleId).then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - - $scope.role =JSON.parse($scope.data.role); - console.log($scope.role); - - $scope.ociavailableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - console.log($scope.ociavailableRoleFunctions); - $scope.availableRoleFunctions=[]; - - if($scope.ociavailableRoleFunctions) - $.each($scope.ociavailableRoleFunctions, function(i, a){ - var availableRoleFunction = a; - availableRoleFunction.selected = false; - $.each($scope.role.roleFunctions, function(j, b){ - if(a.code === b.code) { - availableRoleFunction.selected = true; - } - }); - $scope.availableRoleFunctions.push(availableRoleFunction); - }); - - - $scope.ociavailableRoles=JSON.parse($scope.data.availableRoles); - console.log($scope.ociavailableRoles); - console.log("testing roles if exist"); - $scope.availableRoles=[]; - - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - if($scope.role.childRoles){ - $.each($scope.role.childRoles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - } - }); - }; - $scope.availableRoles.push(availableRole); - }); - - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.saveRole = function() { - var exists = false; - for(x in $scope.availableRoles){ - console.log($scope.availableRoles[x].name); - if($scope.availableRoles[x].name==$scope.role.name){ - modalService.showFailure("Warning", "Role already exists."); - exists = true; - //$modalInstance.close({availableRoleFunctions:message.availableRoleFunctions}); - } - } - if(!exists){ - var uuu = "role/saveRole.htm?role_id="+$routeParams.roleId; - var postData={role: $scope.role, childRoles: $scope.role.childRoles, roleFunctions : $scope.role.roleFunctions}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - modalService.showSuccess("Success","Update Successful."); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while saving."); - } - }); - } - - }; - - $scope.addNewRoleFunctionModalPopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'role_functions_popup.html', - controller: 'rolepopupController', - backdrop: 'static', - resolve: { - roleId: function () { - return $routeParams.roleId; - }, - role: function () { - return $scope.role; - }, - availableRoles: function () { - return $scope.ociavailableRoles; - }, - availableRoleFunctions: function () { - return $scope.ociavailableRoleFunctions; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.role=response.role; - }); - }; - - $scope.addNewChildRoleModalPopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'child_roles_popup.html', - controller: 'rolepopupController', - backdrop: 'static', - resolve: { - roleId: function () { - return $routeParams.roleId; - }, - role: function () { - return $scope.role; - }, - availableRoles: function () { - return $scope.ociavailableRoles; - }, - availableRoleFunctions: function () { - return $scope.ociavailableRoleFunctions; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.role=response.role; - }); - }; - - - - $scope.removeRoleFunction = function(roleFunction) { - modalService.popupConfirmWin("Confirm","You are about to remove the role function "+roleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var uuu = "role/removeRoleFunction.htm?role_id=" + $routeParams.roleId; - var postData={roleFunction:roleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.role=data.role; - $.each($scope.availableRoleFunctions, function(k, c){ - if(c.code === roleFunction.code) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - }; - - $scope.removeChildRole = function(childRole) { - modalService.popupConfirmWin("Confirm","You are about to remove the child role "+childRole.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var uuu = "role/removeChildRole.htm?role_id=" + $routeParams.roleId; - var postData={childRole:childRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.role=data.role; - $.each($scope.availableRoles, function(k, c){ - if(c.id === childRole.id) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - }; - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js deleted file mode 100644 index eedac3e0..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js +++ /dev/null @@ -1,157 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('roleFunctionListController', function ($scope, AdminService, modalService, $modal){ - $( "#dialog" ).hide(); - - AdminService.getRoleFunctionList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.editRoleFunction = null; - var dialog = null; - $scope.editRoleFunctionPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.editRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions; - $scope.availableRoleFunctions={}; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction, - availableRoleFunctions: $scope.availableRoleFunctionsTemp - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - if(response!=null) - $scope.availableRoleFunctions=response.availableRoleFunctions; - else - $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp; - }); - }; - - $scope.addNewRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = null; - $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions; - $scope.availableRoleFunctions={}; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction, - availableRoleFunctions: $scope.availableRoleFunctionsTemp - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - if(response!=null) - $scope.availableRoleFunctions=response.availableRoleFunctions; - else - $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp; - }); - }; - - $scope.addNewRoleFunctionPopup = function() { - $scope.editRoleFunction = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.saveRoleFunction = function(availableRoleFunction) { - var uuu = "role_function_list/saveRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.availableRoleFunctions=[];$scope.$apply(); - $scope.availableRoleFunctions=data.availableRoleFunctions;}); - //alert("Update Successful.") ; - console.log($scope.availableRoleFunctions); - - $scope.editRoleFunction = null; - $( "#dialog" ).dialog("close"); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - - $scope.removeRole = function(availableRoleFunction) { - modalService.popupConfirmWin("Confirm","You are about to delete the role function "+availableRoleFunction.name+". Do you want to continue?", - function(){ - $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions; - $scope.availableRoleFunctions={}; - var uuu = "role_function_list/removeRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.availableRoleFunctions=data.availableRoleFunctions;}); - }, - error : function(data){ - console.log(data); - $scope.$apply(function(){$scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp;}); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js deleted file mode 100644 index a16d61ef..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('roleListController', function ($scope,AdminService,modalService){ - - AdminService.getRoles().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoles =JSON.parse($scope.data.availableRoles); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - //console.log($scope.availableRoles); - $scope.toggleRole = function(selected,availableRole) { - //alert('toggleRole: '+selected); - var toggleType = null; - if(selected) { - toggleType = "activate"; - } else { - toggleType = "inactivate"; - } - - modalService.popupConfirmWinWithCancel("Confirm","You are about to "+toggleType+" the test role "+availableRole.name+". Do you want to continue?", - function(){ - var uuu = "role_list/toggleRole"; - - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - console.log(data); - $scope.$apply(function(){$scope.availableRoles=data.availableRoles;}); - console.log($scope.availableRoles); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRole.active=!availableRole.active; - }) - - - }; - - $scope.removeRole = function(role) { - - modalService.popupConfirmWin("Confirm","You are about to delete the role "+role.name+". Do you want to continue?", - function(){ - var uuu = "role_list/removeRole"; - var postData={role:role}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.availableRoles=data.availableRoles;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - - }; - - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js b/vid/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js deleted file mode 100644 index 14aea22c..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -var rolefunctionpopupController = function ($scope, modalService, $modalInstance, message, $http,AdminService){ - if(message.availableRoleFunction==null) { - $scope.label='Add Role Function'; - var tempText = ""; - } - else{ - $scope.label='Edit Role Function' - $scope.disableCd=true; - var tempText = new String(message.availableRoleFunction.name); - $scope.editRoleFunction = message.availableRoleFunction; - } - - $scope.tempText = tempText; - - $scope.saveRoleFunction = function(availableRoleFunction) { - var uuu = "role_function_list/saveRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - - if(availableRoleFunction==null){ - modalService.showFailure("Warning", "Please enter valid role function details."); - } - var exists = false; - for(x in message.availableRoleFunctions){ - console.log(message.availableRoleFunctions[x].name); - if(message.availableRoleFunctions[x].name==availableRoleFunction.name){ - modalService.showFailure("Warning", "Role Function already exists."); - exists = true; - availableRoleFunction.name = $scope.tempText; - } - } - - if(!exists && availableRoleFunction.name.trim() != '' && availableRoleFunction.code.trim() != ''){ - $http.post(uuu, JSON.stringify(postData)).then(function(res){ - console.log("data"); -// console.log(res.data); -// $scope.availableRoleFunctionsTemp = res.data.availableRoleFunctions; - AdminService.getRoleFunctionList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - - //$scope.resetMenu(); - $modalInstance.close(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - $modalInstance.close(); - }); - - - }); - - - - - } - }; - - - - $scope.close = function() { - $modalInstance.close(); - }; -} diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js b/vid/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js deleted file mode 100644 index f8ecfadd..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js +++ /dev/null @@ -1,205 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -var rolepopupController = function ($scope, $modalInstance, role, roleId, availableRoles, availableRoleFunctions,AdminService,modalService){ - - $scope.role = role; - console.log($scope.role); - if($scope.role.childRoles==null){ - $scope.role.childRoles=[]; - } - - $scope.ociavailableRoles=availableRoles; - console.log($scope.ociavailableRoles); - - $scope.availableRoles=[]; - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - if($scope.role.childRoles){ - $.each($scope.role.childRoles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - } - }); - }; - $scope.availableRoles.push(availableRole); - }); - - $scope.ociavailableRoleFunctions = availableRoleFunctions; - console.log($scope.ociavailableRoleFunctions); - $scope.availableRoleFunctions = []; - if($scope.ociavailableRoleFunctions) - $.each($scope.ociavailableRoleFunctions, function(i, a){ - var availableRoleFunction = a; - availableRoleFunction.selected = false; - $.each($scope.role.roleFunctions, function(j, b){ - if(a.code === b.code) { - availableRoleFunction.selected = true; - } - }); - $scope.availableRoleFunctions.push(availableRoleFunction); - }); - //$scope.resetMenu(); - - $scope.toggleRoleFunction = function(selected,availableRoleFunction) { - //alert('toggleRole: '+selected); - - if(!selected) { - //remove role function - if(role.id==null){ - var index = $scope.role.roleFunctions.indexOf(availableRoleFunction); - if(index>=0) - $scope.role.roleFunctions.splice(index, 1); - return; - } - var uuu = "role/removeRoleFunction.htm?role_id=" + roleId; - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the role function "+availableRoleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={roleFunction:availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRoleFunction.selected=!availableRoleFunction.selected; - }) - - } else { - //add role function - if(role.id==null){ - $scope.role.roleFunctions.push(availableRoleFunction); - return; - } - var uuu = "role/addRoleFunction.htm?role_id=" + roleId; - - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the role function "+availableRoleFunction.name+" to the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={roleFunction:availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRoleFunction.selected=!availableRoleFunction.selected; - }) - } - - - }; - - $scope.toggleChildRole = function(selected,availableRole) { - //alert('toggleRole: '+selected); - - if(!selected) { - //remove role - if(role.id==null){ - var index = $scope.role.childRoles.indexOf(availableRole); - if(index>=0) - $scope.role.childRoles.splice(index, 1); - return; - } - var uuu = "role/removeChildRole.htm?role_id=" + roleId; - - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the child role "+availableRole.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={childRole:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - console.log('role',data.role); - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRole.selected=true; - }) - - } else { - //add role - if(role.id==null){ - $scope.role.childRoles.push(availableRole); - return; - } - var uuu = "role/addChildRole.htm?role_id=" + roleId; - - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the child role "+availableRole.name+" to the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={childRole:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRole.selected=false; - }) - } - - - }; - - $scope.close = function() { - console.log('role', $scope.role); - $modalInstance.close({role:$scope.role}); - }; - -} diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js deleted file mode 100644 index b82dae30..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js +++ /dev/null @@ -1,284 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('selfProfileController', function ($scope,$http,ProfileService,$routeParams,modalService){ - $scope.tableData=[]; - $scope.profile=[]; - $scope.ociavailableRoles=[]; - $scope.ociTimeZones; - $scope.ociCountries; - var stateList=[]; - $scope.availableRoles = []; - $scope.timeZones = []; - $scope.selectedTimeZone = null; - $scope.countries = []; - $scope.selectedCountry = null; - $scope.isUserSystemAdmin = false; - - ProfileService.getSelfProfileDetail().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profile =JSON.parse($scope.data.profile); - $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); - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - 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); - }); - ; - - /*$scope.ociTimeZones = ${model.timeZones};*/ - - 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; - } - }); - }; - - /*$scope.ociCountries = ${model.countries};*/ - - //alert($scope.ociCountries[0].label); - 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; - } - }); - ; - - /*var stateList=${model.stateList};*/ - //alert(stateList[0].label); - stateList = stateList== null? []: stateList; - var selectedState= $scope.profile.state ? $scope.profile.state:""; - $scope.stateList = initDropdownWithLookUp(stateList,selectedState ); - - //$scope.resetMenu(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - /*$scope.profile=${model.profile};*/ - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - $scope.viewPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - - $( "#dialog" ).hide(); - - /*$scope.ociavailableRoles=${model.availableRoles};*/ - //modalService.showFailure('Error','') ; - - - $scope.saveProfile = function() { - var uuu = "profile/saveProfile?profile_id=" + $scope.profileId;; - 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:"" - }; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - modalService.showSuccess("Success","Update Successful."); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - $scope.addNewRolePopup = function(role) { - $( "#dialog" ).dialog({ - modal: true, - width: 500, - height:600 - }); - - $(".ui-dialog").css("z-index",10002); - $(".ui-dialog-titlebar").hide(); - }; - - $scope.toggleRole = function(selected,availableRole) { - //alert('toggleRole: '+selected); - if(!selected) { - //remove role - var uuu = "profile/removeRole?profile_id=" + $scope.profileId;; - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }, - function(){ - availableRole.selected=!availableRole.selected; - }); - - - } else { - //add role - var uuu = "profile/addNewRole?profile_id=" + $scope.profileId;; - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - },function(){ - availableRole.selected=!availableRole.selected; - }) - - } - - - }; - - $scope.removeRole = function(role) { - - - modalService.popupConfirmWin("Confirm","You are about to remove the role "+role.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var uuu = "profile/removeRole?profile_id=" + $scope.profileId;; - var postData={role:role}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.profile=data; - $.each($scope.availableRoles, function(k, c){ - if(c.id === role.id) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - - }; - - 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; - return dropDown; - }; - - $scope.doRolePopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'roles_popup.html', - controller: 'rolepopupController', - resolve: { - message: function () { - var message ={ - availableRoles: $scope.availableRoles - }; - return message; - } - } - }); - modalInstance.result.then(function (opts) { - if(opts!=null){ - $scope.profile=opts.profile; - } - }); - } - - $scope.close = function(){ - $('#dialog').dialog('close'); - } - -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js b/vid/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js deleted file mode 100644 index b495b934..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.controller('usageListController', function ($scope,$interval,$http,$modal,modalService,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.removeSession = function(sessionId) { - 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;}); - }) - - } -}); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js b/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js deleted file mode 100644 index 0a5c8019..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js +++ /dev/null @@ -1,24 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -angular.module('att.abs.helper', []); -angular.module('quantum', []); - -var app=angular.module("workflowApp", ["att.abs", "att.abs.helper","modalServices", - "att.gridster","checklist-model","ngRoute", "ui.bootstrap"]); diff --git a/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js b/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js deleted file mode 100644 index 169a8868..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js +++ /dev/null @@ -1,509 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -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/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js b/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js deleted file mode 100644 index 81fe4e28..00000000 --- a/vid/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js +++ /dev/null @@ -1,26 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - .when('/all', { - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-listing.html', - controller: 'workflowsController' - }) -}); -- cgit 1.2.3-korg