Skip to content

Commit

Permalink
docs(webapps): add documentation about login plugin points (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
tasso94 authored Jul 18, 2023
1 parent c22a4cb commit 4082f0c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion content/webapps/cockpit/extend/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ The second argument contains API endpoints and CSRF cookie information, as well
* `baseApi`, `adminApi`, `cockpitApi`, `engineApi`: The paths to different API endpoints. The engineApi corresponds to the [Rest Api]({{< ref "/reference/rest" >}})
The details of which data is passed into the plugin can be found at the [plugin point reference](#plugin-points).

* `result`: Function, only available in data plugins. Argument is a (`Promise`).

* `unmount`: Optional function which is called when the Plugin is unmounted. Use this to cleanup any listeners you or your Framework might have registered.

* `properties`: Optional object which contains all additional configuration for the plugin point, such as labels.
Expand Down Expand Up @@ -165,8 +167,25 @@ Plugin Points describe where a Plugin will be rendered and define which addition

For more information on creating and configuring your own plugin, please see [How to develop a Cockpit plugin](https://github.com/camunda/camunda-bpm-examples/tree/master/cockpit/cockpit-fullstack-count-processes).

## Data

**Data Plugin Points** have a `#result` function that gets the response data as a promise of a called REST endpoint passed.
The `#result` function is called when the respective HTTP request is performed.
The first argument of the `#result` function is a (`Promise`).

### Login Data

**Name:** `cockit.login.data`\
**REST Endpoint:** `POST /camunda/api/admin/auth/user/default/login/cockpit`

When a user clicks on the **Login** button of the login form, the plugin points `#result` function is called.
Your [Login Plugin](#login) can react to the data that this data plugin will retrieve.

This plugin point is available for all web apps. Just change the canonical app name for the respective webapp (`tasklist.login.data`, `admin.login.data`, `welcome.login.data`).

## Route
`cockpit.route`

**Name:** `cockpit.route`

This plugin points properties contain the attribute `path`, which stands for the hashRoute for this page. This will be rendered when the user navigates in the browser to the url, e.g. `#/my-path`.

Expand All @@ -192,6 +211,16 @@ properties: {
}
```

## Login

**Name:** `cockpit.login`

{{< img src="../../img/plugin-points/plugin-point-login-custom.png" title="Login" >}}

The `cockpit.login` plugin point allows to add your custom views at the place where the web app renders the login form.

This plugin point is available for all web apps. Just change the canonical app name for the respective webapp (`tasklist.login`, `admin.login`, `welcome.login`).

## Dashboard

**Name:** `cockpit.dashboard`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4082f0c

Please sign in to comment.