X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fcontroller%2FdictionaryController%2FMSModelsDictController.js;h=3165b1b9828a223e37d0821bde693098696061c0;hb=b6d9063e06ab8cdf2d97fc75810792659344e4a8;hp=2e30523adaa10c28e1f5ec56bbec04c6180271ad;hpb=e0addf5b588a1244f9679becd90999dfcb4c3a94;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js index 2e30523ad..3165b1b98 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * ECOMP Policy Engine + * ONAP Policy Engine * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -37,7 +37,7 @@ app.controller('editMSModelController' , function ($scope, $modalInstance, mess $scope.uploadFile = function(files) { var extn = files[0].name.substr(files[0].name.lastIndexOf('.')+1); - if(extn == 'zip' || extn == 'xmi'){ + if(extn == 'zip' || extn == 'xmi'|| extn == 'yml'){ valid = true; var fd = new FormData(); fd.append("file", files[0]); @@ -46,11 +46,18 @@ app.controller('editMSModelController' , function ($scope, $modalInstance, mess headers: {'Content-Type': undefined }, transformRequest: angular.identity }).success(function(data){ + if(data.errorMsg != undefined){ + Notification.error(data.errorMsg); + valid = false; + return; + } if(data.classListDatas == "EMPTY"){ Notification.error("No Micro Services Avaialble.") }else{ $scope.classListDatas=data.classListDatas; $scope.modalDatas = data.modelDatas; + $scope.modelType= data.modelType; + $scope.dataOrderInfo= data.dataOrderInfo; console.log($scope.classListDatas); } }).error( ); @@ -64,7 +71,7 @@ app.controller('editMSModelController' , function ($scope, $modalInstance, mess $scope.saveMSModel = function(microServiceModelsDictionaryData) { if(valid){ var uuu = "saveDictionary/ms_dictionary/save_model"; - var postData={microServiceModelsDictionaryData: microServiceModelsDictionaryData, userid: userid, classMap: $scope.modalDatas}; + var postData={microServiceModelsDictionaryData: microServiceModelsDictionaryData, userid: userid, classMap: $scope.modalDatas,modelType:$scope.modelType, dataOrderInfo:$scope.dataOrderInfo}; $.ajax({ type : 'POST', url : uuu,