Declaring the GeneWidgetManifest
To integrate a Custom Widget in the Platform, you have to define a Manifest object that will describe and expose all your widget characteristics.
/**
* Copyright (c) 2019 DecisionBrain SAS. All Rights Reserved.
*
* GeneWidgetManifest is a descriptor class of components that can be used as
* in Dashboards or Custom Views.
*
* Any Custom Widget needs a manifest published by its module in the CustomDashboardWidgetFactoryService
* and also requires to be declared as 'entryComponent' of its module.
*/
export interface GeneWidgetManifest {
/**
* Widget name that will be used in the web client
*/
name: string;
/**
* Widget Version
*/
version?: string;
/**
* Widget Description, basically what it does, how it visualize data
*/
description: string;
/**
* The Platform widget simple className (case-sensitive)
*/
widgetTypeName: string;
/**
* The Platform Widget configurator className (case-sensitive). The configurator
* is the component used to configure the widget within Dashboard or Custom Views
*/
configuratorTypeName?: string;
/**
* This flag is set to true when the Widget can be used in a Dashboard
*/
dashboardCompatible: boolean;
/**
* This flag is set to true when the widget can be used in Custom Views
*/
customViewCompatible: boolean;
/**
* Dashboard minimum layout columns used by the Widget (a Dashboard has twenty (20) columns by default)
*/
minItemCols?: number;
/**
* Dashboard minimum layout rows used by the Widget (a Dashboard has twenty (20) rows by default)
*/
minItemRows?: number;
/**
* Dashboard default layout rows used by the widget
*/
itemRows?: number;
/**
* Dashboard default layout columns used by the widget
*/
itemCols?: number;
/**
* When this property is set to true, the component will not inherit from Gene
* widget default css (borders, colors).
*
* Use it, for example, if you do not want a component to get a card style when
* placed in a dashboard.
*/
preventDefaultCss?: boolean;
/**
* Set this property to true to use the default CSS but without a border and with a white background.
*
* This is useful if the overflow of the widget needs to be contained, but without showing borders (e.g. Rich Text)
*/
defaultCssNoBorder?: boolean;
}
For example:
public static MANIFEST: GeneWidgetManifest = {
name: 'Sample Widget',
version: '0.1.0',
description: 'This widget is a Platform Sample Widget',
widgetTypeName: 'SampleWidgetComponent',
configuratorTypeName: 'SampleWidgetConfiguratorComponent',
dashboardCompatible: true,
customViewCompatible: true,
minItemCols : 2,
minItemRows : 2,
itemRows : 3,
itemCols : 3,
};