diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs index 092db9d..26a68a8 100644 --- a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs +++ b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs @@ -9,7 +9,7 @@ namespace WF_WebAdmin.Converter public string Content { get; set; } public int Likes { get; set; } public string Langue { get; set; } - public bool? IsValide { get; set; } + public bool IsValide { get; set; } public string? Reason { get; set; } public int? IdCaracter { get; set; } public string NameCharac { get; set; } @@ -21,7 +21,7 @@ namespace WF_WebAdmin.Converter public int? IdImg { get; set; } public string ImgPath { get; set; } - public QuoteDTO(int id_quote,string content,int likes,string langue,bool? isValide,string? reason,int? id_caracter,string name_charac,int? id_source,string title,DateTime date,int? id_user_verif,string name_user ,int? id_img,string img_path) + public QuoteDTO(int id_quote,string content,int likes,string langue,bool isValide,string? reason,int? id_caracter,string name_charac,int? id_source,string title,DateTime date,int? id_user_verif,string name_user ,int? id_img,string img_path) { this.Id = id_quote; this.Content = content; diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs index 088520a..a7bd57f 100644 --- a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs +++ b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs @@ -6,13 +6,13 @@ namespace WF_WebAdmin.Converter { public QuoteDTO QuoteToDTO(Quote q) { - QuoteDTO quote = new QuoteDTO(q.Id, q.Content, q.Like, q.Langue, null,null, null,q.Charac,null,q.TitleSrc,q.DateSrc,null,q.UserProposition,null,q.ImgPath); + QuoteDTO quote = new QuoteDTO(q.Id, q.Content, q.Like, q.Langue, q.IsValid,null, null,q.Charac,null,q.TitleSrc,q.DateSrc,null,q.UserProposition,null,q.ImgPath); return quote; } public Quote DTOToQuote(QuoteDTO q) { - Quote quote = new Quote(q.Id, q.Content,q.NameCharac,q.ImgPath,q.TitleSrc,q.DateSrc,q.Likes,q.Langue,q.NameUser); + Quote quote = new Quote(q.Id, q.Content,q.NameCharac,q.ImgPath,q.TitleSrc,q.DateSrc,q.Likes,q.Langue,q.NameUser,q.IsValide); return quote; } } diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Character.cs b/WF-WebAdmin/WF-WebAdmin/Model/Character.cs new file mode 100644 index 0000000..a5e1d87 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/Character.cs @@ -0,0 +1,8 @@ +namespace WF_WebAdmin.Model +{ + public class Character + { + public int id_caracter { get; set; } + public string caracter { get; set; } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs index c6035df..a72be08 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs @@ -9,6 +9,36 @@ namespace WF_WebAdmin.Model public string AnswerC { get; set; } public string AnswerD { get; set; } public string CAnswer { get; set; } + public bool IsValid { get; set; } public string UserProposition { get; set; } + + public Quiz(int id, string question, string answerA, string answerB, string answerC, string answerD, string cAnswer, bool isValid, string userProposition) + { + Id = id; + Question = question; + AnswerA = answerA; + AnswerB = answerB; + AnswerC = answerC; + AnswerD = answerD; + CAnswer = cAnswer; + IsValid = isValid; + UserProposition = userProposition; + } + + public Quiz(int id, string question, string answerA, string answerB, string answerC, string answerD, string cAnswer) + { + Id = id; + Question = question; + AnswerA = answerA; + AnswerB = answerB; + AnswerC = answerC; + AnswerD = answerD; + CAnswer = cAnswer; + IsValid = true; + UserProposition = "Admin"; + } + + public Quiz() {} + } } \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs b/WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs new file mode 100644 index 0000000..ce5c8fa --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; + +namespace WF_WebAdmin.Model +{ + public class QuizModel + { + [Required] + [StringLength(200, ErrorMessage = "La question ne peut pas depasser les 200 caractère.")] + public string Question { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerA { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerB { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerC { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerD { get; set; } + + [Required] + public string CAnswer { get; set; } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs index 5a56083..ffc7f05 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs @@ -13,8 +13,9 @@ namespace WF_WebAdmin.Model public string TitleSrc { get; set; } public DateTime DateSrc { get; set; } public string UserProposition { get; set; } + public bool IsValid { get; set; } - public Quote(int id, string content, string charac, string imgPath, string titleSrc, DateTime dateSrc, int like, string langue, string userProposition) + public Quote(int id, string content, string charac, string imgPath, string titleSrc, DateTime dateSrc, int like, string langue, string userProposition, bool isvalid) { Id = id; Content = content; @@ -25,6 +26,7 @@ namespace WF_WebAdmin.Model Like = like; Langue = langue; UserProposition = userProposition; + IsValid = isvalid; } /* public int Id { get; set; } diff --git a/WF-WebAdmin/WF-WebAdmin/Model/QuoteModel.cs b/WF-WebAdmin/WF-WebAdmin/Model/QuoteModel.cs new file mode 100644 index 0000000..1db3196 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/QuoteModel.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; + +namespace WF_WebAdmin.Model +{ + public class QuoteModel + { + public int Id { get; set; } + + [Required] + [StringLength(300, ErrorMessage = "La citation ne peut pas dépasser les 300 caractère.")] + public string Content { get; set; } + + public int Like { get; set; } + + [Required] + [StringLength(2, ErrorMessage = "La langue ne peut pas dépasser 2 caractère.")] + public string Langue { get; set; } + + + public string Charac { get; set; } + public string ImgPath { get; set; } + public string TitleSrc { get; set; } + public DateTime DateSrc { get; set; } + public string UserProposition { get; set; } + public bool IsValid { get; set; } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Source.cs b/WF-WebAdmin/WF-WebAdmin/Model/Source.cs new file mode 100644 index 0000000..99c390a --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/Source.cs @@ -0,0 +1,11 @@ +namespace WF_WebAdmin.Model +{ + public class Source + { + public int id_source { get; set; } + + public string title { get; set; } + + public int date { get; set; } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/User.cs b/WF-WebAdmin/WF-WebAdmin/Model/User.cs index 599ee8e..9e398dd 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/User.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/User.cs @@ -2,6 +2,7 @@ { public class User { + public int Id { get; set; } public string Image { get; set; } public string Name { get; set; } public string Email { get; set; } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor new file mode 100644 index 0000000..d577939 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor @@ -0,0 +1,58 @@ +@using WF_WebAdmin.Model; + +@page "/add" + +

Ajouter une Question

+ + + + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ + +
\ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs new file mode 100644 index 0000000..36de693 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs @@ -0,0 +1,80 @@ +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Service; +using WF_WebAdmin.Model; +using Microsoft.AspNetCore.Mvc; +using System.Text.RegularExpressions; + + +namespace WF_WebAdmin.Pages +{ + public partial class AddQuiz + { + [Inject] + private IQuizService quizService { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + private QuizModel QuizModel = new(); + + private async void HandleValidSubmit() + { + + int id; + id = await quizService.getNbQuiz(); + id++; + await quizService.addQuiz(new Quiz( + id, + validateInformation(QuizModel.Question), + validateInformation(QuizModel.AnswerA), + validateInformation(QuizModel.AnswerB), + validateInformation(QuizModel.AnswerC), + validateInformation(QuizModel.AnswerD), + validateReponse(QuizModel.CAnswer) + )); + NavigationManager.NavigateTo("modifquiz"); + } + + private void OnCAwnserChange(string item, object checkedValue) + { + QuizModel.CAnswer = item; + } + + private static string validateInformation(string item) + { + return item; // VALIDATION A FAIRE + } + + private static string validateReponse(string item) + { + try + { + if (!string.IsNullOrEmpty(item)) + { + switch (item) + { + case "A": + break; + case "B": + break; + case "C": + break; + case "D": + break; + default: + throw new InvalidDataException("Invalid item (validateReponse) : item must be A,B,C or D " + item + "give."); + } + } + else + { + throw new ArgumentNullException("Invalid item (validateReponse): null given."); + } + return item; + } + catch (Exception ex) + { + return "A"; //Default Argument + } + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor index 18e75cd..d0ad051 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor @@ -12,13 +12,30 @@ else { + + + + + + + + +

@Localizer["UserHere"]

+ @foreach (var user in users) { -
+
@if (user.IsAdmin) { +

@Localizer["UserName"] @user.Name (@Localizer["UserAdmin"])

} else @@ -42,6 +59,7 @@ else

@Localizer["UserNoComment"]

} + @if (!user.IsAdmin) @@ -54,7 +72,7 @@ else }
- } + @if (showPopupDelete) { @@ -66,6 +84,23 @@ else
} + @if (showModifyPopup) + { +
+
+

Modifier les informations de l'utilisateur :

+ + + + + + + + +
+
+ } +} @if (showPopupAdmin) @@ -81,9 +116,3 @@ else } - - - -@code { - -} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs index 0903099..8cdd926 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Components; +using Blazorise.DataGrid; +using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Configuration.UserSecrets; using Microsoft.Extensions.Localization; using System.Collections.Generic; @@ -9,29 +10,56 @@ namespace WF_WebAdmin.Pages { public partial class DeleteUser { - private List users; - - - [Inject] - public IStringLocalizer Localizer { get; set; } - - private bool showPopupDelete = false; - private User userToDelete = null; + private bool showDeletePopup = false; + private bool showModifyPopup = false; + private List users; + private User userToDelete = null; + private User selectedUser; + private bool showPopupDelete = false; private bool showPopupAdmin = false; private User userToAdmin = null; + private int MaxValue = 5; + private int totalItem; + private int page = 1; + + [Inject] public HttpClient Http { get; set; } [Inject] public NavigationManager NavigationManager { get; set; } + [Inject] + private IUserService userService { get; set; } + + [Inject] + public IStringLocalizer Localizer { get; set; } + + + protected override async Task OnInitializedAsync() { - users = await Http.GetFromJsonAsync>($"{NavigationManager.BaseUri}fake-dataUsers.json"); + users = await userService.getSomeUser(MaxValue, 1); } + private async Task OnReadData(DataGridReadDataEventArgs e) + { + if (e.CancellationToken.IsCancellationRequested) + { + return; + } + + var response = await userService.getSomeUser(e.PageSize, e.Page); + + if (!e.CancellationToken.IsCancellationRequested) + { + totalItem = await userService.getNbUser(); + users = new List(response.ToArray()); + page = e.Page; + } + } // ------- Popup remove user ------- private void ShowConfirmation(User user) @@ -40,19 +68,34 @@ namespace WF_WebAdmin.Pages showPopupDelete = true; } - + private void ShowModifyConfirmation(User user) + { + // Afficher la modale et mémoriser l'utilisateur à supprimer + selectedUser = user; + showModifyPopup = true; + } private async Task RemoveUser() { if (userToDelete != null) { - users.RemoveAll(u => u.Name == userToDelete.Name); + await userService.removeUser(userToDelete); ClosePopup(); + var response = await userService.getSomeUser(MaxValue, page); + users = new List(response.ToArray()); } } + private async Task ModifyUser() + { + await userService.updateUser(selectedUser); + ClosePopup(); + } + private void ClosePopup() { + showDeletePopup = false; + showModifyPopup = false; showPopupDelete = false; showPopupAdmin = false; } @@ -67,20 +110,21 @@ namespace WF_WebAdmin.Pages - private async Task Admin() + private async Task setAdmin() { if (!userToAdmin.IsAdmin) - { + { userToAdmin.IsAdmin = true; + await userService.updateUser(userToAdmin); ClosePopup(); } - else - { + else + { userToAdmin.IsAdmin = false; - ClosePopup(); + await userService.updateUser(userToAdmin); + ClosePopup(); } } - } - + } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Edit.razor b/WF-WebAdmin/WF-WebAdmin/Pages/Edit.razor new file mode 100644 index 0000000..edb3822 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Edit.razor @@ -0,0 +1,48 @@ +@using WF_WebAdmin.Model +@page "/edit/{Id:int}" + +

Editer

+ + + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ + +
\ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Edit.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/Edit.razor.cs new file mode 100644 index 0000000..71bb9f0 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Edit.razor.cs @@ -0,0 +1,65 @@ +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Model; +using WF_WebAdmin.Service; + +namespace WF_WebAdmin.Pages +{ + public partial class Edit + { + [Parameter] + public int Id { get; set; } + + [Inject] + private IQuoteService quoteService { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + private Quote q{ get; set; } + + private QuoteModel quoteModel = new(); + + private List charac = new List(); + + private List src = new List(); + + protected override async Task OnInitializedAsync() + { + q = await quoteService.getOnequote(Id); + quoteModel.Content = q.Content; + quoteModel.Langue = q.Langue; + quoteModel.Charac = q.Charac; + quoteModel.TitleSrc = q.TitleSrc; + quoteModel.Id = q.Id; + quoteModel.Like = q.Like; + quoteModel.ImgPath = q.ImgPath; + quoteModel.DateSrc = q.DateSrc; + quoteModel.UserProposition = q.UserProposition; + quoteModel.IsValid = q.IsValid; + charac = await quoteService.getChar(); + src = await quoteService.getSrc(); + } + + protected async void HandleValidSubmit() + { + q.Content = quoteModel.Content; + q.Langue = quoteModel.Langue; + q.TitleSrc = quoteModel.TitleSrc; + q.Charac = quoteModel.Charac; + await quoteService.updateQuote(q); + NavigationManager.NavigateTo("modifquote"); + } + + private void OnlangChange(string item, object checkedValue) + { + if(item == "fr" || item == "en") + { + quoteModel.Langue = item; + } + } + + + + + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs index 3ba9767..c63b04f 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs @@ -28,7 +28,7 @@ namespace WF_WebAdmin.Pages protected override async Task OnInitializedAsync() { - usersConnexion = await Http.GetFromJsonAsync>($"{NavigationManager.BaseUri}fake-dataUsers.json"); + usersConnexion = await Http.GetFromJsonAsync>($"{NavigationManager.BaseUri}fake-dataUserLogin.json"); } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor new file mode 100644 index 0000000..60d2264 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor @@ -0,0 +1,69 @@ +@using WF_WebAdmin.Model +@page "/modifquiz" + +Gestion des question + +

Gestion des quiz

+ +
+ + Ajouter + +
+ + + + + + + + + + + + + + + + + + +@if (showEditQuiz && selectedQuiz != null) +{ +
+
+

Modifier les informations de l'utilisateur :

+ + + + + + + + + + + + + + +
+
+} + +@if (showPopupDelete) +{ +
+
+

Êtes-vous sûr de vouloir supprimer ce quiz ?

+ + +
+
+} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs new file mode 100644 index 0000000..9da2e68 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs @@ -0,0 +1,83 @@ +using Blazorise.DataGrid; +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Model; +using WF_WebAdmin.Service; + +namespace WF_WebAdmin.Pages +{ + public partial class ModifQuiz + { + private Quiz[] quiz; + + private int MaxValue = 5; + + private int totalItem; + + private bool showEditQuiz = false; + + private Quiz? selectedQuiz; + + private bool showPopupDelete = false; + + private int page = 1; + + [Inject] + public IQuizService QuizService { get; set; } + + private async Task OnReadData(DataGridReadDataEventArgs e) + { + if (e.CancellationToken.IsCancellationRequested) + { + return; + } + + var response = await QuizService.getSommeQuiz(e.PageSize, e.Page); + + if (!e.CancellationToken.IsCancellationRequested) + { + totalItem = await QuizService.getNbQuiz(); + quiz = response.ToArray(); + page = e.Page; + } + } + + private void OnEditButtonClicked(Quiz quiz) + { + if (quiz == null) return; + selectedQuiz = quiz; + showEditQuiz = true; + } + + private void ClosePopup() + { + showEditQuiz = false; + showPopupDelete = false; + selectedQuiz = null; + } + + private async Task EditQuiz() + { + await QuizService.updateQuiz(selectedQuiz); + selectedQuiz = null; + ClosePopup(); + } + + private void OnDelete(Quiz q) + { + selectedQuiz = q; + showPopupDelete = true; + } + + private async void RemoveQuote() + { + if (selectedQuiz != null) + { + await QuizService.removeQuiz(selectedQuiz.Id); + selectedQuiz = null; + var response = await QuizService.getSommeQuiz(MaxValue, page); + quiz = response.ToArray(); + } + showPopupDelete= false; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor index c3eaede..a04a0fd 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor @@ -5,20 +5,54 @@

Correction des citations

-

Ajouter une recherche

- -@if (quotes != null) -{ - - - - - - - - + + + + + + + + + @* *@ + Editer + + + + + +@* @if (showEditQuote && selectedQuote != null) +{ +
+
+

Modifier les informations de l'utilisateur :

+ + + + + + + + +
+
*@ + +@if (showPopupDelete) +{ +
+
+

Êtes-vous sûr de vouloir supprimer cette citation ?

+ + +
+
} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs index 727c394..d010106 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs @@ -1,5 +1,7 @@ +using Blazorise.DataGrid; using Microsoft.AspNetCore.Components; using WF_WebAdmin.Model; +using WF_WebAdmin.Service; namespace WF_WebAdmin.Pages { @@ -9,15 +11,73 @@ namespace WF_WebAdmin.Pages private int MaxValue = 5; - [Inject] - public HttpClient Http { get; set; } + private int totalItem; + + /*private bool showEditQuote = false;*/ + + private Quote? selectedQuote; + + private bool showPopupDelete = false; + + private int page = 1; [Inject] - public NavigationManager NavigationManager { get; set; } + public IQuoteService QuoteService { get; set; } + + private async Task OnReadData(DataGridReadDataEventArgs e) + { + if (e.CancellationToken.IsCancellationRequested) + { + return; + } + + var response = await QuoteService.getSomeQuote(e.PageSize, e.Page); + + if (!e.CancellationToken.IsCancellationRequested) + { + totalItem = await QuoteService.getNbQuote(); + quotes = response.ToArray(); + page = e.Page; + } + } + + /*private void OnEditButtonClicked(Quote quote) + { + if (selectedQuote == null) return; + selectedQuote = quote; + showEditQuote = true; + }*/ + + private void ClosePopup() + { + /*showEditQuote = false;*/ + showPopupDelete = false; + selectedQuote = null; + } + + /*private async Task EditQuote() + { + await QuoteService.updateQuote(selectedQuote); + selectedQuote = null; + ClosePopup(); + }*/ + + private void OnDelete(Quote q) + { + selectedQuote = q; + showPopupDelete = true; + } - protected override async Task OnInitializedAsync() + private async void RemoveQuote() { - //quotes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataModifQuote.json"); + if (selectedQuote != null) + { + await QuoteService.removeQuote(selectedQuote); + selectedQuote= null; + var response = await QuoteService.getSomeQuote(MaxValue, page); + quotes = response.ToArray(); + } + showPopupDelete= false; } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs index d907e84..2c2beec 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs @@ -1,23 +1,27 @@ using Blazorise.DataGrid; using Microsoft.AspNetCore.Components; using WF_WebAdmin.Model; +using WF_WebAdmin.Service; namespace WF_WebAdmin.Pages { public partial class ValidQuiz { - private Quiz[] quizzes; - private int totalQuizzes; + private List quizzes; + [Inject] public HttpClient Http { get; set; } [Inject] public NavigationManager NavigationManager { get; set; } + + [Inject] + public IQuizService QuizService { get; set; } protected override async Task OnInitializedAsync() { - quizzes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataQuiz.json"); + quizzes = await QuizService.getQuizzesToValidate(); } private void OnValidButton(Quiz quiz) @@ -28,6 +32,12 @@ namespace WF_WebAdmin.Pages private void ValidateQuiz(Quiz quiz) { Console.WriteLine($"Quiz {quiz.Id} validated!"); + + Quiz newQuiz = quiz; + newQuiz.IsValid = true; + + // Mis à jour de l'état du quiz + QuizService.updateQuiz(quiz); } private void OnRejectButton(Quiz quiz) @@ -38,6 +48,8 @@ namespace WF_WebAdmin.Pages private void RejectQuiz(Quiz quiz) { Console.WriteLine($"Quiz {quiz.Id} rejected!"); + + QuizService.removeQuiz(quiz.Id); } } } \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Program.cs b/WF-WebAdmin/WF-WebAdmin/Program.cs index 7316058..c459806 100644 --- a/WF-WebAdmin/WF-WebAdmin/Program.cs +++ b/WF-WebAdmin/WF-WebAdmin/Program.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Localization; using System.Globalization; using WF_WebAdmin.Data; +using WF_WebAdmin.Service; using WF_WebAdmin.Model; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; @@ -20,7 +21,9 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); builder.Services.AddSingleton(); - +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddHttpClient(); builder.Services.AddScoped(); diff --git a/WF-WebAdmin/WF-WebAdmin/Service/IQuizService.cs b/WF-WebAdmin/WF-WebAdmin/Service/IQuizService.cs new file mode 100644 index 0000000..9c0dd95 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/IQuizService.cs @@ -0,0 +1,26 @@ +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Service +{ + public interface IQuizService + { + public Task addQuiz(Quiz quiz); + + public Task updateQuiz(Quiz quiz); + + public Task removeQuiz(int id); + + public Task validateQuiz(int id); + + public Task> getQuizzes(); + + public Task> getQuizzesToValidate(); + + public Task getQuiz(int id); + + public Task> getSommeQuiz(int nb, int page); + + public Task getNbQuiz(); + } +} + \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Service/IQuoteService.cs b/WF-WebAdmin/WF-WebAdmin/Service/IQuoteService.cs index a76b4b0..6a4103f 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/IQuoteService.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/IQuoteService.cs @@ -16,12 +16,18 @@ namespace WF_WebAdmin.Service public Task> getSomeQuote(int nb, int page); - public Task> getOnequote(int id); + public Task getOnequote(int id); public Task> reserchQuote(string reserch, List argument); public Task> getAllQuoteInvalid(); public Task> getSomeQuoteInvalid(int nb, int page); + + public Task getNbQuote(); + + public Task> getChar(); + + public Task> getSrc(); } } diff --git a/WF-WebAdmin/WF-WebAdmin/Service/IUserService.cs b/WF-WebAdmin/WF-WebAdmin/Service/IUserService.cs index 1742e10..7357e21 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/IUserService.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/IUserService.cs @@ -4,18 +4,22 @@ namespace WF_WebAdmin.Service { public interface IUserService { - public void removeUser(User user); + public Task removeUser(User user); - public void updateRole(User user); + public Task updateRole(User user); - public void downgradeRole(User user); + public Task downgradeRole(User user); - public List getAllUser(); + public Task updateUser(User user); - public List getSomeUser(int nb, int page); + public Task> getAllUser(); - public User getOneUser(int id); + public Task> getSomeUser(int nb, int page); - public List reserchUsers(string reserch, List args); + public Task getOneUser(int id); + + public Task> reserchUsers(string reserch, List args); + + public Task getNbUser(); } } diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuizService.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuizService.cs deleted file mode 100644 index 2a6c75f..0000000 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuizService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using WF_WebAdmin.Model; - -namespace WF_WebAdmin.Service; - -public class QuizService -{ - public List GetQuizToConfirm() - { - var res = new List(); - - return res; - } - - public bool AddQuiz(Quiz quiz) - { - var res = false; - return res; - } - - public bool RemoveQuiz(Quiz quiz) - { - var res = false; - return res; - } -} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs new file mode 100644 index 0000000..7b6b662 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs @@ -0,0 +1,106 @@ +using System.Text.Json; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Service; + +public class QuizServiceStub: IQuizService +{ + private readonly string _jsonFilePath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake_data_quiz.json"); + + public async Task saveQuizJson(List quizzes) + { + var json = JsonSerializer.Serialize(quizzes, new JsonSerializerOptions { WriteIndented = true }); + await File.WriteAllTextAsync(_jsonFilePath, json); + } + + public async Task addQuiz(Quiz quiz) + { + var data = await getQuizzes(); + quiz.Id = data.Count > 0 ? data.Max(p => p.Id) + 1 : 1; + data.Add(quiz); + await saveQuizJson(data); + } + + public async Task updateQuiz(Quiz quiz) + { + var data = await getQuizzes(); + var existingQuiz = data.FirstOrDefault(q => q.Id == quiz.Id); + if (existingQuiz != null) + { + existingQuiz.Question = quiz.Question; + existingQuiz.AnswerA = quiz.AnswerA; + existingQuiz.AnswerB = quiz.AnswerB; + existingQuiz.AnswerC = quiz.AnswerC; + existingQuiz.AnswerD = quiz.AnswerD; + existingQuiz.CAnswer = quiz.CAnswer; + existingQuiz.IsValid = quiz.IsValid; + existingQuiz.UserProposition = quiz.UserProposition; + await saveQuizJson(data); + } + } + + public async Task removeQuiz(int id) + { + var data = await getQuizzes(); + var quiz = data.FirstOrDefault(q => q.Id == id); + if (quiz != null) + { + data.Remove(quiz); + await saveQuizJson(data); + } + } + + public Task validateQuiz(int id) + { + throw new NotImplementedException(); + } + + public async Task> getQuizzes() + { + if (!File.Exists(_jsonFilePath)) + { + Console.Out.WriteLine($"{_jsonFilePath} not found"); + return new List(); + } + + var json = await File.ReadAllTextAsync(_jsonFilePath); + return JsonSerializer.Deserialize>(json) ?? new List(); + } + + public async Task> getQuizzesToValidate() + { + var quizzes = await getQuizzes(); + return quizzes.Where(quiz => quiz.IsValid == false).ToList(); + } + + public async Task getQuiz(int id) + { + var data = await getQuizzes(); + var q = data.FirstOrDefault(p => p.Id == id); + if (q != null) + { + return q; + } + return null; + } + + public async Task> getSommeQuiz(int nb, int page) + { + var data = await getQuizzes(); + if ((page - 1) * nb + nb > data.Count()) + { + if(nb > data.Count()) + { + return data.GetRange(0, data.Count()-1); + } + return data.GetRange(data.Count() - nb, nb); + } + return data.GetRange((page - 1) * nb, nb); + } + + public async Task getNbQuiz() + { + var data = await getQuizzes(); + return data.Count; + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs index 600c0d1..4417c5b 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs @@ -113,22 +113,37 @@ namespace WF_WebAdmin.Service throw new NotImplementedException(); } - public Task> getOnequote(int id) + public Task> reserchQuote(string reserch, List argument) { throw new NotImplementedException(); } - public Task> reserchQuote(string reserch, List argument) + public Task> getAllQuoteInvalid() { throw new NotImplementedException(); } - public Task> getAllQuoteInvalid() + public Task> getSomeQuoteInvalid(int nb, int page) { throw new NotImplementedException(); } - public Task> getSomeQuoteInvalid(int nb, int page) + public Task getOnequote(int id) + { + throw new NotImplementedException(); + } + + public Task getNbQuote() + { + throw new NotImplementedException(); + } + + public Task> getChar() + { + throw new NotImplementedException(); + } + + public Task> getSrc() { throw new NotImplementedException(); } diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs index 5989b12..fcf6102 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs @@ -1,69 +1,151 @@ -using Microsoft.AspNetCore.Components; -using WF_WebAdmin.Model; -using static System.Net.WebRequestMethods; - -namespace WF_WebAdmin.Service -{ - public class QuoteServiceStub : IQuoteService - { - [Inject] - public HttpClient Http { get; set; } - - [Inject] - public NavigationManager NavigationManager { get; set; } +using System.Text.Json; +using WF_WebAdmin.Model; +namespace WF_WebAdmin.Service; + public class QuoteServiceStub : IQuoteService + { + private readonly string _jsonFilePath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataQuote.json"); + private readonly string _char = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataCaracter.json"); + private readonly string _src = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake-dataSource.json"); + public async Task saveQuoteJson(List quotes) + { + var json = JsonSerializer.Serialize(quotes, new JsonSerializerOptions { WriteIndented = true }); + await File.WriteAllTextAsync(_jsonFilePath, json); + } + public async Task addQuote(Quote quote) + { + var data = await getAllQuote(); + quote.Id = data.Count > 0 ? data.Max(p => p.Id) + 1 : 1; + data.Add(quote); + await saveQuoteJson(data); + } - public Task addQuote(Quote quote) + public async Task removeQuote(Quote quote) { - throw new NotImplementedException(); + var data = await getAllQuote(); + var q = data.FirstOrDefault(p => p.Id == quote.Id); + if (q != null) + { + data.Remove(q); + await saveQuoteJson(data); + } } - public Task> getAllQuote() + public async Task validQuote(Quote quote) { throw new NotImplementedException(); } - public Task> getAllQuoteInvalid() + public async Task updateQuote(Quote quote) { - throw new NotImplementedException(); + var data = await getAllQuote(); + var q = data.FirstOrDefault(p => p.Id == quote.Id); + if (q != null) + { + q.Content = quote.Content; + q.Charac = quote.Charac; + q.ImgPath = quote.ImgPath; + q.TitleSrc = quote.TitleSrc; + q.DateSrc = quote.DateSrc; + q.Langue = quote.Langue; + await saveQuoteJson(data); + } } - public Task> getOnequote(int id) + public async Task> getAllQuote() { - throw new NotImplementedException(); + if (!File.Exists(_jsonFilePath)) + { + Console.Out.WriteLine($"{_jsonFilePath} not found"); + return new List(); + } + + var json = await File.ReadAllTextAsync(_jsonFilePath); + return JsonSerializer.Deserialize>(json) ?? new List(); } - public Task> getSomeQuote(int nb, int page) + public async Task> getSomeQuote(int nb, int page) { - throw new NotImplementedException(); + var quotes = await getAllQuote(); + if((page - 1) * nb + nb > quotes.Count()) + { + if (nb > quotes.Count()) + { + return quotes.GetRange(0, quotes.Count()); + } + return quotes.GetRange(quotes.Count()-nb, nb); + } + return quotes.GetRange((page - 1) * nb, nb); } - public Task> getSomeQuoteInvalid(int nb, int page) + public async Task getOnequote(int id) { - throw new NotImplementedException(); + var data = await getAllQuote(); + var q = data.FirstOrDefault(p => p.Id == id); + if (q != null) + { + return q; + } + return null; } - public Task removeQuote(Quote quote) + public async Task> reserchQuote(string reserch, List argument) { throw new NotImplementedException(); } - public Task> reserchQuote(string reserch, List argument) + public async Task> getAllQuoteInvalid() { - throw new NotImplementedException(); + var quotes = await getAllQuote(); + quotes = quotes.Where(q => q.IsValid == false).ToList(); + return quotes; } - public Task updateQuote(Quote quote) + public async Task> getSomeQuoteInvalid(int nb, int page) { - throw new NotImplementedException(); + var quotes = await getAllQuoteInvalid(); + if ((page - 1) * nb + nb > quotes.Count()) + { + if (nb > quotes.Count()) + { + return quotes.GetRange(0, quotes.Count()); + } + return quotes.GetRange(quotes.Count() - nb, nb); + } + return quotes.GetRange((page - 1) * nb, nb); } - public Task validQuote(Quote quote) + public async Task getNbQuote() { - throw new NotImplementedException(); + var data = await getAllQuote(); + return data.Count; + } + + public async Task> getChar() + { + if (!File.Exists(_char)) + { + Console.Out.WriteLine($"{_char} not found"); + return new List(); + } + + var json = await File.ReadAllTextAsync(_char); + return JsonSerializer.Deserialize>(json) ?? new List(); + } + + public async Task> getSrc() + { + if (!File.Exists(_src)) + { + Console.Out.WriteLine($"{_src} not found"); + return new List(); + } + + var json = await File.ReadAllTextAsync(_src); + return JsonSerializer.Deserialize>(json) ?? new List(); } - } -} +} + \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Service/UserServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/UserServiceStub.cs new file mode 100644 index 0000000..67cb03f --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/UserServiceStub.cs @@ -0,0 +1,97 @@ +using System.Text.Json; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Service; + +public class UserServiceStub : IUserService +{ + private readonly string _jsonFilePath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "fake_data_users.json"); + + + public async Task saveUsersJson(List users) + { + var json = JsonSerializer.Serialize(users, new JsonSerializerOptions { WriteIndented = true }); + await File.WriteAllTextAsync(_jsonFilePath, json); + } + + public async Task removeUser(User user) + { + var data = await getAllUser(); + var u = data.FirstOrDefault(p => p.Id == user.Id); + if (u != null) + { + data.Remove(u); + await saveUsersJson(data); + } + } + + public Task updateRole(User user) + { + user.IsAdmin = true; + return updateUser(user); + } + + public Task downgradeRole(User user) + { + user.IsAdmin = false; + return updateUser(user); + } + + public async Task> getAllUser() + { + if (!File.Exists(_jsonFilePath)) + { + Console.Out.WriteLine($"{_jsonFilePath} not found"); + return new List(); + } + + var json = await File.ReadAllTextAsync(_jsonFilePath); + return JsonSerializer.Deserialize>(json) ?? new List(); + } + + public async Task> getSomeUser(int nb, int page) + { + var users = await getAllUser(); + if ((page - 1) * nb + nb > users.Count()) + { + return users.GetRange(users.Count() - nb, nb); + } + return users.GetRange((page - 1) * nb, nb); + } + + public async Task getOneUser(int id) + { + var data = await getAllUser(); + var u = data.FirstOrDefault(p => p.Id == id); + if (u != null) + { + return u; + } + return null; + } + + public Task> reserchUsers(string reserch, List args) + { + throw new NotImplementedException(); + } + + public async Task getNbUser() + { + var data = await getAllUser(); + return data.Count; + } + + public async Task updateUser(User user) + { + var data = await getAllUser(); + var person = data.FirstOrDefault(p => p.Id == user.Id); + if (person != null) + { + person.Name = user.Name; + person.Email = user.Email; + person.Image = user.Image; + person.IsAdmin = user.IsAdmin; + await saveUsersJson(data); + } + } +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor index 28062bd..83deca9 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor @@ -39,7 +39,13 @@ + + diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css b/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css index 24284a5..7995488 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css @@ -83,8 +83,18 @@ button { background-color: #C3C4C5; } -.imgProfil, .imgQuote { +.imgProfil { border-radius: 25px; + width: 150px; /* Taille standard */ + height: 150px; /* Taille standard */ + object-fit: cover; +} + +.imgQuote { + border-radius: 20px; + width: 300px; /* Taille standard */ + height: 300px; /* Taille standard */ + object-fit: cover; } .pseudo, .mail, .idUser, .dateCrea, .idQuote, .contentQuote, .CaracterQuote, .SourceQuote, .langueQuote, .UserPropositionQuote { @@ -106,7 +116,7 @@ button { left: 0; width: 100%; height: 100%; - background-color: white border-radius:20px; + border-radius:20px; display: flex; justify-content: center; align-items: center; @@ -114,10 +124,11 @@ button { } .contentPopup { - background-color: white; padding: 20px; border-radius: 20px; + border: 3px solid black; display: flex; + background-color: white; flex-direction: column; gap: 10px; width: 300px; diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/edit.png b/WF-WebAdmin/WF-WebAdmin/wwwroot/edit.png new file mode 100644 index 0000000..cbf3dce Binary files /dev/null and b/WF-WebAdmin/WF-WebAdmin/wwwroot/edit.png differ diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz.json deleted file mode 100644 index 24eb012..0000000 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz.json +++ /dev/null @@ -1,282 +0,0 @@ -[ - { - "id": 1, - "question": "Voluptate nulla laborum pariatur excepteur consequat officia ea esse ut nisi amet non.", - "answerA": "sit ullamco", - "answerB": "deserunt reprehenderit", - "answerC": "cupidatat deserunt", - "answerD": "ullamco aliqua", - "cAnswer": "B", - "userProposition": "Lori Myers" - }, - { - "id": 2, - "question": "Ea elit esse minim aute aliquip cillum amet cupidatat fugiat exercitation.", - "answerA": "ullamco excepteur", - "answerB": "aliquip occaecat", - "answerC": "incididunt duis", - "answerD": "sunt dolor", - "cAnswer": "A", - "userProposition": "Louella Robinson" - }, - { - "id": 3, - "question": "Aute commodo est proident sunt nulla est cillum eiusmod est voluptate dolore sit aliqua incididunt.", - "answerA": "reprehenderit mollit", - "answerB": "laboris consectetur", - "answerC": "cillum deserunt", - "answerD": "deserunt fugiat", - "cAnswer": "B", - "userProposition": "Richmond Joyner" - }, - { - "id": 4, - "question": "Fugiat duis excepteur non amet tempor deserunt ut occaecat cupidatat eiusmod et amet enim.", - "answerA": "amet aute", - "answerB": "excepteur ad", - "answerC": "laboris veniam", - "answerD": "veniam in", - "cAnswer": "B", - "userProposition": "Brady Patrick" - }, - { - "id": 5, - "question": "Occaecat minim velit dolor est ad ut irure eu labore velit in dolore exercitation.", - "answerA": "eu aliqua", - "answerB": "labore ipsum", - "answerC": "labore reprehenderit", - "answerD": "anim excepteur", - "cAnswer": "C", - "userProposition": "Mavis Boone" - }, - { - "id": 6, - "question": "Non laboris adipisicing anim fugiat labore excepteur tempor elit in.", - "answerA": "in excepteur", - "answerB": "nostrud dolor", - "answerC": "nisi aliqua", - "answerD": "sint nisi", - "cAnswer": "C", - "userProposition": "Douglas Dejesus" - }, - { - "id": 7, - "question": "Lorem proident exercitation elit fugiat do amet aute labore consectetur pariatur consequat.", - "answerA": "eiusmod nulla", - "answerB": "eu id", - "answerC": "proident tempor", - "answerD": "amet proident", - "cAnswer": "A", - "userProposition": "Mia Peterson" - }, - { - "id": 8, - "question": "Incididunt magna commodo laborum do incididunt commodo proident non cillum magna elit irure voluptate.", - "answerA": "laborum fugiat", - "answerB": "laboris est", - "answerC": "in ea", - "answerD": "duis ullamco", - "cAnswer": "A", - "userProposition": "Juliet Fox" - }, - { - "id": 9, - "question": "Qui labore fugiat sint Lorem ut minim in ex dolor.", - "answerA": "et deserunt", - "answerB": "labore sit", - "answerC": "in eiusmod", - "answerD": "amet incididunt", - "cAnswer": "C", - "userProposition": "Earnestine Poole" - }, - { - "id": 10, - "question": "Voluptate pariatur ipsum magna sint Lorem adipisicing.", - "answerA": "sint velit", - "answerB": "non culpa", - "answerC": "nisi ut", - "answerD": "excepteur labore", - "cAnswer": "B", - "userProposition": "Alexis Cross" - }, - { - "id": 11, - "question": "In labore sunt est cupidatat cillum.", - "answerA": "ut ad", - "answerB": "non deserunt", - "answerC": "do officia", - "answerD": "ut nostrud", - "cAnswer": "C", - "userProposition": "Brooks Martinez" - }, - { - "id": 12, - "question": "Irure occaecat sit laborum nulla ea dolore et aliqua sunt Lorem enim esse.", - "answerA": "excepteur occaecat", - "answerB": "pariatur in", - "answerC": "reprehenderit excepteur", - "answerD": "laborum adipisicing", - "cAnswer": "D", - "userProposition": "Shields Roth" - }, - { - "id": 13, - "question": "Laboris sint in sit exercitation nisi id cillum ex ea culpa fugiat in cupidatat.", - "answerA": "labore mollit", - "answerB": "in veniam", - "answerC": "labore eiusmod", - "answerD": "consequat veniam", - "cAnswer": "B", - "userProposition": "Carmella Chase" - }, - { - "id": 14, - "question": "Proident dolor Lorem anim proident laborum sint minim sit laborum aliquip.", - "answerA": "velit exercitation", - "answerB": "voluptate esse", - "answerC": "occaecat cupidatat", - "answerD": "enim adipisicing", - "cAnswer": "D", - "userProposition": "Johns Solomon" - }, - { - "id": 15, - "question": "Do magna dolore enim laborum consequat reprehenderit nisi consequat nostrud.", - "answerA": "proident do", - "answerB": "labore minim", - "answerC": "in elit", - "answerD": "in irure", - "cAnswer": "A", - "userProposition": "Alana Moore" - }, - { - "id": 16, - "question": "Culpa anim id elit dolore veniam.", - "answerA": "ipsum nisi", - "answerB": "officia voluptate", - "answerC": "in excepteur", - "answerD": "ullamco non", - "cAnswer": "B", - "userProposition": "Russo Rios" - }, - { - "id": 17, - "question": "Ea est consectetur exercitation aute ut mollit pariatur irure aute adipisicing dolore.", - "answerA": "fugiat elit", - "answerB": "pariatur nulla", - "answerC": "exercitation ipsum", - "answerD": "exercitation laboris", - "cAnswer": "A", - "userProposition": "Bobbi Lara" - }, - { - "id": 18, - "question": "Laborum consectetur incididunt ad fugiat fugiat proident culpa mollit laborum.", - "answerA": "elit duis", - "answerB": "amet aute", - "answerC": "culpa nostrud", - "answerD": "do pariatur", - "cAnswer": "D", - "userProposition": "Lewis Mullins" - }, - { - "id": 19, - "question": "Culpa anim aliquip mollit non labore.", - "answerA": "labore incididunt", - "answerB": "laborum non", - "answerC": "sunt laborum", - "answerD": "est sunt", - "cAnswer": "B", - "userProposition": "Mccray Mccoy" - }, - { - "id": 20, - "question": "Ex exercitation deserunt aute cillum dolor.", - "answerA": "proident magna", - "answerB": "pariatur exercitation", - "answerC": "ipsum veniam", - "answerD": "culpa quis", - "cAnswer": "C", - "userProposition": "Moss Jefferson" - }, - { - "id": 21, - "question": "Do mollit aute dolore anim id non aliqua.", - "answerA": "ipsum aute", - "answerB": "irure ex", - "answerC": "ex duis", - "answerD": "ipsum cupidatat", - "cAnswer": "B", - "userProposition": "Roth Valdez" - }, - { - "id": 22, - "question": "Commodo sunt reprehenderit tempor sit ut ea Lorem esse minim elit et sunt sint qui.", - "answerA": "et do", - "answerB": "officia culpa", - "answerC": "et commodo", - "answerD": "irure tempor", - "cAnswer": "D", - "userProposition": "Adrienne Carpenter" - }, - { - "id": 23, - "question": "Excepteur cupidatat ut sit commodo magna elit.", - "answerA": "pariatur tempor", - "answerB": "proident non", - "answerC": "velit elit", - "answerD": "pariatur fugiat", - "cAnswer": "D", - "userProposition": "Mcknight Cain" - }, - { - "id": 24, - "question": "Laborum eu nisi consequat voluptate in laboris cillum in aute sint excepteur aliqua Lorem in.", - "answerA": "pariatur in", - "answerB": "voluptate qui", - "answerC": "et cillum", - "answerD": "adipisicing id", - "cAnswer": "D", - "userProposition": "Gay Barlow" - }, - { - "id": 25, - "question": "Laborum ullamco occaecat excepteur deserunt nostrud dolor.", - "answerA": "magna labore", - "answerB": "ullamco veniam", - "answerC": "reprehenderit irure", - "answerD": "magna dolore", - "cAnswer": "B", - "userProposition": "Hannah Battle" - }, - { - "id": 26, - "question": "Commodo in amet laboris Lorem et qui anim ea ullamco dolor dolor commodo.", - "answerA": "amet nulla", - "answerB": "laborum mollit", - "answerC": "amet in", - "answerD": "irure amet", - "cAnswer": "D", - "userProposition": "Dawson Mcpherson" - }, - { - "id": 27, - "question": "Veniam non consectetur sit cillum.", - "answerA": "aliqua cupidatat", - "answerB": "nostrud culpa", - "answerC": "anim ullamco", - "answerD": "adipisicing et", - "cAnswer": "A", - "userProposition": "Reeves Love" - }, - { - "id": 28, - "question": "Ullamco laboris voluptate nostrud commodo Lorem enim ad ipsum.", - "answerA": "id aute", - "answerB": "aliquip incididunt", - "answerC": "duis elit", - "answerD": "mollit ad", - "cAnswer": "B", - "userProposition": "Michael Holmes" - } -] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json index 39d4bd4..a81ebeb 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json @@ -1,112 +1,194 @@ [ { - "id_quote": "1", - "content": "Dans le monde il n’y a pas d’un côté le bien et le mal, il y a une part de lumière et d’ombre en chacun de nous. Ce qui compte c’est celle que l’on choisit de montrer dans nos actes, ça c’est ce que l’on est vraiment.", - "likes": 0, - "langue": "fr", - "isValide": true, - "reason": "insertion de test", - "id_caracter": 50, - "id_source": 38, - "id_user_verif": 1 + "Id": 1, + "Content": "Que la force soit avec toi.", + "Like": 150, + "Langue": "en", + "Charac": "Drago Malefoy", + "ImgPath": "http://starwars.com", + "TitleSrc": "L\u00E0-haut", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user1", + "IsValid": false }, { - "id_quote": "22", - "content": "Nous avons parié, mon père et moi. Je ne crois pas que tu tiendras dix minutes dans ce tournoi. Lui, il n’est pas d’accord, il croit que tu n’en tiendras pas cinq.", - "likes": 0, - "langue": "fr", - "isValide": true, - "reason": "insertion de test", - "id_caracter": 7, - "id_source": 58, - "id_user_verif": 1 + "Id": 2, + "Content": "Il n\u2019y a pas de place comme chez soi.", + "Like": 120, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://wizardofoz.com", + "TitleSrc": "Le Magicien d\u0027Oz", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user2", + "IsValid": false }, { - "id_quote": "45", - "content": "Je vous aurais suivi mon frère, mon capitaine, mon roi.", - "likes": 0, - "langue": "fr", - "isValide": true, - "reason": "insertion de test", - "id_caracter": 77, - "id_source": 76, - "id_user_verif": 1 + "Id": 3, + "Content": "C\u0027est le choix qui fait l\u0027homme, non le destin.", + "Like": 90, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://harrypotter.com", + "TitleSrc": "Harry Potter et la Chambre des Secrets", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user3", + "IsValid": false }, { - "id_quote": "90", - "content": "Si vous le voulez bien, on se taillera des pipes plus tard, les enfants.", - "likes": 0, - "langue": "fr", - "isValide": true, - "reason": "insertion de test", - "id_caracter": 82, - "id_source": 9, - "id_user_verif": 1 + "Id": 4, + "Content": "La magie, c\u2019est de croire en soi, c\u2019est \u00E7a la magie.", + "Like": 75, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://disney.com", + "TitleSrc": "La Belle et la B\u00EAte", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user4", + "IsValid": false }, { - "id_quote": "91", - "content": "Je fais le mort dans la 5e.", - "likes": 0, - "langue": "fr", - "isValide": true, - "reason": "insertion de test", - "id_caracter": 53, - "id_source": 9, - "id_user_verif": 1 + "Id": 5, + "Content": "La v\u00E9rit\u00E9 est plus \u00E9trange que la fiction.", + "Like": 65, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://theimaginarium.com", + "TitleSrc": "L\u0027Imaginarium du Docteur Parnassus", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user5", + "IsValid": false }, { - "id_quote": "110", - "content": "Il les a tuées avec leur amour. C’est comme ça tous les jours dans le monde entier.", - "likes": 0, - "langue": "fr", - "isValide": true, - "reason": "insertion de test", - "id_caracter": 34, - "id_source": 74, - "id_user_verif": 1 + "Id": 6, + "Content": "Un homme qui ne croit pas aux miracles n\u2019est pas un homme.", + "Like": 85, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://theprinceofpersia.com", + "TitleSrc": "Prince of Persia : Les Sables du Temps", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user6", + "IsValid": false }, { - "id_quote": "118", - "content": "La vengeance est un déesse dévorante. Eux aussi en sont victimes… Je ne dois pas céder à son appel. La justice finira par triompher.", - "likes": 0, - "langue": "fr", - "isValide": false, - "reason": "insertion de test", - "id_caracter": 44, - "id_source": 30, - "id_user_verif": 1 + "Id": 7, + "Content": "La seule limite \u00E0 notre r\u00E9alisation de demain sera nos doutes et h\u00E9sitations d\u2019aujourd\u2019hui.", + "Like": 100, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://backtothefuture.com", + "TitleSrc": "Retour vers le futur", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user7", + "IsValid": false }, { - "id_quote": "185", - "content": "Tu viens de me montrer au complet ?!", - "likes": 0, - "langue": "fr", - "isValide": false, - "reason": "insertion de test", - "id_caracter": 38, - "id_source": 10, - "id_user_verif": 1 + "Id": 8, + "Content": "L\u2019imagination est plus importante que la connaissance.", + "Like": 200, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://inceptionmovie.com", + "TitleSrc": "Inception", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user8", + "IsValid": false }, { - "id_quote": "182", - "content": "Nouille ou pas nouille, tu te préoccupes trop de ce qui a été ou de ce qui sera.", - "likes": 0, - "langue": "fr", - "isValide": false, - "reason": "insertion de test", - "id_caracter": 29, - "id_source": 71, - "id_user_verif": 1 + "Id": 9, + "Content": "Ce n\u2019est pas de la magie, c\u2019est de la science, mais on ne comprend pas encore tout.", + "Like": 110, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://doctorstrange.com", + "TitleSrc": "Doctor Strange", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user9", + "IsValid": false }, { - "id_quote": "175", - "content": "Arrête de faire ton Jean-Jacques !", - "likes": 0, - "langue": "fr", - "isValide": false, - "reason": "insertion de test", - "id_caracter": 39, - "id_source": 68, - "id_user_verif": 1 + "Id": 10, + "Content": "L\u2019important ce n\u2019est pas d\u2019\u00EAtre parfait, c\u2019est d\u2019\u00EAtre vrai.", + "Like": 130, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://narnia.com", + "TitleSrc": "Le Monde de Narnia", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user10", + "IsValid": false + }, + { + "Id": 11, + "Content": "Vous ne pouvez pas vivre sans causer de dommages \u00E0 quelqu\u0027un d\u0027autre.", + "Like": 110, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://thematrix.com", + "TitleSrc": "The Matrix", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user11", + "IsValid": false + }, + { + "Id": 12, + "Content": "Les r\u00EAves, ils ne peuvent pas vous mentir.", + "Like": 80, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://peterpanmovie.com", + "TitleSrc": "Peter Pan", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user12", + "IsValid": false + }, + { + "Id": 14, + "Content": "La vie, c\u2019est ce qui nous arrive quand on est occup\u00E9 \u00E0 faire d\u2019autres projets.", + "Like": 140, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://forrestgump.com", + "TitleSrc": "Forrest Gump", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user14", + "IsValid": false + }, + { + "Id": 15, + "Content": "Il faut toujours croire en l\u2019impossible, sinon la magie dispara\u00EEt.", + "Like": 60, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://harrypotter.com", + "TitleSrc": "Harry Potter \u00E0 l\u0027\u00E9cole des sorciers", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user15", + "IsValid": false + }, + { + "Id": 16, + "Content": "Le pouvoir de l\u2019imaginaire est plus fort que tout.", + "Like": 120, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://theincrediblesmovie.com", + "TitleSrc": "Les Indestructibles", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user16", + "IsValid": false + }, + { + "Id": 17, + "Content": "On peut conqu\u00E9rir l\u2019univers en une journ\u00E9e si on travaille ensemble.", + "Like": 130, + "Langue": "fr", + "Charac": "test", + "ImgPath": "http://guardiansofthegalaxy.com", + "TitleSrc": "Les Gardiens de la Galaxie", + "DateSrc": "2025-01-21T00:00:00", + "UserProposition": "user17", + "IsValid": false } ] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json new file mode 100644 index 0000000..01ef57f --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json @@ -0,0 +1,9 @@ +[ + { + "Id": 4, + "Image": "https://tse2.mm.bing.net/th/id/OIP.3vXkEUJ9J8s-GsnBC6I3KAHaF0?w=185\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "jesus", + "Email": "jesus@allah.coran", + "DateCreation": "2024-10-10T00:00:00" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json index 5808bf5..751bd60 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json @@ -2,9 +2,9 @@ { "Id": 1, "Image": "https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123&h=180&c=7&r=0&o=5&pid=1.7", - "Name": "Admin", + "Name": "admin", "IsAdmin": true, - "Mdp" : "passwd" + "Mdp" : "admin" }, { "Id": 2, diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUsers.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUsers.json deleted file mode 100644 index 06f95cf..0000000 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUsers.json +++ /dev/null @@ -1,166 +0,0 @@ -[ - { - "Id": 1, - "Image": "https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123&h=180&c=7&r=0&o=5&pid=1.7", - "Name": "admin", - "Email": "admin@gmail.com", - "DateCreation": "2024-12-12", - "IsAdmin": true, - "Comments": [ - { - "Text": "Commentaire 1", - "DateCreation": "2024-12-12" - }, - { - "Text": "Commentaire 2", - "DateCreation": "2024-11-12" - } - ], - "Mdp": "admin" - }, - { - "Id": 2, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "exploit", - "Email": "exploit@gmail.com", - "DateCreation": "2024-11-12", - "IsAdmin": true, - "Mdp": "exploit" - }, - { - "Id": 3, - "Image": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202&h=180&c=7&r=0&o=5&pid=1.7", - "Name": "testeur", - "Email": "testeur@gmail.com", - "DateCreation": "2024-08-02", - "IsAdmin": false, - "Comments": [ - { - "Text": "Premier test effectué, tout semble OK.", - "DateCreation": "2024-08-02" - } - ] - }, - { - "Id": 4, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "dev", - "Email": "dev@gmail.com", - "DateCreation": "2024-10-10", - "IsAdmin": false - }, - { - "Id": 5, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "jean_doe", - "Email": "jean.doe@gmail.com", - "DateCreation": "2024-06-25", - "IsAdmin": false, - "Comments": [ - { - "Text": "Utilisateur très actif, peut être un peu trop intrusif.", - "DateCreation": "2024-06-25" - } - ] - }, - { - "Id": 6, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "jane_smith", - "Email": "jane.smith@gmail.com", - "DateCreation": "2024-07-15", - "IsAdmin": false - }, - { - "Id": 7, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "admin_joe", - "Email": "admin.joe@gmail.com", - "DateCreation": "2024-05-30", - "IsAdmin": true - }, - { - "Id": 8, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "dev_anna", - "Email": "dev.anna@gmail.com", - "DateCreation": "2024-09-05", - "IsAdmin": false - }, - { - "Id": 9, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "support_mark", - "Email": "support.mark@gmail.com", - "DateCreation": "2024-11-20", - "IsAdmin": false, - "Comments": [ - { - "Text": "Support rapide et efficace, mais manquant un peu de détails.", - "DateCreation": "2024-11-20" - } - ] - }, - { - "Id": 10, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "dev_susan", - "Email": "dev.susan@gmail.com", - "DateCreation": "2024-08-12", - "IsAdmin": false - }, - { - "Id": 11, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "designer_steve", - "Email": "designer.steve@gmail.com", - "DateCreation": "2024-07-01", - "IsAdmin": false, - "Comments": [ - { - "Text": "Le design doit être retravaillé pour plus de clarté.", - "DateCreation": "2024-07-01" - } - ] - }, - { - "Id": 12, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "admin_lucas", - "Email": "admin.lucas@gmail.com", - "DateCreation": "2024-09-22", - "IsAdmin": true - }, - { - "Id": 13, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "manager_anna", - "Email": "manager.anna@gmail.com", - "DateCreation": "2024-05-01", - "IsAdmin": false - }, - { - "Id": 14, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "developer_mike", - "Email": "developer.mike@gmail.com", - "DateCreation": "2024-11-02", - "IsAdmin": false - }, - { - "Id": 15, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "test_user_01", - "Email": "test.user01@gmail.com", - "DateCreation": "2024-06-10", - "IsAdmin": false - }, - { - "Id": 16, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", - "Name": "admin_kate", - "Email": "admin.kate@gmail.com", - "DateCreation": "2024-04-16", - "IsAdmin": true - } -] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json new file mode 100644 index 0000000..ef41eeb --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json @@ -0,0 +1,79 @@ +[ + { + "Id": 9, + "Question": "Question_quiz_1", + "AnswerA": "rep_1", + "AnswerB": "rep_2", + "AnswerC": "rep_3", + "AnswerD": "rep_3", + "CAnswer": "A", + "IsValid": false, + "UserProposition": "Earnestine Poole" + }, + { + "Id": 10, + "Question": "Voluptate pariatur ipsum magna sint Lorem adipisicing.", + "AnswerA": "sint velit", + "AnswerB": "non culpa", + "AnswerC": "nisi ut", + "AnswerD": "excepteur labore", + "CAnswer": "B", + "IsValid": false, + "UserProposition": "Alexis Cross" + }, + { + "Id": 11, + "Question": "nv question", + "AnswerA": "repA", + "AnswerB": "non deserunt", + "AnswerC": "do officia", + "AnswerD": "ut nostrud", + "CAnswer": "C", + "IsValid": false, + "UserProposition": "Brooks Martinez" + }, + { + "Id": 12, + "Question": "Irure occaecat sit laborum nulla ea dolore et aliqua sunt Lorem enim esse.", + "AnswerA": "excepteur occaecat", + "AnswerB": "pariatur in", + "AnswerC": "reprehenderit excepteur", + "AnswerD": "laborum adipisicing", + "CAnswer": "D", + "IsValid": false, + "UserProposition": "Shields Roth" + }, + { + "Id": 13, + "Question": "test", + "AnswerA": "a", + "AnswerB": "b", + "AnswerC": "c", + "AnswerD": "d", + "CAnswer": "D", + "IsValid": true, + "UserProposition": "Admin" + }, + { + "Id": 14, + "Question": "bonjour", + "AnswerA": "ca", + "AnswerB": "va", + "AnswerC": "marcher", + "AnswerD": "!", + "CAnswer": "A", + "IsValid": true, + "UserProposition": "Admin" + }, + { + "Id": 15, + "Question": "test", + "AnswerA": "a", + "AnswerB": "b", + "AnswerC": "c", + "AnswerD": "d", + "CAnswer": "C", + "IsValid": true, + "UserProposition": "Admin" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json new file mode 100644 index 0000000..49c9944 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json @@ -0,0 +1,107 @@ +[ + { + "Id": 3, + "Image": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "testeur", + "Email": "testeur@gmail.com", + "DateCreation": "2024-08-02T00:00:00", + "IsAdmin": true, + "Comments": [ + { + "Text": "Premier test effectu\u00E9, tout semble OK.", + "DateCreation": "2024-08-02T00:00:00" + } + ] + }, + { + "Id": 4, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "dev", + "Email": "dev@gmail.com", + "DateCreation": "2024-10-10T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 5, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "jean_doe", + "Email": "jean.doe@gmail.com", + "DateCreation": "2024-06-25T00:00:00", + "IsAdmin": false, + "Comments": [ + { + "Text": "Utilisateur tr\u00E8s actif, peut \u00EAtre un peu trop intrusif.", + "DateCreation": "2024-06-25T00:00:00" + } + ] + }, + { + "Id": 6, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "jane_smith", + "Email": "jane.smith@gmail.com", + "DateCreation": "2024-07-15T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 7, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "test_n1", + "Email": "admin.joe@gmail.com", + "DateCreation": "2024-05-30T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 8, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "dev_anna", + "Email": "dev.anna@gmail.com", + "DateCreation": "2024-09-05T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 9, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "support_mark", + "Email": "support.mark@gmail.com", + "DateCreation": "2024-11-20T00:00:00", + "IsAdmin": false, + "Comments": [ + { + "Text": "Support rapide et efficace, mais manquant un peu de d\u00E9tails.", + "DateCreation": "2024-11-20T00:00:00" + } + ] + }, + { + "Id": 10, + "Image": "https://th.bing.com/th/id/OIP.24T00MDK-RUhFnm1Do5PFwHaFj?w=229\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "dev_susan", + "Email": "dev.susan@gmail.com", + "DateCreation": "2024-08-12T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 12, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "admin_lucas", + "Email": "admin.lucas@gmail.com", + "DateCreation": "2024-09-22T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 14, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "developer_mike", + "Email": "developer.mike@gmail.com", + "DateCreation": "2024-11-02T00:00:00", + "IsAdmin": false, + "Comments": null + } +] \ No newline at end of file