From 36c86ad506206ed1a038f1129b1bde37efa0eaaa Mon Sep 17 00:00:00 2001 From: jimmydot Date: Thu, 8 Jun 2017 11:54:45 -0400 Subject: [VID-15] fixes for various issues Change-Id: I392a0427078d337a5d501a813dff73c1959481e2 Signed-off-by: jimmydot --- .../openecomp/vid/controller/VidController.java | 25 +- .../org/openecomp/vid/model/ModelConstants.java | 2 +- .../java/org/openecomp/vid/model/ServiceModel.java | 9 +- .../openecomp/vid/properties/VidProperties.java | 21 +- .../vid/scripts/constants/componentConstants.js | 2 +- .../app/vid/scripts/constants/fieldConstants.js | 4 +- .../scripts/controller/aaiSubscriberController.js | 10 +- .../scripts/controller/creationDialogController.js | 261 +++++++++++++++------ .../app/vid/scripts/services/creationService.js | 74 +++--- .../app/vid/scripts/view-models/creationDialog.htm | 105 ++++----- 10 files changed, 319 insertions(+), 194 deletions(-) (limited to 'vid-app-common/src') diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java index e22448ae..f7bf3a54 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java @@ -41,6 +41,7 @@ import javax.ws.rs.client.Client; import org.json.JSONObject; import org.json.JSONTokener; import org.openecomp.vid.exceptions.VidServiceUnavailableException; +import org.openecomp.vid.model.ModelUtil; import org.openecomp.vid.model.ModelConstants; import org.openecomp.vid.model.Network; import org.openecomp.vid.model.ServiceModel; @@ -191,12 +192,11 @@ public class VidController extends RestrictedBaseController { LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start"); boolean isNewFlow = false; - String asdcModelNamespace = VidProperties.getAsdcModelNamespace(); + String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace(); + String[] vnfTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VNF); + String[] networkTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.NETWORK); + String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE); - String vnfTag = asdcModelNamespace + ModelConstants.VNF; - String networkTag = asdcModelNamespace + ModelConstants.NETWORK; - String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE; - try { final ServiceModel serviceModel = new ServiceModel(); final Map vnfs = new HashMap (); @@ -214,7 +214,8 @@ public class VidController extends RestrictedBaseController { final NodeTemplate nodeTemplate = component.getValue(); final String type = nodeTemplate.getType(); - if (type.startsWith(vnfTag)) { + // is it a VNF? + if ( ModelUtil.isType (type, vnfTags) ) { LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " found node template type: " + type); final UUID vnfUuid = UUID.fromString(nodeTemplate.getMetadata().getUUID()); @@ -234,8 +235,9 @@ public class VidController extends RestrictedBaseController { isNewFlow = true; } } - // Networks - if (type.startsWith(networkTag)) { + + // is it a Network? + if ( ModelUtil.isType (type, networkTags) ) { LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " found node template type: " + type); final UUID networkUuid = UUID.fromString(nodeTemplate.getMetadata().getUUID()); final Network network = new Network(); @@ -291,9 +293,8 @@ public class VidController extends RestrictedBaseController { // VF Module Customization UUID: We may have the complete set of all VF Modules for all VNFs under service and VF Modules under each VNF. // Keep using the VF Modules under VNFs but we need to get the customization uuid from the service level and put them // under each VF module at the VNF level + if ( ModelUtil.isType (type, vfModuleTags) ) { - if (type.startsWith(vfModuleTag)) { - VfModule vfMod = VfModule.extractVfModule(modelCustomizationName, group); // Add the vf module customization uuid from the service model @@ -323,6 +324,10 @@ public class VidController extends RestrictedBaseController { LOG.error("Failed to retrieve service definitions from SDC", e); throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e); } + catch (Exception e) { + LOG.error("Failed to retrieve service definitions from SDC", e); + throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e); + } } public ServiceModel getCustomizedServices(ToscaModel asdcServiceToscaModel, ServiceModel serviceModel) { diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java index f4e42707..af5f0db9 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java @@ -31,7 +31,7 @@ public class ModelConstants { public static final String ASDC_SVC_API_PATH = "sdc.svc.api.path"; public static final String ASDC_RESOURCE_API_PATH = "sdc.resource.api.path"; - public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.onap."; + public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.openecomp."; public static final String DEFAULT_ASDC_SVC_API_PATH = "sdc/v1/catalog/services"; public static final String DEFAULT_ASDC_RESOURCE_API_PATH = "sdc/v1/catalog/resources"; diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java index 140e9edf..98e65316 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java @@ -182,16 +182,15 @@ public class ServiceModel { final Map vfModules = new HashMap (); final Map volumeGroups = new HashMap (); - - String asdcModelNamespace = VidProperties.getAsdcModelNamespace(); - String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE; - + String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace(); + String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE); + for (Entry component : serviceToscaModel.gettopology_template().getGroups().entrySet()) { final Group group = component.getValue(); final String type = group.getType(); final String customizationName = component.getKey(); - if (type.startsWith(vfModuleTag)) { + if ( ModelUtil.isType (type, vfModuleTags) ) { VfModule vfMod = VfModule.extractVfModule(customizationName, group); vfModules.put(customizationName, vfMod); if ( vfMod.isVolumeGroupAllowed() ) { diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java index 141b9b27..38062df4 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java @@ -53,21 +53,27 @@ public class VidProperties extends SystemProperties { * * @return the property value or a default value */ - public static String getAsdcModelNamespace() { + public static String[] getAsdcModelNamespace() { String methodName = "getAsdcModelNamespace "; - String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; + String[] asdcModelNamespaces = null; + String value = null; try { - asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE); - if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) { - asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; + value = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE); + if ( value == null || value.isEmpty()) { + asdcModelNamespaces = new String[1]; + asdcModelNamespaces[0] = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; } + else { + asdcModelNamespaces = value.split(","); + } } catch ( Exception e ) { LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default " + ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE); - asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; + asdcModelNamespaces = new String[1]; + asdcModelNamespaces[0] = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; } - return (asdcModelNamespace); + return (asdcModelNamespaces); } /** * Gets the specified property value. If the property is not defined, returns a default value. @@ -90,4 +96,5 @@ public class VidProperties extends SystemProperties { } return (propValue); } + } diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js index d2db094b..cc5b680d 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js @@ -50,7 +50,7 @@ appDS2.constant("COMPONENT", (function() { TENANT_ID : "tenantID", TENANT_NAME : "tenantName", TRUE : "true", - + VF_MODULE : "vfModule", VNF : "vnf", VNF_CODE : "vnfCode", diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js index 291549d6..23ff56b3 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js @@ -127,9 +127,8 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { }; var KEY = { - LCP_REGION_TEXT : "LEGACYREGION" }; - + /* * NAME values are displayed on GUI pages. */ @@ -279,6 +278,7 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { SELECT : "Please select a subscriber or enter a service instance", SERVICE_INST_DNE : "That service instance does not exist. Please try again.", SYSTEM_FAILURE : "System failure", + INVALID_DATA_FORMAT : 'Invalid data format.Please check your file content whether it is not in json or not.', } diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js index 00c14148..496c06f1 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js @@ -41,7 +41,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" $scope.defaultBaseUrl = ""; $scope.responseTimeoutMsec = 60000; - $scope.serviceTypes=[ FIELD.PROMPT.SELECT_SERVICE ]; + $scope.serviceTypes=[ FIELD.PROMPT.SELECT_SERVICE]; $scope.defaultSubscriberName=[ FIELD.PROMPT.SELECT_SUB ]; var callbackFunction = function(response) { @@ -142,6 +142,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" for(var i=0; i<$scope.custSubList.length;i++){ if($scope.createSubscriberName === $scope.custSubList[i].subscriberName){ globalCustomerId = $scope.custSubList[i].globalCustomerId; + globalCustId = globalCustomerId; } }; @@ -182,6 +183,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" }; + var globalCustId;// This value will be assigned only on create new service instance screen-macro $scope.createType = "a la carte"; $scope.deployService = function(service,hideServiceFields) { hideServiceFields = hideServiceFields|| false; @@ -208,6 +210,11 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" "createSubscriberName":serviceModel.service.createSubscriberName }); DataService.setHideServiceFields(hideServiceFields); + if(hideServiceFields){ + DataService.setServiceType($scope.serviceTypeName); + DataService.setGlobalCustomerId(globalCustId); + } + DataService.setALaCarte (true); $scope.createType = "a la carte"; var broadcastType = "createComponent"; @@ -227,6 +234,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" "modelName": serviceModel.service.name, "description": serviceModel.service.description, "category":serviceModel.service.category, + "serviceEcompNaming": serviceModel.service.serviceEcompNaming, "inputs": serviceModel.service.inputs, "displayInputs": convertedAsdcModel.completeDisplayInputs, "serviceTypeName":serviceModel.service.serviceTypeName, diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js index eb170915..b400cc6e 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js @@ -107,91 +107,210 @@ var creationDialogController = function( COMPONENT, FIELD, PARAMETER, $scope, $h showError(FIELD.ERROR.MISSING_DATA, requiredFields); return; } - + + var isUploadAvailable = false; + var uploadIndex =0; var paramList = $scope.userProvidedControl.getList(); - var instanceName = ""; - - if ( DataService.getALaCarte() ) { - if ( paramList != null ) { - for (var i = 0; i < paramList.length; i++) { - if (paramList[i].id === FIELD.ID.INSTANCE_NAME) { - instanceName = paramList[i].value; - break; + + for (var i = 0; i < paramList.length; i++) { + if (paramList[i].id === FIELD.ID.SUPPLEMENTORY_DATA_FILE) { + isUploadAvailable = true; + uploadIndex=i; + break; + } + } + + if(isUploadAvailable){ + var errorMsg = ""; + var fileInput = document.getElementById(FIELD.ID.SUPPLEMENTORY_DATA_FILE); + var file = fileInput.files[0]; + var reader = new FileReader(); + reader.onload = function(e) { + try{ + paramList[uploadIndex].value = JSON.parse(reader.result); + FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'] = JSON.stringify(paramList[uploadIndex].value); + $scope.userProvidedControl.updateList([ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE ]); + + var instanceName = ""; + + if ( DataService.getALaCarte() ) { + if ( paramList != null ) { + for (var i = 0; i < paramList.length; i++) { + if (paramList[i].id === FIELD.ID.INSTANCE_NAME) { + instanceName = paramList[i].value; + break; + } + } + } + var isValid = validateInstanceName (instanceName); + if ( isValid ) { + $scope.isErrorVisible = false; + } else { + showError(FIELD.ERROR.INVALID_INSTANCE_NAME + instanceName, + FIELD.ERROR.INSTANCE_NAME_VALIDATE); + return; + } } - } + var arbitraryParametersList = DataService.getArbitraryParameters(); + var p = null; + if (UtilityService.hasContents (arbitraryParametersList)) { + for (var i = 0; i < arbitraryParametersList.length; i++) { + p = arbitraryParametersList[i]; + if (p.type === PARAMETER.MAP) { + //validate a map: { : , ... , : } + // need to find the value in paramList + for (var j = 0; j < paramList.length; j++) { + if (paramList[j].id === p.id) { + p.value = paramList[j].value; + var isValid = validateMap (p.value); + if ( isValid ) { + $scope.isErrorVisible = false; + break; + } + else { + showError(FIELD.ERROR.INVALID_MAP + p.id, + FIELD.ERROR.MAP_VALIDATE); + return; + } + } + } + } else if (p.type === PARAMETER.LIST) { + //validate a list: { value or a list of comma separated values } + // need to find the value in paramList + for (var j = 0; j < paramList.length; j++) { + if (paramList[j].id === p.id) { + p.value = paramList[j].value; + var isValid = validateList (p.value); + if ( isValid ) { + $scope.isErrorVisible = false; + break; + } + else { + showError(FIELD.ERROR.INVALID_LIST + p.id, + FIELD.ERROR.LIST_VALIDATE); + return; + } + } + } + } + } + } + var requestDetails = CreationService + .getMsoRequestDetails($scope.userProvidedControl.getList()); + + $scope.isDialogVisible = false; + + $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, { + url : CreationService.getMsoUrl(), + requestDetails : requestDetails, + componentId: componentId, + callbackFunction : function(response) { + if (response.isSuccessful) { + $scope.popup.isVisible = false; + runCallback(response); + } else { + $scope.isDialogVisible = false; + $scope.popup.isVisible = false; + } + } + }); + + }catch(e){ + errorMsg = errorMsg+ FIELD.ERROR.INVALID_DATA_FORMAT; } - var isValid = validateInstanceName (instanceName); - if ( isValid ) { - $scope.isErrorVisible = false; - } else { - showError(FIELD.ERROR.INVALID_INSTANCE_NAME + instanceName, - FIELD.ERROR.INSTANCE_NAME_VALIDATE); + if (errorMsg !== "") { + showError(FIELD.ERROR.SYSTEM_FAILURE, errorMsg); return; } - } - var arbitraryParametersList = DataService.getArbitraryParameters(); - var p = null; - if (UtilityService.hasContents (arbitraryParametersList)) { - for (var i = 0; i < arbitraryParametersList.length; i++) { - p = arbitraryParametersList[i]; - if (p.type === PARAMETER.MAP) { - //validate a map: { : , ... , : } - // need to find the value in paramList - for (var j = 0; j < paramList.length; j++) { - if (paramList[j].id === p.id) { - p.value = paramList[j].value; - var isValid = validateMap (p.value); - if ( isValid ) { - $scope.isErrorVisible = false; - break; - } - else { - showError(FIELD.ERROR.INVALID_MAP + p.id, - FIELD.ERROR.MAP_VALIDATE); - return; - } + } + reader.readAsText(file); + }else{ + + var paramList = $scope.userProvidedControl.getList(); + var instanceName = ""; + + if ( DataService.getALaCarte() ) { + if ( paramList != null ) { + for (var i = 0; i < paramList.length; i++) { + if (paramList[i].id === FIELD.ID.INSTANCE_NAME) { + instanceName = paramList[i].value; + break; } } - } else if (p.type === PARAMETER.LIST) { - //validate a list: { value or a list of comma separated values } - // need to find the value in paramList - for (var j = 0; j < paramList.length; j++) { - if (paramList[j].id === p.id) { - p.value = paramList[j].value; - var isValid = validateList (p.value); - if ( isValid ) { - $scope.isErrorVisible = false; - break; - } - else { - showError(FIELD.ERROR.INVALID_LIST + p.id, - FIELD.ERROR.LIST_VALIDATE); - return; - } + } + var isValid = validateInstanceName (instanceName); + if ( isValid ) { + $scope.isErrorVisible = false; + } else { + showError(FIELD.ERROR.INVALID_INSTANCE_NAME + instanceName, + FIELD.ERROR.INSTANCE_NAME_VALIDATE); + return; + } + } + var arbitraryParametersList = DataService.getArbitraryParameters(); + var p = null; + if (UtilityService.hasContents (arbitraryParametersList)) { + for (var i = 0; i < arbitraryParametersList.length; i++) { + p = arbitraryParametersList[i]; + if (p.type === PARAMETER.MAP) { + //validate a map: { : , ... , : } + // need to find the value in paramList + for (var j = 0; j < paramList.length; j++) { + if (paramList[j].id === p.id) { + p.value = paramList[j].value; + var isValid = validateMap (p.value); + if ( isValid ) { + $scope.isErrorVisible = false; + break; + } + else { + showError(FIELD.ERROR.INVALID_MAP + p.id, + FIELD.ERROR.MAP_VALIDATE); + return; + } + } + } + } else if (p.type === PARAMETER.LIST) { + //validate a list: { value or a list of comma separated values } + // need to find the value in paramList + for (var j = 0; j < paramList.length; j++) { + if (paramList[j].id === p.id) { + p.value = paramList[j].value; + var isValid = validateList (p.value); + if ( isValid ) { + $scope.isErrorVisible = false; + break; + } + else { + showError(FIELD.ERROR.INVALID_LIST + p.id, + FIELD.ERROR.LIST_VALIDATE); + return; + } + } } } } } - } - var requestDetails = CreationService - .getMsoRequestDetails($scope.userProvidedControl.getList()); + var requestDetails = CreationService + .getMsoRequestDetails($scope.userProvidedControl.getList()); - $scope.isDialogVisible = false; + $scope.isDialogVisible = false; - $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, { - url : CreationService.getMsoUrl(), - requestDetails : requestDetails, - componentId: componentId, - callbackFunction : function(response) { - if (response.isSuccessful) { - $scope.popup.isVisible = false; - runCallback(response); - } else { - $scope.isDialogVisible = false; - $scope.popup.isVisible = false; + $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, { + url : CreationService.getMsoUrl(), + requestDetails : requestDetails, + componentId: componentId, + callbackFunction : function(response) { + if (response.isSuccessful) { + $scope.popup.isVisible = false; + runCallback(response); + } else { + $scope.isDialogVisible = false; + $scope.popup.isVisible = false; + } } - } - }); + }); + } } $scope.cancel = function() { diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js index 28498129..11e61b3a 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js @@ -187,32 +187,42 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }; var getUserProvidedList = function() { - parameterList = []; + var parameterList = []; var isUserProvidedNaming = false; if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null) && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) { isUserProvidedNaming = true; } - var parameterList; - var hsf = DataService.getHideServiceFields() || false; - if (_this.componentId === COMPONENT.SERVICE && !hsf) { + + var isInTop = DataService.getHideServiceFields() || false; + if (_this.componentId === COMPONENT.SERVICE) { if ( DataService.getALaCarte() ) { parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ]; - parameterList = parameterList.concat([ getSubscribersParameter(), - FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]); + if(!isInTop){ + parameterList = parameterList.concat([ getSubscribersParameter(), + FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]); + } } else { // macro - if (isUserProvidedNaming) { - parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ]; - + + if(!isInTop){ + if (isUserProvidedNaming) { + parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ]; + + } + parameterList = parameterList.concat([ getSubscribersParameter() ]); + parameterList = parameterList.concat([ getServiceId(), + FIELD.PARAMETER.SERVICE_TYPE, + FIELD.PARAMETER.LCP_REGION, + FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN, + FIELD.PARAMETER.TENANT_DISABLED ]); + }else{ + parameterList = parameterList.concat([ getServiceId(), + FIELD.PARAMETER.LCP_REGION, + FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN, + FIELD.PARAMETER.TENANT_DISABLED ]); } - parameterList = parameterList.concat([ getSubscribersParameter() ]); - parameterList = parameterList.concat([ getServiceId(), - FIELD.PARAMETER.SERVICE_TYPE, - FIELD.PARAMETER.LCP_REGION, - FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN, - FIELD.PARAMETER.TENANT_DISABLED ]); } } else { @@ -312,6 +322,9 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON isRequired : inputs[key][PARAMETER.REQUIRED], description : inputs[key][PARAMETER.DESCRIPTION] }; + if ( DataService.getALaCarte() ) { + parameter.name = ComponentService.getFieldDisplayName(inputs[key][PARAMETER.DISPLAY_NAME]); + } switch (inputs[key][PARAMETER.TYPE]) { case PARAMETER.INTEGER: parameter.type = PARAMETER.NUMBER; @@ -539,8 +552,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON globalSubscriberId : DataService.getGlobalCustomerId(), subscriberName : DataService.getSubscriberName() }; + var isInTop = DataService.getHideServiceFields() || false; + if(isInTop){ + requestDetails.requestParameters.subscriptionServiceType = DataService.getModelInfo(_this.componentId)["serviceTypeName"]; + }else{ requestDetails.requestParameters.subscriptionServiceType = getValueFromList( FIELD.ID.SERVICE_TYPE, parameterList); + } requestDetails.requestParameters.aLaCarte = DataService.getALaCarte(); if ( !DataService.getALaCarte() ) { requestDetails.requestInfo.productFamilyId = getValueFromList( @@ -876,7 +894,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }; var updateUserParameterList = function(updatedId, parameterListControl) { console.log ("updateUserParameterList() updatedId=" + updatedId); - if (updatedId === FIELD.ID.SDN_C_PRELOAD) { + if (updatedId === FIELD.ID.PRODUCT_FAMILY && DataService.getHideServiceFields()) { + var cloudRegionTenantList = new Array(); + AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) { + DataService.setCloudRegionTenantList(cloudRegionTenantList); + parameterListControl.updateList([ getLcpRegion() ]); + }); + }else if (updatedId === FIELD.ID.SDN_C_PRELOAD) { var list = parameterListControl.getList(updatedId); if($('input[parameter-id="'+updatedId+'"]').is(':checked')){ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true; @@ -903,25 +927,9 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON var fileExt = arr[arr.length-1]; if(fileExt!='' && fileExt.toLowerCase()!='json'){ $('input[parameter-id="'+updatedId+'"]').val(''); - showError("Invalid file format.", 'Please select *.json format file.'); + alert("Invalid file format. Please select *.json format file."); return false; } - var fileJsonData={}; - var fileInput = document.getElementById(updatedId); - var file = fileInput.files[0]; - var reader = new FileReader(); - reader.onload = function(e) { - try{ - fileJsonData = JSON.parse(reader.result); - FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=(JSON.stringify(fileJsonData)).toString(); - parameterListControl - .updateList([ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE ]); - }catch(e){ - alert('Invalid json format.'); - showError("Invalid data format.", 'Please check your file content it is not in json format.'); - } - } - reader.readAsText(file); } else if (updatedId === FIELD.ID.LCP_REGION) { var list = parameterListControl.getList(updatedId); if (list[0].selectedIndex >= 0) { diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm index 11dc1c39..ff79d707 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm @@ -1,64 +1,43 @@ - - -
- -
-
- -

Create {{componentName}} -- {{createType}}

-
- -
- {{error}} -
- -
- -

- User Provided Data ( indicates required field) -

- +
-
-

- Enter Data and Confirm to
Create {{componentName}} -

-

- Cancel to Return to Previous Page.
Data entered - will be lost -

-
- -
-
- - -
-
- -
- -
+
+
+ +

Create {{componentName}} -- {{createType}}

+
+ +
+ {{error}} +
+ +
+ +

+ User Provided Data ( indicates required field) +

+ +
+

+ Enter Data and Confirm to
Create {{componentName}} +

+

+ Cancel to Return to Previous Page.
Data entered + will be lost +

+
+ +
+
+ + +
+
+ +
+ +
-- cgit 1.2.3-korg