X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Futilities%2Fedit-packages%2FEditPackagesComponent.ts;h=42998b8fff13d64bc8ce7f6aa435ac48faca98df;hb=0a34dfa32165036b380ec6ac493469b34007df0a;hp=befafb8d8598c3b53808a488c8393da741380df1;hpb=3b4814aa2d3dec621dadb52f058ba95a3dc3a86a;p=osm%2FNG-UI.git diff --git a/src/app/utilities/edit-packages/EditPackagesComponent.ts b/src/app/utilities/edit-packages/EditPackagesComponent.ts index befafb8..42998b8 100644 --- a/src/app/utilities/edit-packages/EditPackagesComponent.ts +++ b/src/app/utilities/edit-packages/EditPackagesComponent.ts @@ -90,6 +90,7 @@ export class EditPackagesComponent implements OnInit { /** options @public */ public options: {} = { + // eslint-disable-next-line no-invalid-this mode: this.modeDefault, showCursorWhenSelecting: true, autofocus: true, @@ -172,9 +173,7 @@ export class EditPackagesComponent implements OnInit { Accept: 'text/plain', 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0' }); - // tslint:disable-next-line: no-backbone-get-set-outside-model this.paramsID = this.activatedRoute.snapshot.paramMap.get('id'); - // tslint:disable-next-line: no-backbone-get-set-outside-model this.pacakgeType = this.activatedRoute.snapshot.paramMap.get('type'); this.generateURLPath(); } @@ -187,7 +186,7 @@ export class EditPackagesComponent implements OnInit { this.updateFileContentType = 'package_content'; this.navigatePath = 'vnf'; this.fileTypes = [{ value: 'text/x-yaml', viewValue: 'yaml' }, { value: 'text/json', viewValue: 'json' }]; - this.httpOptions = this.getHeadersWithContentAccept('application/zip', 'application/json'); + this.httpOptions = this.getHeadersWithContentAccept('application/gzip', 'application/json'); this.getEditFileData(); } else if (this.pacakgeType === 'netslice') { this.getUpdateURL = environment.NETWORKSLICETEMPLATE_URL; @@ -204,7 +203,7 @@ export class EditPackagesComponent implements OnInit { this.pacakgeType = 'nsd'; this.navigatePath = 'ns'; this.fileTypes = [{ value: 'text/x-yaml', viewValue: 'yaml' }, { value: 'text/json', viewValue: 'json' }]; - this.httpOptions = this.getHeadersWithContentAccept('application/zip', 'application/json'); + this.httpOptions = this.getHeadersWithContentAccept('application/gzip', 'application/json'); this.getEditFileData(); } } @@ -254,9 +253,13 @@ export class EditPackagesComponent implements OnInit { (packageType !== 'netslice') ? 'PAGE.NSPACKAGE.EDITPACKAGES.UPDATEDSUCCESSFULLY' : 'PAGE.NETSLICE.UPDATEDSUCCESSFULLY')); if (showgraph) { if (packageType === 'nsd') { - this.router.navigate(['/packages/ns/compose/' + this.paramsID]).catch(); + this.router.navigate(['/packages/ns/compose/' + this.paramsID]).catch((): void => { + // Catch Navigation Error + }); } else if (packageType === 'vnf') { - this.router.navigate(['/packages/vnf/compose/' + this.paramsID]).catch(); + this.router.navigate(['/packages/vnf/compose/' + this.paramsID]).catch((): void => { + // Catch Navigation Error + }); } } this.getEditFileData(); @@ -301,14 +304,15 @@ export class EditPackagesComponent implements OnInit { this.restService.getResource(this.getUpdateURL + '/' + this.paramsID + '/' + this.getFileContentType, httpOptions) .subscribe((nsData: NSDDetails[]) => { const getJson: string = jsyaml.load(nsData.toString(), { json: true }); - //tslint:disable-next-line:no-string-literal this.defaults['text/x-yaml'] = nsData.toString(); this.defaults['text/json'] = JSON.stringify(getJson, null, '\t'); this.isLoadingResults = false; }, (error: ERRORDATA) => { error.error = typeof error.error === 'string' ? jsyaml.load(error.error) : error.error; if (error.error.status === HttpStatus.NOT_FOUND || error.error.status === HttpStatus.UNAUTHORIZED ) { - this.router.navigateByUrl('404', { skipLocationChange: true }).catch(); + this.router.navigateByUrl('404', { skipLocationChange: true }).catch((): void => { + // Catch Navigation Error + }); } else { this.restService.handleError(error, 'get'); }