improve admin release and deployment safeguards
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-07-09 09:46:36 +09:00
parent fd590540bc
commit f67017623f
9 changed files with 394 additions and 45 deletions
@@ -12,7 +12,7 @@ import {
listSources,
type GiteaCommit
} from './application-api';
import { getStoredSelectedComponentId, setStoredSelectedComponentId } from '../../lib/selected-app';
import { getStoredSelectedComponentId, selectedComponentChangedEventName, setStoredSelectedComponentId } from '../../lib/selected-app';
const giteaBaseUrl = import.meta.env.VITE_GITEA_BASE_URL ?? 'http://localhost:3000';
const giteaAppOrg = import.meta.env.VITE_GITEA_APP_ORG ?? import.meta.env.GITEA_APP_ORG ?? 'platform';
@@ -352,6 +352,25 @@ export function SourceManagementPage() {
});
}, [filteredSources, selectedAppId]);
useEffect(() => {
const storedSourceId = getStoredSelectedComponentId(selectedAppId);
if (!storedSourceId || storedSourceId === selectedSourceId) return;
if (!filteredSources.some((source) => source.id === storedSourceId)) return;
setSelectedSourceId(storedSourceId);
}, [filteredSources, selectedAppId, selectedSourceId]);
useEffect(() => {
const handleSelectedComponentChange = (event: Event) => {
const detail = (event as CustomEvent<{ appId?: string; componentId?: string }>).detail;
if (detail?.appId !== selectedAppId || !detail.componentId) return;
if (!filteredSources.some((source) => source.id === detail.componentId)) return;
setSelectedSourceId(detail.componentId);
};
window.addEventListener(selectedComponentChangedEventName, handleSelectedComponentChange);
return () => window.removeEventListener(selectedComponentChangedEventName, handleSelectedComponentChange);
}, [filteredSources, selectedAppId]);
useEffect(() => {
setCommitPage(1);
}, [selectedSourceId, selectedBranch, commitRange]);