From ecb8130231f5a73a4227ba8509c74413d2f162e3 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Mon, 9 Mar 2026 10:17:49 +0100 Subject: [PATCH] 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 --- .../packages/model/packages-dashboard.state.ts | 1 + .../packages/packages-api.service.ts | 12 +- .../packages-dashboard.component.html | 18 +-- .../packages-dashboard.component.ts | 8 + .../sort-packages/sort-packages.component.html | 9 +- .../feature-modules/packages/packages.store.ts | 11 +- cds-ui/designer-client/src/styles.css | 1 + .../mock-processor/fixtures/blueprints.json | 8 +- cds-ui/e2e-playwright/mock-processor/server.js | 7 +- cds-ui/e2e-playwright/tests/packages.spec.ts | 180 +++++++++++++++++---- .../src/controllers/blueprint-rest.controller.ts | 5 +- .../datasources/blueprint.datasource-template.ts | 4 +- cds-ui/server/src/services/blueprint.service.ts | 2 +- .../repository/BlueprintModelSearchRepository.kt | 2 + .../designer/api/BlueprintModelController.kt | 9 +- .../designer/api/handler/BluePrintModelHandler.kt | 5 + .../designer/api/BlueprintModelControllerTest.kt | 57 +++++++ 17 files changed, 275 insertions(+), 64 deletions(-) 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 @@
-