Essai fix Sonar
continuous-integration/drone/push Build is failing Details

pull/19/head
Liam MONCHANIN 2 years ago
parent f2358887da
commit 7bcef40dbf

@ -29,6 +29,7 @@ steps:
- name: sonar - name: sonar
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7
secrets: [ Sonar_Login ] secrets: [ Sonar_Login ]
environment:
settings: settings:
sonar_host: https://codefirst.iut.uca.fr/sonar/ sonar_host: https://codefirst.iut.uca.fr/sonar/
sonar_token: sonar_token:

@ -26,7 +26,7 @@ namespace Biblioteque_de_Class
private DateOnly CreationDate { get; } private DateOnly CreationDate { get; }
private DateOnly ModificationDate { get; set; } private DateOnly ModificationDate { get; set; }
private List<NoteImage> ImageList; private List<NoteImage> ImageList;
private List<string> TextLineList; private string TextLine;
private List<User> Collaborators; private List<User> Collaborators;
private List<User> Editors; private List<User> Editors;
private User Owner; private User Owner;
@ -38,7 +38,6 @@ namespace Biblioteque_de_Class
CreationDate = DateOnly.FromDateTime(DateTime.Now); CreationDate = DateOnly.FromDateTime(DateTime.Now);
ModificationDate = DateOnly.FromDateTime(DateTime.Now); ModificationDate = DateOnly.FromDateTime(DateTime.Now);
ImageList = new List<NoteImage>(); ImageList = new List<NoteImage>();
TextLineList = new List<string>();
Collaborators = new List<User>(); Collaborators = new List<User>();
Editors = new List<User>(); Editors = new List<User>();
Owner = owner; Owner = owner;
@ -49,16 +48,17 @@ namespace Biblioteque_de_Class
public DateOnly GetCreationDate() { return CreationDate; } public DateOnly GetCreationDate() { return CreationDate; }
public DateOnly GetModificationDate() { return ModificationDate; } public DateOnly GetModificationDate() { return ModificationDate; }
public List<NoteImage> GetImageList() { return ImageList; } public List<NoteImage> GetImageList() { return ImageList; }
public List<string> GetTextLineList() { return TextLineList; } public string GetTextLine() { return TextLine; }
public List<User> GetCollaborators() { return Collaborators; } public List<User> GetCollaborators() { return Collaborators; }
public List<User> GetEditors() { return Editors; } public List<User> GetEditors() { return Editors; }
public User GetOwner() { return Owner; } 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 SetName(string name) { Name = name; }
public void SetLogoPath(string logoPath) { LogoPath = logoPath; } public void SetLogoPath(string logoPath) { LogoPath = logoPath; }
public void SetModificationDate() { ModificationDate = DateOnly.FromDateTime(DateTime.Now); } public void SetModificationDate() { ModificationDate = DateOnly.FromDateTime(DateTime.Now); }
public void SetTextLine(string texte) { TextLine = texte; }
/// <summary> /// <summary>
/// vérifier si l'utilisateur est le propriétaire de la note /// vérifier si l'utilisateur est le propriétaire de la note

@ -1,6 +1,7 @@
using Biblioteque_de_Class; using Biblioteque_de_Class;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics; using System.Diagnostics;
using System.Linq.Expressions;
string Upseudo = "u"; string Upseudo = "u";
string Umail = "u"; string Umail = "u";
@ -16,7 +17,7 @@ string choixNom;
string choixCouleur; string choixCouleur;
string choixModif; string choixModif;
string _image = "u"; string _image = "u";
string choix = "u"; string choix;
string newColor = "u"; string newColor = "u";
string color = "u"; string color = "u";
string color2; string color2;
@ -140,6 +141,8 @@ while (boucle == 0)
break; break;
case "6":///Supprimer une note case "6":///Supprimer une note
Console.WriteLine("Cherchez une note");
nom = Console.ReadLine();
u.SearchNoteByName(nom); u.SearchNoteByName(nom);
u.DeleteNote(n); u.DeleteNote(n);
break; break;
@ -201,7 +204,7 @@ while (boucle == 0)
case "15":///Supprimer une note des favoris case "15":///Supprimer une note des favoris
Console.WriteLine("Chercher note"); Console.WriteLine("Chercher note");
nom = Console.ReadLine(); nom = Console.ReadLine();
u.SearchNoteByName(nom); u.SearchFavoriteNoteByName(nom);
u.RemoveFavorite(n); u.RemoveFavorite(n);
break; break;
@ -217,6 +220,9 @@ while (boucle == 0)
listCouleurs.Add(color3); listCouleurs.Add(color3);
Theme th = new Theme(nom, listCouleurs); Theme th = new Theme(nom, listCouleurs);
db.AddTheme(th); db.AddTheme(th);
listCouleurs.RemoveAt(1);
listCouleurs.RemoveAt(1);
listCouleurs.RemoveAt(1);
break; break;
case "17":///Supprimer un theme case "17":///Supprimer un theme
@ -238,6 +244,9 @@ while (boucle == 0)
NewColorList.Add(color2); NewColorList.Add(color2);
NewColorList.Add(color3); NewColorList.Add(color3);
db.ModifyThemeColorList(th, NewColorList); db.ModifyThemeColorList(th, NewColorList);
NewColorList.RemoveAt(1);
NewColorList.RemoveAt(1);
NewColorList.RemoveAt(1);
break; break;
case "19":///Rechercher une note case "19":///Rechercher une note
@ -287,11 +296,12 @@ while (boucle == 0)
} }
break; 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); n.VerifyPrivilege(u);
if (true) if (true)
{ {
//n.SetTextLineList(); string texte = Console.ReadLine();
n.SetTextLine(texte);
} }
else else
{ {
@ -303,6 +313,9 @@ while (boucle == 0)
n.VerifyPrivilege(u); n.VerifyPrivilege(u);
if (true) if (true)
{ {
Console.WriteLine("Saisissez un utilisateur");
nom = Console.ReadLine();
user = db.GetUser(nom);
n.AddCollaborator(u, user); n.AddCollaborator(u, user);
} }
break; break;
@ -313,11 +326,15 @@ while (boucle == 0)
n.VerifyPrivilege(u); n.VerifyPrivilege(u);
if (true && choix.Equals('0')) if (true && choix.Equals('0'))
{ {
Console.WriteLine("Saisissez un utilisateur");
nom = Console.ReadLine();
user = db.GetUser(nom); user = db.GetUser(nom);
n.AddEditor(u, user); n.AddEditor(u, user);
} }
if (true && choix.Equals('1')) if (true && choix.Equals('1'))
{ {
Console.WriteLine("Saisissez un utilisateur");
nom = Console.ReadLine();
user = db.GetUser(nom); user = db.GetUser(nom);
n.RemoveEditor(u, user); n.RemoveEditor(u, user);
} }
@ -327,6 +344,8 @@ while (boucle == 0)
n.VerifyPrivilege(u); n.VerifyPrivilege(u);
if (true) if (true)
{ {
Console.WriteLine("Saisissez un utilisateur");
nom = Console.ReadLine();
user = db.GetUser(nom); user = db.GetUser(nom);
n.RemoveCollaborator(u, user); n.RemoveCollaborator(u, user);
} }

Loading…
Cancel
Save