mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-23 14:40:44 -06:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8aedbde36a |
@@ -6,8 +6,6 @@ import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants";
|
||||
import { getEnvironment, getEnvironments } from "@formbricks/lib/environment/service";
|
||||
import { getMembershipByUserIdOrganizationId } from "@formbricks/lib/membership/service";
|
||||
import {
|
||||
getMonthlyActiveOrganizationPeopleCount,
|
||||
getMonthlyOrganizationResponseCount,
|
||||
getOrganizationByEnvironmentId,
|
||||
getOrganizationsByUserId,
|
||||
} from "@formbricks/lib/organization/service";
|
||||
@@ -48,22 +46,11 @@ export const EnvironmentLayout = async ({ environmentId, session, children }: En
|
||||
const currentProductChannel =
|
||||
products.find((product) => product.id === environment.productId)?.config.channel ?? null;
|
||||
|
||||
const [peopleCount, responseCount] = await Promise.all([
|
||||
getMonthlyActiveOrganizationPeopleCount(organization.id),
|
||||
getMonthlyOrganizationResponseCount(organization.id),
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen min-h-screen flex-col overflow-hidden">
|
||||
<DevEnvironmentBanner environment={environment} />
|
||||
|
||||
{IS_FORMBRICKS_CLOUD && (
|
||||
<LimitsReachedBanner
|
||||
organization={organization}
|
||||
peopleCount={peopleCount}
|
||||
responseCount={responseCount}
|
||||
/>
|
||||
)}
|
||||
{IS_FORMBRICKS_CLOUD && <LimitsReachedBanner organization={organization} />}
|
||||
|
||||
<div className="flex h-full">
|
||||
<MainNavigation
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"data-migration:v2.1": "pnpm data-migration:extended-noCodeActions",
|
||||
"data-migration:adds_app_and_website_status_indicator": "ts-node ./data-migrations/20240610055828_adds_app_and_website_status_indicators/data-migration.ts",
|
||||
"data-migration:product-config": "ts-node ./data-migrations/20240612115151_adds_product_config/data-migration.ts",
|
||||
"data-migration:v2.2": "pnpm data-migration:adds_app_and_website_status_indicator && pnpm data-migration:product-config"
|
||||
"data-migration:v2.2": "pnpm data-migration:adds_app_and_website_status_indicator && pnpm data-migration:product-config && pnpm data-migration:pricing-v2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^5.15.1",
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import Link from "next/link";
|
||||
import {
|
||||
getMonthlyActiveOrganizationPeopleCount,
|
||||
getMonthlyOrganizationResponseCount,
|
||||
} from "@formbricks/lib/organization/service";
|
||||
import { TOrganization } from "@formbricks/types/organizations";
|
||||
|
||||
interface LimitsReachedBannerProps {
|
||||
organization: TOrganization;
|
||||
peopleCount: number;
|
||||
responseCount: number;
|
||||
}
|
||||
|
||||
export const LimitsReachedBanner = ({
|
||||
organization,
|
||||
peopleCount,
|
||||
responseCount,
|
||||
}: LimitsReachedBannerProps) => {
|
||||
export const LimitsReachedBanner = async ({ organization }: LimitsReachedBannerProps) => {
|
||||
const [peopleCount, responseCount] = await Promise.all([
|
||||
getMonthlyActiveOrganizationPeopleCount(organization.id),
|
||||
getMonthlyOrganizationResponseCount(organization.id),
|
||||
]);
|
||||
|
||||
const orgBillingPeopleLimit = organization.billing?.limits?.monthly?.miu;
|
||||
const orgBillingResponseLimit = organization.billing?.limits?.monthly?.responses;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user