Граф коммитов

135 Коммитов

Автор SHA1 Сообщение Дата
Peter Bengtsson 72d40de414
make getMainContext async (#31622) 2022-10-12 16:43:58 +00:00
Peter Bengtsson ef5b9d5f07
proxy /api/search/* to docs.github.com (#31281) 2022-09-29 21:50:38 +00:00
Sarah Schneider b7f48ea2c1
Support GHAE internal-only semantic versioning (#29178)
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
2022-09-22 08:26:58 +02:00
Peter Bengtsson 90b754fe3c
Test JSON API without enabling dedicated search results page (#30542) 2022-09-06 17:05:22 +00:00
Sarah Edwards d2a2113c11
REST new user guidance (#29642) 2022-08-23 19:31:01 +00:00
Peter Bengtsson 8eb7898827
send errors to Failbot in SSR rendering (#30153)
* send errors to failbot in SSR rendering

* wip

* progress

* tidying up

* no point awaiting something that doens't return a promise
2022-08-22 16:50:18 +00:00
Peter Bengtsson fe80f4ae4d
suppress es-search if ELASTICSEARCH_URL isn't configured (#30096)
* suppress es-search if ELASTICSEARCH_URL isn't configured

* simplify

* simple 500 error instead
2022-08-19 20:54:37 +00:00
Peter Bengtsson 8765c628ff
dedicated search results page (redux) (#29902)
* dedicated search results page (redux)

* Update SearchResults.tsx

* adding pagination

* fix pagination

* say something on NoQuery

* better Flash

* tidying link

* small fixes for results

* debug info

* l18n the meta info

* inDebugMode

* basic jest rendering of the skeleton page

* basic jest rendering test

* fix content tests

* better document title

* fix tests

* quote query in page title

* use home page sidebar

* something when nothing is found

* parseInt no longer needs the 10

* fix linting tests

* fix test

* prettier

* Update pages/search.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-08-19 13:36:55 +00:00
Peter Bengtsson 5d83a12340
set theme data- attributes on the body (#30054)
* set theme data- attributes on the body

* Color mode back on body tag

* unconflicted

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
2022-08-18 20:13:28 +00:00
Kevin Heis 3cb36aa99f
Remove airgap mode (#29964) 2022-08-15 21:05:21 +00:00
Kevin Heis 688a274f1f
Remove CSRF check (#29910)
* Use color_mode for gating "sign up" button

* Remove csrf check

* Add `res.removeHeader('set-cookie')` to cache-control

* Update static-assets.js

* Remove package

* Remove tough-cookie

* Update cache-control.js

* Update cache-control.js

* Update cache-control.js
2022-08-15 19:28:42 +00:00
Grace Park 2102f25e3f
prevent SSR mismatch (#29852) 2022-08-11 17:17:12 +00:00
Peter Bengtsson 37203886ff
remove now obsolete code comment from render caching (#29767) 2022-08-09 19:55:36 +00:00
Kevin Heis 04f38e4779
Parse color_mode cookie in browser (#29738)
* Parse color_mode cookie in browser

* Update useTheme.ts

* Update use-theme.js

* Update use-theme.js

* Add support for dark_high_contrast

Per https://primer.style/css/support/theming

I also checked all the color mode options, this is the only additional working with Primer 20 so far

* Remove gray bg

* Remove  type

* Use defaults instead of types for fn args

* Thicker types
2022-08-09 16:48:18 +00:00
Peter Bengtsson ef277d6640
Always call initializeEvents with a truthy csrfToken (#29721) 2022-08-08 12:10:00 -04:00
Peter Bengtsson 623a040851
use defaultfallback data for apisession (#29719)
* don't get available languages from session

* update useSession

* one more fix

* use default session till XHR comes in

* warn on error
2022-08-08 15:47:55 +00:00
Peter Bengtsson a1e3866fa5
don't get available languages from session (#29715)
* don't get available languages from session

* update useSession

* one more fix
2022-08-08 11:13:27 -04:00
Kevin Heis 407dd2f102
Use opacity instead of hide/show to preserve anchor position (#29673) 2022-08-05 19:50:09 +00:00
Kevin Heis 56aa9ea094
Move use session to its own hook file (#29641)
* Move use session to its own hook file

* Trying useSWR

* Try one hour html cache

* blah blah lint

* Update to include loading state

* Update components/hooks/useSession.ts

Co-authored-by: Peter Bengtsson <peterbe@github.com>

Co-authored-by: Peter Bengtsson <peterbe@github.com>
2022-08-05 14:47:10 +00:00
Kevin Heis 5d7ec93819
Remove content until color mode is known (#29618)
* Flash of gray

* Update _app.tsx

* Update _app.tsx

* Update _app.tsx

* Update index.scss

* Update index.scss
2022-08-04 16:13:49 +00:00
Rachael Sewell 3cbd7103da
Remove top-level categories on graphql queries page (#29592) 2022-08-03 20:01:38 +00:00
Rachael Sewell 467459af7c
Reactify graphql pages (#28547) 2022-08-03 10:51:21 -07:00
Kevin Heis f8d2395960
Remove theme from HTML (#29560)
* Remove theme from HTML

* update for linting error

* Fix for overriding default color modes

Co-authored-by: Grace Park <lugraciecy@gmail.com>
Co-authored-by: Grace Park <gracepark@github.com>
2022-08-02 17:06:54 -07:00
Kevin Heis 0886faddac
Move language context to browser/session (#29433) 2022-07-28 18:50:46 +00:00
Kevin Heis f79e1d2cb7
Fetch CSRF token over XHR (browser-side) (#29337)
* Client side csrf token grab

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Remove test refs to meta tag

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Update get-session.ts

* Fix some type issues

* Simplify api

* Update components/lib/get-session.ts

Co-authored-by: Rachael Sewell <rachmari@github.com>

Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-07-27 16:18:07 +00:00
Rachael Sewell e8acff555c
refactor the enabled for apps page component (#29253) 2022-07-26 18:14:50 +00:00
Rachael Sewell 26e4dbc4bf
refactor rest context provider to be generic (#29021) 2022-07-14 14:09:38 +00:00
Peter Bengtsson 0186424847
use SSRProvider from @primer/react to avoid warnings (#28546) 2022-06-15 16:51:58 -05:00
Peter Bengtsson 071c95a91c
make miniToc pure data and no html strings (#28517)
* make miniToc pure data and no html strings

* fixups

* some types refactoring
2022-06-15 18:31:36 +00:00
Peter Bengtsson 815d6d9e5c
unbreak release notes (#28123) 2022-05-31 13:26:50 +00:00
Peter Bengtsson 6b26400c49
only include props we need (#28067) 2022-05-29 23:54:05 +00:00
Peter Bengtsson 8d4e1cda62
use shorthand notation (#27919) 2022-05-23 18:22:44 +00:00
Peter Bengtsson 18504871b9
cache full rendering (#25424)
* cache full rendering

* still not working with gzip

* progress progress progress

* smaller

* hacky progress

* small fixes

* wip

* lock file

* wip

* wip

* package-lock updates

* wip

* search DOM in lowercase

* simplify

* with instrument

* improve test coverage

* mutateCheeriobodyByRequest

* fix

* remove renderContentCacheByContex

* disable render caching in sync-search

* diables things in github/github link checker

* gzip lru

* tidying up

* updated

* correct tests

* fix: move userLanguage to LanguagesContext

* Revert "fix: move userLanguage to LanguagesContext"

This reverts commit d7c05d958c71eaad496eb46764eb845d80b866ca.

* contexts ftw

* fixed rendering tests

* oops for got new file

* nits addressed

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-05-23 12:12:09 +00:00
Peter Bengtsson a8d45acea9
refactor getThemeProps to be available in JS (#27439)
* refactor getThemeProps to be available in JS

* wip

* mike's idea

* delete no longer used file
2022-05-18 18:47:27 +00:00
Lucas Costi 5cef9e2fe7
Remove Actions experimental articles (#27524) 2022-05-18 00:35:40 +00:00
Robert Sese b000cf8f07
REST: use actual page titles for subcategory titles (#27477)
* Use actual page titles for subcategory titles

* No longer need this prop client side

* Forgot to update the type

* Set the subcategory toc title as we go

* Comments 🛠
2022-05-10 17:57:12 +00:00
Grace Park f2c6004aaa
REST API Pages: fix links of endpoints-available-for-github-apps page (#27425) 2022-05-04 00:56:04 +00:00
Robert Sese 3ecf82c6f6
openapi: show all operations on TocLanding page for REST categories (#27447)
* Allow getRest() to return everything at the category level

* Explicitly pass a subcategory for categories with no subcategories

* Show all operations for a category on TocLanding page

* Types for linting
2022-05-03 22:57:49 +00:00
Grace Park 982d596d28
REST Bug fixes: Guides/Overview useEffect, duplicate key (#27414)
* add conditional in useeffect

* fix duplicate key error

* consolidate conceptual article check

* remove unnecessary currentanchor

* revert consolidating variable

Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-05-02 13:39:53 -07:00
Grace Park b98c83e924
REST operations sidebar (#26225)
* testing out a rest operations sidebar

* cleanup

* renamed 5 files

* renamed 5 files

* set redirect_from on 5 files

* renamed 1 files

* renamed 1 files

* renamed 3 files

* renamed 1 files

* renamed 1 files

* renamed 3 files

* renamed 1 files

* renamed 2 files

* renamed 1 files

* renamed 4 files

* renamed 15 files

* renamed 2 files

* renamed 6 files

* renamed 1 files

* renamed 4 files

* renamed 7 files

* renamed 1 files

* renamed 3 files

* renamed 3 files

* renamed 1 files

* renamed 5 files

* renamed 1 files

* renamed 1 files

* renamed 3 files

* renamed 4 files

* renamed 1 files

* renamed 1 files

* renamed 2 files

* renamed 4 files

* renamed 1 files

* renamed 1 files

* renamed 1 files

* renamed 6 files

* renamed 6 files

* renamed 4 files

* move files

* adding more

* updating to add restcontext and start of removing data/reusables/rest-reference

* removed data/reusables

* add a RestMiniTocItem and updating the filtering to add a subcategory so all manually added H3s are in mini tocs in addition to operations

* remove console log

* [WIP]: REST New Proposal Sidebar (#26471)

* saving

* update sidebar

* remove console log

* update guides and overview

* import Category for category level rest pages

* update undefined restOperations

* update restOperationData category and subcategory levels"

* minor updates

* update get mini toc items function

* updating REST context for sidebar

* updating rest data

* remove console logs

* WIP: mini-toc-ing the sidebar

Co-authored-by: Robert Sese <rsese@github.com>

* A little cleanup

* Fix first subcategory link and add some comments

* updating anchor links in sidebar

* adding updates

* remove standalone

* update product and maptopic pages using article context

* add conditional link wrapper

* fix sidebar toggle and versions for enterprise admin

* update versions per subcategory

* Highlight sidebar link for current page

* Update miniToc hash links and hash change tracking

* fix unique key in CollapsibleSection

* Fix list markup

* remove title

* update permissions

* Hide minitocs on landing (#26594)

* hide minitocs on landing page

* simplify page components and remove minitoc from sidebar for guides/overview

* fix carats and category fix

* remove id

Co-authored-by: Grace Park <gracepark@github.com>

* updating content based on versions script check with the OpenAPI

* update script and content files

* update script and content/rest files

* update to add TocLanding

* update script

* update index files

* add codespaces repository-secrets

* remove openapi schema check script

* remove minitocs at the top

* add h2 about the {title} api

* fix tests/unit/openapi-schema.js

* Fix linting tests

* fix search/topics test

* fix tests/unit/pages test

* update rest/reference links in components

* run prettier

* Update components/rest/RestReferencePage.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update components/rest/RestReferencePage.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update pages/[versionId]/rest/[category]/[subcategory].tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Update tests/unit/openapi-schema.js

Co-authored-by: Rachael Sewell <rachmari@github.com>

* updating comment location

* remove dependabot override

* remove path-utils current product update for rest

* run linter

* remove dependabot.md and remove h2 heading on restreference

* update the correct product to rest for rest pages

* adding comments for updates to path-utils

* remove console log

* REST sidebar: handle legacy v3 redirects (#26686)

* Add script to handle legacy v3 REST redirects

* Run the script

* Handle a redirect to a redirect

* Update REST test URLs

* 'await' and test runs subcategory of checks

* Update REST URLs for routing/developer-site-redirects tests

* Update developer-redirects fixture with new REST URLs

* Resolve merge conflicts

* Update rest-redirects fixture with new REST URLs

* Fix broken links with REST pages re-org

* redirectTo could be undefined

* Fix script for posterity, can't redirect paths with hashes

* Remove invalid hash redirects

* Typically don't need to save one-off scripts

* Undo redirect changes (not necessary for handling v3 redirects)

* Remove script-added redirects

* Update old v3 redirects with new REST URLs

* No more GHES search indexing page

* 'org' not 'organization'

* Update fixture data for new REST URLs

* revert any content directory changes

Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>

* Adding test rest (#26750)

* add test to check openapi schema versions and content rest frontmatter versions

* update lib/redirects

* fix test and add error messages

* adding repository secrets

* adding repository-secrets.md

* Revert "update lib/redirects"

This reverts commit 3aafe28265764d5bc09c0c478c8e0ca099c8fbcf.

* remove lib/redirects changes and console logs

* Update lib/rest/index.js

Co-authored-by: Rachael Sewell <rachmari@github.com>

* update unique key

* Rest client side redirects (#26754)

* adding tags subcategory for the rest content repos category

* run prettier

* bug fix for anchor scrolls" (#26892)

* updating width size for rest reference page

* Rest sidebar consolidation (#26862)

* refactor sidebar

* fix articlecontext provider issue on rest product landing page for all versions

* fix a bug, create new component

* revert change to create new component and fix bug

Co-authored-by: Rachael Sewell <rachmari@github.com>

* Set currentAnchor with a hashchange handler (#26923)

* Rest sidebar design tweaks (#26807)

* Rest sidebar design tweaks

* tweak color to subtle

* use muted color and margin for line

* update to design feedback

Co-authored-by: Grace Park <gracepark@github.com>

* Remove cheerio from rest-collapsible (#26948)

* remove cheerio from rest-collapsible

* update type

* adding endswith instead

* use productId instead

* one off edge case for secret-scanning

* Reorganize subcategory and category, Update pre -> div, Add RestContext (#26950)

* reorganize subcategory and category

* add RestContext

* update comment

* update for endpoints page

* add comment

* move object to restcontext

* remove effectiveDate in restcontext

* remove width calculation for rest reference page

* fix adding manual writer's minitocs to sidebar

* update with feedback

* update comment

* update isRestReferencePage

* remove page component and fix bug

* adding back rest/index.tsx

Co-authored-by: Rachael Sewell <rachmari@github.com>

* update content/rest"

* add back design tweak

* update to div

* update margins on rest api reference

* remove page component

* adding tests

* separate product from rest sidebar (#27065)

* separate product from rest sidebar

* Use ProductCollapsibleSections for product pages

* fix tests

Co-authored-by: Robert Sese <rsese@github.com>
Co-authored-by: Grace Park <gracepark@github.com>

* Rest sidebar translations (#27052)

* update translations

* remove general test

Co-authored-by: Robert Sese <rsese@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-04-20 10:19:48 -07:00
Siddharth Kshetrapal 6e039efe70
Fix flash of incorrect theme for @primer/components (#24123)
* Pass color mode from server to ThemeProvider

* Add preventSSRMismatch

* Fix bad merge, my bad.

* use release candidate for csrf safe approach

* upgrade primer/react to 34.7.1

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2022-03-21 22:10:06 +00:00
Brian Evans 0f2f23799a
Update 404.tsx
making the linter happy
2022-03-14 08:31:43 -07:00
Brian Evans f57a9801c3
Update pages/404.tsx
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
2022-03-14 07:55:48 -07:00
Kevin Heis 9901f999d2
Merge branch 'main' into enterprise-support-link 2022-03-12 08:47:49 -08:00
Brian Evans 1ba55397c8
update enterprise contact link 2022-03-11 20:45:46 +00:00
Rachael Sewell 67360f5ad5
refactor rest code (#25879) 2022-03-11 20:23:38 +00:00
Grace Park 1a6bee4601
Refactor to add RestReferencePage (#25781)
* refactor to add RestReferencePage

* remove structured data from article page

* add back clientsidehightlight js and remove structuredcontent

* update endpoint available for github apps page to use RestReferencePage

* check for minitocs

* use children for ArticlePage for overview endpoints page and move category data to RestReferencePage

* create MiniTocs component

* add MiniTocs

* fix unique key issue

* break into out into own div

* remove some unnecessary ts

* refactor looping section

* simplify markdown component usage

* add key prop

* add key prop

* add unique key

Co-authored-by: Rachael Sewell <rachmari@github.com>
2022-03-08 18:00:38 +00:00
Peter Bengtsson 693fb35bc6
links on /rest/overview/endpoints (#25771)
* links on /rest/overview/endpoints-available-for-github-apps

* tests

* remove unused code
2022-03-03 17:45:37 +00:00
Rachael Sewell 764966735b
cache rest data for translated pages (#25784) 2022-03-02 20:21:02 -08:00
Grace Park 767ba10934
Bugfix: Fixing toc issue on rest pages (#25740) 2022-03-01 16:32:04 -08:00