Dynamic subtitle and create button for Release Control tabs

- Title: "Release Control" (encompasses both tabs)
- Subtitle changes per tab:
  - Releases tab: "Promotion pipeline with gate status, risk posture, and evidence for every release."
  - Versions tab: "Sealed digest-first version catalog across standard and hotfix lanes."
- Create button changes per tab:
  - Releases tab: "New Release" → /releases/new
  - Versions tab: "New Version" → /releases/versions/new
- Uses Angular effect() to reactively update pageAction when activeTab changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-03-27 18:40:39 +02:00
parent 0c1436aba8
commit 27690ed9a6

View File

@@ -8,7 +8,7 @@
* Tab 2 "Approvals": embeds the existing ApprovalQueueComponent.
*/
import { Component, ChangeDetectionStrategy, OnInit, OnDestroy, ViewChild, inject, signal, computed } from '@angular/core';
import { Component, ChangeDetectionStrategy, OnInit, OnDestroy, ViewChild, effect, inject, signal, computed } from '@angular/core';
import { PageActionService } from '../../core/services/page-action.service';
import { PageActionOutletComponent } from '../../shared/components/page-action-outlet/page-action-outlet.component';
import { UpperCasePipe, SlicePipe } from '@angular/common';
@@ -74,8 +74,8 @@ export interface PipelineRelease {
<div class="rup">
<header class="rup__header">
<div>
<h1 class="rup__title">Releases</h1>
<p class="rup__subtitle">Versions, deployments, approvals, and promotion pipeline.</p>
<h1 class="rup__title">Release Control</h1>
<p class="rup__subtitle">{{ activeSubtitle() }}</p>
</div>
<app-page-action-outlet />
</header>
@@ -397,6 +397,24 @@ export class ReleasesUnifiedPageComponent implements OnInit, OnDestroy {
readonly releaseTabs = RELEASE_TABS;
readonly activeTab = signal<string>(this.route.snapshot.queryParamMap.get('tab') || 'releases');
readonly activeSubtitle = computed(() =>
this.activeTab() === 'versions'
? 'Sealed digest-first version catalog across standard and hotfix lanes.'
: 'Promotion pipeline with gate status, risk posture, and evidence for every release.'
);
constructor() {
// Update page action when tab changes
effect(() => {
const tab = this.activeTab();
if (tab === 'versions') {
this.pageAction.set({ label: 'New Version', route: '/releases/versions/new' });
} else {
this.pageAction.set({ label: 'New Release', route: '/releases/new' });
}
});
}
// Approve dialog
readonly pendingApproveRelease = signal<PipelineRelease | null>(null);
@ViewChild('approveConfirm') approveConfirmRef!: ConfirmDialogComponent;
@@ -426,7 +444,6 @@ export class ReleasesUnifiedPageComponent implements OnInit, OnDestroy {
}
ngOnInit(): void {
this.pageAction.set({ label: 'New Release', route: '/releases/new' });
this.context.initialize();
this.store.loadReleases({});
}