Skip to content

Commit 23f586b

Browse files
committed
merge and fix conflicts
2 parents ee58981 + b24fe62 commit 23f586b

82 files changed

Lines changed: 978 additions & 475 deletions

File tree

Some content is hidden

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

.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/DefaultLayout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useTranslation } from './hooks/useTranslation'
1111

1212
type Props = { children?: React.ReactNode }
1313
export const DefaultLayout = (props: Props) => {
14-
const { builtAssets, page, error, isHomepageVersion } = useMainContext()
14+
const { page, error, isHomepageVersion } = useMainContext()
1515
const { t } = useTranslation('errors')
1616
return (
1717
<div className="d-lg-flex">
@@ -22,8 +22,6 @@ export const DefaultLayout = (props: Props) => {
2222
<title>{page.fullTitle}</title>
2323
) : null}
2424

25-
<script src={builtAssets.main.js} />
26-
2725
{/* For Google and Bots */}
2826
{page.introPlainText && <meta name="description" content={page.introPlainText} />}
2927

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/PrintAction.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react'
2+
3+
type Props = {
4+
children: React.ReactElement
5+
}
6+
export function PrintAction({ children }: Props) {
7+
const onClick = () => {
8+
try {
9+
document.execCommand('print', false)
10+
} catch (e) {
11+
window.print()
12+
}
13+
}
14+
15+
return React.cloneElement(React.Children.only(children), { onClick })
16+
}

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/ArticleTitle.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Tooltip } from '@primer/components'
22
import { PrinterIcon } from './PrinterIcon'
33

4+
import { PrintAction } from 'components/PrintAction'
5+
46
type Props = {
57
children: React.ReactNode
68
}
@@ -10,18 +12,11 @@ export const ArticleTitle = ({ children }: Props) => {
1012
<h1 className="my-4 border-bottom-0">{children}</h1>
1113
<div className="d-none d-lg-block ml-2">
1214
<Tooltip aria-label="Print this article" noDelay direction="n">
13-
<button
14-
className="btn-link Link--muted"
15-
onClick={() => {
16-
try {
17-
document.execCommand('print', false)
18-
} catch (e) {
19-
window.print()
20-
}
21-
}}
22-
>
23-
<PrinterIcon />
24-
</button>
15+
<PrintAction>
16+
<button className="btn-link Link--muted">
17+
<PrinterIcon />
18+
</button>
19+
</PrintAction>
2520
</Tooltip>
2621
</div>
2722
</div>

components/context/MainContext.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export type MainContextT = {
6868
maptopic?: BreadcrumbT
6969
article?: BreadcrumbT
7070
}
71-
builtAssets: { main: { js: string } }
7271
activeProducts: Array<ProductT>
7372
currentProduct?: ProductT
7473
currentLayoutName: string
@@ -112,7 +111,6 @@ export type MainContextT = {
112111

113112
export const getMainContextFromRequest = (req: any): MainContextT => {
114113
return {
115-
builtAssets: { main: { js: req.context.builtAssets.main.js } },
116114
breadcrumbs: req.context.breadcrumbs || {},
117115
activeProducts: req.context.activeProducts,
118116
currentProduct: req.context.productMap[req.context.currentProduct] || null,

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/release-notes/GHESReleaseNotePatch.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { PatchNotes } from './PatchNotes'
66
import { Link } from 'components/Link'
77
import { CurrentVersion, ReleaseNotePatch, GHESMessage } from './types'
88
import { useOnScreen } from 'components/hooks/useOnScreen'
9+
import { PrintAction } from 'components/PrintAction'
910

1011
type Props = {
1112
patch: ReleaseNotePatch
@@ -65,7 +66,9 @@ export function GHESReleaseNotePatch({
6566
</Link>
6667
)}
6768

68-
<button className="js-print btn-link ml-3 text-small text-bold">Print</button>
69+
<PrintAction>
70+
<button className="btn-link ml-3 text-small text-bold">Print</button>
71+
</PrintAction>
6972
</div>
7073

7174
<p className="color-text-secondary mt-1">{dayjs(patch.date).format('MMMM, DD, YYYY')}</p>

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)