IWidget

Last Update: 9/26/2016

All widgets should register a function that returns an object satisfying this contract.

Module path: TFS/Dashboards/WidgetContracts

Members

  • load: Function. This is the method that is called by the widget framework to load the widget. Parameter for this method is of type WidgetSettings. This will have the current saved settings of the widget and should be used by the load method to load the widget. It should return an object of type WidgetStatus wrapped in a Promise. Widgets can use the WidgetStatusHelper to return either Success or Failure.

  • disableWidgetForStakeholders: Function. Optional. This is the method that is called by the widget framework before loading the widget to determine if the widget needs to show a disabled view for Stakeholders. It should return an object of type boolean. Users with Stakeholder license have restricted access to VSTS features. In case your widget makes use of any feature that Stakeholders don't have access to, implement this method and return true. The framework will present the appropriate experience to stakeholders when they see your widget.