fix: stay on 'verify' tab after mark a verify step as done
This commit is contained in:
parent
55060cd5b7
commit
b66fec5075
|
|
@ -16,6 +16,9 @@ interface ReleaseDetailPageProps {
|
||||||
params: Promise<{
|
params: Promise<{
|
||||||
id: string;
|
id: string;
|
||||||
}>;
|
}>;
|
||||||
|
searchParams: Promise<{
|
||||||
|
tab?: string;
|
||||||
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeColors: Record<string, string> = {
|
const typeColors: Record<string, string> = {
|
||||||
|
|
@ -40,10 +43,12 @@ function getStatusColor(status: string) {
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic';
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
export default async function ReleaseDetailPage({ params }: ReleaseDetailPageProps) {
|
export default async function ReleaseDetailPage({ params, searchParams }: ReleaseDetailPageProps) {
|
||||||
const { id } = await params;
|
const { id } = await params;
|
||||||
|
const { tab } = await searchParams;
|
||||||
const releaseId = parseInt(id);
|
const releaseId = parseInt(id);
|
||||||
const release = await getReleaseById(releaseId);
|
const release = await getReleaseById(releaseId);
|
||||||
|
const activeTab = tab === 'verify' ? 'verify' : 'deploy';
|
||||||
|
|
||||||
if (!release) {
|
if (!release) {
|
||||||
notFound();
|
notFound();
|
||||||
|
|
@ -186,13 +191,17 @@ export default async function ReleaseDetailPage({ params }: ReleaseDetailPagePro
|
||||||
|
|
||||||
{/* Matrix View (for active) */}
|
{/* Matrix View (for active) */}
|
||||||
{release.status === 'active' && (
|
{release.status === 'active' && (
|
||||||
<Tabs defaultValue="deploy">
|
<Tabs defaultValue={activeTab}>
|
||||||
<TabsList>
|
<TabsList>
|
||||||
<TabsTrigger value="deploy">
|
<TabsTrigger value="deploy" asChild>
|
||||||
Deploy ({stats.done + stats.skipped}/{stats.total})
|
<Link href={`/releases/${releaseId}?tab=deploy`}>
|
||||||
|
Deploy ({stats.done + stats.skipped}/{stats.total})
|
||||||
|
</Link>
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="verify">
|
<TabsTrigger value="verify" asChild>
|
||||||
Verify
|
<Link href={`/releases/${releaseId}?tab=verify`}>
|
||||||
|
Verify
|
||||||
|
</Link>
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,9 @@ export function ReleaseMatrixClient({ stepsByCluster, category, releaseId }: Rel
|
||||||
const handleActionComplete = () => {
|
const handleActionComplete = () => {
|
||||||
setRefreshKey(prev => prev + 1);
|
setRefreshKey(prev => prev + 1);
|
||||||
setIsPanelOpen(false);
|
setIsPanelOpen(false);
|
||||||
// Refresh the page to get updated data
|
// Refresh the page to get updated data, preserving the current tab
|
||||||
window.location.reload();
|
const currentUrl = new URL(window.location.href);
|
||||||
|
window.location.href = currentUrl.toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Server actions wrapped in async functions
|
// Server actions wrapped in async functions
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue