Merge branch 'developpement'
continuous-integration/drone/push Build is passing
Details
@ -0,0 +1,67 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: pipelinefordeveloppement
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- developpement
|
||||
- master
|
||||
- upgradeclass
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: mcr.microsoft.com/dotnet/sdk:7.0
|
||||
commands:
|
||||
- cd notus/
|
||||
- dotnet restore notus_without_maui.sln
|
||||
- dotnet build notus_without_maui.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0
|
||||
- dotnet publish notus_without_maui.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
|
||||
|
||||
- name: tests
|
||||
image: mcr.microsoft.com/dotnet/sdk:7.0
|
||||
commands:
|
||||
- cd notus/
|
||||
- dotnet restore notus_without_maui.sln
|
||||
- dotnet test notus_without_maui.sln --no-restore
|
||||
depends_on: [build]
|
||||
|
||||
- name: sonar
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7
|
||||
secrets: [ Sonar_Login ]
|
||||
environment:
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
sonar_token:
|
||||
from_secret: Sonar_Login
|
||||
project_key: notus_ThMo
|
||||
coverage_exclusions: "Tests/**/**,Notus_Console/**"
|
||||
commands:
|
||||
- cd notus/
|
||||
- dotnet restore notus_without_maui.sln
|
||||
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
|
||||
- dotnet build notus_without_maui.sln -c Release --no-restore
|
||||
- dotnet test notus_without_maui.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
||||
- reportgenerator -reports:'**/coverage.cobertura.xml' -reporttypes:SonarQube -targetdir:"coveragereport" -verbosity:Verbose
|
||||
- dotnet publish notus_without_maui.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
|
||||
branch:
|
||||
- developpement
|
||||
depends_on: [build,tests]
|
||||
|
||||
- name: generate-and-deploy-docs
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||
failure: ignore
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
- /entrypoint.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
# environment:
|
||||
# NODOXYGEN: true
|
||||
volumes:
|
||||
- name: docs
|
||||
temp: {}
|
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,223 @@
|
||||
using Biblioteque_de_Class;
|
||||
namespace UnitTests_Model
|
||||
{
|
||||
[TestFixture]
|
||||
public class Database_Tests
|
||||
{
|
||||
private Database database;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
database = new Database();
|
||||
database.UserList.Add(new User("John", "john@example.com", "password123"));
|
||||
database.UserList.Add(new User("Jane", "jane@example.com", "choco"));
|
||||
database.UserList.Add(new User("Alice", "alice@example.com", "choco"));
|
||||
database.DefaultLogoList.Add(new Logo("Logo1", "link1"));
|
||||
database.DefaultLogoList.Add(new Logo("Logo2", "link2"));
|
||||
database.DefaultLogoList.Add(new Logo("Logo3", "link3"));
|
||||
}
|
||||
|
||||
// SearchUser tests
|
||||
|
||||
[Test]
|
||||
public void SearchUser_UserDoesNotExist_ThrowsException()
|
||||
{
|
||||
string searchName = "Bob";
|
||||
Assert.Throws<NotFoundException>(() => database.SearchUser(searchName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SearchUser_CaseInsensitiveSearch_ReturnsMatchingUsers()
|
||||
{
|
||||
string searchName = "Alice";
|
||||
User searchedUser = database.SearchUser(searchName);
|
||||
Assert.That(searchedUser.Username, Is.EqualTo("Alice"));
|
||||
}
|
||||
|
||||
// GetLogoLink tests
|
||||
[Test]
|
||||
public void GetLogoLink_LogoExists_ReturnsLogoLink()
|
||||
{
|
||||
Assert.That(database.GetLogoLink("Logo2"), Is.EqualTo("link2"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetLogoLink_LogoDoesNotExist_ThrowsException()
|
||||
{
|
||||
string logoName = "Logo4";
|
||||
Assert.Throws<NotFoundException>(() => database.GetLogoLink(logoName));
|
||||
}
|
||||
|
||||
// GetUser tests
|
||||
[Test]
|
||||
public void GetUser_UserExists_ReturnsUser()
|
||||
{
|
||||
string userName = "Alice";
|
||||
User user = database.GetUser(userName);
|
||||
Assert.IsNotNull(user);
|
||||
Assert.That(user.Username, Is.EqualTo(userName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetUser_UserDoesNotExist_ThrowsException()
|
||||
{
|
||||
string userName = "Eve";
|
||||
Assert.Throws<AlreadyUsedException>(() => database.GetUser(userName));
|
||||
}
|
||||
|
||||
// ComparePassword tests
|
||||
[Test]
|
||||
public void ComparePassword_CorrectPassword_ReturnsTrue()
|
||||
{
|
||||
User user = database.UserList[0];
|
||||
string password = "password123";
|
||||
bool result = Database.ComparePassword(user, password);
|
||||
Assert.That(result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ComparePassword_IncorrectPassword_ReturnsFalse()
|
||||
{
|
||||
User user = database.UserList[0];
|
||||
string password = "incorrectPassword";
|
||||
bool result = Database.ComparePassword(user, password);
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
// FindEmail tests
|
||||
[Test]
|
||||
public void FindEmail_ExistingEmail_ReturnsTrue()
|
||||
{
|
||||
string email = "john@example.com";
|
||||
bool result = database.FindEmail(email);
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindEmail_NonExistingEmail_ReturnsFalse()
|
||||
{
|
||||
string email = "olivedecarglass@example.com";
|
||||
bool result = database.FindEmail(email);
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
// AddUser tests
|
||||
[Test]
|
||||
public void AddUser_ValidUser_AddsUserToList()
|
||||
{
|
||||
User user = new User("Bob", "bob@example.com", "password123");
|
||||
database.AddUser(user);
|
||||
Assert.That(database.UserList, Contains.Item(user));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AddUser_DuplicateUserName_ThrowsException()
|
||||
{
|
||||
User user = new User("John", "johnDae@example.com", "password123");
|
||||
Assert.Throws<AlreadyUsedException>(() => database.AddUser(user));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AddUser_DuplicateUserEmail_ThrowsException()
|
||||
{
|
||||
User user = new User("Bob", "john@example.com", "password123");
|
||||
Assert.Throws<AlreadyUsedException>(() => database.AddUser(user));
|
||||
}
|
||||
|
||||
// removeUser tests
|
||||
[Test]
|
||||
public void RemoveUser_ExistingUser_RemovesUserFromList()
|
||||
{
|
||||
User user = database.UserList[0];
|
||||
database.RemoveUser(user);
|
||||
Assert.That(database.UserList, !Contains.Item(user));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RemoveUser_NotExistingUser_ThrowsException()
|
||||
{
|
||||
User user = new User("Bob", "bob@example.com", "password123");
|
||||
Assert.Throws<NotFoundException>(() => database.RemoveUser(user));
|
||||
}
|
||||
|
||||
// AddTheme tests
|
||||
[Test]
|
||||
public void AddTheme_ValidTheme_AddsThemeToList()
|
||||
{
|
||||
Theme theme = new Theme("Theme1", ",,,".Split().ToList());
|
||||
database.AddTheme(theme);
|
||||
Assert.That(database.ThemeList, Contains.Item(theme));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AddTheme_DuplicateTheme_ThrowsException()
|
||||
{
|
||||
Theme theme = new Theme("Theme1", ",,,".Split().ToList());
|
||||
database.ThemeList.Add(theme);
|
||||
Assert.Throws<AlreadyExistException>(() => database.AddTheme(theme));
|
||||
}
|
||||
|
||||
// GetTheme tests
|
||||
[Test]
|
||||
public void GetTheme_ExistingTheme_ReturnsTheme()
|
||||
{
|
||||
Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList());
|
||||
database.ThemeList.Add(expectedTheme);
|
||||
|
||||
Theme theme = database.GetTheme("Theme1");
|
||||
Assert.IsNotNull(theme);
|
||||
Assert.That(theme, Is.EqualTo(expectedTheme));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetTheme_NonExistingTheme_ReturnsNull()
|
||||
{
|
||||
Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList());
|
||||
database.ThemeList.Add(expectedTheme);
|
||||
Assert.Throws<NotFoundException>(() => database.GetTheme("NonExistingTheme"));
|
||||
}
|
||||
|
||||
// ChangeUsername tests
|
||||
[Test]
|
||||
public void ChangeUsername_CorrectReplaceName_ChangesUsername()
|
||||
{
|
||||
User userSelected = database.UserList[0];
|
||||
string newUsername = "duberlute";
|
||||
|
||||
database.ChangeUsername(userSelected, newUsername);
|
||||
|
||||
User updatedUser = database.UserList.Where(u => u.Username == newUsername).First();
|
||||
Assert.IsNotNull(updatedUser);
|
||||
Assert.That(updatedUser.Username, Is.EqualTo(newUsername));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangeUsername_UsernameAlreadyUsed_ThrowsException()
|
||||
{
|
||||
User userNotSelected = database.UserList[2];
|
||||
string newUsername = "Jane";
|
||||
|
||||
Assert.Throws<AlreadyUsedException>(() => database.ChangeUsername(userNotSelected, newUsername));
|
||||
}
|
||||
|
||||
// VerifThemeNameNotTaken tests
|
||||
[Test]
|
||||
public void VerifThemeNameNotTaken_NameNotTaken_ReturnsTrue()
|
||||
{
|
||||
string themeName = "NewTheme";
|
||||
bool result = database.VerifThemeNameNotTaken(themeName);
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void VerifThemeNameNotTaken_NameAlreadyTaken_ReturnsFalse()
|
||||
{
|
||||
Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList());
|
||||
database.ThemeList.Add(expectedTheme);
|
||||
string themeName = "Theme1";
|
||||
bool result = database.VerifThemeNameNotTaken(themeName);
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1 @@
|
||||
global using NUnit.Framework;
|
@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
|
||||
<ProjectReference Include="..\..\Notus_Persistence\Notus_Persistance.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1 @@
|
||||
global using NUnit.Framework;
|
@ -1,9 +0,0 @@
|
||||
namespace notus;
|
||||
|
||||
public partial class ConnecPage : ContentPage
|
||||
{
|
||||
public ConnecPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
|
||||
x:Class="notus.RecherPage"
|
||||
Title="RecherPage"
|
||||
BackgroundColor="#1C1C1C">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ContentPage>
|
@ -1,9 +0,0 @@
|
||||
namespace notus;
|
||||
|
||||
public partial class RecherPage : ContentPage
|
||||
{
|
||||
public RecherPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using Biblioteque_de_Class;
|
||||
|
||||
namespace notus;
|
||||
|
||||
public partial class ConnecPage : ContentPage
|
||||
{
|
||||
string mail = "";
|
||||
string MDP = "";
|
||||
|
||||
public ConnecPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void Valid_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
mail = Mail.Text;
|
||||
MDP = Password.Text;
|
||||
if ((Application.Current as App).db.SearchUser(mail, MDP))
|
||||
{
|
||||
await Navigation.PushAsync(new RecherPage());
|
||||
}
|
||||
else
|
||||
{
|
||||
ResultSearch.IsVisible = true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="notus.InscrPage"
|
||||
Title="InscrPage">
|
||||
|
||||
<Grid BackgroundColor="#1C1C1C">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="150"/>
|
||||
<RowDefinition Height="150"/>
|
||||
<RowDefinition Height="150"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Entry
|
||||
Placeholder="Pseudo"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="600"
|
||||
HeightRequest="100"
|
||||
FontSize="32"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
PlaceholderColor="#74fabd"
|
||||
/>
|
||||
|
||||
<Entry
|
||||
Placeholder="Mot de passe"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="600"
|
||||
HeightRequest="100"
|
||||
FontSize="32"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
IsPassword="true"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
PlaceholderColor="#74fabd"
|
||||
/>
|
||||
|
||||
<Entry
|
||||
Placeholder ="Verif mot de passe"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="600"
|
||||
HeightRequest="100"
|
||||
FontSize="32"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
IsPassword="true"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
PlaceholderColor="#74fabd"
|
||||
/>
|
||||
|
||||
<Button
|
||||
Text="Valider"
|
||||
Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
HorizontalOptions="End"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="110"
|
||||
HeightRequest="70"
|
||||
BackgroundColor="#74fabd"
|
||||
TextColor="Black"
|
||||
CornerRadius="10"
|
||||
Clicked="Valid_Clicked"
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
|
||||
x:Class="notus.ProfilPage"
|
||||
Title="ProfilPage"
|
||||
BackgroundColor="#1C1C1C">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button
|
||||
Text="Modifier Profil"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
VerticalOptions="Center"
|
||||
HeightRequest="80"
|
||||
FontSize="30"
|
||||
/>
|
||||
|
||||
<Button
|
||||
Text="Modifier Theme"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
FontSize="30"
|
||||
VerticalOptions="Start"
|
||||
HeightRequest="80"
|
||||
/>
|
||||
|
||||
<Label
|
||||
Text="Profil"
|
||||
FontSize="30"
|
||||
HorizontalTextAlignment="Center"
|
||||
VerticalTextAlignment="Center"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
VerticalOptions="End"
|
||||
HeightRequest="80"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
Source="profil.png"
|
||||
Aspect="AspectFit"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
WidthRequest="550"
|
||||
HeightRequest="250"
|
||||
BackgroundColor="#6E6E6E"
|
||||
CornerRadius="10"
|
||||
Clicked="ProfilClicked"
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,17 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using Biblioteque_de_Class;
|
||||
using Notus_Persistance;
|
||||
|
||||
namespace notus;
|
||||
|
||||
public partial class ProfilPage : ContentPage
|
||||
{
|
||||
public ProfilPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
void ProfilClicked(System.Object sender, System.EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
|
||||
x:Class="notus.RecherPage"
|
||||
Title="RecherPage"
|
||||
BackgroundColor="#1C1C1C">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border
|
||||
Background="#6E6E6E"
|
||||
Grid.Column="0"
|
||||
Grid.RowSpan="9"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
Source="profl.png"
|
||||
Aspect="AspectFit"
|
||||
Grid.Column="4"
|
||||
Grid.Row="0"
|
||||
HorizontalOptions="Start"
|
||||
VerticalOptions="Start"
|
||||
WidthRequest="200"
|
||||
HeightRequest="120"
|
||||
BackgroundColor="#6E6E6E"
|
||||
CornerRadius="10"
|
||||
Clicked="Profil_Clicked"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
Source="supp.png"
|
||||
Aspect="AspectFill"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"
|
||||
Margin="20"
|
||||
HorizontalOptions="End"
|
||||
VerticalOptions="Start"
|
||||
WidthRequest="50"
|
||||
HeightRequest="50"
|
||||
BackgroundColor="#4A4A4A"
|
||||
CornerRadius="50"
|
||||
/>
|
||||
|
||||
<Label x:Name="NomNote"
|
||||
Text="{Binding Name}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
TextColor="#74fabd"
|
||||
Margin="20"
|
||||
FontSize="34"
|
||||
BackgroundColor="#4A4A4A"
|
||||
WidthRequest="250"
|
||||
HeightRequest="50"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Start"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
Source="edit.png"
|
||||
Aspect="AspectFit"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Margin="20"
|
||||
HorizontalOptions="Start"
|
||||
VerticalOptions="Start"
|
||||
WidthRequest="50"
|
||||
HeightRequest="50"
|
||||
BackgroundColor="#4A4A4A"
|
||||
CornerRadius="50"
|
||||
/>
|
||||
|
||||
<Entry
|
||||
Placeholder="Rechercher"
|
||||
HorizontalOptions="Start"
|
||||
Margin="20"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="300"
|
||||
HeightRequest="50"
|
||||
FontSize="25"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
TextColor="#74fabd"
|
||||
BackgroundColor="#4A4A4A"
|
||||
PlaceholderColor="#74fabd"
|
||||
/>
|
||||
|
||||
<ListView x:Name="ListNote"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="5"
|
||||
ItemsSource="{Binding NoteList}"
|
||||
/>
|
||||
|
||||
<Editor
|
||||
Placeholder="Texte"
|
||||
IsSpellCheckEnabled="True"
|
||||
FontSize="20"
|
||||
HorizontalOptions="Start"
|
||||
VerticalOptions="Center"
|
||||
Margin="20"
|
||||
WidthRequest="800"
|
||||
HeightRequest="750"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="4"
|
||||
Grid.Row="4"
|
||||
Grid.RowSpan="3"
|
||||
TextColor="White"
|
||||
BackgroundColor="#4A4A4A"
|
||||
PlaceholderColor="#74fabd"
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using Biblioteque_de_Class;
|
||||
using Notus_Persistance;
|
||||
|
||||
|
||||
namespace notus;
|
||||
|
||||
public partial class RecherPage : ContentPage
|
||||
{
|
||||
PersistenceManager manager = (Application.Current as App).manager;
|
||||
public RecherPage()
|
||||
{
|
||||
manager.LoadDatabaseData();
|
||||
InitializeComponent();
|
||||
ListNote.BindingContext = manager;
|
||||
NomNote.BindingContext = manager;
|
||||
}
|
||||
|
||||
private async void Profil_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushAsync(new ProfilPage());
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |