diff --git a/app/components/Sidebar/Settings.tsx b/app/components/Sidebar/Settings.tsx
index 6291c7bfc4..288ccf5570 100644
--- a/app/components/Sidebar/Settings.tsx
+++ b/app/components/Sidebar/Settings.tsx
@@ -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={}
- label={item.name}
+ label={
+ item.locked && item.entitlement ? (
+
+ ) : (
+ item.name
+ )
+ }
/>
))}
@@ -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 (
+
+ {name}
+
+
+
+
+
+
+ );
+}
+
+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;
diff --git a/app/hooks/usePlanName.ts b/app/hooks/usePlanName.ts
new file mode 100644
index 0000000000..6b1ba7459b
--- /dev/null
+++ b/app/hooks/usePlanName.ts
@@ -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");
+ }
+}
diff --git a/app/hooks/useSettingsConfig.ts b/app/hooks/useSettingsConfig.ts
index c1764bd520..f119862818 100644
--- a/app/hooks/useSettingsConfig.ts
+++ b/app/hooks/useSettingsConfig.ts
@@ -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);
diff --git a/app/routes/settings.tsx b/app/routes/settings.tsx
index 2a66d85639..2fb03f1b39 100644
--- a/app/routes/settings.tsx
+++ b/app/routes/settings.tsx
@@ -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 (
- {configs.map((config) => (
-
- ))}
+ {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 (
+ (
+ }
+ description={config.description}
+ feature={feature}
+ />
+ )}
+ />
+ );
+ }
+
+ return (
+
+ );
+ })}
{/* Members was renamed to Users, redirect for backwards compatibility */}
+ {title}
+ {description && (
+
+ {description}
+
+ )}
+
+
+
+
+
+ {t("Available on {{ planName }}", { planName })}
+
+
+
+ This feature is included in {{ planName }} and above. Upgrade your
+ workspace to unlock it for your team.
+
+
+
+ {isCloudHosted ? (
+
+ ) : (
+
+ )}
+
+
+ );
+}
+
+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);
+ `};
+`;
diff --git a/app/utils/PluginManager.ts b/app/utils/PluginManager.ts
index b9c8363c22..8662642a64 100644
--- a/app/utils/PluginManager.ts
+++ b/app/utils/PluginManager.ts
@@ -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. */
diff --git a/plugins/enterprise/client/translations.tsx b/plugins/enterprise/client/translations.tsx
index d42da9f664..e2bf20e393 100644
--- a/plugins/enterprise/client/translations.tsx
+++ b/plugins/enterprise/client/translations.tsx
@@ -17,7 +17,7 @@ export const Translations = () => (
-
+
@@ -72,7 +72,7 @@ export const Translations = () => (
-
+
diff --git a/plugins/upsell/client/AuditLog.tsx b/plugins/upsell/client/AuditLog.tsx
new file mode 100644
index 0000000000..725e56b57f
--- /dev/null
+++ b/plugins/upsell/client/AuditLog.tsx
@@ -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 (
+ }
+ description={t(
+ "The audit log details the history of security related and other events across your knowledge base."
+ )}
+ />
+ );
+}
diff --git a/plugins/upsell/client/Collections.tsx b/plugins/upsell/client/Collections.tsx
new file mode 100644
index 0000000000..d1b9f823b0
--- /dev/null
+++ b/plugins/upsell/client/Collections.tsx
@@ -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 (
+ }
+ description={t(
+ "Manage the permissions and settings of all collections in the knowledge base. As a workspace admin you can also administer private collections."
+ )}
+ />
+ );
+}
diff --git a/plugins/upsell/client/DataAttributes.tsx b/plugins/upsell/client/DataAttributes.tsx
new file mode 100644
index 0000000000..6dc1893d7d
--- /dev/null
+++ b/plugins/upsell/client/DataAttributes.tsx
@@ -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 (
+ }
+ 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."
+ )}
+ />
+ );
+}
diff --git a/plugins/upsell/client/Glean.tsx b/plugins/upsell/client/Glean.tsx
new file mode 100644
index 0000000000..05cccc8061
--- /dev/null
+++ b/plugins/upsell/client/Glean.tsx
@@ -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 (
+ }
+ description={
+
+ Automatically index and search document content from {{ appName }}{" "}
+ inside Glean in realtime.
+
+ }
+ />
+ );
+}
diff --git a/plugins/upsell/client/index.tsx b/plugins/upsell/client/index.tsx
new file mode 100644
index 0000000000..f5eff1a8e2
--- /dev/null
+++ b/plugins/upsell/client/index.tsx
@@ -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,
+ },
+ },
+]);
diff --git a/plugins/upsell/plugin.json b/plugins/upsell/plugin.json
new file mode 100644
index 0000000000..c2df23f906
--- /dev/null
+++ b/plugins/upsell/plugin.json
@@ -0,0 +1,6 @@
+{
+ "id": "upsell",
+ "name": "Enterprise",
+ "priority": 1000,
+ "description": "Adds placeholder settings pages that highlight features available in the Enterprise edition."
+}
diff --git a/shared/types/plans.ts b/shared/types/plans.ts
index ee50d90d6e..1edfd2dc10 100644
--- a/shared/types/plans.ts
+++ b/shared/types/plans.ts
@@ -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",
}
diff --git a/shared/utils/PlanHelper.test.ts b/shared/utils/PlanHelper.test.ts
index cce18f0517..f3a759bf18 100644
--- a/shared/utils/PlanHelper.test.ts
+++ b/shared/utils/PlanHelper.test.ts
@@ -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
+ );
+ });
});
diff --git a/shared/utils/PlanHelper.ts b/shared/utils/PlanHelper.ts
index b6a3ac09a2..658a7ef8ce 100644
--- a/shared/utils/PlanHelper.ts
+++ b/shared/utils/PlanHelper.ts
@@ -22,16 +22,18 @@ export class PlanHelper {
/** The features that are included in each plan. */
public static readonly features: Record = {
[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,
+ ],
};
/**
diff --git a/shared/utils/UrlHelper.ts b/shared/utils/UrlHelper.ts
index fea9bdefd9..36ff532b8d 100644
--- a/shared/utils/UrlHelper.ts
+++ b/shared/utils/UrlHelper.ts
@@ -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-]+$/;