From 820f66e58fba6d72c7ba36cc707cb6674dd8ef14 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 11 Jun 2026 16:01:32 -0700 Subject: [PATCH] Properly hide things with disable enterprise flag --- src/app/[orgId]/settings/general/page.tsx | 68 ++++---- .../settings/sites/[niceId]/general/page.tsx | 150 +++++++++--------- src/components/newt-install-commands.tsx | 6 +- 3 files changed, 119 insertions(+), 105 deletions(-) diff --git a/src/app/[orgId]/settings/general/page.tsx b/src/app/[orgId]/settings/general/page.tsx index e20523250..375592fc5 100644 --- a/src/app/[orgId]/settings/general/page.tsx +++ b/src/app/[orgId]/settings/general/page.tsx @@ -43,6 +43,7 @@ import { usePaidStatus } from "@app/hooks/usePaidStatus"; import { tierMatrix, TierFeature } from "@server/lib/billing/tierMatrix"; import { PaidFeaturesAlert } from "@app/components/PaidFeaturesAlert"; import { ExternalLink } from "lucide-react"; +import { env } from "process"; // Schema for general organization settings const GeneralFormSchema = z.object({ @@ -165,6 +166,7 @@ function DeleteForm({ org }: SectionFormProps) { function GeneralSectionForm({ org }: SectionFormProps) { const { updateOrg } = useOrgContext(); + const { env } = useEnvContext(); const form = useForm({ resolver: zodResolver( GeneralFormSchema.pick({ @@ -265,36 +267,42 @@ function GeneralSectionForm({ org }: SectionFormProps) { - ( - - - - - - {t("newtAutoUpdateDescription")}{" "} - - {t("learnMore")} - - - - - - )} - /> + {!env.flags.disableEnterpriseFeatures && ( + ( + + + + + + {t("newtAutoUpdateDescription")}{" "} + + {t("learnMore")} + + + + + + )} + /> + )} diff --git a/src/app/[orgId]/settings/sites/[niceId]/general/page.tsx b/src/app/[orgId]/settings/sites/[niceId]/general/page.tsx index 8d5a654c9..fdbfc387d 100644 --- a/src/app/[orgId]/settings/sites/[niceId]/general/page.tsx +++ b/src/app/[orgId]/settings/sites/[niceId]/general/page.tsx @@ -253,85 +253,87 @@ export default function GeneralPage() { - {site && site.type === "newt" && ( - { - const isOverriding = form.watch( - "autoUpdateOverrideOrg" - ); - return ( - - -
- { - field.onChange( + {site && + site.type === "newt" && + !env.flags.disableEnterpriseFeatures && ( + { + const isOverriding = form.watch( + "autoUpdateOverrideOrg" + ); + return ( + + +
+ - {isOverriding && ( - { + ) => { + field.onChange( + checked + ); form.setValue( "autoUpdateOverrideOrg", - false - ); - form.setValue( - "autoUpdateEnabled", - orgAutoUpdate + true ); }} - > - {t( - "siteAutoUpdateResetToOrg" - )} - - )} -
-
- - {t( - "siteAutoUpdateDescription" - )}{" "} - - {t("learnMore")} - - - - -
- ); - }} - /> - )} + disabled={ + !hasAutoUpdateFeature + } + /> + {isOverriding && ( + { + form.setValue( + "autoUpdateOverrideOrg", + false + ); + form.setValue( + "autoUpdateEnabled", + orgAutoUpdate + ); + }} + > + {t( + "siteAutoUpdateResetToOrg" + )} + + )} +
+
+ + {t( + "siteAutoUpdateDescription" + )}{" "} + + {t("learnMore")} + + + + +
+ ); + }} + /> + )} diff --git a/src/components/newt-install-commands.tsx b/src/components/newt-install-commands.tsx index 23dd072ed..badc174cc 100644 --- a/src/components/newt-install-commands.tsx +++ b/src/components/newt-install-commands.tsx @@ -75,7 +75,11 @@ export function NewtSiteInstallCommands({ : ""; const disableSshFlag = - supportsSshOption && !allowPangolinSsh ? " --disable-ssh" : ""; + supportsSshOption && + !allowPangolinSsh && + !env.flags.disableEnterpriseFeatures + ? " --disable-ssh" + : ""; const runAsRootPrefix = supportsSshOption && allowPangolinSsh ? "sudo " : "";