From 6d303638f2cbffd26a4c1921df1c3ab03623218e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 1 Mar 2023 14:45:24 +0100 Subject: [PATCH] split workspace stories --- .../.storybook/preview.js | 1 + .../src/stories/extending/header-apps.mdx | 2 + .../stories/extending/workspaces/actions.mdx | 40 +++++++++++++++++++ .../{workspaces.mdx => workspaces/intro.mdx} | 23 +++-------- .../stories/extending/workspaces/views.mdx | 28 +++++++++++++ 5 files changed, 76 insertions(+), 18 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/actions.mdx rename src/Umbraco.Web.UI.Client/src/stories/extending/{workspaces.mdx => workspaces/intro.mdx} (59%) create mode 100644 src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/views.mdx diff --git a/src/Umbraco.Web.UI.Client/.storybook/preview.js b/src/Umbraco.Web.UI.Client/.storybook/preview.js index 3db4a8e24c..d39d7eeeee 100644 --- a/src/Umbraco.Web.UI.Client/.storybook/preview.js +++ b/src/Umbraco.Web.UI.Client/.storybook/preview.js @@ -105,6 +105,7 @@ export const parameters = { 'Section Sidebar Items', 'Entity Actions', 'Workspaces', + ['Intro', 'Views', 'Actions', '*'], 'Property Editors', 'Repositories', '*', diff --git a/src/Umbraco.Web.UI.Client/src/stories/extending/header-apps.mdx b/src/Umbraco.Web.UI.Client/src/stories/extending/header-apps.mdx index 74a512684e..3aff51bf16 100644 --- a/src/Umbraco.Web.UI.Client/src/stories/extending/header-apps.mdx +++ b/src/Umbraco.Web.UI.Client/src/stories/extending/header-apps.mdx @@ -52,6 +52,8 @@ interface UmbHeaderAppElement {} {} ``` +**Default Element** + ```ts // TODO: get interface interface UmbButtonHeaderAppElement {} diff --git a/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/actions.mdx b/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/actions.mdx new file mode 100644 index 0000000000..e6f28b225e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/actions.mdx @@ -0,0 +1,40 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Workspace Actions + +// TODO: intro to workspace actions + +- Relates to a workspace alias (Umb.Workspace.Document). +- Performs the action on the workspace draft state. +- Has Access to the workspace context. + + + +**Manifest** + +```json + { + "type": "workspaceAction", + "alias": "My.WorkspaceAction.Workspace.Action", + "name": "My Workspace Action", + "meta": { + "workspaces": ["My.Workspace"], + "label": "Run", + "look": "primary", + "color": "positive", + }, + }, + +``` + +**Default Element** + +```ts +// TODO: get interface +interface UmbWorkspaceActionElement {} +``` diff --git a/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces.mdx b/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/intro.mdx similarity index 59% rename from src/Umbraco.Web.UI.Client/src/stories/extending/workspaces.mdx rename to src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/intro.mdx index 50c6058c31..8526b9c37c 100644 --- a/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces.mdx +++ b/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/intro.mdx @@ -1,6 +1,9 @@ import { Meta } from '@storybook/addon-docs'; - + # Workspaces @@ -19,22 +22,6 @@ TODO: add description of a workspace interface UmbWorkspaceElement {} ``` -## Workspace Views - -TODO: descrtibe workspace views - - - -```ts -// TODO: get typescript interface -``` - -## Workspace Actions - - - -Relates to a workspace alias (Umb.Workspace.Document). Performs the action on the workspace draft state. - ## The Workspace Context ```ts @@ -42,6 +29,6 @@ Relates to a workspace alias (Umb.Workspace.Document). Performs the action on th interface UmbWorkspaceContext {} ``` -#### Examples of workspaces: +## Examples of workspaces: TODO: link to all workspaces in storybook. Can we somehow auto-generate this list? diff --git a/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/views.mdx b/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/views.mdx new file mode 100644 index 0000000000..2491e2e749 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/stories/extending/workspaces/views.mdx @@ -0,0 +1,28 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Workspace Views + +TODO: add description of a workspace views + + + +**Manifest** + +```json + { + "type": "workspaceView", + "alias": "My.WorkspaceView", + "name": "My Workspace View", + "meta": { + "workspaces": ["My.Workspace"], + "label": "My View", + "pathname": "/my-view" + }, + }, + +```