Skip to content

Commit

Permalink
chore: Upgrade form TS Conversion (#3505)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-sentry authored Nov 15, 2024
1 parent 848db44 commit 3133f8c
Show file tree
Hide file tree
Showing 18 changed files with 148 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom'

import { useLocationParams } from 'services/navigation'
import { useResyncUser } from 'services/user'
import { providerToName } from 'shared/utils'
import { providerToName } from 'shared/utils/provider'
import Icon from 'ui/Icon'
import Spinner from 'ui/Spinner'
import TopBanner from 'ui/TopBanner'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PropType from 'prop-types'
import { useParams } from 'react-router-dom'

import { useAccountDetails } from 'services/account'
import { providerToName } from 'shared/utils'
import { providerToName } from 'shared/utils/provider'
import A from 'ui/A'
import Banner from 'ui/Banner'
import BannerContent from 'ui/Banner/BannerContent'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useParams } from 'react-router-dom'

import { getProviderCommitURL, getProviderPullURL } from 'shared/utils'
import { formatTimeToNow } from 'shared/utils/dates'
import { getProviderCommitURL, getProviderPullURL } from 'shared/utils/provider'
import A from 'ui/A'
import CIStatusLabel from 'ui/CIStatus'
import Icon from 'ui/Icon'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useParams } from 'react-router-dom'

import { getProviderCommitURL, getProviderPullURL } from 'shared/utils'
import { formatTimeToNow } from 'shared/utils/dates'
import { getProviderCommitURL, getProviderPullURL } from 'shared/utils/provider'
import A from 'ui/A'
import CIStatusLabel from 'ui/CIStatus'
import Icon from 'ui/Icon'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CommitDetailPage/Header/PullLabel/PullLabel.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types'

import { providerToName } from 'shared/utils'
import { providerToName } from 'shared/utils/provider'
import A from 'ui/A'
import Icon from 'ui/Icon'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom'
import { useResyncUser } from 'services/user'
import { Provider } from 'shared/api/helpers'
import AppInstallModal from 'shared/AppInstallModal'
import { providerToName } from 'shared/utils'
import { providerToName } from 'shared/utils/provider'
import A from 'ui/A'
import Banner from 'ui/Banner'
import BannerContent from 'ui/Banner/BannerContent'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ProPlanDetails() {
{scheduledPhase && (
<ScheduledPlanDetails scheduledPhase={scheduledPhase} />
)}
{shouldRenderCancelLink(cancelAtPeriodEnd, plan, trialStatus) && (
{shouldRenderCancelLink({ cancelAtPeriodEnd, plan, trialStatus }) && (
<A
to={{ pageName: 'cancelOrgPlan' }}
variant="black"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function SentryPlanDetails() {
</div>
{/* TODO_UPGRADE_FORM: Note that there never was schedules shown here like it is in the pro plan details page. This
is a bug imo and needs to be here in a future ticket */}
{shouldRenderCancelLink(cancelAtPeriodEnd, plan, trialStatus) && (
{shouldRenderCancelLink({ cancelAtPeriodEnd, plan, trialStatus }) && (
<A
to={{ pageName: 'cancelOrgPlan' }}
variant="black"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function TeamPlanDetails() {
{scheduledPhase && (
<ScheduledPlanDetails scheduledPhase={scheduledPhase} />
)}
{shouldRenderCancelLink(cancelAtPeriodEnd, plan, trialStatus) && (
{shouldRenderCancelLink({ cancelAtPeriodEnd, plan, trialStatus }) && (
<A
to={{ pageName: 'cancelOrgPlan' }}
variant="black"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import PropTypes from 'prop-types'
import qs from 'qs'
import { useLocation, useParams } from 'react-router-dom'

import { getProviderCommitURL } from 'shared/utils'
import { deleteDuplicateCFFUploads } from 'shared/utils/extractUploads'
import { mapEdges } from 'shared/utils/graphql'
import { getProviderCommitURL } from 'shared/utils/provider'
import A from 'ui/A'
import Icon from 'ui/Icon'
import Summary from 'ui/Summary'
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 @@ -12,7 +12,7 @@ import { useNavLinks } from 'services/navigation'
import { useRepo } from 'services/repo'
import { Provider } from 'shared/api/helpers'
import { useRedirect } from 'shared/useRedirect'
import { providerToName } from 'shared/utils'
import { providerToName } from 'shared/utils/provider'
import A from 'ui/A'
import { Card } from 'ui/Card'
import { RadioTileGroup } from 'ui/RadioTileGroup'
Expand Down
2 changes: 2 additions & 0 deletions src/services/account/usePlanData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const TrialStatuses = {
CANNOT_TRIAL: 'CANNOT_TRIAL',
} as const

export type TrialStatus = (typeof TrialStatuses)[keyof typeof TrialStatuses]

const PlanSchema = z.object({
baseUnitPrice: z.number(),
benefits: z.array(z.string()),
Expand Down
2 changes: 1 addition & 1 deletion src/services/charts/useSunburstCoverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'

import Api from 'shared/api'
import { Provider } from 'shared/api/helpers'
import { providerToInternalProvider } from 'shared/utils'
import { providerToInternalProvider } from 'shared/utils/provider'

interface SunburstCoverageArgs {
provider: Provider
Expand Down
2 changes: 1 addition & 1 deletion src/services/repo/useUpdateRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
import { useParams } from 'react-router-dom'

import Api from 'shared/api'
import { providerToInternalProvider } from 'shared/utils'
import { providerToInternalProvider } from 'shared/utils/provider'

function getRepoPath({ provider, owner, repo }) {
return `/${provider}/${owner}/repos/${repo}/`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import config from 'config'
import { useLocationParams } from 'services/navigation'
import { Provider } from 'shared/api/helpers'
import AppInstallModal from 'shared/AppInstallModal'
import { providerToName } from 'shared/utils'
import { providerToName } from 'shared/utils/provider'
import Button from 'ui/Button'
import Icon from 'ui/Icon'
import TopBanner, { saveToLocalStorage } from 'ui/TopBanner'
Expand Down
1 change: 0 additions & 1 deletion src/shared/utils/index.js

This file was deleted.

Loading

0 comments on commit 3133f8c

Please sign in to comment.