Skip to content

Commit 457649b

Browse files
committed
Fix next runs table when schedule disabled
1 parent 907bcbf commit 457649b

File tree

2 files changed

+34
-13
lines changed
  • apps/webapp/app

2 files changed

+34
-13
lines changed

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function TaskRunsTable({
125125
</TableHeader>
126126
<TableBody>
127127
{total === 0 && !hasFilters ? (
128-
<TableBlankRow colSpan={9}>
128+
<TableBlankRow colSpan={10}>
129129
{!isLoading && <NoRuns title="No runs found" />}
130130
</TableBlankRow>
131131
) : runs.length === 0 ? (

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules.$scheduleParam/route.tsx

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Paragraph } from "~/components/primitives/Paragraph";
2323
import { Property, PropertyTable } from "~/components/primitives/PropertyTable";
2424
import {
2525
Table,
26+
TableBlankRow,
2627
TableBody,
2728
TableCell,
2829
TableHeader,
@@ -180,6 +181,14 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
180181
}
181182
};
182183

184+
function PlaceholderText({ title }: { title: string }) {
185+
return (
186+
<div className="flex items-center justify-center">
187+
<Paragraph className="w-auto">{title}</Paragraph>
188+
</div>
189+
);
190+
}
191+
183192
export default function Page() {
184193
const { schedule } = useTypedLoaderData<typeof loader>();
185194
const location = useLocation();
@@ -252,18 +261,30 @@ export default function Page() {
252261
</TableRow>
253262
</TableHeader>
254263
<TableBody>
255-
{schedule.nextRuns.map((run, index) => (
256-
<TableRow key={index}>
257-
{!isUtc && (
258-
<TableCell>
259-
<DateTime date={run} timeZone={schedule.timezone} />
260-
</TableCell>
261-
)}
262-
<TableCell>
263-
<DateTime date={run} timeZone="UTC" />
264-
</TableCell>
265-
</TableRow>
266-
))}
264+
{schedule.active ? (
265+
schedule.nextRuns.length ? (
266+
schedule.nextRuns.map((run, index) => (
267+
<TableRow key={index}>
268+
{!isUtc && (
269+
<TableCell>
270+
<DateTime date={run} timeZone={schedule.timezone} />
271+
</TableCell>
272+
)}
273+
<TableCell>
274+
<DateTime date={run} timeZone="UTC" />
275+
</TableCell>
276+
</TableRow>
277+
))
278+
) : (
279+
<TableBlankRow colSpan={1}>
280+
<PlaceholderText title="You found a bug" />
281+
</TableBlankRow>
282+
)
283+
) : (
284+
<TableBlankRow colSpan={1}>
285+
<PlaceholderText title="Schedule disabled" />
286+
</TableBlankRow>
287+
)}
267288
</TableBody>
268289
</Table>
269290
</div>

0 commit comments

Comments
 (0)