Skip to content

Commit 27aa5d9

Browse files
authored
Remove FEATURE_NEXTJS Flag Part 1 (github#20176)
* cleanup FEATURE_NEXTJS * fixing some server tests * updating article a for server tests * update h2 to h4 map topic tests * data off on TOCs * updating dropdown article versions links * Update so markdown renders in intros * updating typo and all server tests are now passing * remove nextjs feature flag * head.js tests pass * updating article-version-picker * remove nextjs feature flag browser test * update header.js tests * fix page-titles.js test * fix deprecated-enterprise versions * adding early access * testing * getting childTocItem * fixing table of contents to show child toc items * updated to 2 because the sidebar article also has the same link * remove comment * updating pick * Update TocLandingContext.tsx * update package.json and change className to h4 for h2 * updating with mikes feedback * remove a.active test * React clean up: Delete unnecessary layouts/includes Part 2 (github#20143) * Delete unnecessary layouts * setting back tests failing :( * update layouts * delete unnecessary includes * remove github-ae-release-notes and updating layouts * remove a.active test
1 parent 741ca7e commit 27aa5d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+105
-1878
lines changed

components/DefaultLayout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import { useTranslation } from './hooks/useTranslation'
1111

1212
type Props = { children?: React.ReactNode }
1313
export const DefaultLayout = (props: Props) => {
14-
const { page, error, isHomepageVersion } = useMainContext()
14+
const { page, error, isHomepageVersion, currentPathWithoutLanguage } = useMainContext()
1515
const { t } = useTranslation('errors')
1616
return (
1717
<div className="d-lg-flex">
1818
<Head>
1919
{error === '404' ? (
2020
<title>{t('oops')}</title>
21-
) : !isHomepageVersion && page.fullTitle ? (
21+
) : (!isHomepageVersion && page.fullTitle) || (currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? (
2222
<title>{page.fullTitle}</title>
2323
) : null}
2424

components/LanguagePicker.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const LanguagePicker = ({ variant }: Props) => {
6363
width: unset;
6464
}
6565
`}
66+
data-testid="language-picker"
6667
>
6768
<summary>
6869
{selectedLang.nativeName || selectedLang.name}

components/article/ArticlePage.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ export const ArticlePage = () => {
5555
)}
5656

5757
{intro && (
58-
<div className="lead-mktg">
59-
<p>{intro}</p>
60-
</div>
58+
<div
59+
className="lead-mktg"
60+
dangerouslySetInnerHTML={{ __html: intro }}
61+
/>
6162
)}
6263

6364
{permissions && (

components/article/ArticleVersionPicker.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const ArticleVersionPicker = () => {
2323
width: unset;
2424
}
2525
`}
26+
data-testid="article-version-picker"
2627
>
2728
<summary className="f4 h5-mktg btn-outline-mktg btn-mktg p-2">
2829
<span className="d-md-none d-xl-inline-block">{t('article_version')}</span>{' '}

components/context/ArticleContext.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const getArticleContextFromRequest = (req: any): ArticleContextT => {
4141
const page = req.context.page
4242
return {
4343
title: page.titlePlainText,
44-
intro: page.introPlainText,
44+
intro: page.intro,
4545
renderedPage: req.context.renderedPage || '',
4646
miniTocItems:
4747
(req.context.miniTocItems || []).map((item: any) => {

components/context/ProductLandingContext.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ export type TocItem = {
55
fullPath: string
66
title: string
77
intro?: string
8+
childTocItems?: Array<{
9+
fullPath: string;
10+
title: string;
11+
}>
812
}
913
export type FeaturedLink = {
1014
title: string

components/context/TocLandingContext.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const getTocLandingContextFromRequest = (req: any): TocLandingContextT =>
3838
introPlainText: req.context.page.introPlainText,
3939
isEarlyAccess: req.context.page?.documentType === 'early-access',
4040
tocItems: (req.context.genericTocFlat || req.context.genericTocNested || []).map((obj: any) =>
41-
pick(obj, ['fullPath', 'title', 'intro'])
41+
pick(obj, ['fullPath', 'title', 'intro', 'childTocItems'])
4242
),
4343
variant: req.context.genericTocFlat ? 'expanded' : 'compact',
4444

components/landing/TableOfContents.tsx

+20-3
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,39 @@ export const TableOfContents = (props: Props) => {
1919
return null
2020
}
2121

22-
const { fullPath: href, title, intro } = item
22+
const { fullPath: href, title, intro, childTocItems } = item
2323
const isActive = router.pathname === href
2424
return variant === 'compact' ? (
2525
<li key={href} className="f4 my-1">
2626
<Link href={href}>{title}</Link>
27+
<ul className={cx(variant === 'compact' ? 'list-style-circle pl-5 my-3' : 'list-style-none')}>
28+
{(childTocItems || []).map((childItem) => {
29+
if (!childItem) {
30+
return null
31+
}
32+
return (
33+
<li key={childItem.fullPath} className="f4 mt-1">
34+
<Link
35+
href={childItem.fullPath}
36+
className="Bump-link--hover no-underline py-1 color-border-primary"
37+
>
38+
{childItem.title}
39+
</Link>
40+
</li>
41+
)
42+
})}
43+
</ul>
2744
</li>
2845
) : (
2946
<li key={href} className={cx('mb-5', isActive && 'color-auto-gray-4')}>
3047
<Link
3148
href={href}
3249
className="Bump-link--hover no-underline d-block py-1 border-bottom color-border-primary"
3350
>
34-
<h4>
51+
<h2 className="h4">
3552
{title}
3653
<span className="Bump-link-symbol"></span>
37-
</h4>
54+
</h2>
3855
</Link>
3956
{intro && <p className="f4 mt-3" dangerouslySetInnerHTML={{ __html: intro }} />}
4057
</li>

feature-flags.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"FEATURE_TEST_TRUE": true,
3-
"FEATURE_TEST_FALSE": false,
4-
"FEATURE_NEXTJS": true
3+
"FEATURE_TEST_FALSE": false
54
}

includes/article-cards.html

-55
This file was deleted.

includes/article-version-switcher.html

-20
This file was deleted.

includes/article.html

-88
This file was deleted.

includes/breadcrumbs.html

-9
This file was deleted.

includes/category-articles-list.html

-40
This file was deleted.

includes/code-example-card.html

-20
This file was deleted.

includes/code-examples.html

-22
This file was deleted.

0 commit comments

Comments
 (0)