Run code clean and fix messages
All checks were successful
Game Ideas build for PR / build_test (pull_request) Successful in 1m26s
All checks were successful
Game Ideas build for PR / build_test (pull_request) Successful in 1m26s
This commit is contained in:
@@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.JSInterop;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Pages.Games.Components;
|
||||
|
||||
@@ -21,7 +20,7 @@ public partial class GameCreationForm
|
||||
[Parameter] public CategoriesDto? Categories { get; set; }
|
||||
[Parameter] public EventCallback OnSubmit { get; set; }
|
||||
|
||||
private GameDetailDto GameDto = new();
|
||||
private readonly GameDetailDto GameDto = new();
|
||||
private EditContext? EditContext;
|
||||
private readonly SelectTheme Theme = SelectTheme.Creation;
|
||||
private readonly SliderParams SliderParams = new() { Gap = 1, Min = 1, Max = 5 };
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@inherits GameBase
|
||||
|
||||
<div class="row">
|
||||
<img class="icon" src="~/icon.png" />
|
||||
<img class="icon" src="icon.png" />
|
||||
|
||||
<a class="title" href="@($"/Detail/{GameDto.Id}")">@GameDto.Title</a>
|
||||
|
||||
|
||||
@@ -80,9 +80,20 @@
|
||||
fill: var(--white);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
.release-date {
|
||||
display: none;
|
||||
grid-column: span;
|
||||
}
|
||||
|
||||
.row {
|
||||
grid-template-columns: auto 3fr 3fr 30px 30px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1000px) {
|
||||
.row {
|
||||
grid-template-columns: 48px 3fr 2fr 3fr 30px 30px;
|
||||
grid-template-columns: auto 3fr 2fr 3fr 30px 30px;
|
||||
}
|
||||
|
||||
.tags, .storage {
|
||||
|
||||
@@ -10,9 +10,9 @@ public partial class Login
|
||||
[Parameter] public IAuthGateway AuthGateway { get; set; } = default!;
|
||||
|
||||
private EditContext? EditContext;
|
||||
private UserDto UserDto = new();
|
||||
private readonly UserDto UserDto = new();
|
||||
private bool IsLoading = false;
|
||||
private LoginValidator Validator = new();
|
||||
private readonly LoginValidator Validator = new();
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
EditContext = new EditContext(UserDto);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using FluentValidation;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using GameIdeas.Shared.Dto;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
@@ -17,10 +17,10 @@ public partial class Users
|
||||
|
||||
private Popup? Popup;
|
||||
private bool IsLoading = false;
|
||||
private UserFilterParams FilterParams = new();
|
||||
private readonly UserFilterParams FilterParams = new();
|
||||
private UserListDto UserList = new();
|
||||
private IEnumerable<RoleDto> Roles = [];
|
||||
private int CurrentPage = 1;
|
||||
private readonly int CurrentPage = 1;
|
||||
private UserDto UserAdd = new();
|
||||
private UserDto? UserDelete;
|
||||
private string? currentUserId;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Net.Http.Json;
|
||||
using Blazored.LocalStorage;
|
||||
using GameIdeas.BlazorApp;
|
||||
using GameIdeas.BlazorApp.Pages.Games.Gateways;
|
||||
@@ -10,6 +9,7 @@ using GameIdeas.Shared.Constants;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
var services = builder.Services;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using GameIdeas.Resources;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json;
|
||||
using System.Text;
|
||||
using Blazored.LocalStorage;
|
||||
using Blazored.LocalStorage;
|
||||
using GameIdeas.Resources;
|
||||
using GameIdeas.Shared.Constants;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Services;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Blazored.LocalStorage;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using System.Security.Claims;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using GameIdeas.Shared.Constants;
|
||||
using GameIdeas.Shared.Dto;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Services;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
await Js.InvokeVoidAsync("setBodyOverflow", "auto");
|
||||
await Js.InvokeVoidAsync("setBodyOverflow", "visible");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using GameIdeas.BlazorApp.Shared.Models;
|
||||
using GameIdeas.Resources;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using GameIdeas.BlazorApp.Shared.Models;
|
||||
using GameIdeas.Resources;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Shared.Components.Header;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Shared.Components.ReadMore;
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using GameIdeas.Resources;
|
||||
using GameIdeas.Shared.Constants;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Shared.Components.Select;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using GameIdeas.BlazorApp.Shared.Components.Search;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Shared.Components.SelectSearch;
|
||||
@@ -34,15 +34,15 @@ public partial class SelectSearch<TItem>
|
||||
}
|
||||
private async Task HandleValuesChanged(IEnumerable<TItem> values)
|
||||
{
|
||||
Values = values.ToList();
|
||||
Values = [.. values];
|
||||
SearchInput?.SetText(string.Join(", ", Values.Select(GetLabel)));
|
||||
await ValuesChanged.InvokeAsync(Values.ToList());
|
||||
await ValuesChanged.InvokeAsync([.. Values]);
|
||||
}
|
||||
|
||||
private async Task HandleClearClicked()
|
||||
{
|
||||
Values = [];
|
||||
await ValuesChanged.InvokeAsync(Values.ToList());
|
||||
await ValuesChanged.InvokeAsync([.. Values]);
|
||||
}
|
||||
|
||||
private void HandleFocusIn()
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace GameIdeas.Resources;
|
||||
|
||||
public class TranslationService
|
||||
{
|
||||
private readonly Dictionary<string, Dictionary<string, string>?> _translations = new();
|
||||
private readonly Dictionary<string, Dictionary<string, string>?> _translations = [];
|
||||
|
||||
public void Initialize(Dictionary<string, string> translations)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using GameIdeas.Shared.Enum;
|
||||
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
namespace GameIdeas.Shared.Dto;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
|
||||
@@ -31,4 +31,3 @@ public partial class Game
|
||||
public virtual ICollection<GameProperty> GameProperties { get; set; }
|
||||
public virtual ICollection<GameTag> GameTags { get; set; }
|
||||
}
|
||||
|
||||
@@ -25,14 +25,16 @@ public class GameIdeasContext : IdentityDbContext<User>
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Developer>(entity => {
|
||||
modelBuilder.Entity<Developer>(entity =>
|
||||
{
|
||||
entity.ToTable("Developer");
|
||||
|
||||
entity.HasIndex(e => e.Name)
|
||||
.IsUnique();
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Platform>(entity => {
|
||||
modelBuilder.Entity<Platform>(entity =>
|
||||
{
|
||||
entity.ToTable("Platform");
|
||||
|
||||
entity.HasIndex(e => e.Label)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace GameIdeas.WebAPI.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@$"DELETE FROM ""AspNetUserRoles"" WHERE ""UserId"" = '{GlobalConstants.ADMINISTRATOR_USER_ID.ToString()}' AND ""RoleId"" = '{GlobalConstants.ADMINISTRATOR_ID.ToString()}'");
|
||||
migrationBuilder.Sql(@$"DELETE FROM ""AspNetUserRoles"" WHERE ""UserId"" = '{GlobalConstants.ADMINISTRATOR_USER_ID}' AND ""RoleId"" = '{GlobalConstants.ADMINISTRATOR_ID}'");
|
||||
migrationBuilder.DeleteData("AspNetUsers", "Id", GlobalConstants.ADMINISTRATOR_USER_ID.ToString());
|
||||
migrationBuilder.DeleteData("AspNetRoles", "Id", GlobalConstants.ADMINISTRATOR_ID.ToString());
|
||||
migrationBuilder.DeleteData("AspNetRoles", "Id", GlobalConstants.MEMBER_ID.ToString());
|
||||
|
||||
@@ -130,15 +130,14 @@ public class GameReadService(GameIdeasContext context, IMapper mapper, ICategory
|
||||
.Select(k => k.Trim())
|
||||
.ToArray() ?? [];
|
||||
|
||||
games = games
|
||||
games = [.. games
|
||||
.Where(game => keywords.All(
|
||||
kw => game.Title.Contains(kw, StringComparison.OrdinalIgnoreCase)
|
||||
))
|
||||
.OrderBy(game => keywords.Min(kw =>
|
||||
game.Title.IndexOf(kw, StringComparison.OrdinalIgnoreCase)
|
||||
))
|
||||
.ThenBy(game => game.Title.Length)
|
||||
.ToList();
|
||||
.ThenBy(game => game.Title.Length)];
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -147,10 +146,9 @@ public class GameReadService(GameIdeasContext context, IMapper mapper, ICategory
|
||||
{
|
||||
var storageSpaces = categoryService.GetStorageSpaces().Where(stor => filter.StorageSpaces.Contains(stor.Id));
|
||||
|
||||
games = games
|
||||
games = [.. games
|
||||
.Where(game => storageSpaces.Any(stor =>
|
||||
(stor.MinSize ?? int.MinValue) <= game.StorageSpace && (stor.MaxSize ?? int.MaxValue) > game.StorageSpace))
|
||||
.ToList();
|
||||
(stor.MinSize ?? int.MinValue) <= game.StorageSpace && (stor.MaxSize ?? int.MaxValue) > game.StorageSpace))];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,15 +91,14 @@ public class UserReadService(
|
||||
.Select(k => k.Trim())
|
||||
.ToArray() ?? [];
|
||||
|
||||
users = users
|
||||
users = [.. users
|
||||
.Where(user => keywords.All(
|
||||
kw => user.UserName?.Contains(kw, StringComparison.OrdinalIgnoreCase) ?? true
|
||||
))
|
||||
.OrderBy(user => keywords.Min(kw =>
|
||||
user.UserName?.IndexOf(kw, StringComparison.OrdinalIgnoreCase)
|
||||
))
|
||||
.ThenBy(user => user.UserName?.Length)
|
||||
.ToList();
|
||||
.ThenBy(user => user.UserName?.Length)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using AutoMapper;
|
||||
using GameIdeas.Resources;
|
||||
using GameIdeas.Resources;
|
||||
using GameIdeas.Shared.Dto;
|
||||
using GameIdeas.Shared.Model;
|
||||
using GameIdeas.WebAPI.Exceptions;
|
||||
|
||||
Reference in New Issue
Block a user