Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 34 additions & 27 deletions components/landing/TableOfContents.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { useRouter } from 'next/router'
import cx from 'classnames'

import { ActionList } from '@primer/react'
import { Link } from 'components/Link'
import { BumpLink } from 'components/ui/BumpLink'
import type { TocItem } from 'components/context/ProductLandingContext'

type Props = {
Expand All @@ -12,22 +10,43 @@ type Props = {
}
export const TableOfContents = (props: Props) => {
const { items, variant = 'expanded' } = props
const router = useRouter()

const actionItems = (items || []).filter((item) => typeof item !== 'undefined')

return (
<ul
data-testid="table-of-contents"
className={cx(variant === 'compact' ? 'list-style-outside pl-2' : 'list-style-none')}
className={cx(variant === 'compact' ? 'list-style-outside pl-2' : '')}
>
<ActionList variant="full">
{(items || [])
.filter((item) => typeof item !== 'undefined')
.map((item) => {
const { fullPath: href, title, intro, childTocItems } = item
const isActive = router.pathname === href
return variant === 'compact' ? (
{variant === 'expanded' &&
actionItems.map((item) => {
const { fullPath: href, title, intro } = item

return (
<li
key={href}
data-testid="expanded-item"
className="pt-4 pb-3 f4 d-list-item width-full list-style-none border-bottom"
>
<h2 className="py-1 h4">
<Link href={href} className="color-fg-accent">
{title}
</Link>
</h2>
{intro && (
<p className="f4 color-fg-muted" dangerouslySetInnerHTML={{ __html: intro }} />
)}
</li>
)
})}

{variant === 'compact' && (
<ActionList>
{actionItems.map((item) => {
const { fullPath: href, title, childTocItems } = item
return (
<ActionList.Item key={href}>
<div className="f4 d-list-item width-full list-style-none">
<li className="f4 d-list-item width-full list-style-none">
<Link className="d-block width-full text-underline" href={href}>
{title}
</Link>
Expand All @@ -54,24 +73,12 @@ export const TableOfContents = (props: Props) => {
})}
</ul>
)}
</div>
</ActionList.Item>
) : (
<ActionList.Item key={href} className={cx('border-bottom')}>
<div className={cx('mt-2', isActive && 'color-fg-muted')}>
<BumpLink as={Link} href={href} title={<h2 className="py-1 h4">{title}</h2>}>
{intro && (
<p
className="f4 color-fg-muted"
dangerouslySetInnerHTML={{ __html: intro }}
/>
)}
</BumpLink>
</div>
</li>
</ActionList.Item>
)
})}
</ActionList>
</ActionList>
)}
</ul>
)
}
2 changes: 1 addition & 1 deletion components/landing/TocLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const TocLanding = () => {

<div className="border-bottom border-xl-0 pb-4 mb-5 pb-xl-2 mb-xl-2" />

<div className={variant === 'expanded' ? 'mt-7' : 'mt-2'}>
<div className={variant === 'expanded' ? 'mt-5' : 'mt-2'}>
{featuredLinks.gettingStarted && featuredLinks.popular && (
<div className="pb-8 container-xl">
<div className="gutter gutter-xl-spacious clearfix">
Expand Down
13 changes: 8 additions & 5 deletions tests/rendering/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,13 @@ describe('server', () => {
expect($('[data-testid=table-of-contents] ul li a').length).toBeGreaterThan(5)
})

test('map topic renders with h2 links to articles', async () => {
test('map topic renders with links to articles', async () => {
const $ = await getDOM(
'/en/get-started/importing-your-projects-to-github/importing-source-code-to-github'
)
expect(
$(
'a[href="/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/about-github-importer"] h2'
'li h2 a[href="/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/about-github-importer"]'
).length
).toBe(1)
})
Expand All @@ -733,15 +733,18 @@ describe('server', () => {
const $ = await getDOM(
'/en/get-started/importing-your-projects-to-github/importing-source-code-to-github'
)
const $bumpLinks = $('[data-testid=bump-link]')
expect($bumpLinks.length).toBeGreaterThan(3)
const $links = $('[data-testid=expanded-item]')
expect($links.length).toBeGreaterThan(3)
})

test('map topic intros are parsed', async () => {
const $ = await getDOM(
'/en/get-started/importing-your-projects-to-github/importing-source-code-to-github'
)
const $intro = $('[data-testid=bump-link][href*="source-code-migration-tools"] > p')
const $parent = $('[data-testid=expanded-item] a[href*="source-code-migration-tools"]')
.parent()
.parent()
const $intro = $('p', $parent)
expect($intro.length).toBe(1)
expect($intro.html()).toContain('You can use external tools to move your projects to GitHub')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,18 @@ Email notifications from {% data variables.product.product_location %} contain t
| --- | --- |
| `From` address | This address will always be {% ifversion fpt or ghec %}'`[email protected]`'{% else %}'the no-reply email address configured by your site administrator'{% endif %}. |
| `To` field | This field connects directly to the thread.{% ifversion not ghae %} If you reply to the email, you'll add a new comment to the conversation.{% endif %} |
| `Cc` address | {% data variables.product.product_name %} will `Cc` you if you're subscribed to a conversation. The second `Cc` email address matches the notification reason. The suffix for these notification reasons is {% data variables.notifications.cc_address %}. The possible notification reasons are: <ul><li>`assign`: You were assigned to an issue or pull request.</li><li>`author`: You created an issue or pull request.</li><li>`ci_activity`: A {% data variables.product.prodname_actions %} workflow run that you triggered was completed.</li><li>`comment`: You commented on an issue or pull request.</li><li>`manual`: There was an update to an issue or pull request you manually subscribed to.</li><li>`mention`: You were mentioned on an issue or pull request.</li><li>`push`: Someone committed to a pull request you're subscribed to.</li><li>`review_requested`: You or a team you're a member of was requested to review a pull request.</li>{% ifversion fpt or ghes or ghae or ghec %}<li>`security_alert`: {% data variables.product.prodname_dotcom %} detected a vulnerability in a repository you receive alerts for.</li>{% endif %}<li>`state_change`: An issue or pull request you're subscribed to was either closed or opened.</li><li>`subscribed`: There was an update in a repository you're watching.</li><li>`team_mention`: A team you belong to was mentioned on an issue or pull request.</li><li>`your_activity`: You opened, commented on, or closed an issue or pull request.</li></ul> |
| `mailing list` field | This field identifies the name of the repository and its owner. The format of this address is always `<repository name>.<repository owner>.{% data variables.command_line.backticks %}`. |{% ifversion fpt or ghes or ghae or ghec %}
| `X-GitHub-Severity` field | {% data reusables.repositories.security-alerts-x-github-severity %} The possible severity levels are:<ul><li>`low`</li><li>`moderate`</li><li>`high`</li><li>`critical`</li></ul>For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." |{% endif %}
| `Cc` address | {% data variables.product.product_name %} will `Cc` you if you're subscribed to a conversation. The second `Cc` email address matches the notification reason. The suffix for these notification reasons is {% data variables.notifications.cc_address %}. The possible notification reasons are: <ul><li>`assign`: You were assigned to an issue or pull request.</li><li>`author`: You created an issue or pull request.</li><li>`ci_activity`: A {% data variables.product.prodname_actions %} workflow run that you triggered was completed.</li><li>`comment`: You commented on an issue or pull request.</li><li>`manual`: There was an update to an issue or pull request you manually subscribed to.</li><li>`mention`: You were mentioned on an issue or pull request.</li><li>`push`: Someone committed to a pull request you're subscribed to.</li><li>`review_requested`: You or a team you're a member of was requested to review a pull request.</li><li>`security_alert`: {% data variables.product.prodname_dotcom %} detected a vulnerability in a repository you receive alerts for.</li><li>`state_change`: An issue or pull request you're subscribed to was either closed or opened.</li><li>`subscribed`: There was an update in a repository you're watching.</li><li>`team_mention`: A team you belong to was mentioned on an issue or pull request.</li><li>`your_activity`: You opened, commented on, or closed an issue or pull request.</li></ul> |
| `mailing list` field | This field identifies the name of the repository and its owner. The format of this address is always `<repository name>.<repository owner>.{% data variables.command_line.backticks %}`. |
| `X-GitHub-Severity` field | {% data reusables.repositories.security-alerts-x-github-severity %} The possible severity levels are:<ul><li>`low`</li><li>`moderate`</li><li>`high`</li><li>`critical`</li></ul>For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)." |

## Choosing your notification settings

{% data reusables.notifications.access_notifications %}
{% data reusables.notifications-v2.manage-notifications %}
3. On the notifications settings page, choose how you receive notifications when:
- There are updates in repositories or team discussions you're watching or in a conversation you're participating in. For more information, see "[About participating and watching notifications](#about-participating-and-watching-notifications)."
- You gain access to a new repository or you've joined a new team. For more information, see "[Automatic watching](#automatic-watching)."{% ifversion fpt or ghes or ghae or ghec %}
- There are new {% data variables.product.prodname_dependabot_alerts %} in your repository. For more information, see "[{% data variables.product.prodname_dependabot_alerts %} notification options](#dependabot-alerts-notification-options)." {% endif %} {% ifversion fpt or ghec %}
- You gain access to a new repository or you've joined a new team. For more information, see "[Automatic watching](#automatic-watching)."
- There are new {% data variables.product.prodname_dependabot_alerts %} in your repository. For more information, see "[{% data variables.product.prodname_dependabot_alerts %} notification options](#dependabot-alerts-notification-options)." {% ifversion fpt or ghec %}
- There are workflow runs updates on repositories set up with {% data variables.product.prodname_actions %}. For more information, see "[{% data variables.product.prodname_actions %} notification options](#github-actions-notification-options)."{% endif %}{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5668 %}
- There are new deploy keys added to repositories that belong to organizations that you're an owner of. For more information, see "[Organization alerts notification options](#organization-alerts-notification-options)."{% endif %}

Expand Down Expand Up @@ -194,15 +194,13 @@ If you are a member of more than one organization, you can configure each one to
5. Select one of your verified email addresses, then click **Save**.
![Switching your per-org email address](/assets/images/help/notifications/notifications_switching_org_email.gif)

{% ifversion fpt or ghes or ghae or ghec %}
## {% data variables.product.prodname_dependabot_alerts %} notification options

{% data reusables.notifications.vulnerable-dependency-notification-enable %}
{% data reusables.notifications.vulnerable-dependency-notification-delivery-method-customization2 %}
{% data reusables.notifications.vulnerable-dependency-notification-options %}

For more information about the notification delivery methods available to you, and advice on optimizing your notifications for {% data variables.product.prodname_dependabot_alerts %}, see "[Configuring notifications for {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/configuring-notifications-for-dependabot-alerts)."
{% endif %}

{% ifversion fpt or ghes or ghec %}
## {% data variables.product.prodname_actions %} notification options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,13 @@ To filter notifications for specific activity on {% data variables.product.produ
- `is:gist`
- `is:issue-or-pull-request`
- `is:release`
- `is:repository-invitation`{% ifversion fpt or ghes or ghae or ghec %}
- `is:repository-vulnerability-alert`{% endif %}{% ifversion fpt or ghec %}
- `is:repository-invitation`
- `is:repository-vulnerability-alert`{% ifversion fpt or ghec %}
- `is:repository-advisory`{% endif %}
- `is:team-discussion`{% ifversion fpt or ghec %}
- `is:discussion`{% endif %}

{% ifversion fpt or ghes or ghae or ghec %}
For information about reducing noise from notifications for {% data variables.product.prodname_dependabot_alerts %}, see "[Configuring notifications for {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/configuring-notifications-for-dependabot-alerts)."
{% endif %}

You can also use the `is:` query to describe how the notification was triaged.

Expand All @@ -142,8 +140,8 @@ To filter notifications by why you've received an update, you can use the `reaso
| `reason:invitation` | When you're invited to a team, organization, or repository.
| `reason:manual` | When you click **Subscribe** on an issue or pull request you weren't already subscribed to.
| `reason:mention` | You were directly @mentioned.
| `reason:review-requested` | You or a team you're on have been requested to review a pull request.{% ifversion fpt or ghes or ghae or ghec %}
| `reason:security-alert` | When a security alert is issued for a repository.{% endif %}
| `reason:review-requested` | You or a team you're on have been requested to review a pull request.
| `reason:security-alert` | When a security alert is issued for a repository.
| `reason:state-change` | When the state of a pull request or issue is changed. For example, an issue is closed or a pull request is merged.
| `reason:team-mention` | When a team you're a member of is @mentioned.
| `reason:ci-activity` | When a repository has a CI update, such as a new workflow run status.
Expand All @@ -161,7 +159,6 @@ For example, to see notifications from the octo-org organization, use `org:octo-

{% endif %}

{% ifversion fpt or ghes or ghae or ghec %}
## {% data variables.product.prodname_dependabot %} custom filters

{% ifversion fpt or ghec or ghes > 3.2 %}
Expand All @@ -182,4 +179,3 @@ If you use {% data variables.product.prodname_dependabot %} to tell you about in
For more information about {% data variables.product.prodname_dependabot %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)."
{% endif %}

{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Opcionalmente, puedes elegir agregar una descripción, ubicación, sitio web y d

{% ifversion fpt %}
Las organizaciones que utilizan {% data variables.product.prodname_ghe_cloud %} pueden confirmar la identidad de la organización y mostrar una insignia de "Verificado" en la página de perfil de la misma si verifican los dominios de la organización con {% data variables.product.product_name %}. Para obtener más información, consulta la sección "[Verificar o aprobar un dominio para tu organización](/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization)" en la documentación de {% data variables.product.prodname_ghe_cloud %}.
{% elsif ghec or ghes > 3.1 %}
{% elsif ghec or ghes %}
Para confirmar la identidad de tu organización y mostrar una insignia de "Verificado" en su página de perfil, puedes verificar sus dominios con {% data variables.product.prodname_dotcom %}. Para obtener más información, consulta la sección "[Verificar o aprobar un dominio para tu organización](/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization)."
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ intro: 'Puedes administrar la forma en que {% data variables.product.product_nam
versions:
fpt: '*'
ghae: '*'
ghes: '>=3.2'
ghes: '*'
ghec: '*'
topics:
- Accounts
Expand Down
Loading