diff --git a/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue b/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue index 1c80c4e1f..d33c92c68 100644 --- a/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue +++ b/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue @@ -18,16 +18,17 @@ Lets users discover the workspace if they sign up with a matching email.

-
+
-
+
+
+ + Upgrade to Business + +
@@ -34,10 +55,12 @@ import { graphql } from '~/lib/common/generated/gql' import type { SettingsWorkspacesSecurityDomainProtection_WorkspaceFragment } from '~/lib/common/generated/gql/graphql' import { useMixpanel } from '~/lib/core/composables/mp' import { workspaceUpdateDomainProtectionMutation } from '~/lib/workspaces/graphql/mutations' +import { settingsWorkspaceRoutes } from '~/lib/common/helpers/route' graphql(` fragment SettingsWorkspacesSecurityDomainProtection_Workspace on Workspace { id + slug role domainBasedMembershipProtectionEnabled hasAccessToDomainBasedSecurityPolicies: hasAccessToFeature( @@ -57,6 +80,7 @@ const mixpanel = useMixpanel() const { mutate: updateDomainProtection } = useMutation( workspaceUpdateDomainProtectionMutation ) +const { triggerNotification } = useGlobalToast() const hasWorkspaceDomains = computed(() => (props.workspace?.domains?.length || 0) > 0) @@ -73,6 +97,11 @@ const isDomainProtectionEnabled = computed({ }).catch(convertThrowIntoFetchResult) if (result?.data) { + triggerNotification({ + type: ToastNotificationType.Success, + title: 'Domain protection updated', + description: `Domain protection has been ${newVal ? 'enabled' : 'disabled'}` + }) mixpanel.track('Workspace Domain Protection Toggled', { value: newVal, // eslint-disable-next-line camelcase @@ -85,7 +114,6 @@ const isDomainProtectionEnabled = computed({ const switchDisabled = computed(() => { if (props.workspace?.role !== Roles.Workspace.Admin) return true if (isDomainProtectionEnabled.value) return false - if (!props.workspace?.hasAccessToDomainBasedSecurityPolicies) return true if (!hasWorkspaceDomains.value) return true return false }) @@ -94,8 +122,6 @@ const tooltipText = computed(() => { if (props.workspace?.role !== Roles.Workspace.Admin) return 'You must be a workspace admin' if (isDomainProtectionEnabled.value) return undefined - if (!props.workspace?.hasAccessToDomainBasedSecurityPolicies) - return 'Business plan required' if (!hasWorkspaceDomains.value) return 'Your workspace must have at least one verified domain' return undefined diff --git a/packages/frontend-2/components/settings/workspaces/security/sso/Wrapper.vue b/packages/frontend-2/components/settings/workspaces/security/sso/Wrapper.vue index 96a8ef647..de70b6896 100644 --- a/packages/frontend-2/components/settings/workspaces/security/sso/Wrapper.vue +++ b/packages/frontend-2/components/settings/workspaces/security/sso/Wrapper.vue @@ -18,11 +18,20 @@
-
-

- SSO requires a Business subscription -

- +
+ Upgrade to Business
@@ -63,13 +72,6 @@