Skip to content

Commit 7ebc887

Browse files
authored
Remove domain edit feature code (#55991)
1 parent d57fbd6 commit 7ebc887

25 files changed

Lines changed: 93 additions & 1048 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ jobs:
7575
- shielding
7676
# - tests
7777
# - tools
78-
- tracking
7978
- versions
8079
- webhooks
8180
- workflows

data/ui.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,7 @@ alerts:
320320
WARNING: Warning
321321
TIP: Tip
322322
CAUTION: Caution
323-
domain_edit:
324-
name: Domain name
325-
edit: Edit
326-
edit_your: Edit your domain name
327-
experimental: Experimental
328-
your_name: Your domain name
329-
cancel: Cancel
330-
save: Save
331-
snippet_about: Updating will include the new domain name in all code snippets across GitHub Docs.
332-
learn_more: Learn more
333-
submission_failed: Submission failed. Please try again in a minute.
323+
334324
cookbook_landing:
335325
spotlight: Spotlight
336326
explore_articles: Explore {{ number }} prompt articles

src/content-render/unified/processor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import wrapProceduralImages from './wrap-procedural-images.js'
2727
import parseInfoString from './parse-info-string.js'
2828
import annotate from './annotate.js'
2929
import alerts from './alerts.js'
30-
import replaceDomain from './replace-domain.js'
3130
import removeHtmlComments from 'remark-remove-comments'
3231
import remarkStringify from 'remark-stringify'
3332

@@ -49,7 +48,6 @@ export function createProcessor(context) {
4948
.use(headingLinks)
5049
.use(codeHeader)
5150
.use(annotate)
52-
.use(replaceDomain)
5351
.use(highlight, {
5452
languages: { ...common, graphql, dockerfile, http, groovy, erb, powershell },
5553
subset: false,

src/content-render/unified/replace-domain.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/fixtures/fixtures/content/get-started/markdown/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ children:
1010
- /permissions
1111
- /code-annotations
1212
- /alerts
13-
- /replace-domain
1413
- /html-comments
1514
---

src/fixtures/fixtures/content/get-started/markdown/replace-domain.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/fixtures/fixtures/data/ui.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,7 @@ alerts:
320320
WARNING: Warning
321321
TIP: Tip
322322
CAUTION: Caution
323-
domain_edit:
324-
name: Domain name
325-
edit: Edit
326-
edit_your: Edit your domain name
327-
experimental: Experimental
328-
your_name: Your domain name
329-
cancel: Cancel
330-
save: Save
331-
snippet_about: Updating will include the new domain name in all code snippets across GitHub Docs.
332-
learn_more: Learn more
333-
submission_failed: Submission failed. Please try again in a minute.
323+
334324
cookbook_landing:
335325
spotlight: Spotlight
336326
explore_articles: Explore {{ number }} prompt articles

src/fixtures/tests/playwright-rendering.spec.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -844,35 +844,3 @@ test.describe('translations', () => {
844844
await expect(page).toHaveURL('/ja/get-started/start-your-journey/hello-world')
845845
})
846846
})
847-
848-
test.describe('view pages with custom domain cookie', () => {
849-
test('view article page', async ({ page }) => {
850-
await page.goto(
851-
'/enterprise-server@latest/get-started/markdown/replace-domain?ghdomain=example.ghe.com',
852-
)
853-
854-
const content = page.locator('pre')
855-
await expect(content.nth(0)).toHaveText(/curl https:\/\/example.ghe.com\/api\/v1/)
856-
await expect(content.nth(1)).toHaveText(/curl https:\/\/HOSTNAME\/api\/v2/)
857-
await expect(content.nth(2)).toHaveText('await fetch("https://example.ghe.com/api/v1")')
858-
await expect(content.nth(3)).toHaveText('await fetch("https://HOSTNAME/api/v2")')
859-
860-
// Now switch to enterprise-cloud, where replacedomain should not be used
861-
await page.getByLabel('Select GitHub product version').click()
862-
await page.getByLabel('Enterprise Cloud', { exact: true }).click()
863-
864-
await expect(content.nth(0)).toHaveText(/curl https:\/\/HOSTNAME\/api\/v1/)
865-
await expect(content.nth(1)).toHaveText(/curl https:\/\/HOSTNAME\/api\/v2/)
866-
await expect(content.nth(2)).toHaveText('await fetch("https://HOSTNAME/api/v1")')
867-
await expect(content.nth(3)).toHaveText('await fetch("https://HOSTNAME/api/v2")')
868-
869-
// Again switch back to enterprise server again
870-
await page.getByLabel('Select GitHub product version').click()
871-
await page.getByLabel('Enterprise Server 3.').first().click()
872-
873-
await expect(content.nth(0)).toHaveText(/curl https:\/\/example.ghe.com\/api\/v1/)
874-
await expect(content.nth(1)).toHaveText(/curl https:\/\/HOSTNAME\/api\/v2/)
875-
await expect(content.nth(2)).toHaveText('await fetch("https://example.ghe.com/api/v1")')
876-
await expect(content.nth(3)).toHaveText('await fetch("https://HOSTNAME/api/v2")')
877-
})
878-
})

src/frame/components/DefaultLayout.tsx

Lines changed: 90 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { useTranslation } from '@/languages/components/useTranslation'
1313
import { Breadcrumbs } from '@/frame/components/page-header/Breadcrumbs'
1414
import { useLanguages } from '@/languages/components/LanguagesContext'
1515
import { ClientSideLanguageRedirect } from './ClientSideLanguageRedirect'
16-
import { DomainNameEditProvider } from '@/links/components/useEditableDomainContext'
1716
import { SearchOverlayContextProvider } from '@/search/components/context/SearchOverlayContext'
1817

1918
const MINIMAL_RENDER = Boolean(JSON.parse(process.env.MINIMAL_RENDER || 'false'))
@@ -76,99 +75,97 @@ export const DefaultLayout = (props: Props) => {
7675
}
7776

7877
return (
79-
<DomainNameEditProvider>
80-
<SearchOverlayContextProvider>
81-
<Head>
82-
{error === '404' ? (
83-
<title>{t('oops')}</title>
84-
) : (!isHomepageVersion && page.fullTitle) ||
85-
(currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? (
86-
<title>{page.fullTitle}</title>
87-
) : null}
88-
89-
{/* For Google and Bots */}
90-
<meta name="description" content={metaDescription} />
91-
{page.hidden && <meta name="robots" content="noindex" />}
92-
{Object.values(languages)
93-
.filter((lang) => lang.code !== router.locale)
94-
.map((variant) => {
95-
return (
96-
<link
97-
key={variant.code}
98-
rel="alternate"
99-
hrefLang={variant.hreflang || variant.code}
100-
href={`https://docs.github.com/${variant.code}${
101-
router.asPath === '/' ? '' : router.asPath
102-
}`}
103-
/>
104-
)
105-
})}
106-
107-
{/* For local site search indexing */}
108-
{page.topics.length > 0 && <meta name="keywords" content={page.topics.join(',')} />}
109-
110-
{/* For analytics events */}
111-
{router.locale && <meta name="path-language" content={router.locale} />}
112-
{currentVersion && <meta name="path-version" content={currentVersion} />}
113-
{currentProduct && <meta name="path-product" content={currentProduct.id} />}
114-
{relativePath && (
115-
<meta
116-
name="path-article"
117-
content={relativePath.replace('/index.md', '').replace('.md', '')}
118-
/>
119-
)}
120-
{page.type && <meta name="page-type" content={page.type} />}
121-
{page.documentType && <meta name="page-document-type" content={page.documentType} />}
122-
{status && <meta name="status" content={status.toString()} />}
123-
124-
{/* OpenGraph data */}
125-
{page.fullTitle && (
126-
<>
127-
<meta property="og:site_name" content="GitHub Docs" />
128-
<meta property="og:title" content={page.fullTitle} />
129-
<meta property="og:type" content="article" />
130-
<meta property="og:url" content={fullUrl} />
131-
<meta property="og:image" content={getSocialCardImage()} />
132-
</>
133-
)}
134-
{/* Twitter Meta Tags */}
135-
<meta name="twitter:card" content="summary" />
136-
<meta property="twitter:domain" content={new URL(fullUrl).hostname} />
137-
<meta property="twitter:url" content={fullUrl} />
138-
<meta name="twitter:title" content={page.fullTitle} />
139-
{page.introPlainText && <meta name="twitter:description" content={page.introPlainText} />}
140-
<meta name="twitter:image" content={getSocialCardImage()} />
141-
</Head>
142-
<a
143-
href="#main-content"
144-
className="visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis"
145-
>
146-
Skip to main content
147-
</a>
148-
<Header />
149-
<ClientSideLanguageRedirect />
150-
<div className="d-lg-flex">
151-
{isHomepageVersion ? null : <SidebarNav />}
152-
{/* Need to set an explicit height for sticky elements since we also
153-
set overflow to auto */}
154-
<div className="flex-column flex-1 min-width-0">
155-
<main id="main-content" style={{ scrollMarginTop: '5rem' }}>
156-
<DeprecationBanner />
157-
<RestBanner />
158-
159-
{props.children}
160-
</main>
161-
<footer data-container="footer">
162-
<SupportSection />
163-
<LegalFooter />
164-
<ScrollButton
165-
className="position-fixed bottom-0 mb-4 right-0 mr-4 z-1"
166-
ariaLabel={t('scroll_to_top')}
78+
<SearchOverlayContextProvider>
79+
<Head>
80+
{error === '404' ? (
81+
<title>{t('oops')}</title>
82+
) : (!isHomepageVersion && page.fullTitle) ||
83+
(currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? (
84+
<title>{page.fullTitle}</title>
85+
) : null}
86+
87+
{/* For Google and Bots */}
88+
<meta name="description" content={metaDescription} />
89+
{page.hidden && <meta name="robots" content="noindex" />}
90+
{Object.values(languages)
91+
.filter((lang) => lang.code !== router.locale)
92+
.map((variant) => {
93+
return (
94+
<link
95+
key={variant.code}
96+
rel="alternate"
97+
hrefLang={variant.hreflang || variant.code}
98+
href={`https://docs.github.com/${variant.code}${
99+
router.asPath === '/' ? '' : router.asPath
100+
}`}
167101
/>
168-
</footer>
169-
</div>
102+
)
103+
})}
104+
105+
{/* For local site search indexing */}
106+
{page.topics.length > 0 && <meta name="keywords" content={page.topics.join(',')} />}
107+
108+
{/* For analytics events */}
109+
{router.locale && <meta name="path-language" content={router.locale} />}
110+
{currentVersion && <meta name="path-version" content={currentVersion} />}
111+
{currentProduct && <meta name="path-product" content={currentProduct.id} />}
112+
{relativePath && (
113+
<meta
114+
name="path-article"
115+
content={relativePath.replace('/index.md', '').replace('.md', '')}
116+
/>
117+
)}
118+
{page.type && <meta name="page-type" content={page.type} />}
119+
{page.documentType && <meta name="page-document-type" content={page.documentType} />}
120+
{status && <meta name="status" content={status.toString()} />}
121+
122+
{/* OpenGraph data */}
123+
{page.fullTitle && (
124+
<>
125+
<meta property="og:site_name" content="GitHub Docs" />
126+
<meta property="og:title" content={page.fullTitle} />
127+
<meta property="og:type" content="article" />
128+
<meta property="og:url" content={fullUrl} />
129+
<meta property="og:image" content={getSocialCardImage()} />
130+
</>
131+
)}
132+
{/* Twitter Meta Tags */}
133+
<meta name="twitter:card" content="summary" />
134+
<meta property="twitter:domain" content={new URL(fullUrl).hostname} />
135+
<meta property="twitter:url" content={fullUrl} />
136+
<meta name="twitter:title" content={page.fullTitle} />
137+
{page.introPlainText && <meta name="twitter:description" content={page.introPlainText} />}
138+
<meta name="twitter:image" content={getSocialCardImage()} />
139+
</Head>
140+
<a
141+
href="#main-content"
142+
className="visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis"
143+
>
144+
Skip to main content
145+
</a>
146+
<Header />
147+
<ClientSideLanguageRedirect />
148+
<div className="d-lg-flex">
149+
{isHomepageVersion ? null : <SidebarNav />}
150+
{/* Need to set an explicit height for sticky elements since we also
151+
set overflow to auto */}
152+
<div className="flex-column flex-1 min-width-0">
153+
<main id="main-content" style={{ scrollMarginTop: '5rem' }}>
154+
<DeprecationBanner />
155+
<RestBanner />
156+
157+
{props.children}
158+
</main>
159+
<footer data-container="footer">
160+
<SupportSection />
161+
<LegalFooter />
162+
<ScrollButton
163+
className="position-fixed bottom-0 mb-4 right-0 mr-4 z-1"
164+
ariaLabel={t('scroll_to_top')}
165+
/>
166+
</footer>
170167
</div>
171-
</SearchOverlayContextProvider>
172-
</DomainNameEditProvider>
168+
</div>
169+
</SearchOverlayContextProvider>
173170
)
174171
}

0 commit comments

Comments
 (0)