From 6bff569ae4560ffa7b884d99e0ce552c3eb0e549 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Wed, 24 Jul 2024 13:01:56 -0700 Subject: [PATCH] Improved menu cache logic --- .../config-pages/GlobalMessage.stories.tsx | 3 +- .../stories/elements/Accordion.stories.tsx | 35 +-- .../stories/elements/Address.stories.tsx | 24 +- .../stories/elements/Button.stories.tsx | 32 +-- .storybook/stories/elements/Email.stories.tsx | 20 +- .../stories/elements/Headers.stories.tsx | 54 ++--- .../stories/elements/Oembed.stories.tsx | 20 +- .../stories/elements/SelectList.stories.tsx | 42 ++-- .../stories/elements/Telephone.stories.tsx | 20 +- .../elements/lockup/Lockup.stories.tsx | 157 +++++------- .../stories/nodes/StanfordCourse.data.tsx | 71 +++--- .../stories/nodes/StanfordEvent.data.tsx | 68 +++--- .../nodes/StanfordEventSeries.data.tsx | 131 +++++----- .../stories/nodes/StanfordNews.data.tsx | 8 +- .../stories/nodes/StanfordPage.data.tsx | 4 +- .../stories/nodes/StanfordPerson.data.tsx | 41 ++-- .../stories/nodes/StanfordPolicy.data.tsx | 13 +- .../nodes/StanfordPublication.data.tsx | 52 ++-- .../nodes/cards/BasicPageCard.stories.tsx | 38 +-- .../nodes/cards/CourseCard.stories.tsx | 42 ++-- .../stories/nodes/cards/EventCard.stories.tsx | 50 ++-- .../nodes/cards/EventSeriesCard.stories.tsx | 36 +-- .../stories/nodes/cards/NewsCard.stories.tsx | 53 +++-- .../nodes/cards/PersonCard.stories.tsx | 40 ++-- .../nodes/cards/PolicyCard.stories.tsx | 36 +-- .../nodes/cards/PublicationCard.stories.tsx | 34 +-- .../list-item/BasicPageListItem.stories.tsx | 36 +-- .../list-item/CourseListItem.stories.tsx | 40 ++-- .../nodes/list-item/EventListItem.stories.tsx | 44 ++-- .../list-item/EventSeriesListItem.stories.tsx | 34 +-- .../nodes/list-item/NewsListItem.stories.tsx | 53 +++-- .../list-item/PersonListItem.stories.tsx | 40 ++-- .../list-item/PolicyListItem.stories.tsx | 36 +-- .../list-item/PublicationListItem.stories.tsx | 34 +-- .../stories/paragraphs/Banner.stories.tsx | 6 +- .../stories/paragraphs/Card.stories.tsx | 6 +- .../stories/paragraphs/Gallery.stories.tsx | 10 +- .../stories/paragraphs/Wysiwyg.stories.tsx | 39 +-- .storybook/stories/storybook-entities.tsx | 48 ++-- app/[...slug]/metadata.tsx | 11 +- app/page.tsx | 14 +- src/components/elements/lockup/lockup.tsx | 44 ++-- src/components/elements/user-analytics.tsx | 14 +- src/components/global/page-header.tsx | 13 +- src/components/layouts/interior-page.tsx | 2 +- src/components/menu/main-menu.client.tsx | 221 +++++++++++++++++ src/components/menu/main-menu.tsx | 223 +----------------- src/lib/gql/gql-queries.tsx | 46 +++- 48 files changed, 1077 insertions(+), 1061 deletions(-) create mode 100644 src/components/menu/main-menu.client.tsx diff --git a/.storybook/stories/config-pages/GlobalMessage.stories.tsx b/.storybook/stories/config-pages/GlobalMessage.stories.tsx index e82d4ca..0cd280d 100644 --- a/.storybook/stories/config-pages/GlobalMessage.stories.tsx +++ b/.storybook/stories/config-pages/GlobalMessage.stories.tsx @@ -29,7 +29,8 @@ const globalMessage = { suGlobalMsgHeader: "Global Message Header", suGlobalMsgLabel: "Global Message Label", suGlobalMsgMessage: { - processed: "

Erat euismod nunc ipsum morbi tincidunt accumsan bibendum elementum mi vel leo elit urna bibendum sit metus varius leo enim ex tristique amet elit interdum.

", + processed: + "

Erat euismod nunc ipsum morbi tincidunt accumsan bibendum elementum mi vel leo elit urna bibendum sit metus varius leo enim ex tristique amet elit interdum.

", }, suGlobalMsgType: "success", suGlobalMsgLink: { diff --git a/.storybook/stories/elements/Accordion.stories.tsx b/.storybook/stories/elements/Accordion.stories.tsx index a6871a8..690e25f 100644 --- a/.storybook/stories/elements/Accordion.stories.tsx +++ b/.storybook/stories/elements/Accordion.stories.tsx @@ -1,48 +1,49 @@ -import type {Meta, StoryObj} from '@storybook/react'; -import Accordion from "@components/elements/accordion"; +import type {Meta, StoryObj} from "@storybook/react" +import Accordion from "@components/elements/accordion" // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction const meta: Meta = { - title: 'Design/Elements/Accordion', + title: "Design/Elements/Accordion", component: Accordion, - tags: ['autodocs'], + tags: ["autodocs"], argTypes: { button: { - control: "text" + control: "text", }, onClick: { table: { disable: true, - } + }, }, buttonProps: { table: { disable: true, - } + }, }, panelProps: { table: { disable: true, - } + }, }, isVisible: { table: { disable: true, - } - } - } -}; + }, + }, + }, +} -export default meta; -type Story = StoryObj; +export default meta +type Story = StoryObj // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const AccordionElement: Story = { render: ({onClick, ...args}) => { - return + return }, args: { button: "Id arcu nec vel tempus rutrum.", - children: "Mi amet tempus congue erat fusce euismod eros cursus morbi amet amet diam tristique bibendum hendrerit sed commodo quisque cursus scelerisque morbi placerat tristique magna." + children: + "Mi amet tempus congue erat fusce euismod eros cursus morbi amet amet diam tristique bibendum hendrerit sed commodo quisque cursus scelerisque morbi placerat tristique magna.", }, -}; +} diff --git a/.storybook/stories/elements/Address.stories.tsx b/.storybook/stories/elements/Address.stories.tsx index 3645fbc..59e1594 100644 --- a/.storybook/stories/elements/Address.stories.tsx +++ b/.storybook/stories/elements/Address.stories.tsx @@ -1,18 +1,18 @@ -import type {Meta, StoryObj} from '@storybook/react'; -import Address from "@components/elements/address"; +import type {Meta, StoryObj} from "@storybook/react" +import Address from "@components/elements/address" // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction const meta: Meta = { - title: 'Design/Elements/Address', + title: "Design/Elements/Address", component: Address, - tags: ['autodocs'], + tags: ["autodocs"], argTypes: { - singleLine: {control: "boolean"} - } -}; + singleLine: {control: "boolean"}, + }, +} -export default meta; -type Story = StoryObj; +export default meta +type Story = StoryObj // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const AddressElement: Story = { @@ -26,11 +26,11 @@ export const AddressElement: Story = { postalCode: "postal_code", singleLine: false, }, -}; +} export const OnelineAddress: Story = { args: { ...AddressElement.args, singleLine: true, - } -} \ No newline at end of file + }, +} diff --git a/.storybook/stories/elements/Button.stories.tsx b/.storybook/stories/elements/Button.stories.tsx index 675a8cf..8b69401 100644 --- a/.storybook/stories/elements/Button.stories.tsx +++ b/.storybook/stories/elements/Button.stories.tsx @@ -1,42 +1,42 @@ -import type {Meta, StoryObj} from '@storybook/react'; +import type {Meta, StoryObj} from "@storybook/react" -import Button from "@components/elements/button"; +import Button from "@components/elements/button" // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction const meta: Meta = { - title: 'Design/Elements/Button', + title: "Design/Elements/Button", component: Button, - tags: ['autodocs'], + tags: ["autodocs"], argTypes: { href: { - description: "Link url" + description: "Link url", }, buttonElem: { description: "Use a