From 1ba64a4a45f26e8bdb58e866e540aa58f32e2e52 Mon Sep 17 00:00:00 2001 From: Ofir Sonsino Date: Wed, 20 Sep 2017 14:08:19 +0300 Subject: Change management and PNF support Issue-ID: VID-44, VID-48, VID-49, VID-50, VID-51, VID-52 Change-Id: I83e940aad2e4e294a0927b546c4c08ca8e539a65 Signed-off-by: Ofir Sonsino --- .../controller/change-management.controller.js | 138 +++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js') diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js new file mode 100644 index 00000000..662b10ec --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js @@ -0,0 +1,138 @@ +(function () { + 'use strict'; + + appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log", changeManagementController]); + + function changeManagementController($uibModal, changeManagementService, _, $log) { + var vm = this; + + var init = function() { + loadMSOChangeManagements(); + loadSchedulerChangeManagements(); + }; + + var loadMSOChangeManagements = function() { + changeManagementService.getMSOChangeManagements() + .then(function(response) { + vm.changeManagements = response.data; + }) + .catch(function (error) { + $log.error(error); + }); + }; + + var loadSchedulerChangeManagements = function() { + changeManagementService.getSchedulerChangeManagements() + .then(function(response) { + vm.pendingChangeManagements = response.data; + _.forEach(vm.pendingChangeManagements, function(changeManagement) { + var callbackData = _.filter(changeManagement.scheduleRequest.domainData, {name: "CallbackData"}); + if(callbackData) { + var parsedModel = {}; + try { + parsedModel = JSON.parse(callbackData[0].value); + } catch(exception) { + $log.error(exception); + } + + changeManagement.workflow = parsedModel.requestType || 'No workflow'; + } + }); + }) + .catch(function(error) { + $log.error(error); + }); + }; + + vm.createNewChange = function() { + var modalInstance = $uibModal.open({ + templateUrl: 'app/vid/scripts/modals/new-change-management/new-change-management.html', + controller: 'newChangeManagementModalController', + controllerAs: 'vm', + resolve: {} + }); + + modalInstance.result.then(function (result) { + console.log("This is the result of the new change management modal.", result); + }); + }; + + vm.openScheduler = function() { + console.log("function for opening the scheduler app") + }; + + vm.searchChanges = function() { + console.log("function for searching changes: " + vm.searchChangesTerm) + }; + + vm.openFailedModal = function(jobInfo) { + var modalInstance = $uibModal.open({ + templateUrl: 'app/vid/scripts/modals/failed-change-management/failed-change-management.html', + controller: 'changeManagementManualTasksController', + controllerAs: 'vm', + resolve: { + jobInfo: function () { + return jobInfo; + } + } + }); + + modalInstance.result.then(function (result) { + console.log("This is the result of the failed change management modal.", result); + }); + }; + + vm.openInProgressModal = function(jobInfo) { + var modalInstance = $uibModal.open({ + templateUrl: 'app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html', + controller: 'changeManagementManualTasksController', + controllerAs: 'vm', + resolve: { + jobInfo: function () { + return jobInfo; + } + } + }); + + modalInstance.result.then(function (result) { + console.log("This is the result of the in progress change management modal.", result); + }); + }; + + vm.openAlertModal = function(jobInfo) { + var modalInstance = $uibModal.open({ + templateUrl: 'app/vid/scripts/modals/alert-change-management/alert-change-management.html', + controller: 'changeManagementManualTasksController', + controllerAs: 'vm', + resolve: { + jobInfo: function () { + return jobInfo; + } + } + }); + + modalInstance.result.then(function (result) { + console.log("This is the result of the alert change management modal.", result); + }); + }; + + vm.openPendingModal = function(jobInfo) { + var modalInstance = $uibModal.open({ + templateUrl: 'app/vid/scripts/modals/pending-change-management/pending-change-management.html', + controller: 'changeManagementManualTasksController', + controllerAs: 'vm', + resolve: { + jobInfo: function () { + return jobInfo; + } + } + }); + + modalInstance.result.then(function (result) { + console.log("This is the result of the pending change management modal.", result); + }); + }; + + init(); + } +})(); \ No newline at end of file -- cgit 1.2.3-korg