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:
@@ -855,8 +855,10 @@ export class ReleaseListComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
if (!this.embedded) {
|
||||||
this.pageAction.clear();
|
this.pageAction.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSearchInput(event: Event): void {
|
onSearchInput(event: Event): void {
|
||||||
this.searchTerm = (event.target as HTMLInputElement).value;
|
this.searchTerm = (event.target as HTMLInputElement).value;
|
||||||
|
|||||||
@@ -787,7 +787,10 @@ export class ReleasesActivityComponent implements OnInit, OnDestroy {
|
|||||||
if (!apr) return;
|
if (!apr) return;
|
||||||
this.approvalApi.approve(apr.id, 'Approved from deployments page').pipe(take(1)).subscribe({
|
this.approvalApi.approve(apr.id, 'Approved from deployments page').pipe(take(1)).subscribe({
|
||||||
next: () => { this.activeApr.set(null); this.loadPendingApprovals(); },
|
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 {
|
onReject(apr: ApprovalRequest): void {
|
||||||
@@ -800,7 +803,11 @@ export class ReleasesActivityComponent implements OnInit, OnDestroy {
|
|||||||
if (!apr) return;
|
if (!apr) return;
|
||||||
this.approvalApi.reject(apr.id, this.rejectReason || 'Rejected from deployments page').pipe(take(1)).subscribe({
|
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(); },
|
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); }
|
cancelReject(): void { this.showRejectDlg.set(false); this.activeApr.set(null); }
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import { PlatformContextStore } from '../../core/context/platform-context.store'
|
|||||||
import type { ReleaseWorkflowStatus } from '../../core/api/release-management.models';
|
import type { ReleaseWorkflowStatus } from '../../core/api/release-management.models';
|
||||||
|
|
||||||
const RELEASE_TABS: readonly StellaPageTab[] = [
|
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' },
|
{ 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"
|
<stella-page-tabs [tabs]="releaseTabs" [activeTab]="activeTab()" urlParam="tab"
|
||||||
(tabChange)="activeTab.set($event)" ariaLabel="Releases tabs" />
|
(tabChange)="activeTab.set($event)" ariaLabel="Releases tabs" />
|
||||||
|
|
||||||
@if (activeTab() === 'pipeline') {
|
@if (activeTab() === 'releases') {
|
||||||
<!-- Pipeline -->
|
<!-- Pipeline -->
|
||||||
<div class="rup__filters">
|
<div class="rup__filters">
|
||||||
<div class="rup__search">
|
<div class="rup__search">
|
||||||
@@ -382,7 +382,7 @@ export class ReleasesUnifiedPageComponent implements OnInit, OnDestroy {
|
|||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|
||||||
readonly releaseTabs = RELEASE_TABS;
|
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 {
|
ngOnInit(): void {
|
||||||
this.pageAction.set({ label: 'New Release', route: '/releases/new' });
|
this.pageAction.set({ label: 'New Release', route: '/releases/new' });
|
||||||
|
|||||||
Reference in New Issue
Block a user