1
0
mirror of synced 2025-12-30 12:02:01 -05:00

Merge pull request #31489 from github/repo-sync

Repo sync
This commit is contained in:
docs-bot
2024-02-06 15:56:39 -06:00
committed by GitHub
7 changed files with 17 additions and 32 deletions

View File

@@ -54,28 +54,3 @@ jobs:
then
gh pr edit $PR --add-reviewer github/docs-engineering
fi
- name: Additional information requested
run: |
id=9664BE8F1CA3
body=$(gh pr view $PR --json body | jq -r .body)
append=$(cat <<-EOM
<!-- $id -->
### For engineers
- **How to test**: {Step by step.}
- **How to review**: {What to look for when reviewing.}
- **Potential risks**: {Any additional risks this change may introduce.}
- **How to monitor**: {Datadog link, etc.}
- **How to rollback**: {Any additional information beyond shipping a revert pull request.}
- **Accessibility impact**: {Any changes to React components.}
If this involves manual change, please create a [production change issue](https://github.com/github/docs-engineering/issues/new?labels=engineering&projects=&template=production-config-change.md).
EOM
)
if [[ ! $body =~ $id ]]
then
body+=$append
gh pr edit $PR --body "$body"
fi

View File

@@ -370,14 +370,12 @@ function initLinkEvent() {
const link = target.closest('a[href]') as HTMLAnchorElement
if (!link) return
const sameSite = link.origin === location.origin
const container = ['header', 'nav', 'article', 'toc', 'footer'].find((name) =>
target.closest(`[data-container="${name}"]`),
)
const container = target.closest(`[data-container]`) as HTMLElement | null
sendEvent({
type: EventType.link,
link_url: link.href,
link_samesite: sameSite,
link_container: container,
link_container: container?.dataset.container,
})
})
}

View File

@@ -251,7 +251,17 @@ const link = {
},
link_container: {
type: 'string',
enum: ['header', 'nav', 'article', 'toc', 'footer'],
enum: [
'header',
'nav',
'breadcrumbs',
'title',
'lead',
'notifications',
'article',
'toc',
'footer',
],
description: 'The part of the page where the user clicked the link.',
},
},

View File

@@ -3,7 +3,7 @@ type Props = {
}
export const ArticleTitle = ({ children }: Props) => {
return (
<div className="d-flex flex-items-baseline flex-justify-between">
<div className="d-flex flex-items-baseline flex-justify-between" data-container="title">
<h1 id="title-h1" className="border-bottom-0">
{children}
</h1>

View File

@@ -28,6 +28,7 @@ export const Breadcrumbs = ({ inHeader }: Props) => {
data-testid={inHeader ? 'breadcrumbs-header' : 'breadcrumbs-in-article'}
className={cx('f5 breadcrumbs', styles.breadcrumbs)}
aria-label="Breadcrumb"
data-container="breadcrumbs"
>
<ul>
{Object.values(breadcrumbs)

View File

@@ -84,7 +84,7 @@ export const HeaderNotifications = () => {
].filter(ExcludesNull)
return (
<div>
<div data-container="notifications">
{allNotifications.map(({ type, content, onClose }, i) => {
const isLast = i === allNotifications.length - 1

View File

@@ -12,6 +12,7 @@ export function Lead({ children, className, as: Component = 'div', ...restProps
return (
<Component
className={cx('f2 color-fg-muted mb-3', styles.container, className)}
data-container="lead"
{...restProps}
{...(typeof children === 'string'
? { dangerouslySetInnerHTML: { __html: children } }