diff --git a/frontend/scripts/capture-screenshots.mjs b/frontend/scripts/capture-screenshots.mjs index a012607..99f2991 100644 --- a/frontend/scripts/capture-screenshots.mjs +++ b/frontend/scripts/capture-screenshots.mjs @@ -86,6 +86,7 @@ async function captureDashboards(page, dir) { await page.goto(`${APP_URL}/dashboards`, { waitUntil: "networkidle" }) if (!(await page.getByTestId("dashboard-card").count())) { + await page.getByTestId("new-dashboard").click() await page.getByTestId("new-dashboard-name").fill("panel") await page.getByTestId("create-dashboard").click() await page.waitForURL(/\/dashboards\/.+/, { timeout: 15000 }) @@ -113,6 +114,7 @@ async function captureFlows(page, dir) { if (await page.getByTestId("flow-card").count()) { await page.getByTestId("flow-card").first().click() } else { + await page.getByTestId("new-flow").click() await page.getByTestId("new-flow-name").fill("first_flow") await page.getByTestId("create-flow").click() } diff --git a/frontend/src/routes/_layout/dashboards/index.tsx b/frontend/src/routes/_layout/dashboards/index.tsx index 8ed58bd..de7ff0b 100644 --- a/frontend/src/routes/_layout/dashboards/index.tsx +++ b/frontend/src/routes/_layout/dashboards/index.tsx @@ -9,6 +9,15 @@ import { dashboardsQueryOptions, } from "@/components/Dashboard/queries" import { Button } from "@/components/ui/button" +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog" import { Input } from "@/components/ui/input" import useCustomToast from "@/hooks/useCustomToast" import { handleError } from "@/utils" @@ -24,12 +33,14 @@ function Dashboards() { const { showErrorToast } = useCustomToast() const [name, setName] = useState("") const [search, setSearch] = useState("") + const [dialogOpen, setDialogOpen] = useState(false) const create = useMutation({ mutationFn: (dashboard: string) => DashboardsService.createDashboard({ name: dashboard }), onSuccess: (created) => { queryClient.invalidateQueries({ queryKey: dashboardKeys.all }) + setDialogOpen(false) navigate({ to: "/dashboards/$name", params: { name: created.name }, @@ -67,37 +78,54 @@ function Dashboards() { data-testid="search-dashboards" onChange={(event) => setSearch(event.target.value)} /> -
+ {dashboards.length === 0 ? ({needle ? "No dashboard matches that." - : "No dashboards yet. Name one above to start."} + : "No dashboards yet. Create one to start."}
) : ({needle ? "No flow matches that." - : "No flows yet. Name one above to start."} + : "No flows yet. Create one to start."}
) : (