@@ -107,6 +107,7 @@ export type MainContextT = {
|
||||
fullTitle?: string
|
||||
introPlainText?: string
|
||||
hidden: boolean
|
||||
noEarlyAccessBanner: boolean
|
||||
permalinks?: Array<{
|
||||
languageCode: string
|
||||
relativePath: string
|
||||
@@ -171,6 +172,7 @@ export const getMainContext = (req: any, res: any): MainContextT => {
|
||||
])
|
||||
),
|
||||
hidden: req.context.page.hidden || false,
|
||||
noEarlyAccessBanner: req.context.page.noEarlyAccessBanner || false,
|
||||
},
|
||||
enterpriseServerReleases: pick(req.context.enterpriseServerReleases, [
|
||||
'isOldestReleaseDeprecated',
|
||||
|
||||
@@ -21,7 +21,7 @@ type Notif = {
|
||||
export const HeaderNotifications = () => {
|
||||
const router = useRouter()
|
||||
const { currentVersion } = useVersion()
|
||||
const { relativePath, allVersions, data, userLanguage, currentPathWithoutLanguage } =
|
||||
const { relativePath, allVersions, data, userLanguage, currentPathWithoutLanguage, page } =
|
||||
useMainContext()
|
||||
const { languages } = useLanguages()
|
||||
const { t } = useTranslation('header')
|
||||
@@ -69,7 +69,7 @@ export const HeaderNotifications = () => {
|
||||
...translationNotices,
|
||||
...releaseNotices,
|
||||
// ONEOFF EARLY ACCESS NOTICE
|
||||
(relativePath || '').includes('early-access/')
|
||||
(relativePath || '').includes('early-access/') && !page.noEarlyAccessBanner
|
||||
? {
|
||||
type: NotificationType.EARLY_ACCESS,
|
||||
content: t('notices.early_access'),
|
||||
|
||||
@@ -64,6 +64,10 @@ export const schema = {
|
||||
hidden: {
|
||||
type: 'boolean',
|
||||
},
|
||||
// specify whether an Early Access article should not have a header notice
|
||||
noEarlyAccessBanner: {
|
||||
type: 'boolean',
|
||||
},
|
||||
layout: {
|
||||
type: ['string', 'boolean'],
|
||||
enum: layoutNames,
|
||||
|
||||
Reference in New Issue
Block a user