From 4e36b426bebd8497126b260c62529c71d16869c9 Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Thu, 30 Apr 2020 17:34:14 +0200 Subject: fix package list component Issue-ID: CCSDK-2320 Signed-off-by: ShaabanEltanany Change-Id: I005dff22beeac0a0ce0fdd3ef31315c35cb501d6 --- .../package-list/package-list.component.html | 8 ++++---- .../package-list/package-list.component.ts | 21 ++++++++++++++++----- .../feature-modules/packages/packages.store.ts | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) (limited to 'cds-ui/designer-client/src/app') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html index 91c7f5b96..9db3ce110 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html @@ -30,7 +30,7 @@

{{bluePrint.artifactName}}

- V 1.0.2 + {{bluePrint.artifactVersion}} @@ -55,7 +55,7 @@
  • - + Download @@ -75,7 +75,7 @@

    Last modified {{ bluePrint.createdDate | date:'short' }}

    -

    By {{bluePrint.updatedBy}}

    +

    - \ No newline at end of file + 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'); + }); + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts index b1f730f06..863adfbd7 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts @@ -31,7 +31,7 @@ import {Observable, of} from 'rxjs'; }) export class PackagesStore extends Store { // TDOD fixed for now as there is no requirement to change it from UI - public pageSize = 5; + public pageSize = 15; private bluePrintContent: BluePrintPage = new BluePrintPage(); constructor(private packagesServiceList: PackagesApiService) { -- cgit 1.2.3-korg