From 08d0b1590ad5055f5e164c28317904cab7451b06 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Wed, 1 Mar 2017 14:14:27 +0800 Subject: Fix some issues to fit new framework Fix some issues to fit new framework Change-Id: I0bbf4127534c771427b89ec85a79e12249de33d1 Issue-ID:GSO-232 Signed-off-by: c00149107 --- lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js | 18 ++++++++++-------- .../src/main/webapp/lifecyclemgr/templates/home.html | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js index d42d28cc..593c6a3d 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js @@ -95,7 +95,6 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' .controller('homeCtrl', function($scope, $compile, $state, $log, DataService, NgTableParams) { $scope.param="lctableData"; - $scope.init = function() { jQuery.i18n.properties({ language : 'en-US', @@ -224,7 +223,7 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' // document.getElementById("svcTempl").innerHTML = templatesInfo; $scope.optionsValue = tmplatesResponse; var dropSimple_data = { - "errmsg" : "Template version is required.", + "errmsg" : "Service template is required.", "modalVar" : "lifecycleData.optSelect", "labelField" : "templateName", "optionsValue" : JSON.stringify(tmplatesResponse), @@ -240,7 +239,7 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' //$('#myModal .creator').html($compile(Mustache.to_html(text, creatorText.ErrMsg))($scope)); - var modelSubmit_data = {"title":"Submit", "clickAction":"saveData(lifecycleData.id)"}; + var modelSubmit_data = {"title":"Submit", "clickAction":"saveData()"}; var modelSubmit_html = Mustache.to_html(def_button_tpl, modelSubmit_data); $('#myModal #footerBtns').html($compile(modelSubmit_html)($scope)); @@ -318,8 +317,12 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' var template = $scope.lifecycleData.optSelect; var lastSelTempCreateParam = DataService.getCreateParamJsonObj(); + if(template == undefined){ + document.getElementById("templateParameters").innerHTML = ""; + return; + } //if the template not changed, no need to update the page. - if(lastSelTempCreateParam.templateId == template.serviceTemplateId){ + if(lastSelTempCreateParam.templateId == template.serviceTemplateId && document.getElementById("templateParameters").innerHTML != ""){ return; } $.when(DataService.generateCreateParameters(template)) @@ -338,16 +341,15 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' $scope.showAddModal = function() { console.log("Showing Modal to Add data"); - $scope.lifecycleData = {}; - $scope.textboxErr = false; - + //$scope.lifecycleData = {}; + //$scope.textboxErr = false; //$("#myModal").modal(); $("#myModal").modal({}).draggable(); } $scope.closeModal = function() { console.log("Closing Modal..."); $('#myModal').modal('hide'); - $state.reload(); + //$state.reload(); } $scope.editData = function(id) { diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/home.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/home.html index 97b7e0c5..c2e4917b 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/home.html +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/home.html @@ -25,7 +25,7 @@
- + -- cgit 1.2.3-korg