From a278c0281bb04e0b02da918796b9068624e5c502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Fri, 13 Mar 2026 12:51:05 +0100 Subject: [PATCH 1/2] remove unnecessary toggle --- .../steps/AddLocationInternalVpnStep.tsx | 31 ------------------- .../EditLocationPage/EditLocationPage.tsx | 19 ------------ 2 files changed, 50 deletions(-) diff --git a/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx b/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx index 5d0f6e2c31..2ee2841c6c 100644 --- a/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx +++ b/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx @@ -1,5 +1,3 @@ -import { useQuery } from '@tanstack/react-query'; -import { useMemo } from 'react'; import z from 'zod'; import { useShallow } from 'zustand/react/shallow'; import { m } from '../../../paraglide/messages'; @@ -8,16 +6,9 @@ import { DescriptionBlock } from '../../../shared/components/DescriptionBlock/De import { WizardCard } from '../../../shared/components/wizard/WizardCard/WizardCard'; import { Button } from '../../../shared/defguard-ui/components/Button/Button'; import { SizedBox } from '../../../shared/defguard-ui/components/SizedBox/SizedBox'; -import { Toggle } from '../../../shared/defguard-ui/components/Toggle/Toggle'; -import { TooltipContent } from '../../../shared/defguard-ui/providers/tooltip/TooltipContent'; -import { TooltipProvider } from '../../../shared/defguard-ui/providers/tooltip/TooltipContext'; -import { TooltipTrigger } from '../../../shared/defguard-ui/providers/tooltip/TooltipTrigger'; import { ThemeSpacing } from '../../../shared/defguard-ui/types'; -import { isPresent } from '../../../shared/defguard-ui/utils/isPresent'; import { useAppForm } from '../../../shared/form'; import { formChangeLogic } from '../../../shared/formLogic'; -import { getLicenseInfoQueryOptions } from '../../../shared/query'; -import { canUseBusinessFeature } from '../../../shared/utils/license'; import { Validate } from '../../../shared/validate'; import { AddLocationPageStep } from '../types'; import { useAddLocationStore } from '../useAddLocationStore'; @@ -38,13 +29,6 @@ const formSchema = z.object({ type FormFields = z.infer; export const AddLocationInternalVpnStep = () => { - const { data: licenseInfo } = useQuery(getLicenseInfoQueryOptions); - const canUseBusiness = useMemo(() => { - if (licenseInfo === undefined) return undefined; - return canUseBusinessFeature(licenseInfo).result; - }, [licenseInfo]); - const firewallRulesToggleLocked = isPresent(canUseBusiness) && !canUseBusiness; - const defaultValues = useAddLocationStore( useShallow( (s): FormFields => ({ @@ -100,21 +84,6 @@ export const AddLocationInternalVpnStep = () => { {(field) => } - - - -
- -
-
- -

{m.license_upgrade_business_tooltip()}

-
-
{(field) => } diff --git a/web/src/pages/EditLocationPage/EditLocationPage.tsx b/web/src/pages/EditLocationPage/EditLocationPage.tsx index d32dfc6837..5e7b3e43e9 100644 --- a/web/src/pages/EditLocationPage/EditLocationPage.tsx +++ b/web/src/pages/EditLocationPage/EditLocationPage.tsx @@ -20,11 +20,7 @@ import { externalLink } from '../../shared/constants'; import { InfoBanner } from '../../shared/defguard-ui/components/InfoBanner/InfoBanner'; import { SizedBox } from '../../shared/defguard-ui/components/SizedBox/SizedBox'; -import { Toggle } from '../../shared/defguard-ui/components/Toggle/Toggle'; import { Snackbar } from '../../shared/defguard-ui/providers/snackbar/snackbar'; -import { TooltipContent } from '../../shared/defguard-ui/providers/tooltip/TooltipContent'; -import { TooltipProvider } from '../../shared/defguard-ui/providers/tooltip/TooltipContext'; -import { TooltipTrigger } from '../../shared/defguard-ui/providers/tooltip/TooltipTrigger'; import { ThemeSpacing } from '../../shared/defguard-ui/types'; import { isPresent } from '../../shared/defguard-ui/utils/isPresent'; import { useAppForm } from '../../shared/form'; @@ -274,21 +270,6 @@ const EditLocationForm = ({ location }: { location: NetworkLocation }) => { {(field) => } - - - -
- -
-
- -

{m.license_upgrade_business_tooltip()}

-
-
{(field) => } From 7687cca1ff17ce73459b4595f5d788e712fef026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Fri, 13 Mar 2026 12:53:12 +0100 Subject: [PATCH 2/2] don't mark allowed IPs as required --- .../pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx b/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx index 2ee2841c6c..1c325ce6c3 100644 --- a/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx +++ b/web/src/pages/AddLocationPage/steps/AddLocationInternalVpnStep.tsx @@ -82,7 +82,7 @@ export const AddLocationInternalVpnStep = () => { - {(field) => } + {(field) => }