< Summary

Information
Class: Syki.Front.Pages.Adm.AdmFeatureFlagsPage
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Pages/Adm/AdmFeatureFlagsPage.razor
Tag: 22_11348620282
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 46
Line coverage: 0%
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
<BuildRenderTree()100%210%
<BuildRenderTree()100%210%
OnInitializedAsync()100%210%
Setup()100%210%

File(s)

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

#LineLine coverage
 1@using Syki.Front.Features.Adm.GetFeatureFlags
 2
 3@namespace Syki.Front.Pages.Adm
 4
 5@page "/adm/feature-flags"
 6@attribute [Authorize(Roles = "Adm")]
 7
 8<SykiPageTitle Title="Features" />
 9
 10<MudContainer Class="my-4 px-4">
 11    <SykiPageHeader Icon="@Icons.Material.Filled.Flag" Title="Features" />
 12    <MudContainer Class="px-0 my-4">
 13        <MudGrid Spacing="4">
 014            <FeatureFlagCard Loading="@_loading" Text="Logar sem cadastro" Value="@_skipUserRegister" ValueChanged="asyn
 015            <FeatureFlagCard Loading="@_loading" Text="Login cruzado" Value="@_crossLogin" ValueChanged="async x => { _c
 16        </MudGrid>
 17    </MudContainer>
 18</MudContainer>
 19
 20@inject ISnackbar Snackbar
 21@inject GetFeatureFlagsClient GetFeatureFlagsClient
 22@inject SetupFeatureFlagsClient SetupFeatureFlagsClient
 23
 24@code
 25{
 26    private bool _loading;
 27    private bool _skipUserRegister;
 28    private bool _crossLogin;
 29
 30    protected override async Task OnInitializedAsync()
 31    {
 032        _loading = true;
 033        var features = await GetFeatureFlagsClient.Get();
 034        _skipUserRegister = features.SkipUserRegister;
 035        _crossLogin = features.CrossLogin;
 036        _loading = false;
 037    }
 38
 39    private async Task Setup()
 40    {
 041        _loading = true;
 042        await SetupFeatureFlagsClient.Setup(_skipUserRegister, _crossLogin);
 043        Snackbar.Add("Feature alterada com sucesso!", Severity.Success);
 044        _loading = false;
 045    }
 46}