mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
Whenever customers run into their 2 Free Plan project limit, we were previously just listed the affected members: <img width="1044" height="566" alt="image" src="https://github.com/user-attachments/assets/d1c1327d-2532-4d8e-8af2-425da9ce1ee5" /> While this lists the affected members, it is pretty unclear which organizations are affected or which projects contribute to this and what the best course of action is. This PR revamps all components that are displayed in this situation (new project launch, downgrade to Free, project unpause) to show the affected organizations + projects primarily and give more actionable tips: <img width="1014" height="638" alt="Screenshot 2026-11-11 at 3 57 45 PM (1)" src="https://github.com/user-attachments/assets/ae38f71d-bbde-4181-a623-24bef778afee" /> <img width="768" height="152" alt="image" src="https://github.com/user-attachments/assets/b3b0efd7-678b-4ac0-9602-4cc5d735a9aa" /> --- Additionally, this contains small improvements to the downgrade flow: - Rename button to "Downgrade Now" as opposed to "Confirm" to make it more clear that this is immediate - Explicitly mention downgrades are immediate and there is still another invoice for unbilled usage - Larger modal width for improved readability
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
import { useParams } from 'common'
|
|
import { Admonition } from 'ui-patterns/Admonition'
|
|
|
|
import { ExceedFreeProjectLimitMembers } from '@/components/ui/ExceedFreeProjectLimitMembers'
|
|
import { FreeProjectLimitActions } from '@/components/ui/FreeProjectLimitActions'
|
|
import Panel from '@/components/ui/Panel'
|
|
import { UpgradePlanButton } from '@/components/ui/UpgradePlanButton'
|
|
import type { MemberWithFreeProjectLimit } from '@/data/organizations/free-project-limit-check-query'
|
|
import { useOrganizationMembersQuery } from '@/data/organizations/organization-members-query'
|
|
|
|
interface FreeProjectLimitWarningProps {
|
|
membersExceededLimit: MemberWithFreeProjectLimit[]
|
|
}
|
|
|
|
export const FreeProjectLimitWarning = ({ membersExceededLimit }: FreeProjectLimitWarningProps) => {
|
|
const { slug } = useParams()
|
|
const { data: orgMembers } = useOrganizationMembersQuery({ slug })
|
|
const hasMultipleMembers = (orgMembers ?? []).filter((member) => !member.invited_id).length > 1
|
|
|
|
return (
|
|
<Panel.Content>
|
|
<Admonition
|
|
type="default"
|
|
title="Unable to create project under Free Plan organization"
|
|
description={
|
|
<div className="space-y-3">
|
|
<p className="text-sm leading-normal">
|
|
Owners and administrators are limited in how many active Free Plan projects they can
|
|
have across all organizations.
|
|
</p>
|
|
|
|
<ExceedFreeProjectLimitMembers membersExceededLimit={membersExceededLimit} />
|
|
|
|
<FreeProjectLimitActions
|
|
goal="create a free project in this organization"
|
|
hasMultipleMembers={hasMultipleMembers}
|
|
/>
|
|
|
|
<div className="mt-4">
|
|
<UpgradePlanButton
|
|
source="freeProjectLimitWarning"
|
|
featureProposition="create more projects"
|
|
/>
|
|
</div>
|
|
</div>
|
|
}
|
|
/>
|
|
</Panel.Content>
|
|
)
|
|
}
|