diff --git a/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj b/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj index 9c5b30a..19ca83e 100644 --- a/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj +++ b/WF-WebAdmin/UnitTestWF/UnitTestWF.csproj @@ -10,10 +10,16 @@ - - - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryDTO.cs new file mode 100644 index 0000000..1ef4973 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryDTO.cs @@ -0,0 +1,23 @@ +using System; +using System.Text.Json.Serialization; + +namespace WF_WebAdmin.Converter +{ + public class CommentaryDTO + { + [JsonPropertyName("id_comment")] + public int Id { get; set; } + + [JsonPropertyName("quote")] + public int Quote { get; set; } + + [JsonPropertyName("users")] + public int IdUser { get; set; } + + [JsonPropertyName("dateC")] + public string DateCreationRaw { get; set; } = string.Empty; + + [JsonPropertyName("comment")] + public string Text { get; set; } = string.Empty; + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryExtension.cs new file mode 100644 index 0000000..3e0dfb2 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/CommentaryExtension.cs @@ -0,0 +1,46 @@ +using System; +using System.Globalization; +using WF_WebAdmin.Converter; + +namespace WF_WebAdmin.Model +{ + public static class CommentaryExtensions + { + public static Commentary ToModel(this CommentaryDTO dto) + { + DateTime parsedDate = DateTime.MinValue; + + if (!string.IsNullOrEmpty(dto.DateCreationRaw) && + DateTime.TryParseExact(dto.DateCreationRaw, "yyyy-MM-dd", + CultureInfo.InvariantCulture, + DateTimeStyles.None, + out DateTime result)) + { + parsedDate = result; + } + else + { + Console.Out.WriteLine($"Erreur de conversion de la date : {dto.DateCreationRaw}"); + } + + return new Commentary + { + Id = dto.Id, + IdUser = dto.IdUser, + DateCreation = parsedDate, + Text = dto.Text + }; + } + + public static CommentaryDTO ToDTO(this Commentary model) + { + return new CommentaryDTO + { + Id = model.Id, + IdUser = model.IdUser, + DateCreationRaw = model.DateCreation.ToString("yyyy-MM-dd"), + Text = model.Text + }; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs b/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs index acb43ef..9350cb2 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs @@ -1,10 +1,12 @@ -namespace WF_WebAdmin.Model +using System; + +namespace WF_WebAdmin.Model { public class Commentary { - //public int Id { get; set; } - //public int IdUser { get; set; } - public string Text { get; set; } + public int Id { get; set; } + public int IdUser { get; set; } public DateTime DateCreation { get; set; } + public string Text { get; set; } = string.Empty; } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor new file mode 100644 index 0000000..e2ea783 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor @@ -0,0 +1,17 @@ +@page "/commentary-chart" +@using MudBlazor + + + +

Statistiques des Commentaires - Année @SelectedYear

+ + + @foreach (var year in AvailableYears) + { + @year + } + + + +
+
diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor.cs new file mode 100644 index 0000000..b41d4c6 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/CommentaryChart.razor.cs @@ -0,0 +1,72 @@ +using Microsoft.AspNetCore.Components; +using MudBlazor; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; +using WF_WebAdmin.Model; +using WF_WebAdmin.Service; + +namespace WF_WebAdmin.Pages +{ + public partial class CommentaryChart : ComponentBase + { + [Inject] public ICommentaryService CommentaryService { get; set; } = default!; + + public List Labels { get; set; } = new(); + public List ChartData { get; set; } = new(); + public List AvailableYears { get; set; } = new(); + public int SelectedYear { get; set; } + + private List AllComments = new(); + + protected override async Task OnInitializedAsync() + { + // Charger tous les commentaires + AllComments = await CommentaryService.GetCommentsAsync(); + + if (!AllComments.Any()) + { + Labels = new List { "Aucun commentaire" }; + ChartData = new List { new double[] { 0 } }; + return; + } + + AvailableYears = AllComments + .Select(c => c.DateCreation.Year) + .Distinct() + .OrderBy(y => y) + .ToList(); + + SelectedYear = AvailableYears.Max(); + + UpdateChartData(SelectedYear); + } + + private void UpdateChartData(int newYear) + { + SelectedYear = newYear; + + var filteredComments = AllComments + .Where(c => c.DateCreation.Year == SelectedYear) + .ToList(); + + if (!filteredComments.Any()) + { + Labels = new List { "Aucun commentaire" }; + ChartData = new List { new double[] { 0 } }; + return; + } + + var grouped = Enumerable.Range(1, 12) + .ToDictionary( + month => new DateTime(SelectedYear, month, 1).ToString("MMMM", CultureInfo.InvariantCulture), + month => filteredComments.Count(c => c.DateCreation.Month == month) + ); + + Labels = grouped.Keys.ToList(); + ChartData = new List { grouped.Values.Select(v => (double)v).ToArray() }; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Program.cs b/WF-WebAdmin/WF-WebAdmin/Program.cs index 18b8666..765abff 100644 --- a/WF-WebAdmin/WF-WebAdmin/Program.cs +++ b/WF-WebAdmin/WF-WebAdmin/Program.cs @@ -13,6 +13,8 @@ using Microsoft.Extensions.Options; using Blazored.Modal; using WF_WebAdmin.Service; using Microsoft.Extensions.Logging; +using MudBlazor.Services; + [assembly: RootNamespace("WF_WebAdmin")] @@ -24,10 +26,10 @@ builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddHttpClient(); builder.Services.AddScoped(); -//builder.WebHost.UseUrls("http://0.0.0.0:5000"); - +builder.Services.AddMudServices(); builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging")); builder.Services diff --git a/WF-WebAdmin/WF-WebAdmin/Service/CommentaryServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/CommentaryServiceStub.cs new file mode 100644 index 0000000..d1a57ae --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/CommentaryServiceStub.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using WF_WebAdmin.Converter; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Service +{ + public class CommentaryServiceStub : ICommentaryService + { + private readonly string? _jsonFilePath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataCommentary.json"); + + public async Task> GetCommentsAsync() + { + if (!File.Exists(_jsonFilePath)) + { + Console.Out.WriteLine($"{_jsonFilePath} not found"); + return new List(); + } + + var json = await File.ReadAllTextAsync(_jsonFilePath); + var dtoList = JsonSerializer.Deserialize>(json) ?? new List(); + + var comments = dtoList.ConvertAll(dto => dto.ToModel()); + + Console.Out.WriteLine($"Nombre de commentaires chargés : {comments.Count}"); + return comments; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Service/ICommentaryService.cs b/WF-WebAdmin/WF-WebAdmin/Service/ICommentaryService.cs new file mode 100644 index 0000000..7880aaa --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/ICommentaryService.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Service +{ + public interface ICommentaryService + { + Task> GetCommentsAsync(); + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs index f4978b5..c66e4cf 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs @@ -10,17 +10,17 @@ namespace WF_WebAdmin.Service; private readonly string _src = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataSource.json"); - /// - /// Asynchronously saves a list of quotes to a JSON file. - /// - /// The list of objects to be serialized and saved to the file. - /// A task representing the asynchronous operation of saving the quotes to the file. - /// - /// This method serializes the provided list of objects into JSON format using . - /// The serialized JSON is then saved to the file path specified in the field. The JSON is written - /// with indentation for better readability. - /// If the file does not already exist, it will be created. - /// + /// + /// Asynchronously saves a list of quotes to a JSON file. + /// + /// The list of objects to be serialized and saved to the file. + /// A task representing the asynchronous operation of saving the quotes to the file. + /// + /// This method serializes the provided list of objects into JSON format using . + /// The serialized JSON is then saved to the file path specified in the field. The JSON is written + /// with indentation for better readability. + /// If the file does not already exist, it will be created. + /// public async Task saveQuoteJson(List quotes) { var json = JsonSerializer.Serialize(quotes, new JsonSerializerOptions { WriteIndented = true }); @@ -28,17 +28,17 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously adds a new quote to the list and saves it to a JSON file. - /// - /// The object to be added to the list. - /// A task representing the asynchronous operation of adding the quote and saving the updated list to the file. - /// - /// This method retrieves the current list of quotes using the method, assigns a new ID to the - /// provided quote (incremented from the maximum existing ID), and adds the quote to the list. After updating the list, - /// the method saves the updated list back to the JSON file using . - /// If the list is empty, the new quote is assigned an ID of 1. - /// + /// + /// Asynchronously adds a new quote to the list and saves it to a JSON file. + /// + /// The object to be added to the list. + /// A task representing the asynchronous operation of adding the quote and saving the updated list to the file. + /// + /// This method retrieves the current list of quotes using the method, assigns a new ID to the + /// provided quote (incremented from the maximum existing ID), and adds the quote to the list. After updating the list, + /// the method saves the updated list back to the JSON file using . + /// If the list is empty, the new quote is assigned an ID of 1. + /// public async Task addQuote(Quote quote) { var data = await getAllQuote(); @@ -48,17 +48,17 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously removes a quote from the list and saves the updated list to a JSON file. - /// - /// The object to be removed from the list. - /// A task representing the asynchronous operation of removing the quote and saving the updated list to the file. - /// - /// This method retrieves the current list of quotes using the method. - /// It searches for the provided quote by its `Id` and, if found, removes it from the list. - /// After removing the quote, the method saves the updated list back to the JSON file using . - /// If the quote is not found in the list, no action is taken. - /// + /// + /// Asynchronously removes a quote from the list and saves the updated list to a JSON file. + /// + /// The object to be removed from the list. + /// A task representing the asynchronous operation of removing the quote and saving the updated list to the file. + /// + /// This method retrieves the current list of quotes using the method. + /// It searches for the provided quote by its `Id` and, if found, removes it from the list. + /// After removing the quote, the method saves the updated list back to the JSON file using . + /// If the quote is not found in the list, no action is taken. + /// public async Task removeQuote(Quote quote) { var data = await getAllQuote(); @@ -71,23 +71,23 @@ namespace WF_WebAdmin.Service; } - public async Task validQuote(Quote quote) + public async Task validQuote(Quote quote) { throw new NotImplementedException(); } - /// - /// Asynchronously updates the details of an existing quote and saves the updated list to a JSON file. - /// - /// The object containing the updated details of the quote. - /// A task representing the asynchronous operation of updating the quote and saving the updated list to the file. - /// - /// This method retrieves the current list of quotes using the method. - /// It searches for the quote with the provided `Id` and, if found, updates its properties (e.g., content, character, image path, etc.) - /// with the values from the provided `quote` object. After updating the quote, the method saves the updated list back to the JSON file - /// using . If the quote with the specified `Id` is not found, no action is taken. - /// + /// + /// Asynchronously updates the details of an existing quote and saves the updated list to a JSON file. + /// + /// The object containing the updated details of the quote. + /// A task representing the asynchronous operation of updating the quote and saving the updated list to the file. + /// + /// This method retrieves the current list of quotes using the method. + /// It searches for the quote with the provided `Id` and, if found, updates its properties (e.g., content, character, image path, etc.) + /// with the values from the provided `quote` object. After updating the quote, the method saves the updated list back to the JSON file + /// using . If the quote with the specified `Id` is not found, no action is taken. + /// public async Task updateQuote(Quote quote) { var data = await getAllQuote(); @@ -105,16 +105,16 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves all quotes from a JSON file. - /// - /// A task representing the asynchronous operation, with a result of a list of objects. - /// - /// This method checks if the JSON file exists at the specified file path (). - /// If the file does not exist, it logs a message and returns an empty list of quotes. - /// If the file exists, it reads the JSON content, deserializes it into a list of objects, - /// and returns that list. If the deserialization results in a null value, an empty list is returned. - /// + /// + /// Asynchronously retrieves all quotes from a JSON file. + /// + /// A task representing the asynchronous operation, with a result of a list of objects. + /// + /// This method checks if the JSON file exists at the specified file path (). + /// If the file does not exist, it logs a message and returns an empty list of quotes. + /// If the file exists, it reads the JSON content, deserializes it into a list of objects, + /// and returns that list. If the deserialization results in a null value, an empty list is returned. + /// public async Task> getAllQuote() { if (!File.Exists(_jsonFilePath)) @@ -128,20 +128,20 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves a subset of quotes based on the specified page number and the number of quotes per page. - /// - /// The number of quotes to retrieve per page. - /// The page number for pagination. - /// A task representing the asynchronous operation, with a result of a list of objects for the specified page. - /// - /// This method retrieves all quotes using the method and then calculates the range of quotes - /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that - /// the returned subset does not exceed the total number of quotes available. - /// - /// If the calculated range is larger than the available quotes, it returns a subset of quotes from the end of the list. - /// If the requested page number exceeds the total number of pages, the method will return the last available page of quotes. - /// + /// + /// Asynchronously retrieves a subset of quotes based on the specified page number and the number of quotes per page. + /// + /// The number of quotes to retrieve per page. + /// The page number for pagination. + /// A task representing the asynchronous operation, with a result of a list of objects for the specified page. + /// + /// This method retrieves all quotes using the method and then calculates the range of quotes + /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that + /// the returned subset does not exceed the total number of quotes available. + /// + /// If the calculated range is larger than the available quotes, it returns a subset of quotes from the end of the list. + /// If the requested page number exceeds the total number of pages, the method will return the last available page of quotes. + /// public async Task> getSomeQuote(int nb, int page) { var quotes = await getAllQuote(); @@ -157,15 +157,15 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves a single quote based on its ID. - /// - /// The unique identifier of the to be retrieved. - /// A task representing the asynchronous operation, with a result of the object if found, otherwise null. - /// - /// This method retrieves all quotes using the method and searches for the quote that matches the provided `id`. - /// If a matching quote is found, it returns that quote; otherwise, it returns `null`. - /// + /// + /// Asynchronously retrieves a single quote based on its ID. + /// + /// The unique identifier of the to be retrieved. + /// A task representing the asynchronous operation, with a result of the object if found, otherwise null. + /// + /// This method retrieves all quotes using the method and searches for the quote that matches the provided `id`. + /// If a matching quote is found, it returns that quote; otherwise, it returns `null`. + /// public async Task getOnequote(int id) { var data = await getAllQuote(); @@ -184,15 +184,15 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves all invalid quotes from the list. - /// - /// A task representing the asynchronous operation, with a result of a list of invalid objects. - /// - /// This method retrieves all quotes using the method and filters them by the `IsValid` property. - /// It returns only those quotes where `IsValid` is set to `false`. - /// If no invalid quotes are found, an empty list is returned. - /// + /// + /// Asynchronously retrieves all invalid quotes from the list. + /// + /// A task representing the asynchronous operation, with a result of a list of invalid objects. + /// + /// This method retrieves all quotes using the method and filters them by the `IsValid` property. + /// It returns only those quotes where `IsValid` is set to `false`. + /// If no invalid quotes are found, an empty list is returned. + /// public async Task> getAllQuoteInvalid() { var quotes = await getAllQuote(); @@ -201,20 +201,20 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves a subset of invalid quotes based on the specified page number and the number of quotes per page. - /// - /// The number of invalid quotes to retrieve per page. - /// The page number for pagination. - /// A task representing the asynchronous operation, with a result of a list of invalid objects for the specified page. - /// - /// This method retrieves all invalid quotes using the method and then calculates the range of invalid quotes - /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that - /// the returned subset does not exceed the total number of invalid quotes available. - /// - /// If the calculated range is larger than the available invalid quotes, it returns a subset of quotes from the end of the list. - /// If the requested page number exceeds the total number of pages, the method will return the last available page of invalid quotes. - /// + /// + /// Asynchronously retrieves a subset of invalid quotes based on the specified page number and the number of quotes per page. + /// + /// The number of invalid quotes to retrieve per page. + /// The page number for pagination. + /// A task representing the asynchronous operation, with a result of a list of invalid objects for the specified page. + /// + /// This method retrieves all invalid quotes using the method and then calculates the range of invalid quotes + /// to be returned based on the provided `nb` (number of quotes per page) and `page` (the page number). It ensures that + /// the returned subset does not exceed the total number of invalid quotes available. + /// + /// If the calculated range is larger than the available invalid quotes, it returns a subset of quotes from the end of the list. + /// If the requested page number exceeds the total number of pages, the method will return the last available page of invalid quotes. + /// public async Task> getSomeQuoteInvalid(int nb, int page) { var quotes = await getAllQuoteInvalid(); @@ -230,14 +230,14 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves the total number of quotes. - /// - /// A task representing the asynchronous operation, with a result of the total number of objects. - /// - /// This method retrieves all quotes using the method and returns the count of quotes. - /// It provides the total number of quotes currently available in the data source. - /// + /// + /// Asynchronously retrieves the total number of quotes. + /// + /// A task representing the asynchronous operation, with a result of the total number of objects. + /// + /// This method retrieves all quotes using the method and returns the count of quotes. + /// It provides the total number of quotes currently available in the data source. + /// public async Task getNbQuote() { var data = await getAllQuote(); @@ -245,16 +245,16 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves a list of characters from a JSON file. - /// - /// A task representing the asynchronous operation, with a result of a list of objects. - /// - /// This method checks if the JSON file containing character data exists at the specified file path (`_char`). - /// If the file does not exist, it logs a message to the console and returns an empty list of characters. - /// If the file exists, it reads the JSON content, deserializes it into a list of objects, - /// and returns that list. If the deserialization results in a null value, an empty list is returned. - /// + /// + /// Asynchronously retrieves a list of characters from a JSON file. + /// + /// A task representing the asynchronous operation, with a result of a list of objects. + /// + /// This method checks if the JSON file containing character data exists at the specified file path (`_char`). + /// If the file does not exist, it logs a message to the console and returns an empty list of characters. + /// If the file exists, it reads the JSON content, deserializes it into a list of objects, + /// and returns that list. If the deserialization results in a null value, an empty list is returned. + /// public async Task> getChar() { if (!File.Exists(_char)) @@ -268,16 +268,16 @@ namespace WF_WebAdmin.Service; } - /// - /// Asynchronously retrieves a list of sources from a JSON file. - /// - /// A task representing the asynchronous operation, with a result of a list of objects. - /// - /// This method checks if the JSON file containing source data exists at the specified file path (`_src`). - /// If the file does not exist, it logs a message to the console and returns an empty list of sources. - /// If the file exists, it reads the JSON content, deserializes it into a list of objects, - /// and returns that list. If the deserialization results in a null value, an empty list is returned. - /// + /// + /// Asynchronously retrieves a list of sources from a JSON file. + /// + /// A task representing the asynchronous operation, with a result of a list of objects. + /// + /// This method checks if the JSON file containing source data exists at the specified file path (`_src`). + /// If the file does not exist, it logs a message to the console and returns an empty list of sources. + /// If the file exists, it reads the JSON content, deserializes it into a list of objects, + /// and returns that list. If the deserialization results in a null value, an empty list is returned. + /// public async Task> getSrc() { if (!File.Exists(_src)) @@ -288,6 +288,6 @@ namespace WF_WebAdmin.Service; var json = await File.ReadAllTextAsync(_src); return JsonSerializer.Deserialize>(json) ?? new List(); - } + } } diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor index db2f3e3..4ac3922 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor @@ -3,6 +3,7 @@ @inject UserLogin uLogin WF-WebAdmin +
diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor index 358d38d..a9174b8 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor @@ -54,8 +54,11 @@ Logs
- - + diff --git a/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj b/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj index f29f827..47115cb 100644 --- a/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj +++ b/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj @@ -15,6 +15,7 @@ +
diff --git a/WF-WebAdmin/WF-WebAdmin/_Imports.razor b/WF-WebAdmin/WF-WebAdmin/_Imports.razor index ebfca63..beef02e 100644 --- a/WF-WebAdmin/WF-WebAdmin/_Imports.razor +++ b/WF-WebAdmin/WF-WebAdmin/_Imports.razor @@ -10,4 +10,5 @@ @using WF_WebAdmin.Shared @using Blazorise.DataGrid @using Blazored.Modal +@using MudBlazor diff --git a/WF-WebAdmin/WF-WebAdmin/libman.json b/WF-WebAdmin/WF-WebAdmin/libman.json new file mode 100644 index 0000000..8ed1410 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/libman.json @@ -0,0 +1,5 @@ +{ + "version": "3.0", + "defaultProvider": "cdnjs", + "libraries": [] +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentary.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentary.json new file mode 100644 index 0000000..5b39c76 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentary.json @@ -0,0 +1,359 @@ +[ + { + "id_comment": 1, + "quote": 1, + "users": 1, + "dateC": "2024-10-10", + "comment": "coucou" + }, + { + "id_comment": 2, + "quote": 1, + "users": 2, + "dateC": "2024-10-11", + "comment": "Super citation !" + }, + { + "id_comment": 3, + "quote": 1, + "users": 3, + "dateC": "2024-10-12", + "comment": "Très inspirant." + }, + { + "id_comment": 4, + "quote": 2, + "users": 4, + "dateC": "2024-10-13", + "comment": "J'adore cette phrase." + }, + { + "id_comment": 5, + "quote": 2, + "users": 5, + "dateC": "2024-10-14", + "comment": "Citation profonde." + }, + { + "id_comment": 6, + "quote": 2, + "users": 6, + "dateC": "2024-10-15", + "comment": "Belle pensée." + }, + { + "id_comment": 7, + "quote": 3, + "users": 7, + "dateC": "2024-10-16", + "comment": "Très motivant." + }, + { + "id_comment": 8, + "quote": 3, + "users": 8, + "dateC": "2024-10-17", + "comment": "Citation puissante." + }, + { + "id_comment": 9, + "quote": 3, + "users": 9, + "dateC": "2024-10-18", + "comment": "Paroles sages." + }, + { + "id_comment": 10, + "quote": 4, + "users": 10, + "dateC": "2024-10-19", + "comment": "Très réfléchi." + }, + { + "id_comment": 11, + "quote": 4, + "users": 11, + "dateC": "2024-10-20", + "comment": "Citation magnifique." + }, + { + "id_comment": 12, + "quote": 4, + "users": 12, + "dateC": "2024-10-21", + "comment": "Très touchant." + }, + { + "id_comment": 13, + "quote": 5, + "users": 13, + "dateC": "2024-10-22", + "comment": "Citation parfaite." + }, + { + "id_comment": 14, + "quote": 5, + "users": 14, + "dateC": "2024-10-23", + "comment": "Très émouvant." + }, + { + "id_comment": 15, + "quote": 5, + "users": 15, + "dateC": "2024-10-24", + "comment": "Citation merveilleuse." + }, + { + "id_comment": 16, + "quote": 6, + "users": 16, + "dateC": "2024-10-25", + "comment": "Très poétique." + }, + { + "id_comment": 17, + "quote": 6, + "users": 17, + "dateC": "2024-10-26", + "comment": "Citation exceptionnelle." + }, + { + "id_comment": 18, + "quote": 6, + "users": 18, + "dateC": "2024-10-27", + "comment": "Très inspirant." + }, + { + "id_comment": 19, + "quote": 7, + "users": 19, + "dateC": "2024-10-28", + "comment": "J'adore cette phrase." + }, + { + "id_comment": 20, + "quote": 7, + "users": 20, + "dateC": "2024-10-29", + "comment": "Citation profonde." + }, + { + "id_comment": 21, + "quote": 7, + "users": 21, + "dateC": "2024-8-30", + "comment": "Belle pensée." + }, + { + "id_comment": 22, + "quote": 8, + "users": 22, + "dateC": "2024-10-31", + "comment": "Très motivant." + }, + { + "id_comment": 23, + "quote": 8, + "users": 23, + "dateC": "2024-11-01", + "comment": "Citation puissante." + }, + { + "id_comment": 24, + "quote": 8, + "users": 24, + "dateC": "2024-11-02", + "comment": "Paroles sages." + }, + { + "id_comment": 25, + "quote": 9, + "users": 25, + "dateC": "2024-11-03", + "comment": "Très réfléchi." + }, + { + "id_comment": 26, + "quote": 9, + "users": 26, + "dateC": "2024-11-04", + "comment": "Citation magnifique." + }, + { + "id_comment": 27, + "quote": 9, + "users": 27, + "dateC": "2024-11-05", + "comment": "Très touchant." + }, + { + "id_comment": 28, + "quote": 10, + "users": 28, + "dateC": "2024-11-06", + "comment": "Citation parfaite." + }, + { + "id_comment": 29, + "quote": 10, + "users": 29, + "dateC": "2024-11-07", + "comment": "Très émouvant." + }, + { + "id_comment": 30, + "quote": 10, + "users": 30, + "dateC": "2024-11-08", + "comment": "Citation merveilleuse." + }, + { + "id_comment": 31, + "quote": 11, + "users": 31, + "dateC": "2024-11-09", + "comment": "Très poétique." + }, + { + "id_comment": 32, + "quote": 11, + "users": 32, + "dateC": "2024-11-10", + "comment": "Citation exceptionnelle." + }, + { + "id_comment": 33, + "quote": 11, + "users": 33, + "dateC": "2024-11-11", + "comment": "Très inspirant." + }, + { + "id_comment": 34, + "quote": 12, + "users": 34, + "dateC": "2024-11-12", + "comment": "J'adore cette phrase." + }, + { + "id_comment": 35, + "quote": 12, + "users": 35, + "dateC": "2024-11-13", + "comment": "Citation profonde." + }, + { + "id_comment": 36, + "quote": 12, + "users": 36, + "dateC": "2024-11-14", + "comment": "Belle pensée." + }, + { + "id_comment": 37, + "quote": 13, + "users": 37, + "dateC": "2024-11-15", + "comment": "Très motivant." + }, + { + "id_comment": 38, + "quote": 13, + "users": 38, + "dateC": "2024-11-16", + "comment": "Citation puissante." + }, + { + "id_comment": 39, + "quote": 13, + "users": 39, + "dateC": "2024-11-17", + "comment": "Paroles sages." + }, + { + "id_comment": 40, + "quote": 14, + "users": 40, + "dateC": "2024-11-18", + "comment": "Très réfléchi." + }, + { + "id_comment": 41, + "quote": 14, + "users": 41, + "dateC": "2024-11-19", + "comment": "Citation magnifique." + }, + { + "id_comment": 42, + "quote": 14, + "users": 42, + "dateC": "2024-11-20", + "comment": "Très touchant." + }, + { + "id_comment": 43, + "quote": 15, + "users": 43, + "dateC": "2024-11-21", + "comment": "Citation parfaite." + }, + { + "id_comment": 44, + "quote": 15, + "users": 44, + "dateC": "2024-11-22", + "comment": "Très émouvant." + }, + { + "id_comment": 45, + "quote": 15, + "users": 45, + "dateC": "2024-11-23", + "comment": "Citation merveilleuse." + }, + { + "id_comment": 46, + "quote": 16, + "users": 46, + "dateC": "2024-11-24", + "comment": "Très poétique." + }, + { + "id_comment": 47, + "quote": 16, + "users": 47, + "dateC": "2024-11-25", + "comment": "Citation exceptionnelle." + }, + { + "id_comment": 48, + "quote": 16, + "users": 48, + "dateC": "2024-11-26", + "comment": "Très inspirant." + }, + { + "id_comment": 49, + "quote": 17, + "users": 49, + "dateC": "2024-11-27", + "comment": "J'adore cette phrase." + }, + { + "id_comment": 50, + "quote": 17, + "users": 50, + "dateC": "2024-11-28", + "comment": "Citation profonde." + }, + { + "id_comment": 51, + "quote": 17, + "users": 51, + "dateC": "2024-11-29", + "comment": "Belle pensée." + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentaty.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentaty.json deleted file mode 100644 index 351ff35..0000000 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentaty.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "id_comment": 1, - "quote": 1, - "users": 1, - "dateC":"2024-10-10", - "comment": "coucou" - } -] \ No newline at end of file