From 3367cc978dbd8bab5fe06c3a7fc093b845774a42 Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Wed, 8 May 2024 08:32:24 -0400 Subject: [PATCH] docs(core): collapse concepts and recipes (#23219) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Collapse the concepts and recipes sections by default ![Screenshot 2024-05-07 at 11 34 05 AM](https://github.com/nrwl/nx/assets/861504/1428c5e9-9c46-4001-b9dc-d06e2efa086d) (cherry picked from commit f13a9608b1a56c08a2c101978b4862df60f2e714) --- nx-dev/data-access-menu/src/lib/menu.utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nx-dev/data-access-menu/src/lib/menu.utils.ts b/nx-dev/data-access-menu/src/lib/menu.utils.ts index 0d17678462da3..da1632993f215 100644 --- a/nx-dev/data-access-menu/src/lib/menu.utils.ts +++ b/nx-dev/data-access-menu/src/lib/menu.utils.ts @@ -1,5 +1,7 @@ import { MenuItem, MenuSection } from '@nx/nx-dev/models-menu'; +const COLLAPSIBLE_SECTIONS = ['concepts', 'recipes']; + export function getBasicNxSection(items: MenuItem[]): MenuSection { return { id: 'basic', @@ -19,7 +21,9 @@ export function getBasicNxSection(items: MenuItem[]): MenuSection { .map((m) => { return { ...m, - disableCollapsible: !m.id.endsWith('tutorial'), + disableCollapsible: !COLLAPSIBLE_SECTIONS.some((collapsibleSection) => + m.id.endsWith(collapsibleSection) + ), }; }), };