Skip to content

Commit

Permalink
docs: add docs on HeaderPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
soofstad committed May 29, 2024
1 parent f5a0468 commit 2b9dcf9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@
"name": "hideAbout",
"type": "dmss://system/SIMOS/BlueprintAttribute",
"attributeType": "boolean",
"description": "Hide the about link in the header",
"default": false
},
{
"name": "hideUserInfo",
"type": "dmss://system/SIMOS/BlueprintAttribute",
"attributeType": "boolean",
"description": "Hide the user info in the header",
"default": false
},
{
"name": "uiRecipesList",
"type": "dmss://system/SIMOS/BlueprintAttribute",
"attributeType": "string",
"dimensions": "*"
"dimensions": "*",
"description": "Can be used to specify a list of UI recipes the user can select. By default, the fist UI recipe in\n the list is displayed. If the list is empty, all UI recipes will be included."
},
{
"name": "adminRole",
"type": "dmss://system/SIMOS/BlueprintAttribute",
"attributeType": "string",
"default": "dmss-admin",
"description": "The role that is considered an admin role. If the user has this role, the user will see the 'admin menu' in the header.",
"optional": true
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import headerPluginConfig from '../../blueprints/header/HeaderPluginConfig.json'


# Data Modelling Framework - UiPlugin - Header

The `header` plugin is meant to be used as a web application header. Providing user information, application
information, and an application recipe selector. Below the header, another UI plugin is displayed.

If you want to specify a config object in some UiRecipe-entity, the Blueprint is included in the npm package.

Copy it like so: `cp -R node_modules/@development-framework/dm-core-plugins/blueprint/header ./myApplicationBlueprints/`
Copy it like so: `cp -R node_modules/@development-framework/dm-core-plugins/blueprints/header ./myApplicationBlueprints/`

# Config

The Header plugin can accept a config of type `HeaderPluginConfig` (
see `dm-core-plugins/blueprints/header/HeaderPluginConfig.json`).
The Header plugin can accept a config of type `HeaderPluginConfig`.
Explanation of the attributes:

* `uiRecipesList`: Can be used to specify a list of UI recipes the user can select. By default, the fist UI recipe in
Expand All @@ -23,10 +19,37 @@ Explanation of the attributes:
defaults to false.
* `hideUserInfo`: Is a boolean value that determines if the User info button in the header is activated. If not
specified, defaults to false.
* `adminRole`: The role that is considered an admin role. If the user has this role, the user will see the 'admin menu' in the header.


![alt text](image.png)
![headerPlugin](./headerPlugin.png)

```json
{headerPluginConfig}
{
"type": "CORE:RecipeLink",
"_blueprintPath_": "/apps/ExampleApplication/ExampleApplication",
"initialUiRecipe": {
"name": "Header",
"type": "CORE:UiRecipe",
"plugin": "@development-framework/dm-core-plugins/header",
"config": {
"type": "PLUGINS:dm-core-plugins/header/HeaderPluginConfig",
"hideAbout": false,
"hideUserInfo": false,
"uiRecipesList": ["Explorer", "Yaml"]
}
},
"uiRecipes": [
{
"name": "Explorer",
"type": "CORE:UiRecipe",
"plugin": "@development-framework/dm-core-plugins/explorer"
},
{
"name": "Yaml",
"type": "CORE:UiRecipe",
"plugin": "@development-framework/dm-core-plugins/yaml"
}
]
}
```
4 changes: 4 additions & 0 deletions packages/dm-core-plugins/docs/HeaderPlugin/blueprints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"folder": "header",
"main": "HeaderPluginConfig"
}

0 comments on commit 2b9dcf9

Please sign in to comment.