< 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
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 72
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
BuildRenderTree(...)100%66100%
.ctor()100%11100%

File(s)

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

#LineLine coverage
 1@using Chronicis.Client.Services
 2
 63@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}
 59else if (_user != null)
 10{
 11    <div class="d-flex flex-column flex-sm-row gap-4 align-start mb-4">
 412        @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">
 21                @(_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;">
 27                @_user.DisplayName
 28            </MudText>
 29            <MudText Typo="Typo.body1" Class="mud-text-secondary mt-1">
 30                @_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 {
 55    [Inject] private IAuthService AuthService { get; set; } = default!;
 56
 57    private UserInfo? _user;
 658    private bool _isLoading = true;
 59
 60    protected override async Task OnInitializedAsync()
 61    {
 62        _isLoading = true;
 63        try
 64        {
 65            _user = await AuthService.GetCurrentUserAsync();
 66        }
 67        finally
 68        {
 69            _isLoading = false;
 70        }
 71    }
 72}