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

Merge pull request #26123 from github/enterprise-support-link

Update Enterprise Support Contact Link
This commit is contained in:
Kevin Heis
2022-03-14 09:29:20 -07:00
committed by GitHub
4 changed files with 6 additions and 36 deletions

View File

@@ -3,12 +3,9 @@ import Link from 'next/link'
import { useRouter } from 'next/router'
import { MarkGithubIcon, CommentDiscussionIcon } from '@primer/octicons-react'
import { useVersion } from 'components/hooks/useVersion'
import { Lead } from 'components/ui/Lead'
export function GenericError() {
const { isEnterprise } = useVersion()
return (
<div className="min-h-screen d-flex flex-column">
<Head>
@@ -28,11 +25,7 @@ export function GenericError() {
</p>
<a
id="contact-us"
href={
isEnterprise
? 'https://enterprise.github.com/support'
: 'https://support.github.com/contact'
}
href="https://support.github.com/contact"
className="btn btn-outline mt-2"
>
<CommentDiscussionIcon size="small" className="octicon mr-1" />

View File

@@ -1,11 +1,9 @@
import { PeopleIcon, CommentDiscussionIcon } from '@primer/octicons-react'
import { useTranslation } from 'components/hooks/useTranslation'
import { useVersion } from 'components/hooks/useVersion'
import { useMainContext } from 'components/context/MainContext'
export const Support = () => {
const { isEnterprise } = useVersion()
const { t } = useTranslation('support')
const { communityRedirect } = useMainContext()
@@ -25,11 +23,7 @@ export const Support = () => {
<div>
<a
id="contact-us"
href={
isEnterprise
? 'https://enterprise.github.com/support'
: 'https://support.github.com/contact'
}
href="https://support.github.com/contact"
className="Link—secondary text-bold"
>
<CommentDiscussionIcon size="small" className="octicon mr-1" />

View File

@@ -1,11 +1,9 @@
import { SimpleHeader, SimpleFooter } from 'components/GenericError'
import Head from 'next/head'
import { CommentDiscussionIcon } from '@primer/octicons-react'
import { useVersion } from 'components/hooks/useVersion'
import { Lead } from 'components/ui/Lead'
const Custom404 = () => {
const { isEnterprise } = useVersion()
return (
<div className="min-h-screen d-flex flex-column">
<Head>
@@ -25,11 +23,7 @@ const Custom404 = () => {
</p>
<a
id="contact-us"
href={
isEnterprise
? 'https://enterprise.github.com/support'
: 'https://support.github.com/contact'
}
href="https://support.github.com/contact"
className="btn btn-outline mt-2"
>
<CommentDiscussionIcon size="small" className="octicon mr-1" />

View File

@@ -1,5 +1,4 @@
import { getDOM } from '../helpers/supertest.js'
import enterpriseServerReleases from '../../lib/enterprise-server-releases.js'
import nonEnterpriseDefaultVersion from '../../lib/non-enterprise-default-version.js'
import { jest } from '@jest/globals'
@@ -7,29 +6,19 @@ describe('footer', () => {
jest.setTimeout(10 * 60 * 1000)
describe('"contact us" link', () => {
test('leads to dotcom support on dotcom pages', async () => {
test('leads to support from articles', async () => {
const $ = await getDOM(`/en/${nonEnterpriseDefaultVersion}/github`)
expect($('a#contact-us').attr('href')).toBe('https://support.github.com/contact')
})
test('leads to Enterprise support on Enterprise pages', async () => {
const $ = await getDOM(`/en/enterprise/${enterpriseServerReleases.latest}`)
expect($('a#contact-us').attr('href')).toBe('https://enterprise.github.com/support')
})
test('leads to Enterprise support on GHEC pages', async () => {
const $ = await getDOM('/en/enterprise-cloud@latest')
expect($('a#contact-us').attr('href')).toBe('https://enterprise.github.com/support')
})
test('leads to dotcom support on 404 pages', async () => {
test('leads to support on 404 pages', async () => {
const $ = await getDOM('/delicious-snacks/donuts.php', { allow404: true })
expect($('a#contact-us').attr('href')).toBe('https://support.github.com/contact')
})
})
describe('"contact us" link with nextjs', () => {
test('leads to dotcom support on dotcom pages', async () => {
test('leads to support from articles', async () => {
const $ = await getDOM(`/en/${nonEnterpriseDefaultVersion}/github?nextjs=`)
expect($('a#contact-us').attr('href')).toBe('https://support.github.com/contact')
})