Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Update GitHub, GitLab, BitBucket copy #3603

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function InstallationHelpBanner() {
const { provider } = useParams()
const { params } = useLocationParams()

if (providerToName(provider) !== 'Github') return null
if (providerToName(provider) !== 'GitHub') return null

const { setup_action: setupAction } = params
if (setupAction !== 'install') return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function UserDropdown() {
})

const { provider } = useParams<URLParams>()
const isGh = providerToName(provider) === 'Github'
const isGh = providerToName(provider) === 'GitHub'
const history = useHistory()

const items =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function GithubIntegrationCopy({ integrationId }) {
return (
<p>
This account is configured via the GitHub App. You can manage the apps
repository integration on <A to={{ pageName: 'github' }}>Github.</A>
repository integration on <A to={{ pageName: 'github' }}>GitHub.</A>
</p>
)
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/CodecovAIPage/InstallCodecovAI/InstallCodecovAI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const COPY_APP_INSTALL_STRING =
const InstallCodecovAI: React.FC = () => {
const { theme } = useThemeContext()
const isDarkMode = theme === Theme.DARK
const githubImage = loginProviderImage('Github', !isDarkMode)
const githubImage = loginProviderImage('GitHub', !isDarkMode)

return (
<div>
<Card>
<Card.Header>
<Card.Title size="base">
Install the Codecov AI app on Github
Install the Codecov AI app on GitHub
</Card.Title>
</Card.Header>
<Card.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import BannerContent from 'ui/Banner/BannerContent'
import BannerHeading from 'ui/Banner/BannerHeading'

export const ProvidersEnum = Object.freeze({
Github: 'Github',
Gitlab: 'Gitlab',
Github: 'GitHub',
Gitlab: 'GitLab',
BitBucket: 'BitBucket',
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('PullLabel', () => {
it('renders provider pull url', async () => {
render(<PullLabel {...mockValidProps} />, { wrapper })

const pullUrlLink = await screen.findByRole('link', { name: /Github/ })
const pullUrlLink = await screen.findByRole('link', { name: /GitHub/ })
expect(pullUrlLink).toBeInTheDocument()
expect(pullUrlLink).toHaveAttribute(
'href',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DefaultOrgSelector/DefaultOrgSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function DefaultOrgSelector() {
})

const { provider } = useParams()
const isGh = providerToName(provider) === 'Github'
const isGh = providerToName(provider) === 'GitHub'

const history = useHistory()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ResyncButton() {
function GitHubHelpBanner() {
const [showModal, setShowModal] = useState(false)
const { provider } = useParams<{ provider: Provider }>()
if (providerToName(provider) !== 'Github') return null
if (providerToName(provider) !== 'GitHub') return null

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('EnterpriseLandingPage', () => {
it('displays bitbucket card', async () => {
render(<EnterpriseLandingPage />, { wrapper })

const element = await screen.findByRole('heading', { name: 'Bitbucket' })
const element = await screen.findByRole('heading', { name: 'BitBucket' })
expect(element).toBeInTheDocument()
})

Expand Down Expand Up @@ -138,7 +138,7 @@ describe('EnterpriseLandingPage', () => {
it('displays bitbucket button', () => {
render(<EnterpriseLandingPage />, { wrapper })

expect(screen.queryByText('Bitbucket')).toBeNull()
expect(screen.queryByText('BitBucket')).toBeNull()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('ProviderCard', () => {
)

const element = screen.getByRole('link', {
name: 'Login via Bitbucket',
name: 'Login via BitBucket',
})
expect(element).toBeInTheDocument()
expect(element).toHaveAttribute('href', '/login/bb')
Expand All @@ -43,7 +43,7 @@ describe('ProviderCard', () => {
)

const element = screen.getByRole('link', {
name: 'Login via Bitbucket Server',
name: 'Login via BitBucket Server',
})
expect(element).toBeInTheDocument()
expect(element).toHaveAttribute('href', '/login/bbs')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import BannerHeading from 'ui/Banner/BannerHeading'

const GithubConfigBanner = () => {
const { provider } = useParams()
const isGh = providerToName(provider) === 'Github'
const isGh = providerToName(provider) === 'GitHub'

if (!isGh) return null

Expand Down
2 changes: 1 addition & 1 deletion src/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type CIUrls = Record<keyof typeof CI_PROVIDERS, string>

const getInitialProvider = (provider: Provider, path: string, urls: CIUrls) => {
const defaultProvider =
providerToName(provider) !== 'Github'
providerToName(provider) !== 'GitHub'
? CI_PROVIDERS.OtherCI
: CI_PROVIDERS.GitHubActions
if (path === urls.CircleCI) {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/SyncProviderPage/SyncButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('SyncButton', () => {
it('renders sync button', () => {
render(<SyncButton provider="gh" />, { wrapper })

const link = screen.getByRole('link', { name: /Sync with Github/ })
const link = screen.getByRole('link', { name: /Sync with GitHub/ })

const expectedRedirect = encodeURIComponent('http://localhost:3000/gh')
expect(link).toBeInTheDocument()
Expand All @@ -26,7 +26,7 @@ describe('SyncButton', () => {
it('renders sync button', () => {
render(<SyncButton provider="gl" />, { wrapper })

const link = screen.getByRole('link', { name: /Sync with Gitlab/ })
const link = screen.getByRole('link', { name: /Sync with GitLab/ })

const expectedRedirect = encodeURIComponent('http://localhost:3000/gl')
expect(link).toBeInTheDocument()
Expand All @@ -51,7 +51,7 @@ describe('SyncButton', () => {
render(<SyncButton provider="ghe" />, { wrapper })

const link = screen.getByRole('link', {
name: /Sync with Github Enterprise/,
name: /Sync with GitHub Enterprise/,
})

const expectedRedirect = encodeURIComponent('http://localhost:3000/ghe')
Expand All @@ -65,7 +65,7 @@ describe('SyncButton', () => {
render(<SyncButton provider="gle" />, { wrapper })

const link = screen.getByRole('link', {
name: /Sync with Gitlab Enterprise/,
name: /Sync with GitLab Enterprise/,
})

const expectedRedirect = encodeURIComponent('http://localhost:3000/gle')
Expand Down
10 changes: 5 additions & 5 deletions src/pages/SyncProviderPage/SyncProviderPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ describe('SyncProviderPage', () => {
setup()
render(<SyncProviderPage />, { wrapper })

const githubSyncButton = await screen.findByText(/Sync with Github/)
const githubSyncButton = await screen.findByText(/Sync with GitHub/)
expect(githubSyncButton).toBeInTheDocument()
})

it('renders github enterprise sync button', async () => {
it('renders gitlab enterprise sync button', async () => {
setup()

render(<SyncProviderPage />, { wrapper })

const gheSyncButton = await screen.findByText(
/Sync with Gitlab Enterprise/
const gleSyncButton = await screen.findByText(
/Sync with GitLab Enterprise/
)
expect(gheSyncButton).toBeInTheDocument()
expect(gleSyncButton).toBeInTheDocument()
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface URLParams {

const GitHubRateLimitExceededBanner = () => {
const { provider } = useParams<URLParams>()
const isGh = providerToName(provider) === 'Github'
const isGh = providerToName(provider) === 'GitHub'

if (!isGh) return null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const RequestInstallBanner = () => {
// @ts-expect-errors useLocationParams needs to be updated to support generic types
const setupAction = params?.setup_action

const isGitHubProvider = provider && providerToName(provider) === 'Github'
const isGitHubProvider = provider && providerToName(provider) === 'GitHub'

const closeModalAndSaveToLocalStorage = () => {
saveToLocalStorage(APP_INSTALL_BANNER_KEY)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/loginProviders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('loginProviderToName', () => {
describe('valid value is passed', () => {
it('returns the provider name', () => {
const data = loginProviderToName(LOGIN_PROVIDER_SHORT_NAMES.gh)
expect(data).toMatch(/Github/)
expect(data).toMatch(/GitHub/)
})
})

Expand Down
36 changes: 18 additions & 18 deletions src/shared/utils/loginProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import sentryLogo from 'assets/providers/sentry-icon.svg'
export const LoginProvidersEnum = {
BITBUCKET: {
provider: 'bb',
name: 'Bitbucket',
name: 'BitBucket',
external: 'BITBUCKET',
externalKey: 'bb',
selfHosted: 'BITBUCKET_SERVER',
selfHostedKey: 'bbs',
selfHostedName: 'Bitbucket Server',
selfHostedName: 'BitBucket Server',
variant: 'bitbucket',
},
GITHUB: {
Expand Down Expand Up @@ -70,17 +70,17 @@ export function loginProviderToShortName(loginProvider?: string) {
}

export const LOGIN_PROVIDER_NAMES = {
gh: 'Github',
gh: 'GitHub',
bb: 'BitBucket',
gl: 'Gitlab',
ghe: 'Github Enterprise',
gle: 'Gitlab Enterprise',
gl: 'GitLab',
ghe: 'GitHub Enterprise',
gle: 'GitLab Enterprise',
bbs: 'BitBucket Server',
github: 'Github',
github: 'GitHub',
bitbucket: 'BitBucket',
gitlab: 'Gitlab',
github_enterprise: 'Github Enterprise',
gitlab_enterprise: 'Gitlab Enterprise',
gitlab: 'GitLab',
github_enterprise: 'GitHub Enterprise',
gitlab_enterprise: 'GitLab Enterprise',
bitbucket_server: 'BitBucket Server',
sentry: 'Sentry',
okta: 'Okta',
Expand All @@ -97,22 +97,22 @@ export function loginProviderToName(loginProvider?: string) {
}

export const LOGIN_PROVIDER_IMAGES = {
Github: githubLogo,
Gitlab: gitlabLogo,
GitHub: githubLogo,
GitLab: gitlabLogo,
BitBucket: bitbucketLogo,
'Github Enterprise': githubLogo,
'Gitlab Enterprise': gitlabLogo,
'GitHub Enterprise': githubLogo,
'GitLab Enterprise': gitlabLogo,
'BitBucket Server': bitbucketLogo,
Sentry: sentryLogo,
Okta: oktaLogo,
} as const

export const LOGIN_PROVIDER_DARK_MODE_IMAGES = {
Github: githubLogoWhite,
Gitlab: gitlabLogo,
GitHub: githubLogoWhite,
GitLab: gitlabLogo,
BitBucket: bitbucketLogo,
'Github Enterprise': githubLogoWhite,
'Gitlab Enterprise': gitlabLogo,
'GitHub Enterprise': githubLogoWhite,
'GitLab Enterprise': gitlabLogo,
'BitBucket Server': bitbucketLogo,
Sentry: sentryLogoWhite,
Okta: oktaLogo,
Expand Down
16 changes: 8 additions & 8 deletions src/shared/utils/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ vi.mock('config')
describe('providerToName', () => {
describe('when called with gh', () => {
it('returns Github', () => {
expect(providerToName('gh')).toBe('Github')
expect(providerToName('gh')).toBe('GitHub')
})
})

describe('when called with gl', () => {
it('returns Gitlab', () => {
expect(providerToName('gl')).toBe('Gitlab')
expect(providerToName('gl')).toBe('GitLab')
})
})

Expand All @@ -30,13 +30,13 @@ describe('providerToName', () => {

describe('when called with ghe', () => {
it('returns Github Enterprise', () => {
expect(providerToName('ghe')).toBe('Github Enterprise')
expect(providerToName('ghe')).toBe('GitHub Enterprise')
})
})

describe('when called with gle', () => {
it('returns Gitlab Enterprise', () => {
expect(providerToName('gle')).toBe('Gitlab Enterprise')
expect(providerToName('gle')).toBe('GitLab Enterprise')
})
})

Expand All @@ -48,13 +48,13 @@ describe('providerToName', () => {

describe('when called with Github', () => {
it('returns Github', () => {
expect(providerToName('github')).toBe('Github')
expect(providerToName('github')).toBe('GitHub')
})
})

describe('when called with Gitlab', () => {
it('returns Gitlab', () => {
expect(providerToName('gitlab')).toBe('Gitlab')
expect(providerToName('gitlab')).toBe('GitLab')
})
})

Expand All @@ -66,13 +66,13 @@ describe('providerToName', () => {

describe('when called with github_enterprise', () => {
it('returns Github Enterprise', () => {
expect(providerToName('github_enterprise')).toBe('Github Enterprise')
expect(providerToName('github_enterprise')).toBe('GitHub Enterprise')
})
})

describe('when called with gitlab-enterprise', () => {
it('returns Gitlab Enterprise', () => {
expect(providerToName('gitlab_enterprise')).toBe('Gitlab Enterprise')
expect(providerToName('gitlab_enterprise')).toBe('GitLab Enterprise')
})
})

Expand Down
Loading
Loading