Skip to content

Commit 34a1906

Browse files
Merge branch 'main' into cy/ts_shared_p5
2 parents 5e1b215 + c05416a commit 34a1906

File tree

83 files changed

+753
-600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+753
-600
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ e75fbde94a6ef3d80c5696255b742e9264ec52cf
99
# Add tailwind and tanstack query lints + lint fixes
1010

1111
ab88e32678c4a1a054a8c525a9f346d5a984e1c9
12+
13+
# Fixing lint errors - https://github.com/codecov/gazebo/pull/3524
14+
0899f21d7fe6eae4248cce5fdd65c7043f4e247f

src/pages/AccountSettings/AccountSettings.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { SentryRoute } from 'sentry'
88
import SidebarLayout from 'layouts/SidebarLayout'
99
import { usePlanData } from 'services/account'
1010
import { useIsCurrentUserAnAdmin, useUser } from 'services/user'
11-
import { isEnterprisePlan } from 'shared/utils/billing'
1211
import LoadingLogo from 'ui/LoadingLogo'
1312

1413
import AccountSettingsSideMenu from './AccountSettingsSideMenu'
@@ -34,7 +33,7 @@ function AccountSettings() {
3433
const { data: currentUser } = useUser()
3534

3635
const { data } = usePlanData({ provider, owner })
37-
const viewOktaAccess = isEnterprisePlan(data?.plan?.value)
36+
const viewOktaAccess = data?.plan?.isEnterprisePlan
3837

3938
const isViewingPersonalSettings =
4039
currentUser?.user?.username?.toLowerCase() === owner?.toLowerCase()

src/pages/AccountSettings/AccountSettings.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ describe('AccountSettings', () => {
161161
plan: {
162162
...mockPlanData,
163163
value: planValue,
164+
isEnterprisePlan: planValue === Plans.USERS_ENTERPRISEM,
164165
},
165166
},
166167
},

src/pages/AccountSettings/AccountSettingsSideMenu.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import config from 'config'
44

55
import { usePlanData } from 'services/account'
66
import { useIsCurrentUserAnAdmin, useUser } from 'services/user'
7-
import { isEnterprisePlan } from 'shared/utils/billing'
87
import Sidemenu from 'ui/Sidemenu'
98

109
function defaultLinks({ internalAccessTab, viewOktaAccess }) {
@@ -66,7 +65,7 @@ function AccountSettingsSideMenu() {
6665
currentUser?.user?.username?.toLowerCase() === owner?.toLowerCase()
6766

6867
const { data } = usePlanData({ provider, owner })
69-
const viewOktaAccess = isEnterprisePlan(data?.plan?.value)
68+
const viewOktaAccess = data?.plan?.isEnterprisePlan
7069

7170
const links = generateLinks({
7271
isAdmin,

src/pages/AccountSettings/AccountSettingsSideMenu.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ describe('AccountSettingsSideMenu', () => {
149149
plan: {
150150
...mockPlanData,
151151
value: planValue,
152+
isEnterprisePlan: planValue === Plans.USERS_ENTERPRISEM,
152153
},
153154
},
154155
},

src/pages/CommitDetailPage/CommitCoverage/UploadsCard/RenderError.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const FlagError = () => (
123123
interface RenderErrorProps {
124124
errors: (UploadErrorObject | null)[]
125125
state: (typeof UploadStateEnum)[keyof typeof UploadStateEnum]
126-
flags: string[] | null
126+
flags: string[] | null | undefined
127127
}
128128

129129
const RenderError = ({ errors, state, flags }: RenderErrorProps) => {

src/pages/DefaultOrgSelector/DefaultOrgSelector.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ describe('DefaultOrgSelector', () => {
212212
hasPrivateRepos: privateRepos,
213213
plan: {
214214
...mockTrialData,
215+
isEnterprisePlan: false,
215216
trialStatus,
216217
value,
217218
},

src/pages/EnterpriseLandingPage/EnterpriseLandingPage.test.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2+
import {
3+
QueryClientProvider as QueryClientProviderV5,
4+
QueryClient as QueryClientV5,
5+
} from '@tanstack/react-queryV5'
26
import { render, screen } from '@testing-library/react'
37
import { graphql, HttpResponse } from 'msw'
48
import { setupServer } from 'msw/node'
@@ -11,16 +15,23 @@ import EnterpriseLandingPage from './EnterpriseLandingPage'
1115
vi.mock('config')
1216

1317
const server = setupServer()
14-
const queryClient = new QueryClient()
18+
const queryClient = new QueryClient({
19+
defaultOptions: { queries: { retry: false } },
20+
})
21+
const queryClientV5 = new QueryClientV5({
22+
defaultOptions: { queries: { retry: false } },
23+
})
1524

1625
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => (
17-
<QueryClientProvider client={queryClient}>
18-
<ThemeContextProvider>
19-
<MemoryRouter initialEntries={['/']}>
20-
<Route path="/">{children}</Route>
21-
</MemoryRouter>
22-
</ThemeContextProvider>
23-
</QueryClientProvider>
26+
<QueryClientProviderV5 client={queryClientV5}>
27+
<QueryClientProvider client={queryClient}>
28+
<ThemeContextProvider>
29+
<MemoryRouter initialEntries={['/']}>
30+
<Route path="/">{children}</Route>
31+
</MemoryRouter>
32+
</ThemeContextProvider>
33+
</QueryClientProvider>
34+
</QueryClientProviderV5>
2435
)
2536

2637
const mockServiceProviders = {
@@ -43,6 +54,7 @@ beforeAll(() => {
4354

4455
afterEach(() => {
4556
queryClient.clear()
57+
queryClientV5.clear()
4658
server.resetHandlers()
4759
})
4860

src/pages/EnterpriseLandingPage/EnterpriseLandingPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { useSuspenseQuery as useSuspenseQueryV5 } from '@tanstack/react-queryV5'
2+
13
import rocketImg from 'assets/enterprise-rocket.png'
2-
import { useLoginProviders } from 'services/config/useLoginProviders'
4+
import { LoginProvidersQueryOpts } from 'services/config/LoginProvidersQueryOpts'
35
import { LoginProvidersEnum } from 'shared/utils/loginProviders'
46

57
import ProviderCard from './ProviderCard/ProviderCard'
@@ -8,7 +10,7 @@ import { useEnterpriseRedirect } from './useEnterpriseRedirect'
810
function EnterpriseLandingPage() {
911
useEnterpriseRedirect()
1012

11-
const { data } = useLoginProviders()
13+
const { data } = useSuspenseQueryV5(LoginProvidersQueryOpts())
1214

1315
return (
1416
<div className="flex flex-col gap-5">

src/pages/EnterpriseLandingPage/ProviderCard/ProviderCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EnterpriseLoginProviders } from 'services/config/useLoginProviders'
1+
import { EnterpriseLoginProviders } from 'services/config/LoginProvidersQueryOpts'
22
import { Theme, useThemeContext } from 'shared/ThemeContext'
33
import {
44
loginProviderImage,

0 commit comments

Comments
 (0)