diff --git a/src/Umbraco.Web.UI.Client/.storybook/preview.js b/src/Umbraco.Web.UI.Client/.storybook/preview.js index 4c063c7389..3db4a8e24c 100644 --- a/src/Umbraco.Web.UI.Client/.storybook/preview.js +++ b/src/Umbraco.Web.UI.Client/.storybook/preview.js @@ -103,12 +103,10 @@ export const parameters = { 'Sections', 'Section Views', 'Section Sidebar Items', - 'Section Menus', - 'Trees', 'Entity Actions', 'Workspaces', - 'Workspace Actions', 'Property Editors', + 'Repositories', '*', ], '*', diff --git a/src/Umbraco.Web.UI.Client/src/stories/extending/repositories.mdx b/src/Umbraco.Web.UI.Client/src/stories/extending/repositories.mdx new file mode 100644 index 0000000000..0e47efec3f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/stories/extending/repositories.mdx @@ -0,0 +1,28 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Repositories + +TODO: make this understandable for others + +A repository is the Backoffices entry point to request data and get notified about updates. Each domain should register their own repository in the Backoffice. + +## Register a repository: + +TODO: add manifest + +With a repository we can have different data sources depending on the state of the app. It can be from a server, an offline database, a store, a Signal-R connection, etc. That means that the consumer will not have to be concerned how to access the data, add or remove items from a collection of items, etc. This means we get a loose connection between the consumer and the data storing procedures hiding all complex implementation. + +## Data flow with a repository + +TODO: add image of data flow + +A repository has to be instanced in the context where it is used. It should take a host element as part of the constructor, so any contexts consumed in the repository (notifications, modals, etc.) get rendered in the correct DOM context. + +A repository can be called directly from an element, but will often be instantiated in a context, like the Workspace Context. + +## The Repository Class + +TODO: get typescript interface +TODO: show repository example: