Skip to content

Commit

Permalink
Remove FEATURE_NEXTJS Flag Part 1 (github#20176)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gracepark authored Jul 16, 2021
1 parent 741ca7e commit 27aa5d9
Show file tree
Hide file tree
Showing 72 changed files with 105 additions and 1,878 deletions.
4 changes: 2 additions & 2 deletions components/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { useTranslation } from './hooks/useTranslation'

type Props = { children?: React.ReactNode }
export const DefaultLayout = (props: Props) => {
const { page, error, isHomepageVersion } = useMainContext()
const { page, error, isHomepageVersion, currentPathWithoutLanguage } = useMainContext()
const { t } = useTranslation('errors')
return (
<div className="d-lg-flex">
<Head>
{error === '404' ? (
<title>{t('oops')}</title>
) : !isHomepageVersion && page.fullTitle ? (
) : (!isHomepageVersion && page.fullTitle) || (currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? (
<title>{page.fullTitle}</title>
) : null}

Expand Down
1 change: 1 addition & 0 deletions components/LanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const LanguagePicker = ({ variant }: Props) => {
width: unset;
}
`}
data-testid="language-picker"
>
<summary>
{selectedLang.nativeName || selectedLang.name}
Expand Down
7 changes: 4 additions & 3 deletions components/article/ArticlePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ export const ArticlePage = () => {
)}

{intro && (
<div className="lead-mktg">
<p>{intro}</p>
</div>
<div
className="lead-mktg"
dangerouslySetInnerHTML={{ __html: intro }}
/>
)}

{permissions && (
Expand Down
1 change: 1 addition & 0 deletions components/article/ArticleVersionPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const ArticleVersionPicker = () => {
width: unset;
}
`}
data-testid="article-version-picker"
>
<summary className="f4 h5-mktg btn-outline-mktg btn-mktg p-2">
<span className="d-md-none d-xl-inline-block">{t('article_version')}</span>{' '}
Expand Down
2 changes: 1 addition & 1 deletion components/context/ArticleContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const getArticleContextFromRequest = (req: any): ArticleContextT => {
const page = req.context.page
return {
title: page.titlePlainText,
intro: page.introPlainText,
intro: page.intro,
renderedPage: req.context.renderedPage || '',
miniTocItems:
(req.context.miniTocItems || []).map((item: any) => {
Expand Down
4 changes: 4 additions & 0 deletions components/context/ProductLandingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export type TocItem = {
fullPath: string
title: string
intro?: string
childTocItems?: Array<{
fullPath: string;
title: string;
}>
}
export type FeaturedLink = {
title: string
Expand Down
2 changes: 1 addition & 1 deletion components/context/TocLandingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getTocLandingContextFromRequest = (req: any): TocLandingContextT =>
introPlainText: req.context.page.introPlainText,
isEarlyAccess: req.context.page?.documentType === 'early-access',
tocItems: (req.context.genericTocFlat || req.context.genericTocNested || []).map((obj: any) =>
pick(obj, ['fullPath', 'title', 'intro'])
pick(obj, ['fullPath', 'title', 'intro', 'childTocItems'])
),
variant: req.context.genericTocFlat ? 'expanded' : 'compact',

Expand Down
23 changes: 20 additions & 3 deletions components/landing/TableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,39 @@ export const TableOfContents = (props: Props) => {
return null
}

const { fullPath: href, title, intro } = item
const { fullPath: href, title, intro, childTocItems } = item
const isActive = router.pathname === href
return variant === 'compact' ? (
<li key={href} className="f4 my-1">
<Link href={href}>{title}</Link>
<ul className={cx(variant === 'compact' ? 'list-style-circle pl-5 my-3' : 'list-style-none')}>
{(childTocItems || []).map((childItem) => {
if (!childItem) {
return null
}
return (
<li key={childItem.fullPath} className="f4 mt-1">
<Link
href={childItem.fullPath}
className="Bump-link--hover no-underline py-1 color-border-primary"
>
{childItem.title}
</Link>
</li>
)
})}
</ul>
</li>
) : (
<li key={href} className={cx('mb-5', isActive && 'color-auto-gray-4')}>
<Link
href={href}
className="Bump-link--hover no-underline d-block py-1 border-bottom color-border-primary"
>
<h4>
<h2 className="h4">
{title}
<span className="Bump-link-symbol"></span>
</h4>
</h2>
</Link>
{intro && <p className="f4 mt-3" dangerouslySetInnerHTML={{ __html: intro }} />}
</li>
Expand Down
3 changes: 1 addition & 2 deletions feature-flags.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"FEATURE_TEST_TRUE": true,
"FEATURE_TEST_FALSE": false,
"FEATURE_NEXTJS": true
"FEATURE_TEST_FALSE": false
}
55 changes: 0 additions & 55 deletions includes/article-cards.html

This file was deleted.

20 changes: 0 additions & 20 deletions includes/article-version-switcher.html

This file was deleted.

88 changes: 0 additions & 88 deletions includes/article.html

This file was deleted.

9 changes: 0 additions & 9 deletions includes/breadcrumbs.html

This file was deleted.

40 changes: 0 additions & 40 deletions includes/category-articles-list.html

This file was deleted.

20 changes: 0 additions & 20 deletions includes/code-example-card.html

This file was deleted.

22 changes: 0 additions & 22 deletions includes/code-examples.html

This file was deleted.

Loading

0 comments on commit 27aa5d9

Please sign in to comment.