Skip to content

Commit 980ca0a

Browse files
authored
Chore/rename cron (supabase#30792)
* Rename cron jobs to cron * Missing history link * Add polling to update list
1 parent 6d2c6cf commit 980ca0a

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

apps/studio/components/interfaces/Integrations/CronJobs/CronJobCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const CronJobCard = ({ job, onEditCronJob, onDeleteCronJob }: CronJobCard
6969
onCheckedChange={() => showToggleConfirmationModal(true)}
7070
/>
7171
<Button type="default" icon={<History />}>
72-
<Link href={`/project/${ref}/integrations/cron-jobs/cron-jobs/${job.jobname}`}>
72+
<Link href={`/project/${ref}/integrations/cron/cron-jobs/${job.jobname}`}>
7373
History
7474
</Link>
7575
</Button>

apps/studio/components/interfaces/Integrations/CronJobs/PreviousRunsTab.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { toString as CronToString } from 'cronstrue'
22
import { List } from 'lucide-react'
33
import Link from 'next/link'
4-
import { UIEvent, useCallback, useMemo } from 'react'
4+
import { UIEvent, useCallback, useEffect, useMemo } from 'react'
55
import DataGrid, { Column, Row } from 'react-data-grid'
66

77
import { useParams } from 'common'
@@ -146,6 +146,7 @@ export const PreviousRunsTab = () => {
146146
data,
147147
isLoading: isLoadingCronJobRuns,
148148
fetchNextPage,
149+
refetch,
149150
isFetching,
150151
} = useCronJobRunsInfiniteQuery(
151152
{
@@ -156,6 +157,15 @@ export const PreviousRunsTab = () => {
156157
{ enabled: !!currentJobState?.jobid, staleTime: 30 }
157158
)
158159

160+
useEffect(() => {
161+
// Refetch only the first page
162+
const timerId = setInterval(() => {
163+
refetch({ refetchPage: (_page, index) => index === 0 })
164+
}, 30000)
165+
166+
return () => clearInterval(timerId)
167+
}, [refetch])
168+
159169
const handleScroll = useCallback(
160170
(event: UIEvent<HTMLDivElement>) => {
161171
if (isLoadingCronJobRuns || !isAtBottom(event)) return

apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const supabaseIntegrations: IntegrationDefinition[] = [
110110
},
111111
},
112112
{
113-
id: 'cron-jobs',
113+
id: 'cron',
114114
type: 'postgres_extension' as const,
115115
requiredExtensions: ['pg_cron'],
116116
name: `Cron`,

apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function LogsSidebarMenuV2() {
165165
items: [],
166166
},
167167
{
168-
name: 'Cron Jobs',
168+
name: 'Cron',
169169
key: 'pg_cron',
170170
url: `/project/${ref}/logs/pgcron-logs`,
171171
items: [],

apps/studio/components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsMenu.utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export const generateProjectIntegrationsMenu = (
4444
...(!!cronUiEnabled
4545
? [
4646
{
47-
name: 'Cron Jobs',
47+
name: 'Cron',
4848
key: 'cron-jobs',
49-
url: `/project/${ref}/integrations/cron-jobs`,
49+
url: `/project/${ref}/integrations/cron`,
5050
items: [],
5151
},
5252
]

apps/studio/next.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@ const nextConfig = {
429429
source: '/project/:ref/settings/vault/keys',
430430
destination: '/project/:ref/integrations/vault/keys',
431431
},
432+
{
433+
permanent: true,
434+
source: '/project/:ref/integrations/cron-jobs',
435+
destination: '/project/:ref/integrations/cron',
436+
},
432437
...(process.env.NEXT_PUBLIC_BASE_PATH?.length
433438
? [
434439
{

packages/shared-data/extensions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@
230230
"tags": ["Utility"],
231231
"link": "/guides/database/extensions/pg_cron",
232232
"github_url": "https://github.com/citusdata/pg_cron",
233-
"product": "Supabase Cron Jobs",
234-
"product_url": "/project/{ref}/integrations/cron-jobs"
233+
"product": "Supabase Cron",
234+
"product_url": "/project/{ref}/integrations/cron"
235235
},
236236
{
237237
"name": "pg_freespacemap",

0 commit comments

Comments
 (0)