Add upsell settings pages for paid plan features (#14631)

* Add enterprise upsell plugin with placeholder settings pages

Introduces a new client-only `upsell` plugin that surfaces Enterprise-only
features as placeholder settings pages in the community edition, encouraging
self-hosted users to upgrade. The plugin is gated to non-cloud deployments
since the cloud edition already ships these features.

Adds:
- UpsellScene: a reusable upsell page (header, pitch, upgrade CTAs, and a
  preview of the locked settings).
- UpsellSettingRow: an upsell variant of SettingRow that renders an
  Enterprise-only setting in a locked, non-interactive state.
- EnterpriseBadge: a small badge denoting Enterprise-only features.
- Placeholder pages for Audit Log, Data Attributes, and Glean.
- A pricing URL on UrlHelper for the upgrade call to action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ca46gcmqU5HGgoK8SFHUx

* Add Security upsell rows and Collections upsell page

Surfaces more Enterprise-only features in the community edition:

- Adds locked upsell rows to the Security settings page for two-factor
  authentication, automatic sign-out, and an IP allowlist. These only render
  on self-hosted instances, where the real settings are not available.
- Adds a Collections placeholder page to the upsell plugin advertising
  workspace-wide collection administration.

Relocates the shared EnterpriseBadge and UpsellSettingRow components from the
plugin into app/scenes/Settings/components so core settings pages and the
plugin can both consume them without inverting the app/plugin dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ca46gcmqU5HGgoK8SFHUx

* Show plan requirement on upsell pages and sidebar

Replace the placeholder Enterprise rows with a single callout that names the
minimum plan for each feature, mark upsell items in the settings sidebar with
a muted lock, and sync PlanHelper with the plan entitlements.

* Hide entitled upsells, show Glean upsell, fix billing link

* Render upsell for settings pages without the entitlement

Settings items can declare the plan feature they need. Without it, the page
shows the upsell scene in place of the real one, and upsell plugin
placeholders give way to a real page for the same feature.
This commit is contained in:
Tom Moor authored and GitHub committed 2026-11-20 08:29:16 -05:00
1 parent dbc1e84ec9
commit 41abdbec3f
17 files changed
+517 -26

No files matched your search

+65 -7
View File
@@ -1,14 +1,20 @@
import { groupBy } from "es-toolkit/compat";
import { groupBy, sortBy } from "es-toolkit/compat";
import { observer } from "mobx-react";
import { BackIcon } from "outline-icons";
import { BackIcon, PadlockIcon } from "outline-icons";
import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";
import styled from "styled-components";
import { Plan } from "@shared/types";
import type { PlanFeature } from "@shared/types";
import { s } from "@shared/styles";
import { PlanHelper } from "@shared/utils/PlanHelper";
import Flex from "~/components/Flex";
import Scrollable from "~/components/Scrollable";
import Tooltip from "~/components/Tooltip";
import useSettingsConfig from "~/hooks/useSettingsConfig";
import { useLocationSelector } from "~/hooks/useLocationSelector";
import { usePlanName } from "~/hooks/usePlanName";
import useStores from "~/hooks/useStores";
import isCloudHosted from "~/utils/isCloudHosted";
import { settingsPath } from "~/utils/routeHelpers";
@@ -28,10 +34,14 @@ function SettingsSidebar() {
const configs = useSettingsConfig();
const groupedConfig = groupBy(
configs.filter((item) =>
item.group === t("Integrations") && item.pluginId
? integrations.findByService(item.pluginId)
: true
// Locked upsell items sort to the end of their group.
sortBy(
configs.filter((item) =>
item.group === t("Integrations") && item.pluginId && !item.locked
? integrations.findByService(item.pluginId)
: true
),
(item) => (item.locked ? 1 : 0)
),
"group"
);
@@ -65,7 +75,16 @@ function SettingsSidebar() {
: undefined
}
icon={<item.icon />}
label={item.name}
label={
item.locked && item.entitlement ? (
<UpsellLabel
name={item.name}
feature={item.entitlement}
/>
) : (
item.name
)
}
/>
))}
</Header>
@@ -84,6 +103,45 @@ function SettingsSidebar() {
);
}
interface UpsellLabelProps {
/** The name of the settings page. */
name: string;
/** The plan feature that the page advertises. */
feature: PlanFeature;
}
function UpsellLabel({ name, feature }: UpsellLabelProps) {
const { t } = useTranslation();
const plan = PlanHelper.getMinimumPlan(feature) ?? Plan.Enterprise;
const planName = usePlanName(plan);
const description = t("Available on {{ planName }}", { planName });
return (
<UpsellLabelWrapper>
{name}
<Tooltip content={description}>
<Lock role="img" aria-label={description}>
<PadlockIcon size={16} />
</Lock>
</Tooltip>
</UpsellLabelWrapper>
);
}
const UpsellLabelWrapper = styled.span`
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
`;
const Lock = styled.span`
display: flex;
flex-shrink: 0;
color: ${s("textTertiary")};
opacity: 0.5;
`;
const StyledBackIcon = styled(BackIcon)`
margin-inline-start: 4px;
+25
View File
@@ -0,0 +1,25 @@
import { useTranslation } from "react-i18next";
import { Plan } from "@shared/types";
/**
* Returns the translated display name of a plan.
*
* @param plan the plan to name.
* @returns the display name of the plan.
*/
export function usePlanName(plan: Plan): string {
const { t } = useTranslation();
switch (plan) {
case Plan.Community:
return t("Community");
case Plan.Standard:
return t("Standard");
case Plan.Business:
return t("Business");
case Plan.Enterprise:
return t("Enterprise");
case Plan.Legacy:
return t("Legacy");
}
}
+34 -1
View File
@@ -20,6 +20,7 @@ import {
} from "outline-icons";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import type { PlanFeature } from "@shared/types";
import { integrationSettingsPath } from "@shared/utils/routeHelpers";
import { createLazyComponent as lazy } from "~/components/LazyLoad";
import { Hook, PluginManager } from "~/utils/PluginManager";
@@ -64,6 +65,12 @@ export type ConfigItem = {
enabled: boolean;
group: string;
pluginId?: string;
/** The plan feature needed for this page. Without it, an upsell page shows instead. */
entitlement?: PlanFeature;
/** Whether the page is only an upsell, removed when a real page needs the same entitlement. */
placeholder?: boolean;
/** Whether the team does not have the entitlement for this page. */
locked?: boolean;
};
const useSettingsConfig = () => {
@@ -280,10 +287,36 @@ const useSettingsConfig = () => {
? plugin.value.enabled(team, user)
: can.update,
icon: plugin.value.icon,
entitlement: plugin.value.entitlement,
placeholder: plugin.value.placeholder,
} as ConfigItem);
});
return items;
return items
.filter(
(item) =>
!item.placeholder ||
!items.some(
(other) =>
!other.placeholder && other.entitlement === item.entitlement
)
)
.map((item): ConfigItem => {
if (!item.entitlement) {
return item;
}
const locked = !team.hasEntitlement(item.entitlement);
if (item.placeholder && !locked) {
return { ...item, enabled: false };
}
return {
...item,
locked,
preload: locked && !item.placeholder ? undefined : item.preload,
};
});
}, [t, can.createApiKey, can.update, can.createImport, can.createExport]);
return config.filter((item) => item.enabled);
+33 -8
View File
@@ -1,5 +1,6 @@
import { Redirect, Switch } from "react-router-dom";
import Error404 from "~/scenes/Errors/Error404";
import { UpsellScene } from "~/scenes/Settings/components/UpsellScene";
import { createLazyComponent as lazy } from "~/components/LazyLoad";
import Route from "~/components/ProfiledRoute";
import useSettingsConfig from "~/hooks/useSettingsConfig";
@@ -18,14 +19,38 @@ function SettingsRoutes() {
return (
<Switch>
{configs.map((config) => (
<Route
exact
key={config.path}
path={config.path}
component={config.component}
/>
))}
{configs.map((config) => {
const feature =
config.locked && !config.placeholder ? config.entitlement : undefined;
// Pages that need an entitlement the team does not have show an upsell.
if (feature) {
return (
<Route
exact
key={config.path}
path={config.path}
render={() => (
<UpsellScene
title={config.name}
icon={<config.icon />}
description={config.description}
feature={feature}
/>
)}
/>
);
}
return (
<Route
exact
key={config.path}
path={config.path}
component={config.component}
/>
);
})}
{/* Members was renamed to Users, redirect for backwards compatibility */}
<Redirect
exact
@@ -0,0 +1,120 @@
import { StarredIcon } from "outline-icons";
import type * as React from "react";
import { Trans, useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import styled from "styled-components";
import { Plan } from "@shared/types";
import type { PlanFeature } from "@shared/types";
import { s } from "@shared/styles";
import { breakpoint } from "@shared/styles/breakpoint";
import { PlanHelper } from "@shared/utils/PlanHelper";
import { UrlHelper } from "@shared/utils/UrlHelper";
import Button from "~/components/Button";
import Flex from "~/components/Flex";
import Heading from "~/components/Heading";
import Scene from "~/components/Scene";
import Text from "~/components/Text";
import isCloudHosted from "~/utils/isCloudHosted";
import { usePlanName } from "~/hooks/usePlanName";
interface Props {
/** The title of the settings page. */
title: string;
/** The icon displayed alongside the title. */
icon: React.ReactNode;
/** A short description of the feature being advertised. */
description?: React.ReactNode;
/** The plan feature that unlocks this page. */
feature: PlanFeature;
}
/**
* A placeholder settings page that advertises a feature from a higher plan. It
* renders the same chrome as a real settings page, a short pitch, and a call
* to action to upgrade.
*
* @param props - the component props.
* @returns the rendered upsell scene.
*/
export function UpsellScene({ title, icon, description, feature }: Props) {
const { t } = useTranslation();
const plan = PlanHelper.getMinimumPlan(feature) ?? Plan.Enterprise;
const planName = usePlanName(plan);
return (
<Scene title={title} textTitle={title} icon={icon}>
<Title>{title}</Title>
{description && (
<Text as="p" type="secondary">
{description}
</Text>
)}
<Callout align="center" gap={12}>
<StarredIcon />
<CalloutText column gap={4} auto>
<Text as="span" weight="bold">
{t("Available on {{ planName }}", { planName })}
</Text>
<Text as="span" type="secondary">
<Trans>
This feature is included in {{ planName }} and above. Upgrade your
workspace to unlock it for your team.
</Trans>
</Text>
</CalloutText>
{isCloudHosted ? (
<Button as={Link} to="/settings/billing">
{t("View plans")}
</Button>
) : (
<Button
as="a"
href={UrlHelper.pricing}
target="_blank"
rel="noopener noreferrer"
>
{t("View plans")}
</Button>
)}
</Callout>
</Scene>
);
}
const Title = styled(Heading)`
gap: 12px;
`;
const Callout = styled(Flex)`
margin: 24px 0 8px;
padding: 20px 24px 20px 20px;
border-radius: 8px;
border: 1px solid ${s("divider")};
background: ${s("backgroundSecondary")};
> svg {
flex-shrink: 0;
align-self: flex-start;
color: ${s("accent")};
}
> a {
flex-shrink: 0;
}
/* On small screens the button moves below the text, aligned with it. */
${breakpoint("mobile", "tablet")`
flex-wrap: wrap;
> a {
margin-left: 36px;
}
`};
`;
const CalloutText = styled(Flex)`
${breakpoint("mobile", "tablet")`
flex-basis: calc(100% - 36px);
`};
`;
+5
View File
@@ -6,6 +6,7 @@ import type {
IntegrationSettings,
IntegrationType,
MentionType,
PlanFeature,
} from "@shared/types";
import type Integration from "~/models/Integration";
import type Team from "~/models/Team";
@@ -43,6 +44,10 @@ type PluginValueMap = {
description?: string;
/** Whether the plugin is enabled in the current context. */
enabled?: (team: Team, user: User) => boolean;
/** The plan feature needed for this page. Without it, an upsell page shows instead. */
entitlement?: PlanFeature;
/** Whether the page is only an upsell, removed when a real page needs the same entitlement. */
placeholder?: boolean;
};
[Hook.Imports]: {
/** The title of the import. */
+2 -2
View File
@@ -17,7 +17,7 @@ export const Translations = () => (
<Trans defaults={`Failed to save revision`} />
<Trans defaults={`Invite to document`} />
<Trans defaults={`Sorry, invalid embed link`} />
<Trans defaults={`Data Attributes`} />
<Trans defaults={`Data attributes`} />
<Trans defaults={`Edit attribute`} />
<Trans defaults={`Property`} />
<Trans defaults={`Yes`} />
@@ -72,7 +72,7 @@ export const Translations = () => (
<Trans defaults={`Text`} />
<Trans defaults={`List`} />
<Trans defaults={`Could not load events`} />
<Trans defaults={`Audit Log`} />
<Trans defaults={`Audit log`} />
<Trans
defaults={`The audit log details the history of security-related and other events across your knowledge base.`}
/>
+25
View File
@@ -0,0 +1,25 @@
import { HistoryIcon } from "outline-icons";
import { useTranslation } from "react-i18next";
import { PlanFeature } from "@shared/types";
import { UpsellScene } from "~/scenes/Settings/components/UpsellScene";
/**
* Upsell placeholder for the paid audit log, which records security
* and activity events across the workspace.
*
* @returns The rendered upsell scene.
*/
export default function AuditLog() {
const { t } = useTranslation();
return (
<UpsellScene
feature={PlanFeature.AuditLog}
title={t("Audit log")}
icon={<HistoryIcon />}
description={t(
"The audit log details the history of security related and other events across your knowledge base."
)}
/>
);
}
+26
View File
@@ -0,0 +1,26 @@
import { CollectionIcon } from "outline-icons";
import { useTranslation } from "react-i18next";
import { PlanFeature } from "@shared/types";
import { UpsellScene } from "~/scenes/Settings/components/UpsellScene";
/**
* Upsell placeholder for the paid collection management page, which
* lets workspace admins administer the permissions and settings of every
* collection, including private ones.
*
* @returns The rendered upsell scene.
*/
export default function Collections() {
const { t } = useTranslation();
return (
<UpsellScene
feature={PlanFeature.ContentManagement}
title={t("Content")}
icon={<CollectionIcon />}
description={t(
"Manage the permissions and settings of all collections in the knowledge base. As a workspace admin you can also administer private collections."
)}
/>
);
}
+25
View File
@@ -0,0 +1,25 @@
import { BuildingBlocksIcon } from "outline-icons";
import { useTranslation } from "react-i18next";
import { PlanFeature } from "@shared/types";
import { UpsellScene } from "~/scenes/Settings/components/UpsellScene";
/**
* Upsell placeholder for the paid data attributes feature, which
* allows defining custom structured properties on documents.
*
* @returns The rendered upsell scene.
*/
export default function DataAttributes() {
const { t } = useTranslation();
return (
<UpsellScene
feature={PlanFeature.DataAttributes}
title={t("Data attributes")}
icon={<BuildingBlocksIcon />}
description={t(
"Attributes allow you to define data to be stored with your documents. They can be used to store custom properties, metadata, or any other structured information that is common across documents."
)}
/>
);
}
+29
View File
@@ -0,0 +1,29 @@
import { SearchIcon } from "outline-icons";
import { Trans } from "react-i18next";
import env from "~/env";
import { PlanFeature } from "@shared/types";
import { UpsellScene } from "~/scenes/Settings/components/UpsellScene";
/**
* Upsell placeholder for the paid Glean integration, which surfaces
* Outline content inside Glean's enterprise search.
*
* @returns The rendered upsell scene.
*/
export default function Glean() {
const appName = env.APP_NAME;
return (
<UpsellScene
feature={PlanFeature.PremiumIntegrations}
title="Glean"
icon={<SearchIcon />}
description={
<Trans>
Automatically index and search document content from {{ appName }}{" "}
inside Glean in realtime.
</Trans>
}
/>
);
}
+74
View File
@@ -0,0 +1,74 @@
import {
BuildingBlocksIcon,
CollectionIcon,
HistoryIcon,
SearchIcon,
} from "outline-icons";
import { createLazyComponent } from "~/components/LazyLoad";
import { Hook, PluginManager } from "~/utils/PluginManager";
import { PlanFeature } from "@shared/types";
import config from "../plugin.json";
PluginManager.add([
{
...config,
id: "upsell-audit-log",
name: "Audit log",
type: Hook.Settings,
value: {
group: "Workspace",
after: "Security",
icon: HistoryIcon,
description: "Track security and activity events across your workspace.",
component: createLazyComponent(() => import("./AuditLog")),
entitlement: PlanFeature.AuditLog,
placeholder: true,
},
},
{
...config,
id: "upsell-collections",
name: "Content",
type: Hook.Settings,
value: {
group: "Workspace",
after: "Groups",
icon: CollectionIcon,
description:
"Manage permissions and settings for every collection, including private ones.",
component: createLazyComponent(() => import("./Collections")),
entitlement: PlanFeature.ContentManagement,
placeholder: true,
},
},
{
...config,
id: "upsell-data-attributes",
name: "Data attributes",
type: Hook.Settings,
value: {
group: "Workspace",
after: "Templates",
icon: BuildingBlocksIcon,
description: "Define custom properties and metadata for documents.",
component: createLazyComponent(() => import("./DataAttributes")),
entitlement: PlanFeature.DataAttributes,
placeholder: true,
},
},
{
...config,
id: "glean",
name: "Glean",
type: Hook.Settings,
value: {
group: "Integrations",
icon: SearchIcon,
description:
"Index and search your workspace content inside Glean enterprise search.",
component: createLazyComponent(() => import("./Glean")),
entitlement: PlanFeature.PremiumIntegrations,
placeholder: true,
},
},
]);
+6
View File
@@ -0,0 +1,6 @@
{
"id": "upsell",
"name": "Enterprise",
"priority": 1000,
"description": "Adds placeholder settings pages that highlight features available in the Enterprise edition."
}
+4
View File
@@ -12,6 +12,8 @@ export enum Plan {
export enum PlanFeature {
/** Access to the workspace audit log. */
AuditLog = "auditLog",
/** Access to workspace document and search insights. */
Insights = "insights",
/** Advanced security controls. */
AdvancedSecurity = "advancedSecurity",
/** Inviting guest users. */
@@ -30,4 +32,6 @@ export enum PlanFeature {
CustomDomain = "customDomain",
/** SAML authentication provider */
SAML = "saml",
/** Structured data attributes on documents. */
DataAttributes = "dataAttributes",
}
+33
View File
@@ -24,4 +24,37 @@ describe("PlanHelper", () => {
it("should return the lowest plan with a feature", () => {
expect(PlanHelper.getMinimumPlan(PlanFeature.AuditLog)).toBe(Plan.Business);
});
it("should include AI answers in business and legacy plans", () => {
expect(PlanHelper.hasFeature(Plan.Standard, PlanFeature.AIAnswers)).toBe(
false
);
expect(PlanHelper.hasFeature(Plan.Business, PlanFeature.AIAnswers)).toBe(
true
);
expect(PlanHelper.hasFeature(Plan.Legacy, PlanFeature.AIAnswers)).toBe(
true
);
expect(PlanHelper.getMinimumPlan(PlanFeature.AIAnswers)).toBe(
Plan.Business
);
});
it("should include data attributes in business and above", () => {
expect(
PlanHelper.hasFeature(Plan.Standard, PlanFeature.DataAttributes)
).toBe(false);
expect(
PlanHelper.hasFeature(Plan.Business, PlanFeature.DataAttributes)
).toBe(true);
expect(
PlanHelper.hasFeature(Plan.Enterprise, PlanFeature.DataAttributes)
).toBe(true);
expect(PlanHelper.hasFeature(Plan.Legacy, PlanFeature.DataAttributes)).toBe(
false
);
expect(PlanHelper.getMinimumPlan(PlanFeature.DataAttributes)).toBe(
Plan.Business
);
});
});
+10 -8
View File
@@ -22,16 +22,18 @@ export class PlanHelper {
/** The features that are included in each plan. */
public static readonly features: Record<Plan, PlanFeature[]> = {
[Plan.Community]: [],
[Plan.Standard]: [
PlanFeature.ContentManagement,
PlanFeature.Guests,
PlanFeature.AIAnswers,
],
[Plan.Standard]: [PlanFeature.Guests],
[Plan.Business]: Object.values(PlanFeature),
[Plan.Enterprise]: Object.values(PlanFeature),
[Plan.Legacy]: Object.values(PlanFeature).filter(
(feature) => feature !== PlanFeature.GroupSync
),
[Plan.Legacy]: [
PlanFeature.AuditLog,
PlanFeature.AdvancedSecurity,
PlanFeature.Guests,
PlanFeature.ApiKeyManagement,
PlanFeature.ContentManagement,
PlanFeature.AIAnswers,
PlanFeature.CustomDomain,
],
};
/**
+1
View File
@@ -5,6 +5,7 @@ export class UrlHelper {
public static developers = "https://www.getoutline.com/developers";
public static changelog = "https://www.getoutline.com/changelog";
public static guide = "https://docs.getoutline.com/s/guide";
public static pricing = "https://www.getoutline.com/pricing";
public static SLUG_URL_REGEX = /^(?:[0-9a-zA-Z-_~]*-)?([a-zA-Z0-9]{10,15})$/;
public static SHARE_URL_SLUG_REGEX = /^[0-9a-z-]+$/;