Skip to content

Commit be4a6fe

Browse files
authored
Update: Banner for maintenance window (supabase#40668)
* updated to use notice banner * added link to maintenance * updated banner * updated message from support
1 parent 93aaae0 commit be4a6fe

File tree

3 files changed

+54
-34
lines changed

3 files changed

+54
-34
lines changed

apps/studio/components/interfaces/App/AppBannerWrapperContext.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@ import { LOCAL_STORAGE_KEYS } from 'common'
22
import { noop } from 'lodash'
33
import { PropsWithChildren, createContext, useContext, useEffect, useState } from 'react'
44

5-
const MIDDLEWARE_OUTAGE_BANNER_KEY = LOCAL_STORAGE_KEYS.MIDDLEWARE_OUTAGE_BANNER
5+
const MAINTENANCE_WINDOW_BANNER_KEY = LOCAL_STORAGE_KEYS.MAINTENANCE_WINDOW_BANNER
66

77
// [Joshen] This file is meant to be dynamic - update this as and when we need to use the NoticeBanner
88

99
type AppBannerContextType = {
10-
middlewareOutageBannerAcknowledged: boolean
11-
onUpdateAcknowledged: (key: typeof MIDDLEWARE_OUTAGE_BANNER_KEY) => void
10+
maintenanceWindowBannerAcknowledged: boolean
11+
onUpdateAcknowledged: (key: typeof MAINTENANCE_WINDOW_BANNER_KEY) => void
1212
}
1313

1414
const AppBannerContext = createContext<AppBannerContextType>({
15-
middlewareOutageBannerAcknowledged: false,
15+
maintenanceWindowBannerAcknowledged: false,
1616
onUpdateAcknowledged: noop,
1717
})
1818

1919
export const useAppBannerContext = () => useContext(AppBannerContext)
2020

2121
export const AppBannerContextProvider = ({ children }: PropsWithChildren<{}>) => {
22-
const [middlewareOutageBannerAcknowledged, setmiddlewareOutageBannerAcknowledged] =
22+
const [maintenanceWindowBannerAcknowledged, setMaintenanceWindowBannerAcknowledged] =
2323
useState<boolean>(false)
2424

2525
useEffect(() => {
2626
if (typeof window !== 'undefined') {
27-
const acknowledged = localStorage.getItem(MIDDLEWARE_OUTAGE_BANNER_KEY) === 'true'
28-
setmiddlewareOutageBannerAcknowledged(acknowledged)
27+
const maintenanceAcknowledged = localStorage.getItem(MAINTENANCE_WINDOW_BANNER_KEY) === 'true'
28+
setMaintenanceWindowBannerAcknowledged(maintenanceAcknowledged)
2929
}
3030
}, [])
3131

3232
const value = {
33-
middlewareOutageBannerAcknowledged,
34-
onUpdateAcknowledged: (key: typeof MIDDLEWARE_OUTAGE_BANNER_KEY) => {
35-
if (key === MIDDLEWARE_OUTAGE_BANNER_KEY) {
33+
maintenanceWindowBannerAcknowledged,
34+
onUpdateAcknowledged: (key: typeof MAINTENANCE_WINDOW_BANNER_KEY) => {
35+
if (key === MAINTENANCE_WINDOW_BANNER_KEY) {
3636
if (typeof window !== 'undefined') {
37-
window.localStorage.setItem(MIDDLEWARE_OUTAGE_BANNER_KEY, 'true')
37+
window.localStorage.setItem(MAINTENANCE_WINDOW_BANNER_KEY, 'true')
3838
}
39-
setmiddlewareOutageBannerAcknowledged(true)
39+
setMaintenanceWindowBannerAcknowledged(true)
4040
}
4141
},
4242
}
@@ -45,6 +45,6 @@ export const AppBannerContextProvider = ({ children }: PropsWithChildren<{}>) =>
4545
}
4646

4747
export const useIsNoticeBannerShown = () => {
48-
const { middlewareOutageBannerAcknowledged } = useAppBannerContext()
49-
return middlewareOutageBannerAcknowledged
48+
const { maintenanceWindowBannerAcknowledged } = useAppBannerContext()
49+
return maintenanceWindowBannerAcknowledged
5050
}

apps/studio/components/layouts/AppLayout/NoticeBanner.tsx

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,65 @@
1-
import { ExternalLink } from 'lucide-react'
1+
import Link from 'next/link'
22
import { useRouter } from 'next/router'
33

44
import { useAppBannerContext } from 'components/interfaces/App/AppBannerWrapperContext'
5-
import { Button, WarningIcon } from 'ui'
5+
import { Button, WarningIcon, cn } from 'ui'
66

77
// This file, like AppBannerWrapperContext.tsx, is meant to be dynamic - update this as and when we need to use the NoticeBanner
8-
// We can disable this banner after 16th May 2025 as the middleware outage is complete
8+
// We can disable this banner after 23rd November 2025 as the maintenance window is complete
99

1010
export const NoticeBanner = () => {
1111
const router = useRouter()
1212

1313
const appBannerContext = useAppBannerContext()
14-
const { middlewareOutageBannerAcknowledged, onUpdateAcknowledged } = appBannerContext
14+
const { maintenanceWindowBannerAcknowledged, onUpdateAcknowledged } = appBannerContext
1515

16-
const acknowledged = middlewareOutageBannerAcknowledged
16+
const acknowledged = maintenanceWindowBannerAcknowledged
1717

1818
if (router.pathname.includes('sign-in') || acknowledged) {
1919
return null
2020
}
2121

2222
return (
23-
<div className="flex items-center justify-center gap-x-4 bg py-0.5 border transition text-foreground border-default">
24-
<WarningIcon className="w-4 h-4" />
25-
<p className="text-sm">
26-
Brief Dashboard outage: May 16, 2025, 22:00–23:00 UTC (no impact to your apps)
27-
</p>
28-
<div className="flex items-center gap-x-1">
29-
<Button asChild type="link" iconRight={<ExternalLink size={14} />}>
30-
<a
23+
<div
24+
className={cn(
25+
'relative bg-warning-300 dark:bg-warning-200 border-b border-muted py-1 flex items-center justify-center flex-shrink-0 px-0'
26+
)}
27+
>
28+
<div className="absolute inset-y-0 left-0 right-0 overflow-hidden z-0">
29+
<div
30+
className="absolute inset-0 opacity-[0.8%]"
31+
style={{
32+
background: `repeating-linear-gradient(
33+
45deg,
34+
currentColor,
35+
currentColor 10px,
36+
transparent 10px,
37+
transparent 20px
38+
)`,
39+
maskImage: 'linear-gradient(to top, black, transparent)',
40+
WebkitMaskImage: 'linear-gradient(to top, black, transparent)',
41+
}}
42+
/>
43+
</div>
44+
<div className="items-center flex flex-row gap-3 z-[1]">
45+
<WarningIcon className="z-[1] flex-shrink-0" />
46+
<div className="flex-1 text-xs sm:text-sm z-[1] text-warning">
47+
Urgent Dashboard and Management API maintenance currently in progress. For full details,{' '}
48+
<Link
49+
href="https://status.supabase.com/incidents/z0l2157y33xk"
3150
target="_blank"
3251
rel="noreferrer"
33-
href="https://status.supabase.com/incidents/8k0ysqkhscfj"
52+
className="opacity-75 hover:opacity-100 underline"
3453
>
35-
Learn more
36-
</a>
37-
</Button>
54+
check here
55+
</Link>
56+
.
57+
</div>
3858
<Button
3959
type="text"
40-
className="opacity-75"
60+
className="opacity-75 z-[1] flex-shrink-0"
4161
onClick={() => {
42-
onUpdateAcknowledged('middleware-outage-banner-2025-05-16')
62+
onUpdateAcknowledged('maintenance-window-banner-2025-11-21')
4363
}}
4464
>
4565
Dismiss

packages/common/constants/local-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const LOCAL_STORAGE_KEYS = {
6767
// Notice banner keys
6868
FLY_POSTGRES_DEPRECATION_WARNING: 'fly-postgres-deprecation-warning-dismissed',
6969
API_KEYS_FEEDBACK_DISMISSED: (ref: string) => `supabase-api-keys-feedback-dismissed-${ref}`,
70-
MIDDLEWARE_OUTAGE_BANNER: 'middleware-outage-banner-2025-05-16',
70+
MAINTENANCE_WINDOW_BANNER: 'maintenance-window-banner-2025-11-21',
7171
REPORT_DATERANGE: 'supabase-report-daterange',
7272

7373
// api keys view switcher for new and legacy api keys

0 commit comments

Comments
 (0)