From: Fiete Ostkamp Date: Mon, 9 Mar 2026 09:17:49 +0000 (+0100) Subject: Add deployed tab functionality X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F143548%2F1;p=ccsdk%2Fcds.git Add deployed tab functionality - enhance /api/v1/blueprint-model/paged endpoint to accept ?published=true|false filter param - use this endpoint in the Deployed tab of the packages page Issue-ID: CCSDK-4182 Change-Id: I9f1be6c49f7d90fae26642ea21e9f613a79e273d Signed-off-by: Fiete Ostkamp --- diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts index f4f56c591..898fe3c58 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts @@ -31,4 +31,5 @@ export class PackagesDashboardState { tags: string[]; sortBy = 'DATE'; totalPackagesWithoutSearchorFilters: number; + publishedFilter: boolean = null; } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts index 8275f8c6c..9e2584247 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts @@ -36,14 +36,18 @@ export class PackagesApiService { constructor(private api: ApiService) { } - getPagedPackages(pageNumber: number, pageSize: number, sortBy: string): Observable { + getPagedPackages(pageNumber: number, pageSize: number, sortBy: string, published: boolean = null): Observable { const sortType = sortBy.includes('DATE') ? 'DESC' : 'ASC'; - return this.api.get(BlueprintURLs.getPagedBlueprints, { + const params: any = { offset: pageNumber, limit: pageSize, sort: sortBy, - sortType - }); + sortType, + }; + if (published !== null) { + params.published = published; + } + return this.api.get(BlueprintURLs.getPagedBlueprints, params); } async checkBluePrintIfItExists(name: string, version: string): Promise { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.html index 25604cd3a..3cf16f2b9 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.html @@ -33,15 +33,15 @@ @@ -61,4 +61,4 @@ - \ No newline at end of file + diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.ts index 9862608b4..d49f8f736 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-dashboard.component.ts @@ -32,8 +32,10 @@ declare var $: any; export class PackagesDashboardComponent implements OnInit, OnDestroy { startTour = false; + activeTab = 'All'; constructor( private tourService: TourService, + private packagesStore: PackagesStore, ) { } ngOnInit() { @@ -90,6 +92,12 @@ export class PackagesDashboardComponent implements OnInit, OnDestroy { localStorage.setItem('tour-guide', 'false'); } + selectTab(tab: string) { + this.activeTab = tab; + const publishedMap = { All: null, Deployed: true, 'Under Construction': false, Archived: null }; + this.packagesStore.filterByPublished(publishedMap[tab]); + } + ngOnDestroy(): void { this.tourService.pause(); } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/sort-packages/sort-packages.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/sort-packages/sort-packages.component.html index ff937fa72..83645e531 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/sort-packages/sort-packages.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/sort-packages/sort-packages.component.html @@ -1,7 +1,7 @@
-