-
Notifications
You must be signed in to change notification settings - Fork 2
Pending Results
zehavibarak edited this page Dec 21, 2021
·
1 revision
You can customize widgets by either passing options using Options attribute in the configuration file, or by extending the backing class.
Core widgets that retrieve data per user can be customized to show only some users. For example, comparison between peers of the logged user, or performance of subordinates. You can define programmatically which users data to populate by overriding the base class methods.
public class Peers : PendingResults {
private readonly IHttpContext _httpContext;
public Peers(Store store, IOptions<SystemOptions> options, IHttpContext httpContext) : base(store, options) {
_httpContext = httpContext;
}
public override async Task<string[]> GetUsersAsync() {
var userId = _httpContext.UserId;
return await GetPeersIdsAsync(userId);
}
private Task<string[]> GetPeersIdsAsync(string userId) {
...
}
}The widgets that follow this pattern are PendingResults, DepartmentsCompare, PersonalActivity and DepartmentalPerformance.
DepartmentsCompare also has a GetGroupsAsync() method you can override to provide the list of departments.
The title of the widget can be set in the configuration file.
Moding Ltd.