From f529cf7a18e21d0f6155f9c0509b9dec704f782e Mon Sep 17 00:00:00 2001 From: hrushikesh07 Date: Fri, 21 Oct 2016 14:08:57 +0530 Subject: [PATCH 1/2] Added env for launch blueprint --- client/cat3/src/factory/workzoneServices.js | 4 ++ .../dashboard/bots/controller/libraryCtrl.js | 8 +-- .../sections/dashboard/genericServices.js | 2 +- .../blueprint/popups/blueprintLaunchCtrl.js | 16 +++++- .../popups/blueprintLaunchParams.html | 56 ++++++++++++------- .../popups/blueprintLaunchParamsCtrl.js | 41 ++++++++++---- 6 files changed, 90 insertions(+), 37 deletions(-) diff --git a/client/cat3/src/factory/workzoneServices.js b/client/cat3/src/factory/workzoneServices.js index 2ee297eb5..d69a6bcb8 100644 --- a/client/cat3/src/factory/workzoneServices.js +++ b/client/cat3/src/factory/workzoneServices.js @@ -531,6 +531,10 @@ getBotTypeList:function () { var url ='/config-data/bot-type'; return $http.get(fullUrl(url),Auth.getHeaderObject()); + }, + getTaggingServer:function () { + var url ='/config-data/tagging-server'; + return $http.get(fullUrl(url),Auth.getHeaderObject()); } }; return serviceInterface; diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js index 34c92ce8b..38552350f 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js @@ -31,8 +31,8 @@ lib.int =function(){ lib.gridOptions.data=[]; var param={ - url:'/blueprints/serviceDelivery/?serviceDeliveryCheck=true' - //url:'src/partials/sections/dashboard/bots/data/bp.json' + //url:'/blueprints/serviceDelivery/?serviceDeliveryCheck=true' + url:'src/partials/sections/dashboard/bots/data/bp.json' }; genSevs.promiseGet(param).then(function (result) { angular.forEach(result,function (val) { @@ -41,8 +41,8 @@ }); }); var param2={ - url:'/tasks/serviceDelivery/?serviceDeliveryCheck=true' - // url:'src/partials/sections/dashboard/bots/data/t.json' + //url:'/tasks/serviceDelivery/?serviceDeliveryCheck=true' + url:'src/partials/sections/dashboard/bots/data/t.json' }; genSevs.promiseGet(param2).then(function (resultTask) { angular.forEach(resultTask,function (val) { diff --git a/client/cat3/src/partials/sections/dashboard/genericServices.js b/client/cat3/src/partials/sections/dashboard/genericServices.js index 767fe9470..6f8dd7a03 100644 --- a/client/cat3/src/partials/sections/dashboard/genericServices.js +++ b/client/cat3/src/partials/sections/dashboard/genericServices.js @@ -204,7 +204,7 @@ $modal.open({ animate: true, templateUrl: "src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html", - controller: "blueprintLaunchParamsCtrl", + controller: "blueprintLaunchParamsCtrl as bPLP", backdrop : 'static', keyboard: false, resolve: { diff --git a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js index eb3f7df3a..a2fdf4c12 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchCtrl.js @@ -79,8 +79,20 @@ versionsList = bpItem.bp.blueprintConfig.infraManagerData.versionsList; versionOptional = versionsList[versionsList.length-1].ver; } - var selectedVersionBpId = bpItem.bp.selectedVersionBpId || bpItem._id; - workzoneServices.launchBlueprint(selectedVersionBpId, versionOptional, envParams.env, bpItem.stackName,bpItem.domainName,bpItem.tagServer).then(function(bpLaunchResponse) { + var selectedVersionBpId = bpItem.bp.selectedVersionBpId; + if(bpItem && bpItem.bp && bpItem.bp.selectedVersionBpId){ + selectedVersionBpId = bpItem.bp.selectedVersionBpId; + } else { + selectedVersionBpId = bpItem.bp._id; + } + var lEnv=null; + if(envParams && envParams.env){ + lEnv=envParams.env; + } + if(bpItem.launchEnv){ + lEnv=bpItem.launchEnv; + } + workzoneServices.launchBlueprint(selectedVersionBpId, versionOptional, lEnv, bpItem.stackName,bpItem.domainName,bpItem.tagServer).then(function(bpLaunchResponse) { $scope.isBPLogsLoading = false; var launchingInstance; if(bpLaunchResponse.data.id && bpLaunchResponse.data.id.length>0){ diff --git a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html index 9f7775c77..cbc76d845 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html +++ b/client/cat3/src/partials/sections/dashboard/workzone/blueprint/popups/blueprintLaunchParams.html @@ -10,26 +10,44 @@