< Summary

Information
Class: Syki.Front.Pages.Adm.AdmInstitutionsPage
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Pages/Adm/AdmInstitutionsPage.razor
Tag: 22_11348620282
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 51
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%210%
OnInitializedAsync()100%210%
get__quickFilter()100%210%
GetNotFoundMessage()0%620%

File(s)

/home/runner/work/syki/syki/Front/Pages/Adm/AdmInstitutionsPage.razor

#LineLine coverage
 1@namespace Syki.Front.Pages.Adm
 2
 3@page "/adm/institutions"
 4@attribute [Authorize(Roles = "Adm")]
 5
 6<SykiPageTitle Title="Instituições" />
 7
 8<MudContainer Class="my-4 px-4">
 9    <SykiPageHeader Icon="@Icons.Material.Filled.School" Title="Instituições" />
 10    <MudContainer Class="px-0 my-4">
 11        <MudDataGrid Class="pa-4" Items="@_institutions" QuickFilter="@_quickFilter" Hover="true" Loading="@_loading" De
 12            <ToolBarContent>
 13                <SykiDataGridSearchTextField @bind-Value="@_searchString" Placeholder="Busque por name" />
 14            </ToolBarContent>
 15            <Columns>
 16                <PropertyColumn Property="x => x.Id" Title="Id" />
 17                <PropertyColumn Property="x => x.Name" Title="Nome" />
 18                <PropertyColumn Property="x => x.CreatedAt.ToLocalTime()" Title="Criada em" />
 19            </Columns>
 20            <NoRecordsContent>
 21                @(GetNotFoundMessage())
 22            </NoRecordsContent>
 23            <PagerContent>
 24                <SykiDataGridPager T="InstitutionOut" />
 25            </PagerContent>
 26        </MudDataGrid>
 27    </MudContainer>
 28</MudContainer>
 29
 30@inject GetInstitutionsClient GetInstitutionsClient
 31
 32@code
 33{
 34    private bool _loading;
 35    private string _searchString;
 036    private List<InstitutionOut> _institutions = [];
 37
 38    protected override async Task OnInitializedAsync()
 39    {
 040        _loading = true;
 041        _institutions = await GetInstitutionsClient.Get();
 042        _loading = false;
 043    }
 44
 045    private Func<InstitutionOut, bool> _quickFilter => x => _searchString.IsIn(x.Name);
 46
 47    private string GetNotFoundMessage()
 48    {
 049        return (_searchString.IsEmpty()) ? "Não existem instituições cadastradas ainda." : "Nenhuma instituição encontra
 50    }
 51}