Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-8410] Extension schema review #3958

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 32 additions & 27 deletions docs/extending/application-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ All the customizations are stored in the `features` section of the configuration
"extensions": []
},
"sidebar": [],
"content-metadata-presets": []
"content-metadata-presets": [],
"badges": []
}
}
```
Expand Down Expand Up @@ -147,32 +148,6 @@ Please refer to the [Content Actions](#content-actions) section for more details

**Tip:** It is also possible to update or disable existing entries from within the external extension files. You will need to know the `id` of the target element to customize.

## Main action

Add possibility to show application `Main Action` button. The action is going to be shown above the `New` button, additionally `Main Action` will be highlighted as primary button, and `New` as secondary.

```json
{
"$schema": "../../../extension.schema.json",
"$version": "1.0.0",
"$name": "plugin1",

"features": {
"mainAction": {
"id": "plugin1.id",
"type": "button",
"title": "Create",
"actions": {
"click": "MAIN_ACTION_CALL"
},
"rules": {
"enabled": "app.navigation.canCall"
}
}
}
}
```

## Navigation Bar

The Navigation bar consists of Link elements (`NavBarLinkRef`) organized into Groups (`NavBarGroupRef`).
Expand Down Expand Up @@ -754,6 +729,36 @@ Here is the initial setting from `app.extension.json`:
**Tip:** In order to allow the content-metadata presets to be extended, the settings from `app.config.json` must be copied to the `app.extensions.json` file and its ids must be added to all the items.
Having ids allows external plugins to extend the current setting.

## Badges

If you would like to display any additional status information for any node you can create a badge for it. Badge is an icon that will be displayed inside document list in the name column, next to a name of the file. For each badge you can provide a custom tooltip, custom icon, a click action that will be triggered by clicking the badge and a custom rule for badge's visibility. The different badges are configured in the `app.extensions.json` file, but they can also be set on runtime through extension files. Badge may be defined like this:

```json
{
"id": "app..my-extension.badge",
MichalKinas marked this conversation as resolved.
Show resolved Hide resolved
"icon": "adf:custom-icon",
"tooltip": "MY_EXTENSION.BADGE_TOOLTIP",
"actions": {
"click": "CUSTOM_BADGE_ACTION"
},
"rules": {
"visible": "app.my-extension.canDisplayCustomBadge"
}
}
```

There is also another option to provide the badge, which is registering the custom component for it that will display the icon. It is particularly useful when status that you want to add the badge for require some asynchronous operations. In that case badge configuration would look like this:

```json
{
"id": "app.my-extension.badge",
"component": "my-extension.components.my-badge-icon",
"rules": {
"visible": "app.my-extension.canDisplayCustomBadge"
}
}
```

## Search

The search configurations are needed by the [Search Filter Component](https://www.alfresco.com/abn/adf/docs/content-services/components/search-filter.component/) to render the filters.
Expand Down
23 changes: 6 additions & 17 deletions extension.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,6 @@
"items": { "ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"badges": {
"description": "List of badges to display in the name column",
"type": "array",
"items": { "$ref": "#/definitions/badge" },
"minItems": 1
},
"badge": {
"type": "object",
"required": ["id", "icon", "tooltip"],
Expand Down Expand Up @@ -758,12 +752,6 @@
"items": { "$ref": "#/definitions/iconRef" },
"minItems": 1
},
"userActions": {
"description": "User option menu extensions",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"header": {
"description": "Application header extensions",
"type": "array",
Expand All @@ -776,11 +764,6 @@
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"mainAction": {
"description": "Main actions displayed on every page",
"type": "object",
"$ref": "#/definitions/contentActionRef"
},
"viewer": {
"description": "Viewer component extensions",
"type": "object",
Expand Down Expand Up @@ -933,6 +916,12 @@
}
}
},
"badges": {
"description": "List of badges to display in the name column",
"type": "array",
"items": { "$ref": "#/definitions/badge" },
"minItems": 1
},
"search": {
"description": "aca search extension",
"type": "array",
Expand Down
Loading