fix some errors

This commit is contained in:
miloschwartz
2026-02-09 20:23:55 -08:00
parent ba5ae6ed04
commit ed40eae655
4 changed files with 12 additions and 46 deletions

View File

@@ -45,7 +45,7 @@ export function verifyValidSubscription(tiers: Tier[]) {
} }
const { tier, active } = await getOrgTierData(orgId); const { tier, active } = await getOrgTierData(orgId);
const isTier = tiers.includes(tier || ""); const isTier = tiers.includes(tier as Tier);
if (!active) { if (!active) {
return next( return next(
createHttpError( createHttpError(

View File

@@ -90,7 +90,7 @@ export async function handleSubscriptionUpdated(
const itemsToUpsert = fullSubscription.items.data.map((item) => { const itemsToUpsert = fullSubscription.items.data.map((item) => {
// Try to get featureId from price // Try to get featureId from price
let featureId: string | null = getFeatureIdByPriceId(item.price.id) || null; let featureId: string | null = getFeatureIdByPriceId(item.price.id) || null;
// If no match, try to preserve existing featureId // If no match, try to preserve existing featureId
if (!featureId) { if (!featureId) {
const existingItem = existingItems.find( const existingItem = existingItems.find(

View File

@@ -37,10 +37,6 @@ import { cn } from "@app/lib/cn";
import { import {
CreditCard, CreditCard,
ExternalLink, ExternalLink,
Users,
Globe,
Server,
Layout,
Check Check
} from "lucide-react"; } from "lucide-react";
import { import {
@@ -50,7 +46,6 @@ import {
import { useTranslations } from "use-intl"; import { useTranslations } from "use-intl";
import Link from "next/link"; import Link from "next/link";
import { Tier } from "@server/types/Tiers"; import { Tier } from "@server/types/Tiers";
import { w } from "@faker-js/faker/dist/airline-DF6RqYmq";
// Plan tier definitions matching the mockup // Plan tier definitions matching the mockup
type PlanId = "free" | "homelab" | "team" | "business" | "enterprise"; type PlanId = "free" | "homelab" | "team" | "business" | "enterprise";
@@ -63,35 +58,6 @@ interface PlanOption {
tierType: Tier | null; tierType: Tier | null;
} }
// Tier limits for display in confirmation dialog
interface TierLimits {
sites: number;
users: number;
domains: number;
remoteNodes: number;
}
const tierLimits: Record<Tier, TierLimits> = {
tier1: {
sites: 3,
users: 3,
domains: 3,
remoteNodes: 1
},
tier2: {
sites: 10,
users: 150,
domains: 250,
remoteNodes: 5
},
tier3: {
sites: 10,
users: 150,
domains: 250,
remoteNodes: 5
}
};
const planOptions: PlanOption[] = [ const planOptions: PlanOption[] = [
{ {
id: "free", id: "free",

View File

@@ -616,7 +616,7 @@ export default function GeneralPage() {
{t("diskEncrypted")} {t("diskEncrypted")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.diskEncrypted .diskEncrypted
@@ -634,7 +634,7 @@ export default function GeneralPage() {
{t("firewallEnabled")} {t("firewallEnabled")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.firewallEnabled .firewallEnabled
@@ -653,7 +653,7 @@ export default function GeneralPage() {
{t("autoUpdatesEnabled")} {t("autoUpdatesEnabled")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.autoUpdatesEnabled .autoUpdatesEnabled
@@ -671,7 +671,7 @@ export default function GeneralPage() {
{t("tpmAvailable")} {t("tpmAvailable")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.tpmAvailable .tpmAvailable
@@ -693,7 +693,7 @@ export default function GeneralPage() {
)} )}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.windowsAntivirusEnabled .windowsAntivirusEnabled
@@ -711,7 +711,7 @@ export default function GeneralPage() {
{t("macosSipEnabled")} {t("macosSipEnabled")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.macosSipEnabled .macosSipEnabled
@@ -733,7 +733,7 @@ export default function GeneralPage() {
)} )}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.macosGatekeeperEnabled .macosGatekeeperEnabled
@@ -755,7 +755,7 @@ export default function GeneralPage() {
)} )}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.macosFirewallStealthMode .macosFirewallStealthMode
@@ -774,7 +774,7 @@ export default function GeneralPage() {
{t("linuxAppArmorEnabled")} {t("linuxAppArmorEnabled")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.linuxAppArmorEnabled .linuxAppArmorEnabled
@@ -793,7 +793,7 @@ export default function GeneralPage() {
{t("linuxSELinuxEnabled")} {t("linuxSELinuxEnabled")}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
{isPaidUser {isPaidUser(tierMatrix.devicePosture)
? formatPostureValue( ? formatPostureValue(
client.posture client.posture
.linuxSELinuxEnabled .linuxSELinuxEnabled