Remove responses limit for link surveys on free plan (#686)

This commit is contained in:
Matti Nannt
2023-08-14 09:50:58 +02:00
committed by GitHub
parent 315467ef3f
commit d83c530012
3 changed files with 6 additions and 27 deletions

View File

@@ -51,7 +51,8 @@ export default function PricingTable({ environmentId, session }: PricingTablePro
"Unlimited surveys",
"Unlimited team members",
"Remove branding",
"100 responses per survey",
"Unlimited link survey responses",
"100 responses per web-app survey",
"Granular targeting",
"In-product surveys",
"Link surveys",

View File

@@ -13,7 +13,10 @@ export const getAnalysisData = async (surveyId: string, environmentId: string) =
if (!team) throw new Error(`Team not found for environment: ${environmentId}`);
if (survey.environmentId !== environmentId) throw new Error(`Survey not found: ${surveyId}`);
const limitReached =
IS_FORMBRICKS_CLOUD && team.plan === "free" && allResponses.length >= RESPONSES_LIMIT_FREE;
IS_FORMBRICKS_CLOUD &&
team.plan === "free" &&
survey.type === "web" &&
allResponses.length >= RESPONSES_LIMIT_FREE;
const responses = limitReached ? allResponses.slice(0, RESPONSES_LIMIT_FREE) : allResponses;
const responsesCount = allResponses.length;

View File

@@ -1,25 +0,0 @@
import Script from "next/script";
declare global {
namespace JSX {
interface IntrinsicElements {
["stripe-pricing-table"]: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
}
}
}
export default function BillingPage({ organisationId }: { organisationId: string }) {
if (!process.env.NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID || !process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY) {
return <div>Stripe environment variables not set</div>;
}
return (
<>
<Script async src="https://js.stripe.com/v3/pricing-table.js" />
<stripe-pricing-table
pricing-table-id={process.env.NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID}
publishable-key={process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY}
client-reference-id={organisationId}></stripe-pricing-table>
</>
);
}