< Summary

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

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
BuildRenderTree(...)0%40%
get_Delegation()100%10%
get_Clicked()100%10%
get_IsSelected()100%10%
get_SelectionText()100%10%
PickOrUnpickThis()100%10%
get_UseFlagStyle()0%40%

File(s)

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

#LineLine coverage
 1@inject MUNity.Database.Context.MunityContext context
 2
 3<div class="col-xl-3 col-lg-4 col-md-4 col-sm-6">
 04    <a @onclick="() => PickOrUnpickThis()" class="table-booking cursor-pointer">
 5        <div class="table-booking-container">
 6            <div class="table-booking-header" style="@UseFlagStyle">
 7                <div style="position: initial; display:block; left: 0; right: 0; top:0; bottom: 0; @UseFlagStyle"></div>
 8                <div class="d-flex align-items-center">
 9                    <div class="flex-1">
 010                        <div class="title fs-16px text-black" style="-webkit-text-stroke-width: 0.5px; -webkit-text-stro
 011                        <div class="no text-black" style="-webkit-text-stroke-width: 0.5px; -webkit-text-stroke-color: w
 012                        <div class="desc" style="-webkit-text-stroke-width: 0.5px; -webkit-text-stroke-color: black;">@D
 13                    </div>
 14                    @*@if (IsSelected)
 15                        {
 16                            <div class="pe-1 text-success">
 17                                <svg width="4em" height="4em" viewBox="0 0 16 16" class="bi bi-check2-circle" fill="curr
 18                                    <path fill-rule="evenodd" d="M15.354 2.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l
 19                                    <path fill-rule="evenodd" d="M8 2.5A5.5 5.5 0 1 0 13.5 8a.5.5 0 0 1 1 0 6.5 6.5 0 1 
 20                                </svg>
 21                            </div>
 22                        }
 23                        else
 24                        {
 25                            <div class="text-white">
 26                                <svg width="4em" height="4em" viewBox="0 0 16 16" class="bi bi-dash-circle" fill="curren
 27                                    <path fill-rule="evenodd" d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 0 8 0a8
 28                                    <path fill-rule="evenodd" d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 
 29                                </svg>
 30                            </div>
 31                        }*@
 32
 033                    @if (SelectionText != null)
 034                    {
 35                        <div class="pe-1 text-success text-center">
 36                            <svg width="4em" height="4em" viewBox="0 0 16 16" class="bi bi-check2-circle" fill="white" x
 37
 38                            </svg>
 39
 040                            <span class="badge bg-primary rounded-pill text-white fs-24px">@SelectionText</span>
 41                        </div>
 042                    }
 43
 44                </div>
 45            </div>
 46            <div class="table-booking-body">
 047                @foreach (var role in Delegation.Roles)
 048                {
 49                    <div class="booking">
 050                        <div class="time">@role.RoleName</div>
 051                        <div class="info">@role.CommitteeName</div>
 052                        <div class="">@role.Costs €</div>
 53                    </div>
 054                }
 55            </div>
 56        </div>
 57
 58    </a>
 59</div>
 60
 61@code {
 62
 063    [Parameter] public MUNity.Schema.Conference.ApplicationAvailableDelegation Delegation { get; set; }
 64
 065    [Parameter] public EventCallback<MUNity.Schema.Conference.ApplicationAvailableDelegation> Clicked { get; set; }
 66
 067    [Parameter] public bool IsSelected { get; set; }
 68
 069    [Parameter] public string SelectionText { get; set; }
 70
 71    private void PickOrUnpickThis()
 072    {
 073        this.Clicked.InvokeAsync(this.Delegation);
 074    }
 75
 76    public string UseFlagStyle
 77    {
 78        get
 079        {
 080            var flagIso = Delegation.Roles.GroupBy(n => n.CountryIso).Where(n => n.Key != null).Select(a => a.Key).First
 081            if (flagIso != null)
 082            {
 083                @if (SelectionText == null)
 084                    return $"background: url(/img/flags/medium/{flagIso}.png) #aaa no-repeat center center;background-bl
 85                else
 086                    return $"background: url(/img/flags/medium/{flagIso}.png) #333 no-repeat center center;background-bl
 87            }
 88
 089            return null;
 090        }
 91    }
 92}