This repository serves as a template for building your own custom widget plugins for Grafolean.
There are two simple steps to create a working plugin:
-
fork this repository
-
in your fork, click on
Actions
and enable running of workflows (feel free to inspect them first) -
create a release "v0.0.1-rc.1"
This is it! GitHub Actions will now automatically package the code and publish the plugin (as an asset to the release) so that any Grafolean admin will be able to install it. You might need to wait a few minutes (check "Actions" tab for progress) before the plugin is ready to be used.
Now that this works, edit the code (clone it, edit src/*
files locally, commit and push) to modify the plugin as you see fit. Once ready, create a new release to publish a new version.
- releases must start with a letter
v
- only the latest release can currently be installed in Grafolean (i.e.: do not mark it as pre-release - pre-releases can't be used)
- it is recommended that releases follow semantic versioning
Prop g
contains everything that is passed from Grafolean to the widget plugin components. It includes:
urlParams
- parts of URL paths as parsed byreact-router
(i.e.,accountId
anddashboardId
), andcomponents
- access to some of the components available in Grafolean (most notablyPersistentFetcher
).
-
Connections to 3rd party servers disallowed
To limit potential privacy and security issues, Grafolean uses Content Security Policy (CSP). The settings employed forbid any connection to any server, except for the Grafolean deployment itself. In other words, never fetch resources (data, images, scripts,...) from external addresses as it will not work. Use
PersistentFetcher
component instead to fetch data from the Grafolean server.