< Summary

Class:MUNity.BlazorServer.Components.Conference.ManageApplicationSettings
Assembly:MUNity.BlazorServer
File(s):C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNity.BlazorServer\Components\Conference\ManageApplicationSettings.razor
Covered lines:0
Uncovered lines:30
Coverable lines:30
Total lines:112
Line coverage:0% (0 of 30)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)
Covered methods:0
Total methods:5
Method coverage:0% (0 of 5)

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
BuildRenderTree(...)0%80%
get_ConferenceId()100%10%
get_AuthStateTask()100%10%
.ctor()100%10%
OnInitializedAsync()0%40%

File(s)

C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNity.BlazorServer\Components\Conference\ManageApplicationSettings.razor

#LineLine coverage
 1@using MUNity.Database.Models.Website
 2@using MUNity.Database.Context
 3@inject Services.UserConferenceAuthService conferenceAuthService
 4@inject MunityContext dbContext
 5
 06@if (isAuthorized)
 07{
 8    <table class="table">
 9        <thead>
 10            <tr>
 11                <th>Eigenschaft</th>
 12                <th>Wert</th>
 13            </tr>
 14        </thead>
 15        <tbody>
 16            <tr>
 17                <td>Bewerbung auf Delegation</td>
 018                <td>@((dbContext.ConferenceApplicationOptions.Any(a => a.Conference.ConferenceId == ConferenceId && a.Al
 19            </tr>
 20            <tr>
 21                <td>Bewerbung auf Rollen</td>
 022                <td>@((dbContext.ConferenceApplicationOptions.Any(a => a.Conference.ConferenceId == ConferenceId && a.Al
 23            </tr>
 24            <tr>
 25                <td>Bewerbung auf Team-Rollen</td>
 026                <td>@((dbContext.ConferenceApplicationOptions.Any(a => a.Conference.ConferenceId == ConferenceId && a.Al
 27            </tr>
 28            <tr>
 29                <td>Anzahl Delegation-Slots</td>
 030                <td>@dbContext.Delegates.Count(n => n.Conference.ConferenceId == ConferenceId && n.ApplicationState == E
 31            </tr>
 32            <tr>
 33                <td>Anzahl Rollen mit Direktbewerbung</td>
 034                <td>@dbContext.Delegates.Count(n => n.Conference.ConferenceId == ConferenceId && n.ApplicationState == E
 35            </tr>
 36            <tr>
 37                <td>Anzahl Rollen mit geschlossener Bewerbung</td>
 038                <td>@dbContext.Delegates.Count(n => n.Conference.ConferenceId == ConferenceId && n.ApplicationState == E
 39            </tr>
 40            <tr>
 41                <td>Anzahl eingereichter DelegationWishesbewerbungen</td>
 042                <td>@dbContext.DelegationApplications.Count(n => n.DelegationWishes.Select(a => a.Delegation.Conference)
 43            </tr>
 44            <tr>
 45                <td>Delegationen welche durch Bewerbungen abgedeckt sind</td>
 46                <td>
 47                    @{
 048                        var totalCount = dbContext.Delegations.Count(n => n.Conference.ConferenceId == ConferenceId);
 049                        var coveredCount = dbContext.Delegations.Count(n => n.Conference.ConferenceId == ConferenceId &&
 050                        int percentage = coveredCount * 100 / totalCount;
 51
 52                        <div class="widget-chart-info-progress">
 53                            <b>Abdeckung</b>
 054                            <span class="float-end">@percentage %</span>
 55                        </div>
 56                        <div class="progress h-10px">
 57                            <div class="progress-bar rounded-pill" style="width:@(percentage)%;"></div>
 58                        </div>
 59                        <small class="text-secondary">Achtung, diese Zahl gibt nur an, wie auf welche Delegationen ein B
 60                    }
 61                </td>
 62
 63            </tr>
 64            <tr>
 65                <td>Delegationen welche durch erstwünsche abgedeckt sind</td>
 66                <td>
 67                    @{
 068                        var coveredCountByPrioZero = dbContext.Delegations.Count(n => n.Conference.ConferenceId == Confe
 069                        int percentagePrioZero = coveredCountByPrioZero * 100 / totalCount;
 70
 71                        <div class="widget-chart-info-progress">
 72                            <b>Abdeckung</b>
 073                            <span class="float-end">@percentagePrioZero %</span>
 74                        </div>
 75                        <div class="progress h-10px">
 76                            <div class="progress-bar rounded-pill" style="width:@(percentagePrioZero)%;"></div>
 77                        </div>
 78                        <small class="text-secondary">Diese Zahl gibt an, wie viele Delegationen besetzt sind, wenn die 
 79                    }
 80                </td>
 81
 82            </tr>
 83        </tbody>
 84    </table>
 85
 086}
 87else
 088{
 89    <div class="alert alert-muted">
 90        Daten werden geladen...
 91    </div>
 092}
 93
 94@code {
 095    [Parameter] public string ConferenceId { get; set; }
 96
 097    [CascadingParameter] public Task<AuthenticationState> AuthStateTask { get; set; }
 98
 099    private bool isAuthorized = false;
 100
 101
 102    protected override async Task OnInitializedAsync()
 0103    {
 0104        await base.OnInitializedAsync();
 0105        var claim = (await AuthStateTask)?.User;
 0106        if (claim != null)
 0107        {
 0108            this.isAuthorized = await conferenceAuthService.IsUserAllowedToEditConference(ConferenceId, claim);
 0109        }
 0110    }
 111
 112}