Fix Releases tab naming, duplicate button, and approve/reject error feedback

Releases page:
- Rename "Pipeline" tab → "Releases" (first tab should match page name)
- Default activeTab from 'pipeline' → 'releases'
- Fix embedded ReleaseListComponent also clearing parent's pageAction on destroy

Deployments page:
- Approve/reject now show error banner when API fails instead of silently swallowing
  (the demo env returns 404 for approval endpoints, making buttons appear broken)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-03-27 17:57:36 +02:00
parent ae9a9fab91
commit 149bb9123b
3 changed files with 15 additions and 6 deletions

View File

@@ -855,7 +855,9 @@ export class ReleaseListComponent implements OnInit, OnDestroy {
}
ngOnDestroy(): void {
this.pageAction.clear();
if (!this.embedded) {
this.pageAction.clear();
}
}
onSearchInput(event: Event): void {

View File

@@ -787,7 +787,10 @@ export class ReleasesActivityComponent implements OnInit, OnDestroy {
if (!apr) return;
this.approvalApi.approve(apr.id, 'Approved from deployments page').pipe(take(1)).subscribe({
next: () => { this.activeApr.set(null); this.loadPendingApprovals(); },
error: () => this.activeApr.set(null),
error: (err) => {
this.activeApr.set(null);
this.error.set(`Approve failed: ${err?.message || 'API unavailable'}`);
},
});
}
onReject(apr: ApprovalRequest): void {
@@ -800,7 +803,11 @@ export class ReleasesActivityComponent implements OnInit, OnDestroy {
if (!apr) return;
this.approvalApi.reject(apr.id, this.rejectReason || 'Rejected from deployments page').pipe(take(1)).subscribe({
next: () => { this.showRejectDlg.set(false); this.activeApr.set(null); this.loadPendingApprovals(); },
error: () => { this.showRejectDlg.set(false); this.activeApr.set(null); },
error: (err) => {
this.showRejectDlg.set(false);
this.activeApr.set(null);
this.error.set(`Reject failed: ${err?.message || 'API unavailable'}`);
},
});
}
cancelReject(): void { this.showRejectDlg.set(false); this.activeApr.set(null); }

View File

@@ -23,7 +23,7 @@ import { PlatformContextStore } from '../../core/context/platform-context.store'
import type { ReleaseWorkflowStatus } from '../../core/api/release-management.models';
const RELEASE_TABS: readonly StellaPageTab[] = [
{ id: 'pipeline', label: 'Pipeline', icon: 'M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z' },
{ id: 'releases', label: 'Releases', icon: 'M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z' },
{ id: 'versions', label: 'Versions', icon: 'M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5' },
];
@@ -78,7 +78,7 @@ export interface PipelineRelease {
<stella-page-tabs [tabs]="releaseTabs" [activeTab]="activeTab()" urlParam="tab"
(tabChange)="activeTab.set($event)" ariaLabel="Releases tabs" />
@if (activeTab() === 'pipeline') {
@if (activeTab() === 'releases') {
<!-- Pipeline -->
<div class="rup__filters">
<div class="rup__search">
@@ -382,7 +382,7 @@ export class ReleasesUnifiedPageComponent implements OnInit, OnDestroy {
private readonly route = inject(ActivatedRoute);
readonly releaseTabs = RELEASE_TABS;
readonly activeTab = signal<string>(this.route.snapshot.queryParamMap.get('tab') || 'pipeline');
readonly activeTab = signal<string>(this.route.snapshot.queryParamMap.get('tab') || 'releases');
ngOnInit(): void {
this.pageAction.set({ label: 'New Release', route: '/releases/new' });