@page "/"
@page "/Dashboard"
@inject MesaFabApprovalAuthStateProvider stateProvider
@inject IApprovalService approvalService
@inject IMemoryCache cache
@inject NavigationManager navigationManager
@inject ISnackbar snackbar
Dashboard
Dashboard
@if (stateProvider.CurrentUser is not null && approvalList is not null) {
My Active Approvals
Issue ID
Role
Assigned Date
Step
@context.IssueID
@context.SubRoleCategoryItem
@DateTimeUtilities.GetDateAsStringMinDefault(context.AssignedDate)
@context.Step
}
@code {
private IEnumerable approvalList = new List();
protected async override Task OnParametersSetAsync() {
try {
if (stateProvider.CurrentUser is not null)
approvalList = (await approvalService.GetApprovalsForUserId(stateProvider.CurrentUser.UserID, true)).ToList();
} catch (Exception ex) {
snackbar.Add($"Unable to fetch your outstanding approvals, because {ex.Message}", Severity.Error);
}
}
private void GoTo(string page) {
cache.Set("redirectUrl", page);
navigationManager.NavigateTo(page);
}
}