Skip to content

Commit e8f00c7

Browse files
authored
Merge branch 'main' into patch-1
2 parents 6c03900 + b9e9d87 commit e8f00c7

File tree

88 files changed

+944
-496
lines changed

Some content is hidden

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

88 files changed

+944
-496
lines changed

.github/workflows/browser-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ jobs:
4141
- name: Install dependencies
4242
run: npm ci --include=optional
4343

44-
- name: Run brower-test
44+
- name: Run browser-test
4545
run: npm run browser-test

.github/workflows/move-new-issues-to-correct-docs-repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
owner: owner,
4949
repo: originalRepo,
5050
issue_number: issueNo,
51-
body: `👋 Moving forward, we're asking that folks create all new Docs issues in the [${process.env.TEAM_ENGINEERING_REPO}](${process.env.TEAM_ENGINEERING_REPO}) repo and all new content issues in [${process.env.TEAM_CONTENT_REPO}](${process.env.TEAM_CONTENT_REPO}). We transferred it for you!`
51+
body: `👋 You opened this issue in `${context.repo.repo}`. Moving forward, we're asking that folks create new issues in the following repositories instead:\n- For issues with the docs site, please submit to the [${process.env.TEAM_ENGINEERING_REPO}](/${owner}/${process.env.TEAM_ENGINEERING_REPO}) repo.\n- For all new content issues, please submit to the [${process.env.TEAM_CONTENT_REPO}](/${owner}/${process.env.TEAM_CONTENT_REPO}) repo.\n\nWe will transfer this issue for you!`
5252
})
5353
5454
// Transfer the issue to the correct repo

components/Link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useMainContext } from 'components/context/MainContext'
44

55
const { NODE_ENV } = process.env
66

7-
const enableNextLinks = false
7+
const enableNextLinks = true
88

99
type Props = { locale?: string } & ComponentProps<'a'>
1010
export function Link(props: Props) {

components/SidebarNav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useVersion } from './hooks/useVersion'
1010

1111
export const SidebarNav = () => {
1212
const router = useRouter()
13-
const { error, relativePath, isHomepageVersion } = useMainContext()
13+
const { error, relativePath } = useMainContext()
1414
const { t } = useTranslation('header')
1515

1616
return (
@@ -39,7 +39,7 @@ export const SidebarNav = () => {
3939
<nav>
4040
{error === '404' || relativePath === 'index.md' ? (
4141
<ul className="sidebar-products mt-4">
42-
{!isHomepageVersion && <AllProductsLink />}
42+
{<AllProductsLink />}
4343
<SidebarHomepage />
4444
</ul>
4545
) : (
@@ -66,12 +66,12 @@ export const SidebarNav = () => {
6666
const SidebarHomepage = () => {
6767
const router = useRouter()
6868
const { currentVersion } = useVersion()
69-
const { activeProducts, isHomepageVersion } = useMainContext()
69+
const { activeProducts } = useMainContext()
7070

7171
return (
7272
<>
7373
{activeProducts.map((product) => {
74-
if (!product.versions?.includes(currentVersion) && !isHomepageVersion) {
74+
if (!product.versions?.includes(currentVersion) && !product.external) {
7575
return null
7676
}
7777

components/Survey.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export const Survey = () => {
128128
</>
129129
)}
130130

131-
{state === ViewState.END && <p className="color-text-secondary f6" data-testid="survey-end">{t`feedback`}</p>}
131+
{state === ViewState.END && (
132+
<p className="color-text-secondary f6" data-testid="survey-end">{t`feedback`}</p>
133+
)}
132134
</form>
133135
)
134136
}

components/article/ArticleVersionPicker.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ export const ArticleVersionPicker = () => {
3131
</summary>
3232
<Dropdown.Menu direction="sw">
3333
{(page.permalinks || []).map((permalink) => {
34-
if (permalink.pageVersion === 'homepage') {
35-
return null
36-
}
37-
3834
return (
3935
<Dropdown.Item key={permalink.href}>
4036
<Link href={permalink.href}>{permalink.pageVersionTitle}</Link>

components/context/MainContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const getMainContextFromRequest = (req: any): MainContextT => {
115115
activeProducts: req.context.activeProducts,
116116
currentProduct: req.context.productMap[req.context.currentProduct] || null,
117117
currentLayoutName: req.context.currentLayoutName,
118-
isHomepageVersion: req.context.currentVersion === 'homepage',
118+
isHomepageVersion: req.context.page?.documentType === 'homepage',
119119
error: req.context.error ? req.context.error.toString() : '',
120120
data: {
121121
ui: req.context.site.data.ui,

components/context/ProductSubLandingContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const getProductSubLandingContextFromRequest = (req: any): ProductSubLand
6262
includeGuides: (page.includeGuides || []).map((guide: any) => {
6363
return {
6464
...pick(guide, ['href', 'title', 'intro', 'topics']),
65-
type: guide.type || ''
65+
type: guide.type || '',
6666
}
6767
}),
6868
}

components/landing/HomepageVersionPicker.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ChevronDownIcon } from '@primer/octicons-react'
66
import { Link } from 'components/Link'
77
import { useMainContext } from 'components/context/MainContext'
88
import { useVersion } from 'components/hooks/useVersion'
9-
import { useTranslation } from 'components/hooks/useTranslation'
109

1110
type Props = {
1211
variant?: 'inline'
@@ -15,14 +14,13 @@ export const HomepageVersionPicker = ({ variant }: Props) => {
1514
const router = useRouter()
1615
const { currentVersion } = useVersion()
1716
const { getDetailsProps } = useDetails({})
18-
const { allVersions, page, enterpriseServerVersions, isHomepageVersion } = useMainContext()
19-
const { t } = useTranslation('homepage')
17+
const { allVersions, page, enterpriseServerVersions } = useMainContext()
2018

2119
if (page.permalinks && page.permalinks.length <= 1) {
2220
return null
2321
}
2422

25-
const label = isHomepageVersion ? t('version_picker') : allVersions[currentVersion].versionTitle
23+
const label = allVersions[currentVersion].versionTitle
2624

2725
if (variant === 'inline') {
2826
return (
@@ -35,9 +33,6 @@ export const HomepageVersionPicker = ({ variant }: Props) => {
3533
</summary>
3634
<div>
3735
{(page.permalinks || []).map((permalink) => {
38-
if (permalink.pageVersion === 'homepage') {
39-
return null
40-
}
4136
return (
4237
<Link
4338
key={permalink.href}
@@ -78,10 +73,6 @@ export const HomepageVersionPicker = ({ variant }: Props) => {
7873
</summary>
7974
<Dropdown.Menu direction="sw">
8075
{(page.permalinks || []).map((permalink) => {
81-
if (permalink.pageVersion === 'homepage') {
82-
return null
83-
}
84-
8576
return (
8677
<Dropdown.Item key={permalink.href}>
8778
<Link href={permalink.href}>{permalink.pageVersionTitle}</Link>

components/sublanding/ArticleCard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const ArticleCard = ({ card, typeLabel }: Props) => {
1010
<div data-testid="article-card" className="d-flex col-12 col-md-4 pr-0 pr-md-6 pr-lg-8">
1111
<a className="no-underline d-flex flex-column py-3 border-bottom" href={card.href}>
1212
<h4 className="h4 color-text-primary mb-1">{card.title}</h4>
13-
<div className="h6 text-uppercase" data-testid="article-card-type">{typeLabel}</div>
13+
<div className="h6 text-uppercase" data-testid="article-card-type">
14+
{typeLabel}
15+
</div>
1416
<p className="color-text-secondary my-3">{card.intro}</p>
1517
{card.topics.length > 0 && (
1618
<div>

0 commit comments

Comments
 (0)