Skip to content

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

chore: Clean up the flag for enabling Github integration on free plan (#44352)

Ivan Vasilov8e10546305cc
diff --git a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx
index 38e7fd21d6c..ed1468e76c4 100644
--- a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx
+++ b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx
@@ -65,12 +65,10 @@ const GITHUB_ICON = (
)
interface GitHubIntegrationConnectionFormProps {
- disabled?: boolean
connection?: GitHubConnection
}
export const GitHubIntegrationConnectionForm = ({
- disabled = false,
connection,
}: GitHubIntegrationConnectionFormProps) => {
const { data: selectedProject } = useSelectedProjectQuery()
@@ -761,7 +759,7 @@ export const GitHubIntegrationConnectionForm = ({
<Button
type="outline"
onClick={handleRemoveIntegration}
- disabled={isDeletingConnection}
+ disabled={isDeletingConnection || isCheckingBranch}
loading={isDeletingConnection}
>
Disable integration
@@ -773,7 +771,7 @@ export const GitHubIntegrationConnectionForm = ({
<Button
type="default"
onClick={() => githubSettingsForm.reset()}
- disabled={!canUpdateGitHubConnection}
+ disabled={!canUpdateGitHubConnection || isCheckingBranch}
>
Cancel
</Button>
@@ -790,7 +788,7 @@ export const GitHubIntegrationConnectionForm = ({
(!connection && !githubSettingsForm.getValues().repositoryId) ||
(connection && !githubSettingsForm.formState.isDirty)
}
- loading={isCheckingBranch || isLoading}
+ loading={isLoading}
>
{connection ? 'Save changes' : 'Enable integration'}
</Button>
diff --git a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
index 4d87acfc1be..a3f032197cf 100644
--- a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
+++ b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
@@ -1,5 +1,5 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { IS_PLATFORM, useFlag, useParams } from 'common'
+import { IS_PLATFORM, useParams } from 'common'
import { useMemo } from 'react'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
@@ -11,8 +11,6 @@ import {
ScaffoldSectionDetail,
} from '@/components/layouts/Scaffold'
import NoPermission from '@/components/ui/NoPermission'
-import { UpgradeToPro } from '@/components/ui/UpgradeToPro'
-import { useGitHubAuthorizationQuery } from '@/data/integrations/github-authorization-query'
import { useGitHubConnectionsQuery } from '@/data/integrations/github-connections-query'
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
@@ -35,12 +33,6 @@ export const GitHubSection = () => {
const { can: canReadGitHubConnection, isLoading: isLoadingPermissions } =
useAsyncCheckPermissions(PermissionAction.READ, 'integrations.github_connections')
- const isProPlanAndUp = organization?.plan?.id !== 'free'
- const promptProPlanUpgrade = IS_PLATFORM && !isProPlanAndUp
- const isGithubOnFreePlan = useFlag('githubOnFreePlan')
-
- const { data: gitHubAuthorization } = useGitHubAuthorizationQuery()
-
const { data: connections } = useGitHubConnectionsQuery(
{ organizationId: organization?.id },
{ enabled: !!projectRef && !!organization?.id }
@@ -67,38 +59,13 @@ export const GitHubSection = () => {
<NoPermission resourceText="view this organization's GitHub connections" />
) : (
<div className="space-y-6">
- <div>
- <h5 className="text-foreground mb-2">How does the GitHub integration work?</h5>
- <p className="text-foreground-light text-sm mb-6">
- Connecting to GitHub allows you to sync preview branches with a chosen GitHub
- branch, keep your production branch in sync, and automatically create preview
- branches for every pull request.
- </p>
-
- {!isGithubOnFreePlan && promptProPlanUpgrade && (
- <div className="mb-6">
- <UpgradeToPro
- layout="vertical"
- source="github-integration"
- featureProposition="use GitHub integrations"
- primaryText={`Upgrade to ${!!existingConnection ? 'manage' : 'unlock'} GitHub integration`}
- secondaryText="Connect your GitHub repository to automatically sync preview branches and deploy changes."
- />
- </div>
- )}
-
- {/* [Joshen] Show connection form only if one of the following is true:
- - GH has already been authorized OR
- - no GH authorization but on a paid plan OR
- - on a free plan but the GitHub integration flag is enabled
- */}
- {(!!gitHubAuthorization || !promptProPlanUpgrade || isGithubOnFreePlan) && (
- <GitHubIntegrationConnectionForm
- disabled={promptProPlanUpgrade}
- connection={existingConnection}
- />
- )}
- </div>
+ <h5 className="text-foreground mb-2">How does the GitHub integration work?</h5>
+ <p className="text-foreground-light text-sm mb-6">
+ Connecting to GitHub allows you to sync preview branches with a chosen GitHub
+ branch, keep your production branch in sync, and automatically create preview
+ branches for every pull request.
+ </p>
+ <GitHubIntegrationConnectionForm connection={existingConnection} />
</div>
)}
</ScaffoldSectionContent>