From 701623e7ca5a243febb08a55488e4cecce8dc73d Mon Sep 17 00:00:00 2001 From: od7427 Date: Thu, 13 Sep 2018 21:33:09 -0400 Subject: Fix for Defect: CDT reference data does not send . CDT sent reference data payload, which was not initialized, when the data were manually entered. The missing initialization is added with this fix. Change-Id: I89fde82b6ef32ad65390f2dc15de39aaece8fe8e Issue-ID: APPC-1205 Signed-off-by: od7427 --- .../reference-dataform.component.html | 2 +- .../reference-dataform.component.ts | 34 +++++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html index 6065e6d..e9a8c64 100644 --- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html +++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html @@ -109,7 +109,7 @@ limitations under the License.
   -   
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts index a8eeb7e..79be2c5 100644 --- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts +++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts @@ -217,8 +217,9 @@ export class ReferenceDataformComponent implements OnInit { } ngOnInit() { + let methName= "ngOnInit"; if( this.utilityService.getTracelvl() > 0 ) - console.log( this.classNm+": ngOnInit: start."); + console.log( this.classNm+": "+methName+": start."); this.displayVnfc = sessionStorage.getItem("vnfcSelectionFlag"); if (this.configScaleOutExist) { this.actions = ['', 'Configure', 'ConfigModify', 'ConfigBackup', 'ConfigRestore', 'GetRunningConfig', 'HealthCheck', 'StartApplication', 'StopApplication', 'QuiesceTraffic', 'ResumeTraffic', 'UpgradeBackout', 'UpgradeBackup', 'UpgradePostCheck', 'UpgradePreCheck', 'UpgradeSoftware', 'OpenStack Actions', 'ConfigScaleOut']; @@ -241,7 +242,9 @@ export class ReferenceDataformComponent implements OnInit { }; this.updateParams = sessionStorage.getItem('updateParams'); let cacheData = this.mappingEditorService.referenceNameObjects; - if (cacheData != undefined && cacheData != null && cacheData.length > 0) { + if( cacheData != undefined && cacheData != null && cacheData.length > 0) { + if( this.utilityService.getTracelvl() > 0 ) + console.log( this.classNm+": ngOnInit: have cacheData."); this.tempAllData = cacheData; if (this.mappingEditorService.latestAction != undefined) { this.referenceDataObject = this.mappingEditorService.latestAction; @@ -263,13 +266,13 @@ export class ReferenceDataformComponent implements OnInit { } if( this.vnfParams && this.vnfParams.vnfType) { if( this.utilityService.getTracelvl() > 0 ) - console.log( this.classNm+": ngOnInit: vnfParams.vnfType:["+ + console.log( this.classNm+": "+methName+": vnfParams.vnfType:["+ this.vnfParams.vnfType+"]"); this.referenceDataObject['scope']['vnf-type']= this.vnfParams.vnfType; } if( this.vnfParams && this.vnfParams.vnfcType) { if( this.utilityService.getTracelvl() > 0 ) - console.log( this.classNm+": ngOnInit: vnfParams.vnfcType:["+ + console.log( this.classNm+": "+methName+": vnfParams.vnfcType:["+ this.vnfParams.vnfcType+"]"); this.referenceDataObject['scope']['vnfc-type']= this.vnfParams.vnfcType; } @@ -280,15 +283,19 @@ export class ReferenceDataformComponent implements OnInit { this.templateIdentifier = this.mappingEditorService.identifier this.oldVnfcIdentifier = this.vnfcIdentifier; if( this.utilityService.getTracelvl() > 1 ) - console.log( this.classNm+": ngOnInit: displayVnfc:["+this.displayVnfc+"]"); + console.log( this.classNm+": "+methName+": displayVnfc:["+ + this.displayVnfc+"]"); if( this.utilityService.getTracelvl() > 1 ) - console.log( this.classNm+": ngOnInit: templateIdentifier:["+ + console.log( this.classNm+": "+methName+": templateIdentifier:["+ this.templateIdentifier+"]"); // Enable or Block Template and PD Tabs this.buildDesignComponent.getRefData( { ...this.referenceDataObject, displayVnfc: this.displayVnfc }, { reqField: this.templateIdentifier }); + //.. configure some drop-downs this.configDrp(this.referenceDataObject.action) + if( this.utilityService.getTracelvl() > 0 ) + console.log( this.classNm+": "+methName+": finish."); } toggleIdentifier(data) { @@ -457,6 +464,8 @@ export class ReferenceDataformComponent implements OnInit { } // update my vnf pop up session values updateSessionValues(event: any, type: string) { + if( this.utilityService.getTracelvl() > 0 ) + console.log(this.classNm+": updateSessionValues: type:["+type+"]"); if (type === 'action') { sessionStorage.setItem('action', event); } @@ -807,7 +816,9 @@ export class ReferenceDataformComponent implements OnInit { if( this.utilityService.getTracelvl() > 0 ) console.log( this.classNm+": saveToAppc: start: vnf-type:["+ this.referenceDataObject.scope['vnf-type']+"]"); - let theJSON = JSON.stringify(this.tempAllData, null, '\t'); + let theJSON = JSON.stringify( this.tempAllData); + if( this.utilityService.getTracelvl() > 0 ) + console.log( this.classNm+": saveToAppc: tempAllData:["+theJSON+"]"); let fileName = 'reference_AllAction_' + this.referenceDataObject.scope['vnf-type'].replace(/ /g, '').replace(new RegExp('/', 'g'), '_').replace(/ /g, '') + '_' + '0.0.1V.json'; this.saveReferenceDataToAppc( JSON.stringify({ reference_data: this.tempAllData }), this.referenceDataObject.scope['vnf-type'], fileName); @@ -1040,6 +1051,7 @@ export class ReferenceDataformComponent implements OnInit { // } resetForm() { + if( this.utilityService.getTracelvl() > 0 ) console.log( this.classNm+": resetForm: start."); this.referenceDataObject['action-level'] = 'vnf'; this.referenceDataObject.template = 'Y'; @@ -1052,6 +1064,7 @@ export class ReferenceDataformComponent implements OnInit { // this method gets called with the action as parameter and the respective action details are fetched and assigned to the current page populateExistinAction(data) { + if( this.utilityService.getTracelvl() > 0 ) console.log( this.classNm+": populateExistinAction: start."); let existAction = this.tempAllData.findIndex(obj => { return obj.action == data; @@ -1067,6 +1080,7 @@ export class ReferenceDataformComponent implements OnInit { this.referenceDataObject['vnfcIdentifier'] = obj['scope']['vnfc-type-list'][0]; } } else { + if( this.utilityService.getTracelvl() > 0 ) console.log( this.classNm+": populateExistinAction: action not found"); this.resetForm(); this.referenceDataObject.action = data; @@ -1108,7 +1122,9 @@ export class ReferenceDataformComponent implements OnInit { //Modal pop up for action change with values entered. actionChange(data, userForm) { var methName= "actionChange"; - console.log( this.classNm+": "+methName+": start: data:["+data+"]"); + if( this.utilityService.getTracelvl() > 0 ) + console.log( this.classNm+": "+methName+": start: data:["+data+"]"+ + " userForm.valid:["+userForm.valid+"]"); this.disableGrpNotationValue = false if (data == null) { console.log( this.classNm+": "+methName+": data == null"); @@ -1713,6 +1729,7 @@ export class ReferenceDataformComponent implements OnInit { } addAllActionObj(newObj, scopeName) { + if( this.utilityService.getTracelvl() > 0 ) console.log( this.classNm+": addAllActionObj: start."); //Creating all action block to allow mulitple actions at once let allAction = { @@ -1735,6 +1752,7 @@ export class ReferenceDataformComponent implements OnInit { } resetTempData() { + if( this.utilityService.getTracelvl() > 0 ) console.log( this.classNm+": resetTempData: start."); if (this.uploadedDataArray && this.uploadedDataArray != undefined && this.uploadedDataArray.length != 0) { if (this.tempAllData && this.tempAllData != undefined) { -- cgit 1.2.3-korg