diff --git a/.drone.yml b/.drone.yml index fc9ee6e..f765e59 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,11 +29,12 @@ steps: - name: sonar image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 secrets: [ Sonar_Login ] - settings: - sonar_host: https://codefirst.iut.uca.fr/sonar/ - sonar_token: - from_secret: Sonar_Login - project_key: notus_ThMo + environment: + settings: + sonar_host: https://codefirst.iut.uca.fr/sonar/ + sonar_token: + from_secret: Sonar_Login + project_key: notus_ThMo commands: - cd notus/ - dotnet restore notus_without_maui.sln diff --git a/notus/Biblioteque_de_Class/Note.cs b/notus/Biblioteque_de_Class/Note.cs index 75dd7d0..85e0370 100644 --- a/notus/Biblioteque_de_Class/Note.cs +++ b/notus/Biblioteque_de_Class/Note.cs @@ -26,7 +26,7 @@ namespace Biblioteque_de_Class private DateOnly CreationDate { get; } private DateOnly ModificationDate { get; set; } private List ImageList; - private List TextLineList; + private string TextLine; private List Collaborators; private List Editors; private User Owner; @@ -38,7 +38,6 @@ namespace Biblioteque_de_Class CreationDate = DateOnly.FromDateTime(DateTime.Now); ModificationDate = DateOnly.FromDateTime(DateTime.Now); ImageList = new List(); - TextLineList = new List(); Collaborators = new List(); Editors = new List(); Owner = owner; @@ -49,16 +48,17 @@ namespace Biblioteque_de_Class public DateOnly GetCreationDate() { return CreationDate; } public DateOnly GetModificationDate() { return ModificationDate; } public List GetImageList() { return ImageList; } - public List GetTextLineList() { return TextLineList; } + public string GetTextLine() { return TextLine; } public List GetCollaborators() { return Collaborators; } public List GetEditors() { return Editors; } public User GetOwner() { return Owner; } - public override string ToString() => $"Note -> Name: {Name}\nLogoPath: {LogoPath}\nNumber of lines: {TextLineList.Count()}"; + public override string ToString() => $"Note -> Name: {Name}\nLogoPath: {LogoPath}"; public void SetName(string name) { Name = name; } public void SetLogoPath(string logoPath) { LogoPath = logoPath; } public void SetModificationDate() { ModificationDate = DateOnly.FromDateTime(DateTime.Now); } + public void SetTextLine(string texte) { TextLine = texte; } /// /// vérifier si l'utilisateur est le propriétaire de la note diff --git a/notus/Notus_Console/Program.cs b/notus/Notus_Console/Program.cs index 4cd49e5..fe2b0b0 100644 --- a/notus/Notus_Console/Program.cs +++ b/notus/Notus_Console/Program.cs @@ -1,6 +1,7 @@ using Biblioteque_de_Class; using System.ComponentModel.DataAnnotations.Schema; using System.Diagnostics; +using System.Linq.Expressions; string Upseudo = "u"; string Umail = "u"; @@ -16,7 +17,7 @@ string choixNom; string choixCouleur; string choixModif; string _image = "u"; -string choix = "u"; +string choix; string newColor = "u"; string color = "u"; string color2; @@ -140,6 +141,8 @@ while (boucle == 0) break; case "6":///Supprimer une note + Console.WriteLine("Cherchez une note"); + nom = Console.ReadLine(); u.SearchNoteByName(nom); u.DeleteNote(n); break; @@ -201,7 +204,7 @@ while (boucle == 0) case "15":///Supprimer une note des favoris Console.WriteLine("Chercher note"); nom = Console.ReadLine(); - u.SearchNoteByName(nom); + u.SearchFavoriteNoteByName(nom); u.RemoveFavorite(n); break; @@ -217,6 +220,9 @@ while (boucle == 0) listCouleurs.Add(color3); Theme th = new Theme(nom, listCouleurs); db.AddTheme(th); + listCouleurs.RemoveAt(1); + listCouleurs.RemoveAt(1); + listCouleurs.RemoveAt(1); break; case "17":///Supprimer un theme @@ -238,6 +244,9 @@ while (boucle == 0) NewColorList.Add(color2); NewColorList.Add(color3); db.ModifyThemeColorList(th, NewColorList); + NewColorList.RemoveAt(1); + NewColorList.RemoveAt(1); + NewColorList.RemoveAt(1); break; case "19":///Rechercher une note @@ -287,11 +296,12 @@ while (boucle == 0) } break; - case "24":///Modifier le texte de la note mais jsp c'est quoi qu'il faut set + case "24":///Modifier le texte de la note n.VerifyPrivilege(u); if (true) { - //n.SetTextLineList(); + string texte = Console.ReadLine(); + n.SetTextLine(texte); } else { @@ -303,6 +313,9 @@ while (boucle == 0) n.VerifyPrivilege(u); if (true) { + Console.WriteLine("Saisissez un utilisateur"); + nom = Console.ReadLine(); + user = db.GetUser(nom); n.AddCollaborator(u, user); } break; @@ -313,11 +326,15 @@ while (boucle == 0) n.VerifyPrivilege(u); if (true && choix.Equals('0')) { + Console.WriteLine("Saisissez un utilisateur"); + nom = Console.ReadLine(); user = db.GetUser(nom); n.AddEditor(u, user); } if (true && choix.Equals('1')) { + Console.WriteLine("Saisissez un utilisateur"); + nom = Console.ReadLine(); user = db.GetUser(nom); n.RemoveEditor(u, user); } @@ -327,6 +344,8 @@ while (boucle == 0) n.VerifyPrivilege(u); if (true) { + Console.WriteLine("Saisissez un utilisateur"); + nom = Console.ReadLine(); user = db.GetUser(nom); n.RemoveCollaborator(u, user); }