From ebbddb66dd52272cb5bb04082c56036b530955c4 Mon Sep 17 00:00:00 2001 From: Thomas CHAZOT Date: Fri, 16 Dec 2022 10:49:30 +0100 Subject: [PATCH] revert f73a3dfcd8ac4d1531ba2c8c7f0d8da5cb42ed17 revert Commit pour pull ce qu'a fait mathilde --- BlazorApp/BlazorApp.sln | 17 ------- BlazorApp/BlazorApp/BlazorApp.csproj | 10 ++-- .../BlazorApp/Components/InventoryComp.razor | 24 +-------- .../Components/InventoryComp.razor.cs | 49 +++---------------- .../BlazorApp/Components/InventoryItem.razor | 23 ++------- .../Components/InventoryItem.razor.cs | 8 +-- BlazorApp/BlazorApp/Program.cs | 3 -- .../BlazorApp/Services/DataApiService.cs | 10 ---- .../BlazorApp/Services/DataLocalService.cs | 4 -- BlazorApp/BlazorApp/Services/IDataService.cs | 4 -- .../BlazorApp/appsettings.Development.json | 8 +-- .../Minecraft.Crafting.Api.csproj | 4 +- 12 files changed, 23 insertions(+), 141 deletions(-) diff --git a/BlazorApp/BlazorApp.sln b/BlazorApp/BlazorApp.sln index fb5c367..80c6881 100644 --- a/BlazorApp/BlazorApp.sln +++ b/BlazorApp/BlazorApp.sln @@ -5,13 +5,7 @@ VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorApp", "BlazorApp\BlazorApp.csproj", "{1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}" EndProject -<<<<<<< Updated upstream Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft.Crafting.Api", "Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{E1E95C86-6F7D-42A8-983F-C64395DB549C}" -======= -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Minecraft.Crafting.Api", "..\Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{90D900E1-58D6-48D0-8B7F-B04CF2B32467}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft.Crafting.Api", "Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{66D487C8-86D6-4394-BB71-BFA92E57D90E}" ->>>>>>> Stashed changes EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,21 +17,10 @@ Global {1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}.Release|Any CPU.ActiveCfg = Release|Any CPU {1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}.Release|Any CPU.Build.0 = Release|Any CPU -<<<<<<< Updated upstream {E1E95C86-6F7D-42A8-983F-C64395DB549C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1E95C86-6F7D-42A8-983F-C64395DB549C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1E95C86-6F7D-42A8-983F-C64395DB549C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E1E95C86-6F7D-42A8-983F-C64395DB549C}.Release|Any CPU.Build.0 = Release|Any CPU -======= - {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Release|Any CPU.Build.0 = Release|Any CPU - {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Release|Any CPU.Build.0 = Release|Any CPU ->>>>>>> Stashed changes EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BlazorApp/BlazorApp/BlazorApp.csproj b/BlazorApp/BlazorApp/BlazorApp.csproj index 0b32f52..1bb76d0 100644 --- a/BlazorApp/BlazorApp/BlazorApp.csproj +++ b/BlazorApp/BlazorApp/BlazorApp.csproj @@ -7,13 +7,12 @@ - - - + + + - @@ -26,9 +25,6 @@ - - - diff --git a/BlazorApp/BlazorApp/Components/InventoryComp.razor b/BlazorApp/BlazorApp/Components/InventoryComp.razor index 22e0144..ab7078a 100644 --- a/BlazorApp/BlazorApp/Components/InventoryComp.razor +++ b/BlazorApp/BlazorApp/Components/InventoryComp.razor @@ -42,7 +42,6 @@
Available items:
-<<<<<<< Updated upstream
-======= -
- - - - ->>>>>>> Stashed changes - - - - - - - - -
+
diff --git a/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs b/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs index d442884..6ca14eb 100644 --- a/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs +++ b/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs @@ -6,15 +6,12 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using BlazorApp.Services; using Blazorise.DataGrid; -using Microsoft.Extensions.Options; namespace BlazorApp.Components { public partial class InventoryComp { - - public Item CurrentDragItem { get; set; } public int CurrentDragIndex { get; set; } @@ -27,30 +24,17 @@ namespace BlazorApp.Components public List InventoryItems { get; set; } - public ObservableCollection Actions { get; set; } - - public bool IsSorted { get; set; } - - - [Inject] - internal IJSRuntime JavaScriptRuntime { get; set; } - - private int totalItem; public InventoryComp() { - Actions = new ObservableCollection(); - Actions.CollectionChanged += OnActionsCollectionChanged; - - this.InventoryItems = new List(new Item[18]); + this.InventoryItems = new List { }; + for (int i = 0; i < 18; i++) + { + this.InventoryItems.Append(null); } - - private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) - { - JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems); } - + private async Task OnReadData(DataGridReadDataEventArgs e) { if (e.CancellationToken.IsCancellationRequested) @@ -58,33 +42,16 @@ namespace BlazorApp.Components return; } - if (!e.CancellationToken.IsCancellationRequested && IsSorted==false) + if (!e.CancellationToken.IsCancellationRequested) { Items = await DataService.List(e.Page, e.PageSize); totalItem = await DataService.Count(); - } - else - { - Items = await DataService.SortedList(e.Page, e.PageSize); - } + } } - private void SortByName() + private async Task SortByName() { -<<<<<<< Updated upstream Items = await DataService.SortedList(); -======= - if (IsSorted) - { - IsSorted = false; - } - else - { - IsSorted = true; - } - - StateHasChanged(); ->>>>>>> Stashed changes } void refresh() diff --git a/BlazorApp/BlazorApp/Components/InventoryItem.razor b/BlazorApp/BlazorApp/Components/InventoryItem.razor index a714c13..298b7eb 100644 --- a/BlazorApp/BlazorApp/Components/InventoryItem.razor +++ b/BlazorApp/BlazorApp/Components/InventoryItem.razor @@ -5,25 +5,10 @@ @ondrop="@OnDrop" @ondragenter="@OnDragEnter" @ondragleave="@OnDragLeave" - @ondragend="@OnDragEnd"> + @ondragend="@OnDragEnd" > @if (Item != null) - { - if (NoDrop) - { - @if (!string.IsNullOrWhiteSpace(Item.ImageBase64)) - { - @Item.DisplayName - } - else - { - @Item.DisplayName - } - } - else - { - @Item.DisplayName - } - - } + { + @Item.DisplayName + } \ No newline at end of file diff --git a/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs b/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs index 9e79fd4..6af5477 100644 --- a/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs +++ b/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs @@ -52,9 +52,6 @@ namespace BlazorApp.Components Parent.CurrentDragItem = tmp; Parent.CurrentDragIndex = this.Index; } - - Parent.Actions.Add(new CraftingAction { Action = "On Drop", Item = this.Item, Index = this.Index }); - } private void OnDragStart() @@ -73,8 +70,8 @@ namespace BlazorApp.Components { Parent.CurrentDragIndex = -1; } + } - Parent.Actions.Add(new CraftingAction { Action = "Drag Start", Item = this.Item, Index = this.Index }); } internal void OnDragEnd() @@ -88,9 +85,6 @@ namespace BlazorApp.Components Parent.InventoryItems[this.Index] = this.Item; this.Item = Parent.CurrentDragItem; } - - Parent.Actions.Add(new CraftingAction { Action = "Drag End", Item = this.Item, Index = this.Index }); - Parent.CurrentDragIndex = -1; Parent.CurrentDragItem = null; diff --git a/BlazorApp/BlazorApp/Program.cs b/BlazorApp/BlazorApp/Program.cs index 07f4836..77f260e 100644 --- a/BlazorApp/BlazorApp/Program.cs +++ b/BlazorApp/BlazorApp/Program.cs @@ -10,8 +10,6 @@ using Blazored.Modal; using System.Globalization; using Microsoft.Extensions.Options; using Microsoft.AspNetCore.Localization; -using Microsoft.Extensions.Logging; - var builder = WebApplication.CreateBuilder(args); @@ -27,7 +25,6 @@ builder.Services builder.Services.AddBlazoredLocalStorage(); - builder.Services.AddScoped(); builder.Services.AddBlazoredModal(); diff --git a/BlazorApp/BlazorApp/Services/DataApiService.cs b/BlazorApp/BlazorApp/Services/DataApiService.cs index 905ae06..035adb2 100644 --- a/BlazorApp/BlazorApp/Services/DataApiService.cs +++ b/BlazorApp/BlazorApp/Services/DataApiService.cs @@ -57,20 +57,10 @@ namespace BlazorApp.Services return await _http.GetFromJsonAsync>("https://localhost:7234/api/Crafting/recipe"); } -<<<<<<< Updated upstream public async Task> SortedList() { List it = await _http.GetFromJsonAsync>($"https://localhost:7234/api/Crafting/all/"); return it.OrderBy(i => i.DisplayName).ToList(); -======= - public async Task> SortedList(int currentPage, int pageSize) - { - List it = await _http.GetFromJsonAsync>($"https://localhost:7234/api/Crafting/all"); - it.OrderBy(i => i.DisplayName).ToList(); - List items= it.GetRange((currentPage-1)*10, pageSize); - return items; - ->>>>>>> Stashed changes } diff --git a/BlazorApp/BlazorApp/Services/DataLocalService.cs b/BlazorApp/BlazorApp/Services/DataLocalService.cs index e9cbfda..3b13a80 100644 --- a/BlazorApp/BlazorApp/Services/DataLocalService.cs +++ b/BlazorApp/BlazorApp/Services/DataLocalService.cs @@ -185,11 +185,7 @@ namespace BlazorApp.Services return Task.FromResult(items); } -<<<<<<< Updated upstream public Task> SortedList() -======= - public Task> SortedList(int currentPage, int pageSize) ->>>>>>> Stashed changes { throw new NotImplementedException(); } diff --git a/BlazorApp/BlazorApp/Services/IDataService.cs b/BlazorApp/BlazorApp/Services/IDataService.cs index 2b95484..a39928c 100644 --- a/BlazorApp/BlazorApp/Services/IDataService.cs +++ b/BlazorApp/BlazorApp/Services/IDataService.cs @@ -14,11 +14,7 @@ namespace BlazorApp.Services Task Update(int id, ItemModel itemModel); Task Delete(int id); Task> GetRecipes(); -<<<<<<< Updated upstream Task> SortedList(); -======= - Task> SortedList(int currentPage, int pageSize); ->>>>>>> Stashed changes } } diff --git a/BlazorApp/BlazorApp/appsettings.Development.json b/BlazorApp/BlazorApp/appsettings.Development.json index 2a1e03d..f042c67 100644 --- a/BlazorApp/BlazorApp/appsettings.Development.json +++ b/BlazorApp/BlazorApp/appsettings.Development.json @@ -1,9 +1,9 @@ { + "DetailedErrors": true, "Logging": { "LogLevel": { - "Default": "Trace", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" + "Default": "Information", + "Microsoft.AspNetCore": "Warning" } } -} \ No newline at end of file +} diff --git a/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj b/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj index 880b236..c12997a 100644 --- a/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj +++ b/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj @@ -7,8 +7,8 @@ - - + +