1
0
mirror of synced 2025-12-19 18:10:59 -05:00

add breadcrumbs to AutomatedPage component (#49247)

This commit is contained in:
Robert Sese
2024-02-16 10:39:01 -06:00
committed by GitHub
parent 71fdf1ae14
commit a8d128c29c
6 changed files with 59 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import { MiniTocs } from 'src/frame/components/ui/MiniTocs'
import { useAutomatedPageContext } from 'src/automated-pipelines/components/AutomatedPageContext' import { useAutomatedPageContext } from 'src/automated-pipelines/components/AutomatedPageContext'
import { ClientSideHighlight } from 'src/frame/components/ClientSideHighlight' import { ClientSideHighlight } from 'src/frame/components/ClientSideHighlight'
import { Alert } from 'src/frame/components/ui/Alert' import { Alert } from 'src/frame/components/ui/Alert'
import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
type Props = { type Props = {
children: React.ReactNode children: React.ReactNode
@@ -23,7 +24,14 @@ export const AutomatedPage = ({ children }: Props) => {
<div className="container-xl px-3 px-md-6 my-4"> <div className="container-xl px-3 px-md-6 my-4">
<ArticleGridLayout <ArticleGridLayout
topper={<ArticleTitle>{title}</ArticleTitle>} topper={
<>
<div className="d-none d-xl-block my-3 mr-auto width-full">
<Breadcrumbs />
</div>
<ArticleTitle>{title}</ArticleTitle>
</>
}
intro={ intro={
<> <>
{intro && ( {intro && (

View File

@@ -4,6 +4,7 @@ featuredLinks:
gettingStarted: gettingStarted:
- /get-started/start-your-journey/hello-world - /get-started/start-your-journey/hello-world
- /rest - /rest
- /webhooks
popular: popular:
- /get-started - /get-started
- /get-started/foo/bar - /get-started/foo/bar
@@ -31,6 +32,7 @@ children:
- code-security - code-security
- actions - actions
- rest - rest
- webhooks
# - account-and-profile # - account-and-profile
# - authentication # - authentication
# - repositories # - repositories

View File

@@ -0,0 +1,23 @@
---
title: Webhooks documentation
shortTitle: Webhooks
intro: 'Webhooks can let your integrations take an action in response to events that occur on {% data variables.product.company_short %}.'
introLinks:
reference: /webhooks/webhook-events-and-payloads
featuredLinks:
popular:
- /webhooks/webhook-events-and-payloads
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- Webhooks
children:
- /webhook-events-and-payloads
changelog:
label: webhooks
layout: product-landing
---

View File

@@ -0,0 +1,18 @@
---
title: Webhook events and payloads
intro: Learn about when each webhook event occurs and what the payload contains.
versions:
fpt: '*'
ghes: '*'
ghec: '*'
topics:
- Webhooks
shortTitle: Webhook events & payloads
autogenerated: webhooks
---
## About webhook events and payloads
HubGit webhook events and payloads.
<!-- Content after this section is automatically generated -->

View File

@@ -301,6 +301,12 @@ test.describe('test nav at different viewports', () => {
// breadcrumbs show up in rest reference pages // breadcrumbs show up in rest reference pages
await page.goto('/rest/actions/artifacts') await page.goto('/rest/actions/artifacts')
await expect(page.getByTestId('breadcrumbs-in-article')).toBeVisible() await expect(page.getByTestId('breadcrumbs-in-article')).toBeVisible()
// breadcrumbs show up in one of the pages that use the AutomatedPage
// component (e.g. graphql, audit log, etc.) -- we test the webhooks
// reference page here
await page.goto('/webhooks/webhook-events-and-payloads')
await expect(page.getByTestId('breadcrumbs-in-article')).toBeVisible()
}) })
test('large -> x-large viewports - 1012+', async ({ page }) => { test('large -> x-large viewports - 1012+', async ({ page }) => {

View File

@@ -14,7 +14,7 @@ describe('featuredLinks', () => {
test('landing page intro links have expected properties', async () => { test('landing page intro links have expected properties', async () => {
const $ = await getDOM('/en') const $ = await getDOM('/en')
const $featuredLinks = $('[data-testid=article-list] a') const $featuredLinks = $('[data-testid=article-list] a')
expect($featuredLinks).toHaveLength(6) expect($featuredLinks).toHaveLength(7)
expect($featuredLinks.eq(0).attr('href')).toBe('/en/get-started/start-your-journey/hello-world') expect($featuredLinks.eq(0).attr('href')).toBe('/en/get-started/start-your-journey/hello-world')
expect($featuredLinks.eq(0).children('h3').text()).toMatch('Hello World') expect($featuredLinks.eq(0).children('h3').text()).toMatch('Hello World')
expect($featuredLinks.eq(0).children('p').text()).toMatch('Follow this Hello World exercise') expect($featuredLinks.eq(0).children('p').text()).toMatch('Follow this Hello World exercise')