Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,7 @@ gcloud.json
keys.json

# Playwright MCP
.playwright-mcp/*
.playwright-mcp/*

# Application
**/.superset/**
14 changes: 4 additions & 10 deletions apps/docs/components/GuidesSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ interface TOCHeader {

function AiTools({ className }: { className?: string }) {
const [copied, setCopied] = useState(false)
let url = ''

// Safe check for server side rendering.
try {
const urlParts = new URL(`${window.location}`)
url = urlParts.origin + urlParts.pathname
} catch (error) {}
const path = usePathname()

async function copyMarkdown() {
const mdUrl = `${url}.md`
const mdUrl = `/docs/${path}.md`

try {
const res = await fetch(mdUrl)
Expand Down Expand Up @@ -62,7 +56,7 @@ function AiTools({ className }: { className?: string }) {
{copied ? 'Copied!' : 'Copy as Markdown'}
</button>
<a
href={`https://chatgpt.com/?hint=search&q=Read from ${url} so I can ask questions about its contents`}
href={`https://chatgpt.com/?hint=search&q=Read from https://supabase.com/docs${path} so I can ask questions about its contents`}
target="_blank"
rel="noreferrer noopener"
className="flex items-center gap-1.5 text-xs text-foreground-lighter hover:text-foreground transition-colors"
Expand All @@ -71,7 +65,7 @@ function AiTools({ className }: { className?: string }) {
Ask ChatGPT
</a>
<a
href={`https://claude.ai/new?q=Read from ${url} so I can ask questions about its contents`}
href={`https://claude.ai/new?q=Read from https://supabase.com/docs${path} so I can ask questions about its contents`}
target="_blank"
rel="noreferrer noopener"
className="flex items-center gap-1.5 text-xs text-foreground-lighter hover:text-foreground transition-colors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Panel from 'components/ui/Panel'
import { useCloneBackupsQuery } from 'data/projects/clone-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { Badge, Button } from 'ui'
import { TimestampInfo } from 'ui-patterns'
Expand All @@ -9,17 +8,14 @@ import { BackupsEmpty } from '../BackupsEmpty'
interface BackupsListProps {
onSelectRestore: (id: number) => void
disabled?: boolean
hasAccess?: boolean
}

export const BackupsList = ({ onSelectRestore, disabled }: BackupsListProps) => {
export const BackupsList = ({ onSelectRestore, disabled, hasAccess }: BackupsListProps) => {
const { data: project } = useSelectedProjectQuery()
const { data: organization } = useSelectedOrganizationQuery()

const isFreePlan = organization?.plan?.id === 'free'

const { data: cloneBackups } = useCloneBackupsQuery(
{ projectRef: project?.ref },
{ enabled: !isFreePlan }
{ enabled: hasAccess }
)

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { z } from 'zod'
import { PasswordStrengthBar } from 'components/ui/PasswordStrengthBar'
import { useProjectCloneMutation } from 'data/projects/clone-mutation'
import { useCloneBackupsQuery } from 'data/projects/clone-query'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { passwordStrength, PasswordStrengthScore } from 'lib/password-strength'
import { generateStrongPassword } from 'lib/project'
Expand Down Expand Up @@ -37,6 +36,7 @@ interface CreateNewProjectDialogProps {
onOpenChange: (value: boolean) => void
onCloneSuccess: () => void
additionalMonthlySpend: NewProjectPrice
hasAccess?: boolean
}

export const CreateNewProjectDialog = ({
Expand All @@ -46,10 +46,9 @@ export const CreateNewProjectDialog = ({
onOpenChange,
onCloneSuccess,
additionalMonthlySpend,
hasAccess,
}: CreateNewProjectDialogProps) => {
const { data: project } = useSelectedProjectQuery()
const { data: organization } = useSelectedOrganizationQuery()

const [passwordStrengthScore, setPasswordStrengthScore] = useState(0)
const [passwordStrengthMessage, setPasswordStrengthMessage] = useState('')

Expand All @@ -66,11 +65,9 @@ export const CreateNewProjectDialog = ({
},
})

const isFreePlan = organization?.plan?.id === 'free'

const { data: cloneBackups } = useCloneBackupsQuery(
{ projectRef: project?.ref },
{ enabled: !isFreePlan }
{ enabled: hasAccess }
)
const hasPITREnabled = cloneBackups?.pitr_enabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { UpgradeToPro } from 'components/ui/UpgradeToPro'
import { useDiskAttributesQuery } from 'data/config/disk-attributes-query'
import { useCloneBackupsQuery } from 'data/projects/clone-query'
import { useCloneStatusQuery } from 'data/projects/clone-status-query'
import { useCheckEntitlements } from 'hooks/misc/useCheckEntitlements'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import {
Expand All @@ -35,7 +36,8 @@ import { PreviousRestoreItem } from './PreviousRestoreItem'
export const RestoreToNewProject = () => {
const { data: project } = useSelectedProjectQuery()
const { data: organization } = useSelectedOrganizationQuery()
const isFreePlan = organization?.plan?.id === 'free'
const { hasAccess: hasAccessToRestoreToNewProject, isLoading: isLoadingEntitlement } =
useCheckEntitlements('backup.restore_to_new_project')
const isOrioleDb = useIsOrioleDb()
const isAwsK8s = useIsAwsK8sCloudProvider()

Expand All @@ -50,7 +52,10 @@ export const RestoreToNewProject = () => {
error,
isPending: cloneBackupsLoading,
isError,
} = useCloneBackupsQuery({ projectRef: project?.ref }, { enabled: !isFreePlan })
} = useCloneBackupsQuery(
{ projectRef: project?.ref },
{ enabled: hasAccessToRestoreToNewProject }
)

const isActiveHealthy = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY

Expand Down Expand Up @@ -102,7 +107,11 @@ export const RestoreToNewProject = () => {
const isRestoring = previousClones?.some((c) => c.status === 'IN_PROGRESS')
const restoringClone = previousClones?.find((c) => c.status === 'IN_PROGRESS')

if (isFreePlan) {
if (isLoadingEntitlement) {
return <GenericSkeletonLoader />
}

if (!hasAccessToRestoreToNewProject) {
return (
<UpgradeToPro
buttonText="Upgrade"
Expand Down Expand Up @@ -256,6 +265,7 @@ export const RestoreToNewProject = () => {
selectedBackupId={selectedBackupId}
recoveryTimeTarget={recoveryTimeTarget}
additionalMonthlySpend={additionalMonthlySpend}
hasAccess={hasAccessToRestoreToNewProject}
onOpenChange={setShowNewProjectDialog}
onCloneSuccess={() => {
refetchCloneStatus()
Expand Down Expand Up @@ -307,6 +317,7 @@ export const RestoreToNewProject = () => {
) : (
<BackupsList
disabled={isRestoring}
hasAccess={hasAccessToRestoreToNewProject}
onSelectRestore={(id) => {
setSelectedBackupId(id)
setShowConfirmationDialog(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { InlineLink } from 'components/ui/InlineLink'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import * as z from 'zod'
import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'

const GITHUB_ICON = (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96" className="w-6">
Expand Down Expand Up @@ -79,8 +80,10 @@ const GitHubIntegrationConnectionForm = ({
const [repoComboBoxOpen, setRepoComboboxOpen] = useState(false)
const isParentProject = !selectedProject?.parent_project_ref

const isProPlanAndUp = selectedOrganization?.plan?.id !== 'free'
const promptProPlanUpgrade = IS_PLATFORM && !isProPlanAndUp
const { hasAccess: hasAccessToGitHubIntegration, isLoading: isLoadingEntitlements } =
useCheckEntitlements('integrations.github_connections')
const promptProPlanUpgrade =
IS_PLATFORM && !isLoadingEntitlements && !hasAccessToGitHubIntegration

const { can: canUpdateGitHubConnection } = useAsyncCheckPermissions(
PermissionAction.UPDATE,
Expand Down Expand Up @@ -425,7 +428,8 @@ const GitHubIntegrationConnectionForm = ({
)
}

const isLoading = isCreatingConnection || isUpdatingConnection || isDeletingConnection
const isLoading =
isLoadingEntitlements || isCreatingConnection || isUpdatingConnection || isDeletingConnection

return (
<>
Expand Down
6 changes: 3 additions & 3 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "next dev -p 8082",
"dev": "next dev -p ${STUDIO_PORT:-8082}",
"build": "next build && if [ \"$SKIP_ASSET_UPLOAD\" != \"1\" ]; then ./../../scripts/upload-static-assets.sh; fi",
"start": "next start -p 8082",
"lint": "eslint .",
Expand Down Expand Up @@ -57,8 +57,8 @@
"@stripe/react-stripe-js": "^3.7.0",
"@stripe/stripe-js": "^7.5.0",
"@supabase/auth-js": "catalog:",
"@supabase/mcp-server-supabase": "^0.6.3",
"@supabase/mcp-utils": "^0.3.2",
"@supabase/mcp-server-supabase": "^0.7.0",
"@supabase/mcp-utils": "^0.4.0",
"@supabase/pg-meta": "workspace:*",
"@supabase/realtime-js": "catalog:",
"@supabase/shared-types": "0.1.84",
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading