diff options
author | 2020-04-30 17:34:14 +0200 | |
---|---|---|
committer | 2020-04-30 17:34:14 +0200 | |
commit | 4e36b426bebd8497126b260c62529c71d16869c9 (patch) | |
tree | 59efc11d0f6a2dd99462240ab47b88cf5414907b /cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts | |
parent | 94ef4b36bfb7e78e8135cf000d369caf2070d753 (diff) |
fix package list component
Issue-ID: CCSDK-2320
Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com>
Change-Id: I005dff22beeac0a0ce0fdd3ef31315c35cb501d6
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts index b7bc05ff9..352f33b91 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts @@ -1,7 +1,9 @@ -import { Component, OnInit } from '@angular/core'; -import { BlueprintModel } from '../../model/BluePrint.model'; -import { PackagesStore } from '../../packages.store'; -import { Router } from '@angular/router'; +import {Component, OnInit} from '@angular/core'; +import {BlueprintModel} from '../../model/BluePrint.model'; +import {PackagesStore} from '../../packages.store'; +import {Router} from '@angular/router'; +import {ConfigurationDashboardService} from '../../configuration-dashboard/configuration-dashboard.service'; +import {saveAs} from 'file-saver'; @Component({ selector: 'app-packages-list', @@ -13,7 +15,8 @@ export class PackageListComponent implements OnInit { viewedPackages: BlueprintModel[] = []; - constructor(private packagesStore: PackagesStore, private router: Router) { + constructor(private packagesStore: PackagesStore, private router: Router + , private configurationDashboardService: ConfigurationDashboardService) { console.log('PackageListComponent'); this.packagesStore.state$.subscribe(state => { console.log(state); @@ -30,7 +33,15 @@ export class PackageListComponent implements OnInit { view(id) { this.router.navigate(['/packages/package', id]); } + testDispatch(bluePrint: BlueprintModel) { console.log(bluePrint.id); } + + downloadPackage(artifactName: string, artifactVersion: string) { + this.configurationDashboardService.downloadResource(artifactName + '/' + artifactVersion).subscribe(response => { + const blob = new Blob([response], {type: 'application/octet-stream'}); + saveAs(blob, artifactName + '-' + artifactVersion + '-CBA.zip'); + }); + } } |