Deploy
In order to deploy your widget to Corvina your account must have the permission to modify the organization.
To deploy a widget to Corvina you need to:
- create the manifest file
- create the widget package
- deploy the widget package to Corvina
Manifest file
The manifest file is JSON file that describe widget package and resources, save it in src/manifest.json
.
It is possible to export a single widget or a collection of widgets. To export a single widget the manifest format is:
{
"name": "org",
"source": "sdk",
"main": "lib.js",
"widgets": ["org.MyWidget"],
"resources":
{
"images": [
"corvina_logo.png"
],
"icon": "corvina_logo.png"
}
}
Remembet to specify the widget type in the widgets array.
- name: must be the same of widget class and component (required)
- source: use "sdk" (required)
- main: use "lib.js" (required)
- images: array of images name or empty array (required)
- icon: name of the icon (optional)
To export a collection of widgets the manifest format is:
{
"name": "org",
"source": "sdk",
"main": "lib.js",
"widgets": ["org.MyWidget", "org.MyWidget2"],
"resources":
{
"images": [ "image.svg"],
"icon": [ "corvina-widget1.png", "corvina-widget2.png" ]
}
}
The widget package contains transpiled widget code and resources. To create the package run:
yarn run build
that creates the zip package inside dist/upload.
Now to upload the widget to cCrvina:
- connect to Corvina portal
- open the dashboard editor
- select widget Gallery and navigate to Custom Widget section
- click the plus button to open the upload dialog
- drag and drop the widget package to the upload area or click the area to select the widget package
In order to add or remove widget to an organization is required the permission to modify the organization.