Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: remove AWS marketplace integration

Beng Eu564bfb8371cd
diff --git a/studio/components/interfaces/Organization/BillingSettings/AWSMarketplaceSubscription.tsx b/studio/components/interfaces/Organization/BillingSettings/AWSMarketplaceSubscription.tsx
deleted file mode 100644
index cf175daa039..00000000000
--- a/studio/components/interfaces/Organization/BillingSettings/AWSMarketplaceSubscription.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { FC } from 'react'
-import { Button, Typography } from '@supabase/ui'
-
-interface Props {
- organization: any
-}
-
-const AWSMarketplaceSubscription: FC<Props> = ({ organization }) => {
- return (
- <div className="flex flex-col space-y-4">
- <Typography.Text>
- This organization is subscribed via AWS Marketplace. The subscription expires on{' '}
- {organization.aws_marketplace.Entitlements[0].ExpirationDate.slice(0, 10)}.
- </Typography.Text>
-
- <Button>
- <a
- href="https://aws.amazon.com/marketplace/saas/ordering?productId=dc498450-cecf-44c2-8c99-c3c13f16e70a&offerId=d1htt16t3ygx5brtwhooms0ei"
- target="_blank"
- >
- Manage AWS Marketplace subscription
- </a>
- </Button>
- </div>
- )
-}
-
-export default AWSMarketplaceSubscription
diff --git a/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx b/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx
index d1b47ec790b..9a2430dab8a 100644
--- a/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx
+++ b/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx
@@ -4,7 +4,6 @@ import { useStore } from 'hooks'
import { API_URL } from 'lib/constants'
import { get } from 'lib/common/fetch'
-import AWSMarketplaceSubscription from './AWSMarketplaceSubscription'
import ProjectsSummary from './ProjectsSummary'
import CreditBalance from './CreditBalance'
import PaymentMethods from './PaymentMethods'
@@ -94,33 +93,27 @@ const BillingSettings: FC<Props> = ({ organization, projects = [] }) => {
return (
<article className="container my-4 max-w-4xl space-y-8">
- {organization.aws_marketplace ? (
- <AWSMarketplaceSubscription organization={organization} />
- ) : (
- <>
- <div className="space-y-8">
- <ProjectsSummary projects={projects} />
- <CreditBalance balance={balance} isCredit={isCredit} isDebt={isDebt} />
- <PaymentMethods
- loading={isLoadingCustomer || isLoadingPaymentMethods}
- defaultPaymentMethod={defaultPaymentMethod}
- paymentMethods={paymentMethods || []}
- onDefaultMethodUpdated={setCustomer}
- onPaymentMethodsDeleted={() => getPaymentMethods()}
- />
- <BillingAddress
- loading={isLoadingCustomer}
- address={customer?.address ?? {}}
- onAddressUpdated={(address: any) => setCustomer({ ...customer, address })}
- />
- <TaxID
- loading={isLoadingTaxIds}
- taxIds={taxIds || []}
- onTaxIdsUpdated={(ids: any) => setTaxIds(ids)}
- />
- </div>
- </>
- )}
+ <div className="space-y-8">
+ <ProjectsSummary projects={projects} />
+ <CreditBalance balance={balance} isCredit={isCredit} isDebt={isDebt} />
+ <PaymentMethods
+ loading={isLoadingCustomer || isLoadingPaymentMethods}
+ defaultPaymentMethod={defaultPaymentMethod}
+ paymentMethods={paymentMethods || []}
+ onDefaultMethodUpdated={setCustomer}
+ onPaymentMethodsDeleted={() => getPaymentMethods()}
+ />
+ <BillingAddress
+ loading={isLoadingCustomer}
+ address={customer?.address ?? {}}
+ onAddressUpdated={(address: any) => setCustomer({ ...customer, address })}
+ />
+ <TaxID
+ loading={isLoadingTaxIds}
+ taxIds={taxIds || []}
+ onTaxIdsUpdated={(ids: any) => setTaxIds(ids)}
+ />
+ </div>
</article>
)
}
diff --git a/studio/pages/account/associate.tsx b/studio/pages/account/associate.tsx
deleted file mode 100644
index e2d8c88c7f4..00000000000
--- a/studio/pages/account/associate.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { useEffect, useState } from 'react'
-import { useRouter } from 'next/router'
-import { Button, Select } from '@supabase/ui'
-import { observer } from 'mobx-react-lite'
-
-import { useStore } from 'hooks'
-import { API_URL } from 'lib/constants'
-import { get, post } from 'lib/common/fetch'
-
-const Associate = observer(() => {
- const { ui, app } = useStore()
- const sortedOrganizations = app.organizations.list()
-
- const [awsMarketplace, setAwsMarketplace] = useState<any>()
- const [error, setError] = useState<any>('')
- const [loading, setLoading] = useState<any>(true)
- const [organizationSlug, setOrganizationSlug] = useState<any>('')
- const [saving, setSaving] = useState<any>(false)
- const router = useRouter()
-
- const handleChange = (e: any) => {
- setOrganizationSlug(e.target.value)
- }
-
- const onSave = async () => {
- if (organizationSlug === '') {
- setError('Please select an organization')
- return
- }
- setSaving(true)
- const { error } = await post(
- `${API_URL}/organizations/${organizationSlug}/associate`,
- awsMarketplace
- )
- if (error) {
- setError(error.message)
- }
- setSaving(false)
- if (!error) {
- router.push('/')
- }
- }
-
- useEffect(() => {
- const getAwsMarketplaceInfo = async () => {
- try {
- setLoading(true)
- const xAmznMarketplaceToken = router.query['x-amzn-marketplace-token']
- if (typeof xAmznMarketplaceToken !== 'string') {
- throw new Error('Missing or multiple x-amzn-marketplace-token')
- }
- const response = await get(
- `${API_URL}/organizations/aws-marketplace?x-amzn-marketplace-token=${encodeURIComponent(
- xAmznMarketplaceToken
- )}`
- )
- if (response.error) {
- throw response.error
- }
- if (response.slug) {
- setOrganizationSlug(response.slug)
- }
- setAwsMarketplace(response.awsMarketplace)
- setLoading(false)
- if (sortedOrganizations.length === 1) {
- onSave()
- }
- } catch (error: any) {
- ui.setNotification({
- category: 'error',
- message: `Failed to get AWS Marketplace Information: ${error.message}`,
- })
- }
- }
- getAwsMarketplaceInfo()
- }, [])
-
- return (
- <div className="flex justify-center">
- {!loading && (
- <div>
- <Select
- className="my-4"
- error={error}
- label="Select an organization to associate AWS Marketplace subscription with:"
- onChange={handleChange}
- value={organizationSlug}
- >
- <Select.Option key="" value="">
- {' '}
- </Select.Option>
- {sortedOrganizations.map((organization: any) => (
- <Select.Option key={organization.slug} value={organization.slug}>
- {organization.name}
- </Select.Option>
- ))}
- </Select>
- <Button type="primary" loading={saving} onClick={onSave}>
- Save
- </Button>
- </div>
- )}
- </div>
- )
-})
-
-export default Associate
diff --git a/studio/pages/index.tsx b/studio/pages/index.tsx
index c913013180d..45826dc1282 100644
--- a/studio/pages/index.tsx
+++ b/studio/pages/index.tsx
@@ -105,9 +105,7 @@ Home.getLayout = (page) => <IndexLayout>{page}</IndexLayout>
export default observer(Home)
// detect for redirect from 3rd party service like vercel, aws...
-function isRedirectFromThirdPartyService(router: NextRouter) {
- return router.query.next !== undefined || router.query['x-amzn-marketplace-token'] !== undefined
-}
+const isRedirectFromThirdPartyService = (router: NextRouter) => router.query.next !== undefined
const UnauthorizedLanding = () => {
const router = useRouter()
@@ -148,8 +146,6 @@ const IndexLayout = withAuth(
router.push(`/vercel/integrate?${params.toString()}`)
} else if (router.query?.next?.includes('new-project')) {
router.push('/new/project')
- } else if (router.query['x-amzn-marketplace-token'] != undefined) {
- router.push(`/account/associate?${params.toString()}`)
} else if (
typeof router.query?.next === 'string' &&
router.query?.next?.startsWith('project/_/')