Small UI changes (#3787)

This commit is contained in:
Joe Milazzo 2025-05-04 08:14:44 -06:00 committed by GitHub
parent 50a052e412
commit 5b8a643d82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
203 changed files with 369 additions and 446 deletions

View file

@ -2,15 +2,15 @@
namespace API.DTOs.Account;
public class AgeRestrictionDto
public sealed record AgeRestrictionDto
{
/// <summary>
/// The maximum age rating a user has access to. -1 if not applicable
/// </summary>
public required AgeRating AgeRating { get; set; } = AgeRating.NotApplicable;
public required AgeRating AgeRating { get; init; } = AgeRating.NotApplicable;
/// <summary>
/// Are Unknowns explicitly allowed against age rating
/// </summary>
/// <remarks>Unknown is always lowest and default age rating. Setting this to false will ensure Teen age rating applies and unknowns are still filtered</remarks>
public required bool IncludeUnknowns { get; set; } = false;
public required bool IncludeUnknowns { get; init; } = false;
}

View file

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ConfirmEmailDto
public sealed record ConfirmEmailDto
{
[Required]
public string Email { get; set; } = default!;

View file

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ConfirmEmailUpdateDto
public sealed record ConfirmEmailUpdateDto
{
[Required]
public string Email { get; set; } = default!;

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class ConfirmMigrationEmailDto
public sealed record ConfirmMigrationEmailDto
{
public string Email { get; set; } = default!;
public string Token { get; set; } = default!;

View file

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ConfirmPasswordResetDto
public sealed record ConfirmPasswordResetDto
{
[Required]
public string Email { get; set; } = default!;

View file

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account;
public class InviteUserDto
public sealed record InviteUserDto
{
[Required]
public string Email { get; set; } = default!;

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class InviteUserResponse
public sealed record InviteUserResponse
{
/// <summary>
/// Email link used to setup the user account

View file

@ -1,7 +1,7 @@
namespace API.DTOs.Account;
#nullable enable
public class LoginDto
public sealed record LoginDto
{
public string Username { get; init; } = default!;
public string Password { get; set; } = default!;

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class MigrateUserEmailDto
public sealed record MigrateUserEmailDto
{
public string Email { get; set; } = default!;
public string Username { get; set; } = default!;

View file

@ -2,7 +2,7 @@
namespace API.DTOs.Account;
public class ResetPasswordDto
public sealed record ResetPasswordDto
{
/// <summary>
/// The Username of the User

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class TokenRequestDto
public sealed record TokenRequestDto
{
public string Token { get; init; } = default!;
public string RefreshToken { get; init; } = default!;

View file

@ -3,7 +3,7 @@ using API.Entities.Enums;
namespace API.DTOs.Account;
public class UpdateAgeRestrictionDto
public sealed record UpdateAgeRestrictionDto
{
[Required]
public AgeRating AgeRating { get; set; }

View file

@ -1,6 +1,6 @@
namespace API.DTOs.Account;
public class UpdateEmailDto
public sealed record UpdateEmailDto
{
public string Email { get; set; } = default!;
public string Password { get; set; } = default!;

View file

@ -4,12 +4,16 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account;
#nullable enable
public record UpdateUserDto
public sealed record UpdateUserDto
{
/// <inheritdoc cref="API.Entities.AppUser.Id"/>
public int UserId { get; set; }
/// <inheritdoc cref="API.Entities.AppUser.UserName"/>
public string Username { get; set; } = default!;
/// <summary>
/// List of Roles to assign to user. If admin not present, Pleb will be applied.
/// If admin present, all libraries will be granted access and will ignore those from DTO.
/// </summary>
public IList<string> Roles { get; init; } = default!;
/// <summary>
/// A list of libraries to grant access to
@ -19,8 +23,6 @@ public record UpdateUserDto
/// An Age Rating which will limit the account to seeing everything equal to or below said rating.
/// </summary>
public AgeRestrictionDto AgeRestriction { get; init; } = default!;
/// <summary>
/// Email of the user
/// </summary>
/// <inheritdoc cref="API.Entities.AppUser.Email"/>
public string? Email { get; set; } = default!;
}