From d2917a8d2ed21a7ae27c8d235fb02e3e615b6d56 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Thu, 19 Jul 2018 16:41:13 +0530 Subject: added progress spinner in PD to show file upload added progress spinner in PD to show file upload progress Issue-ID: APPC-1070 Change-Id: I28d237a3a69f68a9e9dbc6433c95dc53c4fbffbf Signed-off-by: Sandeep J --- .../parameter-definitions/parameter.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 8725c3c..6c8be91 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts @@ -34,6 +34,7 @@ import { NotificationsService } from 'angular2-notifications'; import { ParameterDefinitionService } from './parameter-definition.service'; import 'rxjs/add/operator/map'; import { NgProgress } from 'ngx-progressbar'; +import { NgxSpinnerService } from 'ngx-spinner'; let YAML = require('yamljs'); @@ -197,7 +198,8 @@ export class ParameterComponent implements OnInit { private httpUtil: HttpUtilService, private utilService: UtilityService, private nService: NotificationsService, - private ngProgress: NgProgress) { + private ngProgress: NgProgress, + private spinner: NgxSpinnerService) { } ngOnInit() { @@ -349,6 +351,7 @@ export class ParameterComponent implements OnInit { //This is called when the user selects new files from the upload button public fileChange(input, uploadType) { if (input.files && input.files[0]) { + this.spinner.show(); // Create the file reader let reader = new FileReader(); this.readFile(input.files[0], reader, (result) => { @@ -357,7 +360,10 @@ export class ParameterComponent implements OnInit { this.displayParamObjects = this.parameterDefinitionService.processPDfile(this.myPdFileName, result); } }); - + setTimeout(() => { + /** spinner ends after 3.5 seconds */ + this.spinner.hide(); + }, 3500); } } -- cgit 1.2.3-korg