What product/components do you use and which version/fix level are you on?
Cumulocity 1016.0.300
Is your question related to the free trial, or to a production (customer) instance?
Production instance
What are you trying to achieve? Please describe it in detail.
Basically, I’m trying to create a widget plugin that doesn’t require an asset selection. More specifically, trying to figure out how to freely modify the “Asset selection” parameters here:
It seems like the AssetSelectorOptions interface would be the way to do it, but I haven’t been able to get the widget plugin to use those options. I started by using ‘c8ycli’ with the ‘widget-plugin’ project scaffold and then modifying from there. Any suggestions on how to modify the asset selector options in the widget?
if you e.g. have a look at the tutorial applications widget:
providers: [
{
provide: HOOK_COMPONENTS,
multi: true,
useValue: [
{
id: 'angular.widget.demo',
label: 'My angular widget',
description: 'This is a description from angular',
component: WidgetDemo,
configComponent: WidgetConfigDemo,
/** new Angular-Dashboard definition */
data: {
// The settings object can be used to configure the configComponent
settings: {
noNewWidgets: false, // Set this to true, to don't allow adding new widgets.
ng1: {
options: {
noDeviceTarget: false, // Set this to true to hide the AngularJS device selector.
groupsSelectable: false // Set this, if not only devices should be selectable.
}
}
},
// Settings that are attached to the display component (in this case: WidgetDemo)
displaySettings: {
globalTimeContext: true // Set this to true, to add a global time context binding
}
} as ContextWidgetConfig
}
] as DynamicComponentDefinition[]
}
]
By setting noDeviceTarget to true and groupsSelectable to false, the asset selector should be gone.
You could then go ahead and either add the asset-selector with your configuration/options to your widget configuration component or implement your own asset selection.
Thanks Tristan - that worked! Do you know if there is documentation that lists all of the available options? I see some of them in Web SDK documentation but not all of them (e.g., noDeviceTarget).
the ContextWidgetConfig type covers this. Sadly the online documentation does not cover the attributes…
But if you import the type, you should get these.