From 3d0d6a39df25ed3b04c85d470cead16d9c414e5f Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Fri, 13 Jul 2018 15:10:51 +0530 Subject: added setTimeOut method in PD retrival progres bar added setTimeOut of 3.5 seconds in progress bar for retrieving PD data from APPC Issue-ID: APPC-1073 Change-Id: I79432be9b3f74dfa84e7a37da6fb8d86c2a779f5 Signed-off-by: Sandeep J --- .../parameter-definitions/parameter.component.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts') diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts index 3c95859..8725c3c 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts @@ -3,6 +3,8 @@ =================================================================== Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== +Copyright (C) 2018 IBM. +=================================================================== Unless otherwise specified, all software contained herein is licensed under the Apache License, Version 2.0 (the License); @@ -33,7 +35,6 @@ import { ParameterDefinitionService } from './parameter-definition.service'; import 'rxjs/add/operator/map'; import { NgProgress } from 'ngx-progressbar'; - let YAML = require('yamljs'); declare var $: any; @@ -254,7 +255,11 @@ export class ParameterComponent implements OnInit { if (this.paramShareService.getSessionParamData() != undefined && this.paramShareService.getSessionParamData().length > 0) { this.getPDFromSession(); } else { + this.ngProgress.start(); this.getPD(); + setTimeout(() => { + this.ngProgress.done(); + }, 3500); } } else { this.nService.error('Error', 'Please enter Action and VNF type in Reference Data screen'); @@ -275,7 +280,6 @@ export class ParameterComponent implements OnInit { } }; let artifactContent: any; - this.ngProgress.start(); return this.httpService.post({ url: environment.getDesigns, data: input @@ -286,14 +290,11 @@ export class ParameterComponent implements OnInit { let fileModel = pdObject['vnf-parameter-list']; this.displayParamObjects = this.parameterDefinitionService.populatePD(fileModel); } - else { - - } - this.ngProgress.done(); + }, error => this.nService.error('Error', 'Error in connecting APPC Server')); - + } public getPDFromSession() { @@ -340,7 +341,6 @@ export class ParameterComponent implements OnInit { //========================== End of ngOnDestroy() Method============================================ - //========================== End of createOrUpdateParameterDefinitionData() Method============================================ public showUpload() { this.selectedUploadType = this.uploadTypes[0].value; }; @@ -357,8 +357,7 @@ export class ParameterComponent implements OnInit { this.displayParamObjects = this.parameterDefinitionService.processPDfile(this.myPdFileName, result); } }); - } else { - //this.notificationService.notifyErrorMessage('Failed to read file!Please try again.'); + } } -- cgit 1.2.3-korg