< Summary

Information
Class: Elsa.Dashboard.Api.Endpoints.Dashboard.NeedsAttention.Endpoint
Assembly: Elsa.Dashboard.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Dashboard.Api/Endpoints/Dashboard/NeedsAttention/Endpoint.cs
Line coverage
44%
Covered lines: 4
Uncovered lines: 5
Coverable lines: 9
Total lines: 26
Line coverage: 44.4%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Configure()100%11100%
ExecuteAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Dashboard.Api/Endpoints/Dashboard/NeedsAttention/Endpoint.cs

#LineLine coverage
 1using Elsa.Authorization;
 2using Elsa.Abstractions;
 3using Elsa.Dashboard.Abstractions.Contracts;
 4using Elsa.Dashboard.Abstractions.Models;
 5using Elsa.Dashboard.Api.Permissions;
 6using JetBrains.Annotations;
 7
 8namespace Elsa.Dashboard.Api.Endpoints.Dashboard.NeedsAttention;
 9
 10[PublicAPI]
 311internal class Endpoint(IDashboardProvider dashboardProvider) : ElsaEndpointWithoutRequest<DashboardNeedsAttentionRespon
 12{
 13    public override void Configure()
 14    {
 315        Get("/dashboard/needs-attention");
 316        RequirePermission(Elsa.Dashboard.Api.Permissions.DashboardResourcePermissions.Dashboard, CoreVerbs.View);
 317    }
 18
 19    public override async Task<DashboardNeedsAttentionResponse> ExecuteAsync(CancellationToken cancellationToken)
 20    {
 021        var range = Query<string?>("range", false);
 022        var take = Query<int?>("take", false) ?? 8;
 023        var includeSystem = Query<bool>("includeSystem", false);
 024        return await dashboardProvider.GetNeedsAttentionAsync(new(range, includeSystem), take, cancellationToken);
 025    }
 26}