< Summary

Information
Class: Chronicis.Client.Components.Settings.ProfileSection
Assembly: Chronicis.Client
File(s): /home/runner/work/chronicis/chronicis/src/Chronicis.Client/Components/Settings/ProfileSection.razor
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 72
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
BuildRenderTree(...)0%4260%
get_AuthService()100%210%
.ctor()100%210%
OnInitializedAsync()100%210%

File(s)

/home/runner/work/chronicis/chronicis/src/Chronicis.Client/Components/Settings/ProfileSection.razor

#LineLine coverage
 1@using Chronicis.Client.Services
 2
 03@if (_isLoading)
 4{
 5    <div class="d-flex justify-center pa-4">
 6        <MudProgressCircular Indeterminate="true" Size="Size.Medium" Color="Color.Primary" />
 7    </div>
 8}
 09else if (_user != null)
 10{
 11    <div class="d-flex flex-column flex-sm-row gap-4 align-start mb-4">
 012        @if (!string.IsNullOrEmpty(_user.AvatarUrl))
 13        {
 14            <MudAvatar Size="Size.Large" Class="profile-avatar">
 15                <MudImage Src="@_user.AvatarUrl" Alt="@_user.DisplayName" />
 16            </MudAvatar>
 17        }
 18        else
 19        {
 20            <MudAvatar Size="Size.Large" Color="Color.Primary" Class="profile-avatar profile-avatar--initials">
 021                @(_user.DisplayName?.FirstOrDefault())
 22            </MudAvatar>
 23        }
 24
 25        <div class="flex-grow-1">
 26            <MudText Typo="Typo.h5" Color="Color.Primary" Style="font-weight: 600;">
 027                @_user.DisplayName
 28            </MudText>
 29            <MudText Typo="Typo.body1" Class="mud-text-secondary mt-1">
 030                @_user.Email
 31            </MudText>
 32        </div>
 33    </div>
 34
 35    <MudDivider Class="my-4" />
 36
 37    <MudText Typo="Typo.subtitle2" Color="Color.Primary" Class="mb-2" Style="font-weight: 600;">
 38        Account Information
 39    </MudText>
 40
 41    <MudText Typo="Typo.body2" Class="mud-text-secondary">
 42        Your profile information is managed through your authentication provider.
 43        To update your display name or avatar, please update it in your
 44        connected account (Google, Discord, etc.) and sign in again.
 45    </MudText>
 46}
 47else
 48{
 49    <MudAlert Severity="Severity.Warning">
 50        Unable to load profile information. Please try refreshing the page.
 51    </MudAlert>
 52}
 53
 54@code {
 055    [Inject] private IAuthService AuthService { get; set; } = default!;
 56
 57    private UserInfo? _user;
 058    private bool _isLoading = true;
 59
 60    protected override async Task OnInitializedAsync()
 61    {
 062        _isLoading = true;
 63        try
 64        {
 065            _user = await AuthService.GetCurrentUserAsync();
 066        }
 67        finally
 68        {
 069            _isLoading = false;
 70        }
 071    }
 72}