Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ConnectPage from "./pages/ConnectPage";
import ConfigurePage from "./pages/ConfigurePage";
import SecretsPage from "./pages/SecretsPage";
import DashboardPage from "./pages/DashboardPage";
import Jenkins from "./routes/Jenkins";
import { useRepoStore } from "./store/useRepoStore";
import { usePipelineStore } from "./store/usePipelineStore";

Expand Down Expand Up @@ -56,7 +55,6 @@ export default function App() {
<NavLink to="/configure">2 Configure</NavLink>
<NavLink to="/secrets">3 Secrets</NavLink>
<NavLink to="/dashboard">4 Dashboard</NavLink>
<NavLink to="/jenkins">5 Jenkins</NavLink>
</nav>
</header>

Expand Down Expand Up @@ -90,7 +88,6 @@ export default function App() {
</NeedRepo>
}
/>
<Route path="/jenkins" element={<Jenkins />} />
</Routes>
</main>
</BrowserRouter>
Expand Down
2 changes: 2 additions & 0 deletions client/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { usePipelineStore } from "../store/usePipelineStore";

// In dev: talk to Vite dev server proxy at /api
// In prod: use the real backend URL from VITE_API_BASE (e.g. https://api.autodeploy.app)
const DEFAULT_API_BASE =
Expand Down
15 changes: 8 additions & 7 deletions client/src/pages/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function formatDate(iso: string) {
}

export default function DashboardPage() {
const { repo } = useRepoStore();
const { repo, branch: selectedBranch } = useRepoStore();
const { result, setResultYaml } = usePipelineStore();
const cfg = useConfigStore();

Expand All @@ -36,7 +36,8 @@ export default function DashboardPage() {
}, [clear]);

const repoFullName = result?.repo || repo || "";
const branch = (result as any)?.branch || "main";
const branchName =
(result as any)?.branch || selectedBranch || "main";

const [versions, setVersions] = useState<PipelineVersion[]>([]);
const [loadingHistory, setLoadingHistory] = useState(false);
Expand Down Expand Up @@ -65,7 +66,7 @@ export default function DashboardPage() {
try {
const rows = await api.getPipelineHistory({
repoFullName,
branch,
branch: branchName,
limit: 20,
});
if (!cancelled) {
Expand All @@ -87,11 +88,11 @@ export default function DashboardPage() {
cancelled = true;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [repoFullName, branch]);
}, [repoFullName, branchName]);

async function handleRollback(version: PipelineVersion) {
if (!version?.id) return;
const confirmMsg = `Rollback ${repoFullName}@${branch} to version created at ${formatDate(
const confirmMsg = `Rollback ${repoFullName}@${branchName} to version created at ${formatDate(
version.created_at
)}?`;
if (!window.confirm(confirmMsg)) return;
Expand Down Expand Up @@ -119,7 +120,7 @@ export default function DashboardPage() {
function handleCommitClick() {
const repoFullNameLocal = result?.repo || repo;
const yaml = result?.generated_yaml;
const branchLocal = result?.branch || "main";
const branchLocal = (result as any)?.branch || branchName || "main";
const environment = cfg.env || "dev";
const provider = "aws";
const path = `.github/workflows/${environment}-deploy.yml`;
Expand All @@ -146,7 +147,7 @@ export default function DashboardPage() {
<h1 className="text-2xl font-semibold">Pipeline Dashboard</h1>
{repoFullName ? (
<p className="text-sm text-muted-foreground">
{repoFullName} @ <span className="font-mono">{branch}</span>
{repoFullName} @ <span className="font-mono">{branchName}</span>
</p>
) : (
<p className="text-sm text-orange-600">
Expand Down
149 changes: 0 additions & 149 deletions client/src/routes/Jenkins.tsx

This file was deleted.

Loading