From 98726c56051c7a1a3131d6e49b96a14d012ff541 Mon Sep 17 00:00:00 2001 From: chyoo Date: Fri, 3 Jul 2026 10:14:58 +0900 Subject: [PATCH] improve admin build release and notice screens --- .../applications/BuildManagementPage.tsx | 21 +++++++++++++++++++ src/pages/operations/NoticesPage.tsx | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/pages/applications/BuildManagementPage.tsx b/src/pages/applications/BuildManagementPage.tsx index c7e8bb2..36a6880 100644 --- a/src/pages/applications/BuildManagementPage.tsx +++ b/src/pages/applications/BuildManagementPage.tsx @@ -87,6 +87,7 @@ export function BuildManagementPage() { const selectedComponent = componentOptions.find((source) => source.id === selectedComponentId) ?? componentOptions[0]; const selectedTarget = selectedComponent?.buildTarget || buildTargetForType(selectedComponent?.type); const predicted = predictedArtifact(selectedComponent, branch, commitSha); + const hasActiveJob = jobs.some((job) => job.status === 'PENDING' || job.status === 'RUNNING'); const refresh = async () => { setLoading(true); @@ -112,6 +113,26 @@ export function BuildManagementPage() { void refresh(); }, [selectedAppId, selectedApp?.key]); + useEffect(() => { + if (!hasActiveJob) return; + const timer = window.setInterval(() => { + listBuildJobs(selectedApp?.key) + .then((nextJobs) => setJobs(nextJobs)) + .catch((error: Error) => { + toast({ type: 'error', message: `빌드 작업 갱신 실패: ${error.message}` }); + }); + }, 2000); + return () => window.clearInterval(timer); + }, [hasActiveJob, selectedApp?.key, toast]); + + useEffect(() => { + if (!selectedJob) return; + const nextSelectedJob = jobs.find((job) => job.id === selectedJob.id); + if (nextSelectedJob && nextSelectedJob !== selectedJob) { + setSelectedJob(nextSelectedJob); + } + }, [jobs, selectedJob]); + useEffect(() => { if (!componentOptions.some((source) => source.id === selectedComponentId)) { const nextComponent = componentOptions[0]; diff --git a/src/pages/operations/NoticesPage.tsx b/src/pages/operations/NoticesPage.tsx index ab5732d..5749344 100644 --- a/src/pages/operations/NoticesPage.tsx +++ b/src/pages/operations/NoticesPage.tsx @@ -28,7 +28,7 @@ type NoticeForm = { }; const emptyForm: NoticeForm = { - appKey: 'launcher', + appKey: 'Launcher', title: '', body: '', linkUrl: '', @@ -357,7 +357,7 @@ export function NoticesPage() {