Skip to content

Commit db2da07

Browse files
authored
Merge pull request #13027 from github/repo-sync
repo sync
2 parents 9deba62 + c51c09b commit db2da07

15 files changed

Lines changed: 7339 additions & 58 deletions

File tree

.github/workflows/staging-deploy-pr.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ env:
3636
BUILD_ACTIONS_RUN_LOG: https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}
3737

3838
jobs:
39-
debug:
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Dump full context for debugging
43-
env:
44-
GITHUB_CONTEXT: ${{ toJSON(github) }}
45-
run: echo "$GITHUB_CONTEXT"
46-
4739
pr-metadata:
4840
# This is needed because the workflow we depend on
4941
# (see on.workflow_run.workflows) might be running from pushes on
56.8 KB
Loading

components/article/ArticlePage.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { useRouter } from 'next/router'
2-
import { useState } from 'react'
32
import cx from 'classnames'
43
import { ActionList, Heading } from '@primer/components'
54

6-
import { ChevronDownIcon, ZapIcon, InfoIcon, ShieldLockIcon } from '@primer/octicons-react'
5+
import { ZapIcon, InfoIcon, ShieldLockIcon } from '@primer/octicons-react'
76
import { Callout } from 'components/ui/Callout'
87

98
import { Link } from 'components/Link'
@@ -61,9 +60,8 @@ export const ArticlePage = () => {
6160
} = useArticleContext()
6261
const { t } = useTranslation('pages')
6362
const currentPath = router.asPath.split('?')[0]
64-
const [isActive, setActive] = useState(-1)
6563

66-
const renderTocItem = (item: MiniTocItem, index: number) => {
64+
const renderTocItem = (item: MiniTocItem) => {
6765
return (
6866
<ActionList.Item
6967
as="li"
@@ -72,19 +70,9 @@ export const ArticlePage = () => {
7270
sx={{ listStyle: 'none', padding: '2px' }}
7371
>
7472
<div className={cx('lh-condensed d-block width-full')}>
75-
<div className="d-inline-flex" dangerouslySetInnerHTML={{ __html: item.contents }} />
76-
{item.items && item.items.length > 0 && (
77-
<button
78-
className="color-bg-default border-0 ml-1"
79-
onClick={() => setActive(index === isActive ? -1 : index)}
80-
>
81-
{<ChevronDownIcon />}
82-
</button>
83-
)}
73+
<div dangerouslySetInnerHTML={{ __html: item.contents }} />
8474
{item.items && item.items.length > 0 ? (
85-
<ul className={index === isActive ? 'ml-3' : 'd-none'}>
86-
{item.items.map(renderTocItem)}
87-
</ul>
75+
<ul className="ml-3">{item.items.map(renderTocItem)}</ul>
8876
) : null}
8977
</div>
9078
</ActionList.Item>
@@ -158,7 +146,7 @@ export const ArticlePage = () => {
158146
return {
159147
key: title + i,
160148
text: title,
161-
renderItem: () => <ul>{renderTocItem(items, i)}</ul>,
149+
renderItem: () => <ul>{renderTocItem(items)}</ul>,
162150
}
163151
})}
164152
/>

content/codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,19 @@ By default, a codespace can only access the repository from which it was created
3737
{% data reusables.organizations.click-codespaces %}
3838
1. Under "User permissions", select one of the following options:
3939

40-
* **Allow for all users** to allow all your organization members to use {% data variables.product.prodname_codespaces %}.
4140
* **Selected users** to select specific organization members to use {% data variables.product.prodname_codespaces %}.
41+
* **Allow for all members** to allow all your organization members to use {% data variables.product.prodname_codespaces %}.
42+
* **Allow for all members and outside collaborators** to allow all your organization members as well as outside collaborators to use {% data variables.product.prodname_codespaces %}.
4243

43-
![Radio buttons for "User permissions"](/assets/images/help/codespaces/organization-user-permission-settings.png)
44+
![Radio buttons for "User permissions"](/assets/images/help/codespaces/org-user-permission-settings-outside-collaborators.png)
45+
46+
{% note %}
47+
48+
**Note:** When you select **Allow for all members and outside collaborators**, all outside collaborators who have been added to specific repositories can create and use {% data variables.product.prodname_codespaces %}. Your organization will be billed for all usage incurred by outside collaborators. For more information on managing outside collaborators, see "[About outside collaborators](/organizations/managing-access-to-your-organizations-repositories/adding-outside-collaborators-to-repositories-in-your-organization#about-outside-collaborators)."
49+
50+
{% endnote %}
51+
52+
1. Click **Save**.
4453

4554
## Disabling {% data variables.product.prodname_codespaces %} for your organization
4655

content/graphql/reference/mutations.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ Every GraphQL schema has a root type for both queries and mutations. The [mutati
1818

1919
For more information, see "[About mutations](/graphql/guides/forming-calls-with-graphql#about-mutations)."
2020

21-
{% for item in graphql.schemaForCurrentVersion.mutations %}
22-
{% include graphql-mutation %}
23-
{% endfor %}
21+
<!-- this page is pre-rendered by scripts because it's too big to load dynamically -->
22+
<!-- see lib/graphql/static/prerendered-mutations.json -->

lib/graphql/static/prerendered-mutations.json

Lines changed: 7198 additions & 0 deletions
Large diffs are not rendered by default.

middleware/contextualizers/graphql.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const prerenderedObjects = readCompressedJsonFileFallback(
99
const prerenderedInputObjects = readCompressedJsonFileFallback(
1010
'./lib/graphql/static/prerendered-input-objects.json'
1111
)
12+
const prerenderedMutations = readCompressedJsonFileFallback(
13+
'./lib/graphql/static/prerendered-mutations.json'
14+
)
1215

1316
const explorerUrl =
1417
process.env.NODE_ENV === 'production'
@@ -36,6 +39,7 @@ export default function graphqlContext(req, res, next) {
3639
upcomingChangesForCurrentVersion: upcomingChanges[graphqlVersion],
3740
prerenderedObjectsForCurrentVersion: prerenderedObjects[graphqlVersion],
3841
prerenderedInputObjectsForCurrentVersion: prerenderedInputObjects[graphqlVersion],
42+
prerenderedMutationsForCurrentVersion: prerenderedMutations[graphqlVersion],
3943
explorerUrl,
4044
changelog,
4145
}

middleware/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import helpToDocs from './redirects/help-to-docs.js'
3434
import languageCodeRedirects from './redirects/language-code-redirects.js'
3535
import handleRedirects from './redirects/handle-redirects.js'
3636
import findPage from './find-page.js'
37+
import spotContentFlaws from './spot-content-flaws.js'
3738
import blockRobots from './block-robots.js'
3839
import archivedEnterpriseVersionsAssets from './archived-enterprise-versions-assets.js'
3940
import events from './events.js'
@@ -173,6 +174,7 @@ export default function (app) {
173174

174175
// *** Config and context for rendering ***
175176
app.use(asyncMiddleware(instrument(findPage, './find-page'))) // Must come before archived-enterprise-versions, breadcrumbs, featured-links, products, render-page
177+
app.use(asyncMiddleware(instrument(spotContentFlaws, './spot-content-flaws'))) // Must come after findPage
176178
app.use(instrument(blockRobots, './block-robots'))
177179

178180
// Check for a dropped connection before proceeding

middleware/render-page.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ export default async function renderPage(req, res, next) {
8181
context.renderedPage + req.context.graphql.prerenderedInputObjectsForCurrentVersion.html
8282
}
8383

84+
// handle special-case prerendered GraphQL mutations page
85+
if (req.pagePath.endsWith('graphql/reference/mutations')) {
86+
// concat the markdown source miniToc items and the prerendered miniToc items
87+
context.miniTocItems = context.miniTocItems.concat(
88+
req.context.graphql.prerenderedMutationsForCurrentVersion.miniToc
89+
)
90+
context.renderedPage =
91+
context.renderedPage + req.context.graphql.prerenderedMutationsForCurrentVersion.html
92+
}
93+
8494
// Create string for <title> tag
8595
context.page.fullTitle = context.page.titlePlainText
8696

middleware/spot-content-flaws.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// This middleware, exclusively in 'development' tries to spot flaws in
2+
// the content you're actively viewing.
3+
// The hopeful assumption is that if you're actively viewing this
4+
// page on localhost, you're actively working on its content.
5+
6+
import path from 'path'
7+
8+
import kleur from 'kleur'
9+
10+
export default async function spotContentFlaws(req, res, next) {
11+
const { page } = req.context
12+
if (process.env.NODE_ENV === 'development' && page) {
13+
const trailingSlashRedirects = (page.redirect_from || []).filter(
14+
(uri) => uri.endsWith('/') && uri.startsWith('/')
15+
)
16+
if (trailingSlashRedirects.length > 0) {
17+
console.warn(
18+
`The page ${kleur.bold(path.relative(process.cwd(), page.fullPath))} has ${
19+
trailingSlashRedirects.length
20+
} redirect_from entries that have a trailing slash\n ${kleur.yellow(
21+
trailingSlashRedirects.join('\n ')
22+
)}`
23+
)
24+
console.log(
25+
"If you're actively working on this page, consider",
26+
kleur.bold('deleting all trailing slashes in redirect_from.\n')
27+
)
28+
}
29+
}
30+
31+
return next()
32+
}

0 commit comments

Comments
 (0)