Compare commits

..

4 Commits

@ -1,81 +0,0 @@
kind: pipeline
type: docker
name: HeartTrack-Admin-CI
trigger:
event:
- push
steps:
- name: build
image: mcr.microsoft.com/dotnet/sdk:6.0
commands:
- cd Sources/HeartTrack/
- dotnet restore HeartTrack.sln
- dotnet build HeartTrack.sln -c Release --no-restore
- dotnet publish HeartTrack.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
- name: tests
image: mcr.microsoft.com/dotnet/sdk:6.0
commands:
- cd Sources/HeartTrack/
- dotnet restore HeartTrack.sln
- dotnet test HeartTrack.sln --no-restore
depends_on: [build]
- name: code-analysis
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
secrets: [ SECRET_SONAR_LOGIN ]
settings:
sonar_host: https://codefirst.iut.uca.fr/sonar/
sonar_token:
from_secret: SECRET_SONAR_LOGIN
project_key: HeartTrack-API
coverage_exclusions: Tests/**, StubbedContextLib/**, StubAPI/**
duplication_exclusions: Tests/**, StubbedContextLib/**
commands:
- cd Sources/HeartTrack/
- dotnet restore HeartTrack.sln
- dotnet sonarscanner begin /k:HeartTrack-API /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN} /d:sonar.coverage.exclusions="Tests/**, StubbedContextLib/**, StubAPI/**, HeartTrackAPI/Utils/**" /d:sonar.cpd.exclusions="Tests/**, StubbedContextLib/**, StubAPI/**" /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml"
- dotnet build HeartTrack.sln -c Release --no-restore
- dotnet test HeartTrack.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
- dotnet publish HeartTrack.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
depends_on: [ tests ]
---
kind: pipeline
type: docker
name: HeartTrack-Admin-CD
trigger:
event:
- push
steps:
- name: docker-build-and-push
image: plugins/docker
settings:
dockerfile: Sources/HeartTrack/Dockerfile
context: Sources/HeartTrack/
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/david.d_almeida/admin
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
# database container admin
- name: deploy-container-admin
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
CODEFIRST_CLIENTDRONE_ENV_TYPE: ADMIN
IMAGENAME: hub.codefirst.iut.uca.fr/david.d_almeida/admin:latest
CONTAINERNAME: heart_track_admin
COMMAND: create
ADMINS: davidd_almeida,kevinmonteiro,antoineperederii,paullevrault,antoinepinagot,nicolasraymond,marcchevaldonne
OVERWRITE: true
depends_on: [ docker-build-and-push ]

@ -43,38 +43,12 @@ Ce dépôt contient une application Blazor conçue pour faciliter l'administrati
4. **Sécurité Intégrée**: Utilisation des fonctionnalités de sécurité de Blazor pour protéger les données sensibles.
## Les attendus du projet
* [x] Implementation of a data visualization page with pagination (2 points)
* [x] Page for adding an element with validation (2 point)
* [x] Edit page of an element without validation (2 point)
* [x] Deletion of an element with a confirmation (2 point)
* [ ] Complex component (5 point)
* [x] Use API (Get / Insert / Update / Delete) (3 point)
* [x] IOC & DI use (4 point)
* [x] Localization & Globalization (at least two languages) (1 point)
* [ ] Use of the configuration (1 point)
* [ ] Logs (2 points)
* [x] Code cleanliness (2 point)
* [x] GUI (Global design, placement of buttons, ...) (2 point)
* [x] Code location (No code in views) (2 point)
* [x] The Readme (2 points)
* [x] Description of how the client solution works (code-level illustration) (6 points)
* [x] Merge request (2 points)
## Ce que nous avons fait
Pour d'avantages d'informations, voir les branches `issue_auth` et `merged_APE`
* [x] Les listing dans la page de tickets et d'Activités
* [x] La modification dans la page de tickets
* [x] La suppression dans la page de tickets
* [x] Le get by id dans la page de tickets
* [x] L'implementation de la partie API et du data service dans la pages d'Activités
* [x] L'authentification dans la branch `issue_auth` mais des problèmes persistent (les actions des services ne sont pas gerer par l'authentification)
* [ ] Le data service dans toutes les pages
* [ ] La répartitions des fonctionnalités de la page de tickets sur les autres pages
## Répartition du Git
[**Sources**](Sources/HeartTrack) : **Code de l'application**
[**Sources**](Sources/) : **Code de l'application**
[**Documents**](Documents/README_DOCUMENTS.md) : **Documentation de l'application et diagrammes**
---
@ -87,7 +61,7 @@ Le projet HeartTrack utilise un modèle de flux de travail Git (Gitflow) pour or
### API PHP
L'application Blazor utilise une API en PHP pour récupérer les données depuis la base de données.
Pour l'utiliser, vous devez faire tourner notre projet PHP disponible [ici](https://codefirst.iut.uca.fr/git/HeartDev/Web/src/branch/API_tests) sur votre machine locale. Pour ensuite changer le type de skockage `ActivityDataServiceFactice` par `ActivityDataServiceAPI` et vice versa dans le fichier `Program.cs` de l'application Blazor en ligne 24 `Add Data Services`.
Pour l'utiliser, vous devez faire tourner notre projet PHP disponible [ici](https://codefirst.iut.uca.fr/git/HeartDev/Web/src/branch/API_tests) sur votre machine locale. Pour ensuite changer le type de skockage par `API` dans le fichier `monfichier.cs` dans le dossier `Data` de l'application Blazor.
### Prérequis
@ -100,19 +74,30 @@ Pour l'utiliser, vous devez faire tourner notre projet PHP disponible [ici](http
1. Clonez ce dépôt sur votre machine locale :
```bash
git clone https://codefirst.iut.uca.fr/git/HeartDev/Admin.git
git clone https://github.com/votre-utilisateur/Blazor-User-Admin.git
```
2. Lacer Visual Studio et ouvrez le projet `HeartTrack.sln` dans le dossier `Sources/HeartTrack`.
2. Accédez au répertoire du projet :
```bash
cd Blazor-User-Admin
```
Pour des raison de manque de la partie php, vous ne pourrez utiliser l'application qu'en localStorage. Il est cependant possible de tester l'aaplication avec la partie API en PHP en faisant tourner en local le projet php disponible [ici](https://codefirst.iut.uca.fr/git/HeartDev/Web/src/branch/API_tests) et en changant le type de skockage `ActivityDataServiceFactice` par `ActivityDataServiceAPI` dans le fichier `Program.cs` de l'application Blazor en ligne 24 `Add Data Services` et importer les dépendances en conséquence.
3. Lancez l'application avec la commande :
```bash
dotnet run
```
4. Ouvrez votre navigateur et accédez à [https://localhost:5001](https://localhost:5001) pour voir l'application en action.
Pour des raison de manque de la partie php, vous ne pourrez utiliser l'application qu'en localStorage. Il est cependant possible de tester l'aaplication avec la partie API en PHP en faisant tourner en local le projet php disponible [ici](https://codefirst.iut.uca.fr/git/HeartDev/Web/src/branch/API_tests) et en changant le type de stockage dans le fichier `monfichier.cs` dans le dossier `Data` de l'application Blazor.
Comme ceci :
```csharp
// Add Data Services
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceAPI>();
builder.Services.AddScoped<ITicketDataService, TicketDataServiceAPI>();
public class MonFichier
{
public static string TypeStockage = "API";
}
```
### Fabriqué avec

@ -3,13 +3,25 @@
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc;
/// <summary>
/// The culture controller.
/// </summary>
[Route("[controller]/[action]")]
public class CultureController : Controller
{
/// <summary>
/// Sets the culture.
/// </summary>
/// <param name="culture">The culture.</param>
/// <param name="redirectUri">The redirect URI.</param>
/// <returns>
/// The action result.
/// </returns>
public IActionResult SetCulture(string culture, string redirectUri)
{
if (culture != null)
{
// Define a cookie with the selected culture
this.HttpContext.Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
CookieRequestCultureProvider.MakeCookieValue(

@ -1,20 +0,0 @@
# Utiliser l'image SDK .NET pour construire l'application
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
# Copier les fichiers du projet et restaurer les dépendances
COPY *.csproj .
RUN dotnet restore
# Copier tout le reste et construire l'application
COPY . .
RUN dotnet publish -c Release -o out
# Utiliser l'image runtime .NET pour exécuter l'application
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
WORKDIR /app
COPY --from=build /app/out .
EXPOSE 8080
ENTRYPOINT ["dotnet", "HeartTrack.dll"]

@ -0,0 +1,32 @@
using HeartTrack.Models;
using static MudBlazor.CategoryTypes;
namespace HeartTrack.Factories
{
public static class TicketFactory
{
public static TicketModel ToModel(Ticket item)
{
return new TicketModel
{
Id = item.Id,
Username = item.Username,
Contexte = item.Contexte,
Description = item.Description,
Urgence = Convert.ToBoolean(item.Urgence)
};
}
public static Ticket Create(TicketModel model)
{
return new Ticket
{
Id = model.Id,
Username = model.Username,
Contexte = model.Contexte,
Description = model.Description,
Urgence = Convert.ToString(model.Urgence)
};
}
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
@ -15,14 +15,17 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" />
<PackageReference Include="MudBlazor" Version="6.12.0" />
<PackageReference Include="xunit" Version="2.7.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Services\ActivityDataService\" />
<Folder Include="Models\Activity\" />
<Folder Include="Services\DataLocalService\" />
<Folder Include="Services\ReportDataService\" />
<Folder Include="Services\UserDataService\" />
<Folder Include="wwwroot\data\" />
<Folder Include="Services\TicketDataService\" />
<Folder Include="Components\" />
</ItemGroup>
<ItemGroup>

@ -1,4 +1,3 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188

@ -5,8 +5,8 @@
public int IdActivity { get; set; }
public string Type { get; set; }
public DateOnly Date { get; set; }
public DateOnly StartTime { get; set; }
public DateOnly EndTime { get; set; }
public TimeOnly StartTime { get; set; }
public DateTime EndTime { get; set; }
public int EffortRessenti { get; set; }
public float Variability { get; set; }
public float Variance { get; set; }

@ -6,7 +6,7 @@ namespace HeartTrack.Models
public class ReportModel
{
[Required]
[Range(0, 2500000)]
[Range(0, 121425711425541)]
public int Id { get; set; }
[Required]
[StringLength(50)]

@ -6,6 +6,7 @@
public string Username { get; set; }
public string Contexte { get; set; }
public string Description { get; set; }
public string Urgence { get; set; }
public Boolean isCheck { get; set; }
}
}

@ -7,7 +7,7 @@ namespace HeartTrack.Models
public class TicketModel
{
[Required]
[Range(0, 2500000)]
[Range(0, 121425711425541)]
public int Id { get; set; }
[Required]
@ -20,6 +20,7 @@ namespace HeartTrack.Models
[Required]
[StringLength(500, ErrorMessage = "Description must not exceed 500 characters.")]
public string Description { get; set; }
public Boolean Urgence { get; set; }
public Boolean isCheck { get; set; } = false;
}
}

@ -6,7 +6,7 @@ namespace HeartTrack.Models
public class UserModel
{
[Required]
[Range(0,2500000)]
[Range(0,121425711425541)]
public int Id { get; set; }
[Required]

@ -17,9 +17,37 @@ namespace HeartTrack.Pages
[Inject]
private IActivityDataService ActivitiesDataService { get; set; }
[Inject]
public IStringLocalizer<Activities> Localizer { get; set; }
public IStringLocalizer<BannedUsers> Localizer { get; set; }
private async Task OnReadData()
{
//if (e.CancellationToken.IsCancellationRequested)
//{
// return;
//}
//// When you use a real API, we use this follow code
////var response = await Http.GetJsonAsync<Item[]>( $"http://my-api/api/data?page={e.Page}&pageSize={e.PageSize}" );
////var response = await Http.GetStringAsync("http://localhost:8080/api");
////var activityList = JsonConvert.DeserializeObject<List<Activity>>(response);
//var response = (await Http.GetFromJsonAsync<Activity[]>("http://localhost:8080/api")).Skip((e.Page - 1) * e.PageSize).Take(e.PageSize).ToList();
////await Http.GetFromJsonAsync<Activity[]>("http://localhost:8080/api");
////Console.WriteLine(response);
////var response = (await Http.GetFromJsonAsync<Activity[]>($"{NavigationManager.BaseUri}fake-activities.json")).Skip((e.Page - 1) * e.PageSize).Take(e.PageSize).ToList();
//if (!e.CancellationToken.IsCancellationRequested)
//{
// totalActivity = (await Http.GetFromJsonAsync<List<Activity>>("http://localhost:8080/api")).Count;
// //(await Http.GetFromJsonAsync<List<Activity>>($"{NavigationManager.BaseUri}fake-data-activity.json")).Count;
// activities = new List<Activity>(response); // an actual data for the current page
// //Console.WriteLine(totalActivity);
//}
//Console.WriteLine("Passage dans le OnInitializedAsync...");
this.activities = await this.ActivitiesDataService.getAllActivities();
this.totalActivity = activities.Count();
}

@ -1,5 +1,7 @@
@page "/tickets/add"
@* <AuthorizeView Context="authContext" Roles="admin">
<Authorized > *@
<h3>Add Ticket</h3>
<EditForm Model="@ticketModel" OnValidSubmit="@HandleValidSubmit">
@ -25,6 +27,22 @@
</label>
</p>
<p>
<label for="urgence">
Urgence:
<InputCheckbox id="urgence" @bind-Value="ticketModel.Urgence" />
</label>
</p>
<button type="submit">Submit</button>
</EditForm>
@* </Authorized>
<Authorizing>
<h1>Loading ...</h1>
</Authorizing>
<NotAuthorized>
<h1>Authentication Failure!</h1>
<p>You're not signed in.</p>
</NotAuthorized>
</AuthorizeView> *@

@ -23,9 +23,13 @@ namespace HeartTrack.Pages
private async void HandleValidSubmit()
{
// Get the current data
var currentData = await TicketStorage.getAllTickets();
// Simulate the Id
ticketModel.Id = currentData.Max(s => s.Id) + 1;
// Add the item to the current data
currentData.Add(new Ticket
{
Id = ticketModel.Id,
@ -35,7 +39,9 @@ namespace HeartTrack.Pages
Urgence = ticketModel.Urgence*/
});
// Save the data
await TicketStorage.SaveAllTickets(currentData);
NavigationManager.NavigateTo("tickets");
}

@ -0,0 +1,4 @@
@page "/admin-manager"
@attribute [Authorize(Roles = "superadmin")]
<h3>Admin Page</h3>

@ -0,0 +1,50 @@
@page "/banned-users"
@using HeartTrack.Models
<PageTitle>Banned Users</PageTitle>
<h1>Banned Users</h1>
This is banned users list of this website.
<div>
<NavLink class="btn btn-primary" href="banned-users/add" Match="NavLinkMatch.All">
<i class="fa fa-plus"></i> Ajouter
</NavLink>
</div>
<DataGrid TItem="User"
Data="@users"
ReadData="@OnReadData"
TotalItems="@totalUser"
PageSize="10"
ShowPager
Responsive>
<DataGridColumn TItem="User" Field="@nameof(User.Username)" Caption="Username" />
<DataGridColumn TItem="User" Field="@nameof(User.isBan)" Caption="#">
<DisplayTemplate>
@if(context.isBan)
{
<MudChip Variant="Variant.Outlined" Color="Color.Error">Banni</MudChip>
} else
{
<MudChip Variant="Variant.Outlined" Color="Color.Success">Libre</MudChip>
}
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="User" Field="@nameof(User.Id)" Caption="Actions" Sortable="false" Width="150px">
<DisplayTemplate>
@if (context.isBan)
{
<MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Filled.LockOpen" Size="Size.Small" @onclick="()=>UnbanOnID(context.Id)" />
}
else
{
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Lock" Size="Size.Small" @onclick="()=>BanOnID(context.Id)" />
}
</DisplayTemplate>
</DataGridColumn>
</DataGrid>

@ -0,0 +1,58 @@
using Blazored.LocalStorage;
using Blazorise;
using Blazorise.DataGrid;
using HeartTrack.Models;
using HeartTrack.Services.TicketDataService;
using HeartTrack.Services.UserDataService;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using static MudBlazor.CategoryTypes;
using System.Net.Http;
namespace HeartTrack.Pages
{
public partial class BannedUsers
{
private List<User> users;
private int totalUser;
[Inject]
public HttpClient Http { get; set; }
[Inject]
public NavigationManager NavigationManager { get; set; }
[Inject]
public ILocalStorageService LocalStorage { get; set; }
[Inject]
public IUserDataService UserService { get; set; }
private async Task OnReadData(DataGridReadDataEventArgs<User> e)
{
if (e.CancellationToken.IsCancellationRequested)
{
return;
}
// When you use a real API, we use this follow code
//var response = await Http.GetJsonAsync<Item[]>( $"http://my-api/api/data?page={e.Page}&pageSize={e.PageSize}" );
var response = (await Http.GetFromJsonAsync<User[]>($"{NavigationManager.BaseUri}fake-users.json")).Skip((e.Page - 1) * e.PageSize).Take(e.PageSize).ToList();
if (!e.CancellationToken.IsCancellationRequested)
{
totalUser = (await Http.GetFromJsonAsync<List<User>>($"{NavigationManager.BaseUri}fake-users.json")).Count;
users = new List<User>(response); // an actual data for the current page
}
}
private void BanOnID(int id)
{
UserService.BanOnId(id);
NavigationManager.NavigateTo("/banned-users", true);
}
private void UnbanOnID(int id)
{
UserService.UnbanOnId(id);
NavigationManager.NavigateTo("/banned-users", true);
}
}
}

@ -0,0 +1,22 @@
@page "/reports"
@using HeartTrack.Models
<PageTitle>Reports</PageTitle>
<h1>Report list</h1>
This is the report list of users.
<DataGrid TItem="Report"
Data="@reports"
ReadData="@OnReadData"
TotalItems="@totalReport"
PageSize="10"
ShowPager
Responsive>
<DataGridColumn TItem="Report" Field="@nameof(Report.Id)" Caption="Id" />
<DataGridColumn TItem="Report" Field="@nameof(Report.Username)" Caption="@Localizer["Username"]" />
<DataGridColumn TItem="Report" Field="@nameof(Report.Raison)" Caption="@Localizer["Raison"]" />
<DataGridColumn TItem="Report" Field="@nameof(Report.Description)" Caption="@Localizer["Description"]" />
<DataGridColumn Caption="" />
</DataGrid>

@ -0,0 +1,63 @@
using Blazored.LocalStorage;
using Blazorise.DataGrid;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
namespace HeartTrack.Pages
{
public partial class Reports
{
private List<Report> reports;
private int totalReport;
[Inject]
public HttpClient Http { get; set; }
[Inject]
public NavigationManager NavigationManager { get; set; }
[Inject]
public ILocalStorageService LocalStorage { get; set; }
[Inject]
public IStringLocalizer<Report> Localizer { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// Do not treat this action if is not the first render
if (!firstRender)
{
return;
}
var currentData = await LocalStorage.GetItemAsync<Report[]>("data");
// Check if data exist in the local storage
if (currentData == null)
{
// this code add in the local storage the fake data (we load the data sync for initialize the data before load the OnReadData method)
var originalData = Http.GetFromJsonAsync<Report[]>($"{NavigationManager.BaseUri}fake-data.json").Result;
await LocalStorage.SetItemAsync("data", originalData);
}
}
private async Task OnReadData(DataGridReadDataEventArgs<Report> e)
{
if (e.CancellationToken.IsCancellationRequested)
{
return;
}
// When you use a real API, we use this follow code
//var response = await Http.GetJsonAsync<Data[]>( $"http://my-api/api/data?page={e.Page}&pageSize={e.PageSize}" );
var response = (await LocalStorage.GetItemAsync<Report[]>("data")).Skip((e.Page - 1) * e.PageSize).Take(e.PageSize).ToList();
if (!e.CancellationToken.IsCancellationRequested)
{
totalReport = (await LocalStorage.GetItemAsync<List<User>>("data")).Count;
reports = new List<Report>(response); // an actual data for the current page
}
}
}
}

@ -0,0 +1,20 @@
@page "/test"
<div class="text-center bg-blue-100">
<input class="border-4 w-1/3 rounded m-6 p-6 h-8
border-blue-300" @bind-value="SearchText"
@bind-value:event="oninput" placeholder="Search by title" />
</div>
@if (!Users.Any())
{
<p>Loading some images...</p>
}
else
{
<div class="p-2 grid grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3">
@foreach (var user in FilteredUsers)
{
<p>feur</p>
}
</div>
}

@ -0,0 +1,28 @@
using Blazorise;
using HeartTrack.Models;
using HeartTrack.Services;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Pages
{
partial class Test : ComponentBase
{
public IEnumerable<User> Users { get; set; } = new List<User>();
public string SearchText = "";
[Inject]
public IDataService DataService { get; set; }
[Inject]
public IWebHostEnvironment WebHostEnvironment { get; set; }
protected override async Task OnInitializedAsync()
{
Users = await DataService.List(1, 50); ;
}
List<User> FilteredUsers => Users.Where(
user => user.Username.ToLower().Contains(SearchText.ToLower())).ToList();
}
}

@ -12,6 +12,8 @@ This is the ticket list of users.
<MudButtonGroup Color="Color.Primary" Variant="Variant.Filled" Style="margin-top:50px; margin-bottom:5px;">
<MudButton OnClick="OnNavigateOnAddClicked">Add</MudButton>
<MudButton >Reset DATA</MudButton>
<MudButton >Shows Open Tickets</MudButton>
</MudButtonGroup>
</div>
@ -26,8 +28,9 @@ This is the ticket list of users.
Responsive
Sortable
SortMode="DataGridSortMode.Single">
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Username)" Caption="Username" Width="200px"/>
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Username)" Caption="Username" />
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Contexte)" Caption="Context" />
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Urgence)" Caption="Urgency" Width="150px" />
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.isCheck)" Caption="Status" SortField="@nameof( Ticket.isCheck )" SortDirection="Blazorise.SortDirection.Ascending" Width="150px" Editable>
<DisplayTemplate>
@if (context.isCheck)
@ -45,7 +48,7 @@ This is the ticket list of users.
<DisplayTemplate>
@if (context.isCheck)
{
<MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Filled.RemoveRedEye" Size="Size.Small" @onclick="(() => OnView(context.Id))"/>
<MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Filled.RemoveRedEye" Size="Size.Small" @onclick="() => OnView(context.Id)" />
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Delete" Size="Size.Small" @onclick="() => OnDelete(context)" />
}
else

@ -31,9 +31,6 @@ namespace HeartTrack.Pages
[Inject]
public NavigationManager NavigationManager { get; set; }
[Inject]
private ISnackbar Snackbar { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// Do not treat this action if is not the first render
@ -74,10 +71,11 @@ namespace HeartTrack.Pages
private async void OnClose(int id)
{
await TicketService.Close(id);
// Reload the page
NavigationManager.NavigateTo("tickets", true);
Snackbar.Add("Ticket fermé !");
}
private void OnView(int id)
@ -96,5 +94,28 @@ namespace HeartTrack.Pages
NavigationManager.NavigateTo("tickets", true);
}
/*private void OnShowsOpenTicketClicked()
{
foreach (var ticket in tickets)
{
if (!ticket.isCheck)
{
sortedTickets.Add(ticket);
}
}
dataGrid.Data = sortedTickets;
dataGrid.Refresh();
}
private void OnResetDataClicked()
{
dataGrid.Data = tickets;
dataGrid.Refresh();
}*/
}
}

@ -14,6 +14,8 @@
Description: @ticket.Description
</p>
<p>
Status: @ticket.isCheck
Urgence: @ticket.Urgence
</p>
<MudButton @OnClick="OnNavigateOnReturnClicked">Return</MudButton>
<p>
Status: @ticket.isCheck
</p>

@ -31,13 +31,9 @@ namespace HeartTrack.Pages
Username = item.Username,
Contexte = item.Contexte,
Description = item.Description,
Urgence = item.Urgence,
isCheck = item.isCheck
};
}
private void OnNavigateOnReturnClicked()
{
NavigationManager.NavigateTo("/tickets", true);
}
}
}

@ -5,37 +5,30 @@ using Microsoft.AspNetCore.Localization;
using System.Globalization;
using Microsoft.Extensions.Options;
using Blazored.LocalStorage;
using HeartTrack.Services;
using HeartTrack.Services.ActivityDataService;
using HeartTrack.Services.ReportDataService;
using HeartTrack.Services.UserDataService;
using HeartTrack.Services.TicketDataService;
using MudBlazor.Services;
using HeartTrack.Services.ActivityDataServiceFactice;
using HeartTrack.Services.TicketDataServiceFactice;
using MudBlazor;
var builder = WebApplication.CreateBuilder(args);
// Add Badge Component services
builder.Services.AddMudServices(config =>
{
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomLeft;
config.SnackbarConfiguration.PreventDuplicates = false;
config.SnackbarConfiguration.NewestOnTop = false;
config.SnackbarConfiguration.ShowCloseIcon = true;
config.SnackbarConfiguration.VisibleStateDuration = 10000;
config.SnackbarConfiguration.HideTransitionDuration = 500;
config.SnackbarConfiguration.ShowTransitionDuration = 500;
config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
});
builder.Services.AddMudServices();
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddHttpClient();
// Add Data Services
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceFactice>();
// Add Services
builder.Services.AddScoped<IDataService, DataLocalService>();
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceAPI>();
builder.Services.AddScoped<IReportDataService, ReportDataServiceAPI>();
builder.Services.AddScoped<ITicketDataService, TicketDataServiceFactice>();
builder.Services.AddScoped<IUserDataService, UserDataServiceAPI>();
builder.Services.AddBlazorise()
@ -63,6 +56,8 @@ builder.Services.AddBlazoredLocalStorage();
builder.Services.AddHttpClient();
builder.Services.AddScoped<IDataService, DataLocalService>();
builder.Services.AddBlazorise()
.AddBootstrapProviders()
.AddFontAwesomeIcons();
@ -120,4 +115,5 @@ app.UseEndpoints(endpoints =>
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();
app.Run();

@ -0,0 +1,133 @@
using Blazored.LocalStorage;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
using static MudBlazor.CategoryTypes;
namespace HeartTrack.Services
{
public class DataLocalService : IDataService
{
private readonly HttpClient _http;
private readonly ILocalStorageService _localStorage;
private readonly NavigationManager _navigationManager;
private readonly IWebHostEnvironment _webHostEnvironment;
public DataLocalService(
ILocalStorageService localStorage,
HttpClient http,
IWebHostEnvironment webHostEnvironment,
NavigationManager navigationManager)
{
_localStorage = localStorage;
_http = http;
_webHostEnvironment = webHostEnvironment;
_navigationManager = navigationManager;
}
public async Task Add(UserModel model)
{
// Get the current data
var currentData = await _localStorage.GetItemAsync<List<User>>("data");
// Simulate the Id
model.Id = currentData.Max(s => s.Id) + 1;
// Add the item to the current data
currentData.Add(new User
{
Id = model.Id,
Username = model.Username,
Nom = model.FirstName,
Prenom = model.LastName,
Email = model.Email,
Password = model.Password,
Sexe = model.Sexe,
Taille = model.Taille,
Poids = model.Poids,
BirthDate = model.BirthDate
});
// Save the data
await _localStorage.SetItemAsync("data", currentData);
}
public async Task<int> Count()
{
// Load data from the local storage
var currentData = await _localStorage.GetItemAsync<User[]>("data");
// Check if data exist in the local storage
if (currentData == null)
{
// this code add in the local storage the fake data
var originalData = await _http.GetFromJsonAsync<User[]>($"{_navigationManager.BaseUri}fake-data.json");
await _localStorage.SetItemAsync("data", originalData);
}
return (await _localStorage.GetItemAsync<User[]>("data")).Length;
}
public async Task<List<User>> List(int currentPage, int pageSize)
{
// Load data from the local storage
var currentData = await _localStorage.GetItemAsync<User[]>("data");
// Check if data exist in the local storage
if (currentData == null)
{
// this code add in the local storage the fake data
var originalData = await _http.GetFromJsonAsync<User[]>($"{_navigationManager.BaseUri}fake-data.json");
await _localStorage.SetItemAsync("data", originalData);
}
return (await _localStorage.GetItemAsync<User[]>("data")).Skip((currentPage - 1) * pageSize).Take(pageSize).ToList();
}
public async Task Close(int id)
{
// Get the current data
var currentData = await _localStorage.GetItemAsync<List<Ticket>>("data");
// Get the item int the list
var item = currentData.FirstOrDefault(w => w.Id == id);
// Update item status
item.isCheck = true;
// Save the data
await _localStorage.SetItemAsync("data", currentData);
}
public async Task Delete(int id)
{
// Get the current data
var currentData = await _localStorage.GetItemAsync<List<Ticket>>("data");
// Get the item int the list
var item = currentData.FirstOrDefault(w => w.Id == id);
// Delete item in
currentData.Remove(item);
// Save the data
await _localStorage.SetItemAsync("data", currentData);
}
public async Task<Ticket> GetByID(int id)
{
// Get the current data
var currentData = await _localStorage.GetItemAsync<List<Ticket>>("data");
// Get the item int the list
var item = currentData.FirstOrDefault(w => w.Id == id);
// Check if item exist
if (item == null)
{
throw new Exception($"Unable to found the item with ID: {id}");
}
return item;
}
}
}

@ -0,0 +1,17 @@
using HeartTrack.Models;
using static MudBlazor.CategoryTypes;
namespace HeartTrack.Services
{
public interface IDataService
{
Task Add(UserModel model);
Task<List<User>> List(int currentPage, int pageSize);
Task<Ticket> GetByID(int id);
Task Close(int id);
Task Delete(int id);
}
}

@ -0,0 +1,20 @@
using System;
using HeartTrack.Models;
namespace HeartTrack.Services.ReportDataService
{
public interface IReportDataService
{
public Task<List<Report>> getAllReports();
public Task SaveAllReports(List<Report> list);
public Task AddReport(Report r);
public Task RemoveReport(Report r);
public Task UpdateReport(Report r);
public Task<Report> getReportById(int id);
}
}

@ -0,0 +1,86 @@
using System;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.ReportDataService
{
public class ReportDataServiceAPI : IReportDataService
{
[Inject]
private HttpClient _clientHttp { get; set; }
public ReportDataServiceAPI(HttpClient clientHttp)
{
this._clientHttp = clientHttp;
}
public async Task AddReport(Report r)
{
HttpResponseMessage response = await _clientHttp.PostAsJsonAsync("http://localhost:8080/api/reports", r);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Report avec l'id " + r.Id + " ajouté avec succès");
}
else
{
Console.WriteLine("API - Problème ajout Report");
}
}
public async Task<Report> getReportById(int id)
{
Report Report = await _clientHttp.GetFromJsonAsync<Report>("http://localhost:8080/api/reports/{id}");
return Report;
}
public async Task<List<Report>> getAllReports()
{
List<Report> lReports = await _clientHttp.GetFromJsonAsync<List<Report>>("http://localhost:8080/api/reports");
return lReports;
}
public async Task RemoveReport(Report r)
{
HttpResponseMessage response = await _clientHttp.DeleteAsync($"http://localhost:8080/api/reports/{r.Id}");
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Report avec l'id " + r.Id + " supprimé avec succès");
}
else
{
Console.WriteLine("API - Problème suppression Report");
}
}
public async Task SaveAllReports(List<Report> list)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync("http://localhost:8080/api/reports", list);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - List de reports sauvegardé avec succès");
}
else
{
Console.WriteLine("API - Problème sauvegarde List de reports");
}
}
public async Task UpdateReport(Report r)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync($"http://localhost:8080/api/reports/{r.Id}", r);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Report avec l'id " + r.Id + " mis à jour avec succès");
}
else
{
Console.WriteLine("API - Problème mise à jour Report");
}
}
}
}

@ -0,0 +1,139 @@
using System;
using Blazored.LocalStorage;
using HeartTrack.Models;
using HeartTrack.Services.ReportDataService;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.ReportDataServiceFactice
{
public class ReportDataServiceFactice : IReportDataService
{
[Inject]
private HttpClient _clientHttp { get; set; }
[Inject]
public ILocalStorageService _localStorage { get; set; }
[Inject]
public NavigationManager _navigationManager { get; set; }
private String EmplacementLocalStorage { get; set; }
private String EmplacementJson { get; set; }
public ReportDataServiceFactice(HttpClient clientHttp, ILocalStorageService localStorage, NavigationManager navigationManager)
{
this._clientHttp = clientHttp;
this._localStorage = localStorage;
this._navigationManager = navigationManager;
this.EmplacementLocalStorage = "reportsData";
this.EmplacementJson = $"{_navigationManager.BaseUri}data/fake-reports.json";
}
public async Task AddReport(Report a)
{
List<Report> data = await getAllReports();
data.Add(a);
await this.SaveAllReports(data);
}
public async Task<Report> getReportById(int id)
{
List<Report> reports = await getAllReports();
Report? temp = null;
foreach (Report r in reports)
{
if (r.Id == id)
{
temp = r;
}
}
return temp;
}
public async Task<List<Report>> getAllReports()
{
List<Report> lReports = new List<Report>();
lReports = await this.getReportsFromLocalStorage();
if (lReports.Count == 0)
{
lReports = await this.getReportsFromJson(this.EmplacementJson);
await this.saveReportsLocalStorage(lReports);
}
return lReports;
}
private async Task<List<Report>> getReportsFromJson(String cheminVersJson)
{
List<Report> ReportsDeserialiser = new List<Report>();
var data = await _clientHttp.GetFromJsonAsync<Report[]>(cheminVersJson);
ReportsDeserialiser = data.ToList();
return ReportsDeserialiser;
}
private async Task<List<Report>> getReportsFromLocalStorage()
{
List<Report> ReportsFromLocalStorage = null;
var data = await _localStorage.GetItemAsync<Report[]>(EmplacementLocalStorage);
if (data == null)
{
ReportsFromLocalStorage = new List<Report>();
}
else
{
ReportsFromLocalStorage = data.ToList();
}
return ReportsFromLocalStorage;
}
public async Task RemoveReport(Report r)
{
List<Report> data = await getAllReports();
int index = -1;
foreach (Report temp in data)
{
if (temp.Id == r.Id)
{
index = data.IndexOf(temp);
}
}
if (index != -1)
{
data.RemoveAt(index);
}
await this.SaveAllReports(data);
data = await this.getAllReports();
}
public async Task SaveAllReports(List<Report> list)
{
await this.saveReportsLocalStorage(list);
}
private async Task saveReportsLocalStorage(List<Report> lReports)
{
await _localStorage.SetItemAsync(this.EmplacementLocalStorage, lReports);
}
public async Task UpdateReport(Report r)
{
await this.RemoveReport(r);
await this.AddReport(r);
}
}
}

@ -0,0 +1,23 @@
using System;
using HeartTrack.Models;
namespace HeartTrack.Services.UserDataService
{
public interface IUserDataService
{
public Task<List<User>> getAllUsers();
public Task SaveAllUsers(List<User> list);
public Task AddUser(User u);
public Task RemoveUser(User u);
public Task UpdateUser(User u);
public Task<User> getUserById(int id);
public void BanOnId(int id);
public void UnbanOnId(int id);
}
}

@ -0,0 +1,94 @@
using System;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.UserDataService
{
public class UserDataServiceAPI : IUserDataService
{
[Inject]
private HttpClient _clientHttp { get; set; }
public UserDataServiceAPI(HttpClient clientHttp)
{
this._clientHttp = clientHttp;
}
public async Task AddUser(User u)
{
HttpResponseMessage response = await _clientHttp.PostAsJsonAsync("http://localhost:8080/api/users", u);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - User avec l'id " + u.Id + " ajouté avec succès");
}
else
{
Console.WriteLine("API - Problème ajout User");
}
}
public async Task<User> getUserById(int id)
{
User User = await _clientHttp.GetFromJsonAsync<User>("http://localhost:8080/api/users/{id}");
return User;
}
public async Task<List<User>> getAllUsers()
{
List<User> lUsers = await _clientHttp.GetFromJsonAsync<List<User>>("http://localhost:8080/api/users");
return lUsers;
}
public async Task RemoveUser(User u)
{
HttpResponseMessage response = await _clientHttp.DeleteAsync($"http://localhost:8080/api/users/{u.Id}");
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - User avec l'id " + u.Id + " supprimé avec succès");
}
else
{
Console.WriteLine("API - Problème suppression User");
}
}
public async Task SaveAllUsers(List<User> list)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync("http://localhost:8080/api/users", list);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - List de users sauvegardé avec succès");
}
else
{
Console.WriteLine("API - Problème sauvegarde List de users");
}
}
public async Task UpdateUser(User u)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync($"http://localhost:8080/api/users/{u.Id}", u);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - User avec l'id " + u.Id + " mis à jour avec succès");
}
else
{
Console.WriteLine("API - Problème mise à jour User");
}
}
public async void BanOnId(int id)
{
}
public async void UnbanOnId(int id)
{
}
}
}

@ -0,0 +1,168 @@
using System;
using Blazored.LocalStorage;
using HeartTrack.Models;
using HeartTrack.Services.UserDataService;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.UserDataServiceFactice
{
public class UserDataServiceFactice : IUserDataService
{
[Inject]
private HttpClient _clientHttp { get; set; }
[Inject]
public ILocalStorageService _localStorage { get; set; }
[Inject]
public NavigationManager _navigationManager { get; set; }
private String EmplacementLocalStorage { get; set; }
private String EmplacementJson { get; set; }
public UserDataServiceFactice(HttpClient clientHttp, ILocalStorageService localStorage, NavigationManager navigationManager)
{
this._clientHttp = clientHttp;
this._localStorage = localStorage;
this._navigationManager = navigationManager;
this.EmplacementLocalStorage = "usersData";
this.EmplacementJson = $"{_navigationManager.BaseUri}data/fake-users.json";
}
public async Task AddUser(User u)
{
List<User> data = await getAllUsers();
data.Add(u);
await this.SaveAllUsers(data);
}
public async Task<User> getUserById(int id)
{
List<User> users = await getAllUsers();
User? temp = null;
foreach (User u in users)
{
if (u.Id == id)
{
temp = u;
}
}
return temp;
}
public async Task<List<User>> getAllUsers()
{
List<User> lUsers = new List<User>();
lUsers = await this.getUsersFromLocalStorage();
if (lUsers.Count == 0)
{
lUsers = await this.getUsersFromJson(this.EmplacementJson);
await this.saveUsersLocalStorage(lUsers);
}
return lUsers;
}
private async Task<List<User>> getUsersFromJson(String cheminVersJson)
{
List<User> UsersDeserialiser = new List<User>();
var data = await _clientHttp.GetFromJsonAsync<User[]>(cheminVersJson);
UsersDeserialiser = data.ToList();
return UsersDeserialiser;
}
private async Task<List<User>> getUsersFromLocalStorage()
{
List<User> UsersFromLocalStorage = null;
var data = await _localStorage.GetItemAsync<User[]>(EmplacementLocalStorage);
if (data == null)
{
UsersFromLocalStorage = new List<User>();
}
else
{
UsersFromLocalStorage = data.ToList();
}
return UsersFromLocalStorage;
}
public async Task RemoveUser(User u)
{
List<User> data = await getAllUsers();
int index = -1;
foreach (User temp in data)
{
if (temp.Id == u.Id)
{
index = data.IndexOf(temp);
}
}
if (index != -1)
{
data.RemoveAt(index);
}
await this.SaveAllUsers(data);
data = await this.getAllUsers();
}
public async Task SaveAllUsers(List<User> list)
{
await this.saveUsersLocalStorage(list);
}
private async Task saveUsersLocalStorage(List<User> lUsers)
{
await _localStorage.SetItemAsync(this.EmplacementLocalStorage, lUsers);
}
public async Task UpdateUser(User u)
{
await this.RemoveUser(u);
await this.AddUser(u);
}
public async void BanOnId(int id)
{
// Get the current data
var currentData = await _localStorage.GetItemAsync<List<User>>("data");
// Get the item int the list
var item = currentData.FirstOrDefault(w => w.Id == id);
// Update item status
item.isBan = true;
// Save the data
await _localStorage.SetItemAsync("data", currentData);
}
public async void UnbanOnId(int id)
{
// Get the current data
var currentData = await _localStorage.GetItemAsync<List<User>>("data");
// Get the item int the list
var item = currentData.FirstOrDefault(w => w.Id == id);
// Update item status
item.isBan = false;
// Save the data
await _localStorage.SetItemAsync("data", currentData);
}
}
}

@ -1,12 +1,42 @@
@using System.Globalization
@inject NavigationManager NavigationManager
<p>
<label>
<select @bind="Culture">
@foreach (var culture in @supportedCultures)
@foreach (var culture in supportedCultures)
{
<option value="@culture">@culture.DisplayName</option>
}
</select>
</label>
</p>
@code
{
private CultureInfo[] supportedCultures = new[]
{
new CultureInfo("en-US"),
new CultureInfo("fr-FR")
};
private CultureInfo Culture
{
get => CultureInfo.CurrentCulture;
set
{
if (CultureInfo.CurrentUICulture == value)
{
return;
}
var culture = value.Name.ToLower(CultureInfo.InvariantCulture);
var uri = new Uri(this.NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
var query = $"?culture={Uri.EscapeDataString(culture)}&" + $"redirectUri={Uri.EscapeDataString(uri)}";
// Redirect the user to the culture controller to set the cookie
this.NavigationManager.NavigateTo("/Culture/SetCulture" + query, forceLoad: true);
}
}
}

@ -1,42 +0,0 @@
using Microsoft.AspNetCore.Components;
using System.Globalization;
namespace HeartTrack.Shared
{
public partial class CultureSelector
{
[Inject]
private NavigationManager NavigationManager { get; set; }
private CultureInfo[] supportedCultures = new[]
{
new CultureInfo("en-US"),
new CultureInfo("fr-FR")
};
private CultureInfo Culture
{
get => CultureInfo.CurrentCulture;
set
{
if (CultureInfo.CurrentUICulture == value)
{
return;
}
var culture = value.Name.ToLower(CultureInfo.InvariantCulture);
var uri = new Uri(this.NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
var query = $"?culture={Uri.EscapeDataString(culture)}&" + $"redirectUri={Uri.EscapeDataString(uri)}";
// Redirect the user to the culture controller to set the cookie
this.NavigationManager.NavigateTo("/Culture/SetCulture" + query, forceLoad: true);
}
}
public int getSizeCultures()
{
return supportedCultures.Length;
}
}
}

@ -17,15 +17,38 @@
<span class="navbat-toggler-icon"></span>
</MudIconButton>
<MudSpacer />
<CultureSelector></CultureSelector>
<MudMenu Icon="@Icons.Material.Filled.AccountCircle" Color="Color.Inherit" Edge="Edge.End">
<MudMenuItem>Profile</MudMenuItem>
<MudButton type="button" class="btn btn-link ml-md-auto">Logout</MudButton>
</MudMenu>
<MudIconButton Icon="@Icons.Material.Filled.ManageAccounts" Color="Color.Inherit" Edge="Edge.End" @onclick="ToggleProfilMenu"/>
</MudAppBar>
@* <div class="top-row px-4 auth">
@* <div class="container-fluid toggler-container">
<button title="Navigation menu" class="navbar-toggler custom-toggler" @onclick="ToggleNavMenu">
<span class="navbat-toggler-icon"></span>
</button>
</div> *@
@* Messages, notifs et pp compte à mettre *@
@* <div class="top-row px-4">
<CultureSelector />
<button type="button" class="btn btn-link ml-md-auto" @onclick="@LogoutClick">Logout</button>
</div>
</div> *@
<article class="content px-4">
@Body
</article>
</main>
</div>
</div>
@code {
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
}
private void ToggleProfilMenu()
{
}
}

@ -6,21 +6,27 @@ namespace HeartTrack.Shared
{
public partial class MainLayout
{
/*[Inject]
public CustomStateProvider AuthStateProvider { get; set; }*/
[Inject]
public NavigationManager NavigationManager { get; set; }
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
[CascadingParameter]
private Task<AuthenticationState> AuthenticationState { get; set; }
public void ToggleNavMenu()
/*protected override async Task OnParametersSetAsync()
{
collapseNavMenu = !collapseNavMenu;
}
if (!(await AuthenticationState).User.Identity.IsAuthenticated)
{
NavigationManager.NavigateTo("/login");
}
}*/
public bool getCollapseNavMenu()
/*private async Task LogoutClick()
{
return this.collapseNavMenu;
}
await AuthStateProvider.Logout();
NavigationManager.NavigateTo("/login");
}*/
}
}

@ -11,16 +11,40 @@
<span class="oi oi-home" aria-hidden="true"></span> @Localizer["Global"]
</NavLink>
</div>
@* <AuthorizeView Roles="admin"> *@
<div class="nav-item px-3">
<NavLink class="nav-link" href="reports">
<span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["Report"]
</NavLink>
</div>
@* </AuthorizeView>
<AuthorizeView Roles="admin"> *@
<div class="nav-item px-3">
<NavLink class="nav-link" href="activities">
<span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["Activity"]
</NavLink>
</div>
@* </AuthorizeView>
<AuthorizeView Roles="admin"> *@
<div class="nav-item px-3">
<NavLink class="nav-link" href="banned-users">
<span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["Ban"]
</NavLink>
</div>
@* </AuthorizeView>
<AuthorizeView Roles="admin"> *@
<div class="nav-item px-3">
<NavLink class="nav-link" href="tickets">
<span class="oi oi-plus" aria-hidden="true"></span> @Localizer["Ticket"]
</NavLink>
</div>
@* </AuthorizeView>
<AuthorizeView Roles="owner"> *@
<div class="nav-item px-3">
<NavLink class="nav-link" href="admin">
<span class="oi oi-plus" aria-hidden="true"></span> @Localizer["Admin"]
</NavLink>
</div>
@* </AuthorizeView> *@
</nav>
</div>

@ -0,0 +1,17 @@
<div class="alert alert-secondary mt-4">
<span class="oi oi-pencil me-2" aria-hidden="true"></span>
<strong>@Title</strong>
<span class="text-nowrap">
Please take our
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a>
</span>
and tell us what you think.
</div>
@code {
// Demonstrates how a parent component can supply parameters
[Parameter]
public string? Title { get; set; }
}

@ -1,25 +0,0 @@
using HeartTrack.Controllers;
using Microsoft.AspNetCore.Mvc;
using Xunit;
namespace HeartTrack.Tests.Controller
{
public class CultureControllerTests
{
[Fact]
public void IsCultureControllerInstanceOfCultureController()
{
var culture = new CultureController();
Assert.IsType<CultureController>(culture);
}
[Fact]
public void IsSetCultureRedirecting()
{
var culture = new CultureController();
Assert.IsAssignableFrom<IActionResult>(culture.SetCulture("",""));
}
}
}

@ -1,37 +0,0 @@
using HeartTrack.Models;
using Xunit;
namespace HeartTrack.Tests.Models
{
public class ActivityTests
{
[Fact]
public void IsActivityInstanceOfActivity()
{
var activity = new Activity();
Assert.IsType<Activity>(activity);
}
[Fact]
public void HasActivityAttrivutesRightInstance()
{
var activity = new Activity();
Assert.IsType<int>(activity.IdActivity);
Assert.IsType<string>(activity.Type);
Assert.IsType<DateOnly>(activity.Date);
Assert.IsType<DateOnly>(activity.StartTime);
Assert.IsType<DateOnly>(activity.EndTime);
Assert.IsType<int>(activity.EffortRessenti);
Assert.IsType<float>(activity.Variability);
Assert.IsType<float>(activity.Variance);
Assert.IsType<float>(activity.StandardDeviation);
Assert.IsType<float>(activity.Average);
Assert.IsType<int>(activity.Maximum);
Assert.IsType<int>(activity.Minimum);
Assert.IsType<float>(activity.AvrTemperature);
Assert.IsType<bool>(activity.HasAutoPause);
}
}
}

@ -1,42 +0,0 @@
using Blazorise;
using HeartTrack.Models;
using Xunit;
namespace HeartTrack.Tests.Models
{
public class ReportTests
{
[Fact]
public void IsReportInstanceOfReport()
{
var report = new Report();
Assert.IsType<Report>(report);
}
[Fact]
public void HasReportAttributeRightInstace()
{
var report = new Report();
Assert.IsType<int>(report.Id);
Assert.IsType<string>(report.Username);
Assert.IsType<string>(report.ReportedUser);
Assert.IsType<string>(report.Raison);
Assert.IsType<string>(report.Description);
Assert.IsType<Image>(report.Image);
}
[Fact]
public void IsReportModelValidate()
{
var report = new ReportModel();
Assert.True(report.Id < 2500000);
Assert.True(report.Username.Length < 50 && report.Username.Length>0);
Assert.True(report.ReportedUser.Length < 50 && report.ReportedUser.Length > 0);
Assert.True(report.Raison.Length < 150 && report.Raison.Length > 0);
Assert.True(report.Description.Length < 500 && report.Description.Length > 0);
}
}
}

@ -1,40 +0,0 @@
using HeartTrack.Models;
using Xunit;
namespace HeartTrack.Tests.Models
{
public class TicketTests
{
[Fact]
public void IsTicketInstanceOfTicket()
{
var ticket = new Ticket();
Assert.IsType<Ticket>(ticket);
}
[Fact]
public void HasTicketAttributeRightInstance()
{
var ticket = new Ticket();
Assert.IsType<int>(ticket.Id);
Assert.IsType<string>(ticket.Username);
Assert.IsType<string>(ticket.Contexte);
Assert.IsType<string>(ticket.Description);
Assert.IsType<Boolean>(ticket.isCheck);
}
[Fact]
public void IsTicketModelValidate()
{
var ticket = new TicketModel();
Assert.True(ticket.Id < 2500000);
Assert.True(ticket.Username.Length > 0 && ticket.Username.Length < 50);
Assert.True(ticket.Contexte.Length > 0 && ticket.Contexte.Length < 25);
Assert.True(ticket.Description.Length > 0 && ticket.Description.Length < 500);
Assert.True(ticket.isCheck);
}
}
}

@ -1,52 +0,0 @@
using Xunit;
using HeartTrack.Models;
namespace HeartTrack.Tests.Models
{
public class UserTests
{
[Fact]
public void IsUserInstanceOfUser()
{
var user = new User();
Assert.IsType<User>(user);
}
[Fact]
public void HasUserAttributeRightInstance()
{
var user = new User();
Assert.IsType<int>(user.Id);
Assert.IsType<string>(user.Username);
Assert.IsType<string>(user.Nom);
Assert.IsType<string>(user.Prenom);
Assert.IsType<string>(user.Email);
Assert.IsType<string>(user.Password);
Assert.IsType<string>(user.Sexe);
Assert.IsType<float>(user.Taille);
Assert.IsType<float>(user.Poids);
Assert.IsType<DateTime>(user.BirthDate);
Assert.IsType<Boolean>(user.isBan);
}
[Fact]
public void IsUserModelValidate()
{
var user = new UserModel();
Assert.NotNull(user.Username);
Assert.NotNull(user.FirstName);
Assert.NotNull(user.LastName);
Assert.NotNull(user.Email);
Assert.NotNull(user.Password);
Assert.NotNull(user.Sexe);
Assert.True(user.Id<2500000);
Assert.True(user.Username.Length >= 0 && user.Username.Length < 50);
Assert.True(user.FirstName.Length >= 0 && user.FirstName.Length < 50);
Assert.True(user.LastName.Length >= 0 && user.LastName.Length < 25);
}
}
}

@ -1,24 +0,0 @@
using HeartTrack.Shared;
using Xunit;
namespace HeartTrack.Tests.Shared
{
public class CultureSelectorTests
{
[Fact]
public void IsCultureSelectorInstanceOfCultureSelector()
{
var culture = new CultureSelector();
Assert.IsType<CultureSelector>(culture);
}
[Fact]
public void HasCultureEnoughLanguages()
{
var culture = new CultureSelector();
Assert.Equal(2, culture.getSizeCultures());
}
}
}

@ -1,25 +0,0 @@
using HeartTrack.Shared;
using Xunit;
namespace HeartTrack.Tests.Shared
{
public class MainLayoutTests
{
[Fact]
public void IsMainLayoutInstanceOfMainLayout()
{
var main = new MainLayout();
Assert.IsType<MainLayout>(main);
}
[Fact]
public void StateChangeOnToggleNavMenu()
{
var main = new MainLayout();
Assert.True(main.getCollapseNavMenu());
main.ToggleNavMenu();
Assert.False(main.getCollapseNavMenu());
}
}
}

@ -0,0 +1,178 @@
[
{
"id": 1,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 2,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 3,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 4,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 5,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 6,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 7,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 8,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 9,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 10,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 11,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 12,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 13,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 14,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 15,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 16,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 17,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 18,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 19,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 20,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 21,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 22,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
}
]

@ -5,7 +5,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 2,
@ -13,7 +14,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 3,
@ -21,7 +23,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 4,
@ -29,7 +32,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 5,
@ -37,7 +41,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 6,
@ -45,7 +50,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 7,
@ -53,7 +59,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 8,
@ -61,7 +68,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 9,
@ -70,6 +78,7 @@
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 10,
@ -77,7 +86,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 11,
@ -85,7 +95,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 12,
@ -93,7 +104,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 13,
@ -101,7 +113,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 14,
@ -109,7 +122,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 15,
@ -117,7 +131,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 16,
@ -125,7 +140,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 17,
@ -133,7 +149,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 18,
@ -141,7 +158,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 19,
@ -149,7 +167,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 20,
@ -157,7 +176,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 21,
@ -165,7 +185,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 22,
@ -173,7 +194,8 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 23,
@ -181,6 +203,7 @@
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description"
"description": "Wallah c`est la description",
"urgence": true
}
]

@ -0,0 +1,379 @@
[
{
"id": 1,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2018-12-27",
"isban": true
},
{
"id": 2,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2021-06-29",
"isban": true
},
{
"id": 3,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2021-04-09",
"isban": true
},
{
"id": 4,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-11-20",
"isban": true
},
{
"id": 5,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2021-02-20",
"isban": true
},
{
"id": 6,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-02-17",
"isban": true
},
{
"id": 7,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-07-14",
"isban": true
},
{
"id": 8,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2018-02-21",
"isban": false
},
{
"id": 9,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-07-31",
"isban": true
},
{
"id": 10,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2019-10-02",
"isban": true
},
{
"id": 11,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-07-26",
"isban": false
},
{
"id": 12,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-10-23",
"isban": false
},
{
"id": 13,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-11-03",
"isban": true
},
{
"id": 14,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-01-31",
"isban": false
},
{
"id": 15,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-04-12",
"isban": false
},
{
"id": 16,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2018-07-22",
"isban": false
},
{
"id": 17,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-04-04",
"isban": true
},
{
"id": 18,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-08-15",
"isban": true
},
{
"id": 19,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-04-10",
"isban": false
},
{
"id": 20,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-02-09",
"isban": false
},
{
"id": 21,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-02-18",
"isban": false
},
{
"id": 22,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2023-06-25",
"isban": false
},
{
"id": 23,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-09-27",
"isban": true
},
{
"id": 24,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-02-01",
"isban": true
},
{
"id": 25,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-05-28",
"isban": true
},
{
"id": 26,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-06-11",
"isban": true
},
{
"id": 27,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2019-08-08",
"isban": true
},
{
"id": 28,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-01-29",
"isban": false
},
{
"id": 29,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-08-21",
"isban": false
}
]

@ -0,0 +1,178 @@
[
{
"id": 1,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 2,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 3,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 4,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 5,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 6,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 7,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 8,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 9,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 10,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 11,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 12,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 13,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 14,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 15,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 16,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 17,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 18,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 19,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 20,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 21,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
},
{
"id": 22,
"username": "johndoe",
"reported_user": "erickol",
"raison": "Jvais dire wallah",
"description": "Wallah c`est la description",
"image": "oui.png"
}
]

@ -0,0 +1,209 @@
[
{
"id": 1,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 2,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 3,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 4,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 5,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 6,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 7,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 8,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 9,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 10,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 11,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 12,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 13,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 14,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 15,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 16,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 17,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 18,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 19,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 20,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 21,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
},
{
"id": 22,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": false
},
{
"id": 23,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"contexte": "Jvais dire wallah",
"description": "Wallah c`est la description",
"urgence": true
}
]

@ -0,0 +1,379 @@
[
{
"id": 1,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2018-12-27",
"isban": true
},
{
"id": 2,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2021-06-29",
"isban": true
},
{
"id": 3,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2021-04-09",
"isban": true
},
{
"id": 4,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-11-20",
"isban": true
},
{
"id": 5,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2021-02-20",
"isban": true
},
{
"id": 6,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-02-17",
"isban": true
},
{
"id": 7,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-07-14",
"isban": true
},
{
"id": 8,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2018-02-21",
"isban": false
},
{
"id": 9,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-07-31",
"isban": true
},
{
"id": 10,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2019-10-02",
"isban": true
},
{
"id": 11,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-07-26",
"isban": false
},
{
"id": 12,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-10-23",
"isban": false
},
{
"id": 13,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-11-03",
"isban": true
},
{
"id": 14,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2014-01-31",
"isban": false
},
{
"id": 15,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-04-12",
"isban": false
},
{
"id": 16,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2018-07-22",
"isban": false
},
{
"id": 17,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-04-04",
"isban": true
},
{
"id": 18,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-08-15",
"isban": true
},
{
"id": 19,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-04-10",
"isban": false
},
{
"id": 20,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-02-09",
"isban": false
},
{
"id": 21,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-02-18",
"isban": false
},
{
"id": 22,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2023-06-25",
"isban": false
},
{
"id": 23,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-09-27",
"isban": true
},
{
"id": 24,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-02-01",
"isban": true
},
{
"id": 25,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2017-05-28",
"isban": true
},
{
"id": 26,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2022-06-11",
"isban": true
},
{
"id": 27,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2019-08-08",
"isban": true
},
{
"id": 28,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2015-01-29",
"isban": false
},
{
"id": 29,
"username": "johndoe",
"nom": "Doe",
"prenom": "John",
"email": "john.doe@example.com",
"password": "password123",
"sexe": "male",
"taille": 1.76,
"poids": 56.3,
"birthdate": "2020-08-21",
"isban": false
}
]
Loading…
Cancel
Save