From 6ee4d31800a68975294ef11156bea9a595b23adf Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Wed, 20 Nov 2019 11:32:53 +0200 Subject: add pacakges dashboard component to new cds ui Issue-ID: CCSDK-1951 Signed-off-by: Ahmed Abbas Change-Id: I0c320e5f49a50e442068f5af1fd79c41c97bb74d --- .../package-pagination.component.ts | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/package-pagination/package-pagination.component.ts (limited to 'cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/package-pagination/package-pagination.component.ts') diff --git a/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/package-pagination/package-pagination.component.ts b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/package-pagination/package-pagination.component.ts new file mode 100644 index 000000000..49a88c6c2 --- /dev/null +++ b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/package-pagination/package-pagination.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; +import { PackagesStore } from '../../packages.store'; + +@Component({ + selector: 'app-package-pagination', + templateUrl: './package-pagination.component.html', + styleUrls: ['./package-pagination.component.css'], +}) +export class PackagePaginationComponent implements OnInit { + pageNumber = 0; + totalCount = 4; + pageSize: number; + + constructor(private packagesStore: PackagesStore) { + this.pageSize = packagesStore.pageSize; + } + + ngOnInit() { + } + + public getPageFromService(page) { + console.log('getPageFromService', page); + if (isNaN(page)) { + page = 1; + console.log('page change to first...', page); + } + this.packagesStore.getPagedPackages(page - 1, this.packagesStore.pageSize); + } + +} -- cgit 1.2.3-korg