From d7d3110912a2ab7cd1f205af2d79647d6f61a885 Mon Sep 17 00:00:00 2001 From: Isabella Enriquez Date: Fri, 14 Jun 2024 17:30:09 -0700 Subject: [PATCH] feat: enable hiding pages in sidebar + pricing docs updates (#10407) * spend allocation changes * update copy * remove last ref --- docs/pricing/quotas/index.mdx | 1 - docs/pricing/quotas/spend-allocation.mdx | 3 ++- docs/pricing/quotas/spike-protection.mdx | 1 - src/components/dynamicNav.tsx | 7 ++++++- src/components/sidebar/index.tsx | 3 +++ src/types/frontmatter.ts | 5 +++++ src/utils.ts | 1 + 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/pricing/quotas/index.mdx b/docs/pricing/quotas/index.mdx index 4f28f274b11d9..8c969357530e5 100644 --- a/docs/pricing/quotas/index.mdx +++ b/docs/pricing/quotas/index.mdx @@ -31,7 +31,6 @@ The first 6 actions in the list can all be done in [sentry.io](https://sentry.io | Action | Errors | Span Units | Replays |Attachments | | ------ | ------ | ------------ | ----------- |----------- | | [Ensure spike protection is enabled](#spike-protection) | ✓ | ✓ | | ✓ | -| [Set a spend allocation budget](#spend-allocation) | ✓ | ✓ | | ✓ | | [Adjust your quota](#adjusting-your-quota) | ✓ | ✓ | ✓ | ✓ | | [Rate limit your events or attachments](#rate-limits) | ✓ | | | ✓ | | [Review repeated events](#event-repetition) | ✓ | | | | diff --git a/docs/pricing/quotas/spend-allocation.mdx b/docs/pricing/quotas/spend-allocation.mdx index 521e305813745..9f63265abac6c 100644 --- a/docs/pricing/quotas/spend-allocation.mdx +++ b/docs/pricing/quotas/spend-allocation.mdx @@ -1,12 +1,13 @@ --- title: "Spend Allocation" +sidebar_hidden: true sidebar_order: 20 description: "Learn how to allocate reserved volume to specific projects so that the most important projects are always monitored." --- -This feature is only available to organizations with a Business or Enterprise plan. +This feature is only available to organizations with an Enterprise plan. diff --git a/docs/pricing/quotas/spike-protection.mdx b/docs/pricing/quotas/spike-protection.mdx index aa8601e0ef761..f16bee9a768ad 100644 --- a/docs/pricing/quotas/spike-protection.mdx +++ b/docs/pricing/quotas/spike-protection.mdx @@ -66,7 +66,6 @@ We recommend taking the following steps to manage your spikes: - Set up [metric alerts](/product/alerts/alert-types/#metric-alerts) for the number of events in a project. - If a specific release version has caused the spike, add the version identifier to the project's [inbound filters](/pricing/quotas/manage-event-stream-guide/#inbound-data-filters) to avoid accepting events from that release. - Set up a [pay-as-you-go budget](/pricing/#pricing-how-it-works) to make sure you have time to adjust your volume in the event of a future spike. -- Set up [spend allocations](/pricing/quotas/#spend-allocation) to ensure your critical projects are guaranteed a portion of your reserved volume, even if there are spikes in other projects. To review the events that were dropped to save your quota with Spike Protection, go to the "Usage Stats" tab of the **Stats** page for your Sentry org and select the event of interest from the "Category" dropdown. You'll be able to see project-level details of your stats by using the project selector. diff --git a/src/components/dynamicNav.tsx b/src/components/dynamicNav.tsx index dc19b4ac8cf97..f6152ca5faad5 100644 --- a/src/components/dynamicNav.tsx +++ b/src/components/dynamicNav.tsx @@ -10,6 +10,7 @@ type Node = { [key: string]: any; context: { [key: string]: any; + sidebar_hidden?: boolean; sidebar_order?: number; sidebar_title?: string; title?: string; @@ -62,7 +63,11 @@ export const renderChildren = ( return sortPages( children.filter( ({name, node}) => - node && !!node.context.title && name !== '' && exclude.indexOf(node.path) === -1 + node && + !!node.context.title && + name !== '' && + exclude.indexOf(node.path) === -1 && + !node.context.sidebar_hidden ), ({node}) => node! ).map(({node, children: nodeChildren}) => { diff --git a/src/components/sidebar/index.tsx b/src/components/sidebar/index.tsx index 1335c167d46bb..92d572421393e 100644 --- a/src/components/sidebar/index.tsx +++ b/src/components/sidebar/index.tsx @@ -203,6 +203,7 @@ type NavNode = { context: { draft: boolean; title: string; + sidebar_hidden?: boolean; sidebar_order?: number; sidebar_title?: string; }; @@ -215,6 +216,7 @@ const docNodeToNavNode = (node: DocNode): NavNode => ({ title: node.frontmatter.title, sidebar_order: node.frontmatter.sidebar_order, sidebar_title: node.frontmatter.sidebar_title, + sidebar_hidden: node.frontmatter.sidebar_hidden, }, path: '/' + node.path + '/', }); @@ -300,6 +302,7 @@ function PlatformSidebar({rootNode, platformName, guideName}: PlatformSidebarPro title: n.frontmatter.title, sidebar_order: n.frontmatter.sidebar_order, sidebar_title: n.frontmatter.sidebar_title, + sidebar_hidden: n.frontmatter.sidebar_hidden, }, path: '/' + n.path + '/', }; diff --git a/src/types/frontmatter.ts b/src/types/frontmatter.ts index 3bfa4b3fa7f29..c474ce8efa745 100644 --- a/src/types/frontmatter.ts +++ b/src/types/frontmatter.ts @@ -36,6 +36,11 @@ export interface FrontMatter { */ notoc?: boolean; + /** + * Set this to true to hide from the sidebar + */ + sidebar_hidden?: boolean; + /** * The order of this page in auto generated sidebars and grids. */ diff --git a/src/utils.ts b/src/utils.ts index 0ba9b79ef84db..38ce852b67e68 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -29,6 +29,7 @@ export const splitToChunks = (numChunks: number, arr: T[]): T[][] => { type Page = { context: { + sidebar_hidden?: boolean; sidebar_order?: number; sidebar_title?: string; title?: string;