Migrations
Widgets
Widget Type
WidgetType Enum describes the available types of widgets.
Platform- Widgets like navigation, GA, sidenav. Anything that cannot be placed on the dashboard.Dashboard- Widgets for dashboards only. Informers, charts, e.t.c.Universal- Widgets both for platform and dashboards.
enum WidgetType {
Platform = 0,
Dashboard = 1,
Universal = 2,
}
Domain
Domain describes placement of widget.
type Domain =
| "info"
| "navigation"
| "dashboard"
| "menu"
| "users"
| "lightbox"
| "navigation"
| "reporters"
| "get-user-info"
| "actionbar";
Migration widget
type MigrationWidgetConfigT = {
id: number;
name: string;
issuer: string;
domain: Domain;
url?: string;
placement?: string;
version: string;
widgetType: number;
widgetDetails?: WidgetDetailsT;
defaultProps?: Record<string, unknown>;
props?: Record<string, unknown>;
layout?: WidgetLayoutT;
port: number;
vendorPrefix: string;
tenentSlug: string;
defaultBranch: string;
exposes: Record<string, string>;
extended?: Record<string, unknown>;
};
id- id ofGitlabrepo.name- widget name. IMPORTANT: please use VENODOR-PREFIX_WidgetName notationissuer- issuer of the widget.domain- seedomainsectionurl- widget source url if used non defaultplacement- place where widget expected to be placedversion- widget versionwidgetType- seeWidgetTypeenumtenantSlug- short name of vendorwidgetDetails- special widget's parametersdefaultProps- props setted to widget by defaultprops- react propslayout- React Grid Layout propsport- port on which the widget is publishedvendorPrefix- short name of vendortenetSlug- short name of vendordefaultBranch- default branch of repositoryexposes- react components exposed in module federationextended- reserved key
Example:
{
"id": 100,
"port": 5100,
"name": "VENDOR_Widget",
"issuer": "Invent",
"domain": "domain",
"url": "url",
"version": "0.1.1",
"widgetType": 1,
"vendorPrefix": "vendor",
"tenentSlug": "vendor",
"defaultBranch": "master",
"exposes": {
"./Widget": "./src/widget/widget",
"./WidgetSettings": "./src/widget/settings",
"./WidgetPreview": "./src/widget/preview"
},
"widgetDetails": {
},
"defaultProps": {
"apiUrl": "_internal_api_"
},
"layout": {
"minW": 5,
"maxW": 1000,
"minH": 5,
"maxH": 1000
}
}
Vendors
Types
type JWKSLink = {
link: string;
issuer: string;
tenentSlug: string;
token: string;
};
link- url where open-id configuration for jwks could be foundissuer- issuer keytenentSlug- same as for Widgetstoken- tenent-id
The example of tenent data migration
{
link: "https://id.vendor.some-host.cloud/.well-known/openid-configuration/jwks",
issuer: "https://id.vendor.some-host.cloud",
tenentSlug: "VENDOR",
token: "2f6a9390-fe40-46ed-8731-0b72d321d01d",
}