Compare commits

...

42 Commits

Author SHA1 Message Date
Antoine PINAGOT d51484101c Ajout Tests
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII d01c538964 Update 'Sources/HeartTrack/Dockerfile'
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII 89cc3c41e3 Update '.drone.yml'
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII c4602a4b0e Update '.drone.yml'
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII d00c5198a3 Update '.drone.yml'
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII 0cf6cfcbff Update '.drone.yml'
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII a3ba1c9b15 🧪 Test deploying Web Site
continuous-integration/drone/push Build is failing Details
1 year ago
David D'ALMEIDA 65eb8b9d95 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
1 year ago
David D'ALMEIDA adb9655a87 Mise à jour de '.drone.yml'
1 year ago
Antoine PEREDERII ed8ed96133 🧪 Test CI/CD
1 year ago
Antoine PINAGOT bc87676131 Résolution erreur affichage Datagrid ticket
1 year ago
Antoine PINAGOT 207ac95462 Mise à jour de 'Sources/HeartTrack/Pages/Tickets.razor.cs'
1 year ago
Antoine PINAGOT bb7eb27e9d Test
1 year ago
Antoine PEREDERII 7052f5c3ee Update 'README.md'
1 year ago
Antoine PEREDERII 9139329c60 Merge pull request 'merge merged_APE into master for evaluation' (#2) from merged_APE into main
1 year ago
Antoine PEREDERII 75f2e18c31 update README.md
1 year ago
Antoine PINAGOT 0305b1187f Suppression code inutile
1 year ago
Antoine PEREDERII a4ae9e1426 update program.cs
1 year ago
Antoine PINAGOT bb4e8620f1 Suppression code inutile
1 year ago
Antoine PEREDERII 9a0abe0206 Merge branch 'merged_APE' of codefirst.iut.uca.fr:HeartDev/Admin into merged_APE
1 year ago
Antoine PEREDERII 7b50b1e5ad remove fakes data's files
1 year ago
Antoine PINAGOT f223bd6a79 Link fonctionne
1 year ago
Antoine PINAGOT 0e51eab49e link ticket service w/ tickets pages
1 year ago
Antoine PEREDERII 013b41e3ef merge Test_API and WORK_API into merged_APE
1 year ago
Paul LEVRAULT f1688e278d Debut siganlements
1 year ago
Antoine PEREDERII 7e56cbfb00 fix bugs with ReportDataService
1 year ago
Antoine PEREDERII a6efaf9d5f update DataServices
1 year ago
Antoine PEREDERII 2b6bb5a983 update Activities
1 year ago
Antoine PEREDERII 8872c10e2f add all the services
1 year ago
Antoine PEREDERII 4bd6617ddf merge WORK_APE on this branch
1 year ago
Antoine PEREDERII 9ab1129011 add IActivityDataServices
1 year ago
Antoine PEREDERII ff65a2da02 update sources
1 year ago
Antoine PEREDERII 307650c321 update .giti
1 year ago
Antoine PEREDERII 6dd85a1cf1 add sources project
1 year ago
Antoine PEREDERII aa94fb211e update .gitignore
1 year ago
Antoine PINAGOT 4a25bcaf21 Suppression authentificationcar marche pas
1 year ago
Antoine PEREDERII 1ba710d521 update readme
1 year ago
Antoine PINAGOT 91a6b54ed3 Ajout model Signalement
1 year ago
Antoine PINAGOT 2449c27f4e Connexion + Tab dans des pages
1 year ago
Antoine PEREDERII e3639acbaa add API
1 year ago
Antoine PEREDERII 7147f2160b add blazor API
1 year ago
Antoine PINAGOT a098e11154 Page Tokens terminé, Mise en place + Page Token traduite
1 year ago

@ -0,0 +1,81 @@
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 ]

@ -1,6 +1,6 @@
<div align = center> <div align = center>
<h1>HeartTrack</h1> <h1>HeartTrack - Admin</h1>
</div> </div>
@ -9,17 +9,15 @@
--- ---
&nbsp; ![PHP](https://img.shields.io/badge/Blazor-56478C?style=for-the-badge&logo=Blazor&logoColor=FFFFFF&labelColor=56478C) &nbsp; ![Blazor](https://img.shields.io/badge/Blazor-56478C?style=for-the-badge&logo=Blazor&logoColor=FFFFFF&labelColor=56478C)
&nbsp; ![CSS](https://img.shields.io/badge/CSS-000?style=for-the-badge&logo=css3&logoColor=white&color=darkblue) &nbsp; ![CSS](https://img.shields.io/badge/CSS-000?style=for-the-badge&logo=css3&logoColor=white&color=darkblue)
&nbsp; ![DOCKER](https://img.shields.io/badge/.NET-56478C?style=for-the-badge&logo=.NET&logoColor=FFFFFF&labelColor=56478C) &nbsp; ![.NET](https://img.shields.io/badge/.NET-56478C?style=for-the-badge&logo=.NET&logoColor=FFFFFF&labelColor=56478C)
&nbsp; ![PostgreSQL](https://img.shields.io/badge/Postgresql-000?style=for-the-badge&logo=postgresql&logoColor=white&color=blue)
&nbsp; ![JAVASCRIPT](https://img.shields.io/badge/JavaScript-000?style=for-the-badge&logo=javascript&logoColor=white&color=yellow)
</br> </br>
</div> </div>
# Table des matières # Table des matières
[Présentation](#présentation) | [Répartition du Git](#répartition-du-git) | [Documentation](#documentation) | [Prerequisites](#prerequisites) | [Getting Started](#getting-started) | [Features](#features) | [Ce que nous avons fait](#ce-que-nous-avons-fait) | [Fabriqué avec](#fabriqué-avec) | [Contributeurs](#contributeurs) | [Comment contribuer](#comment-contribuer) | [License](#license) | [Remerciements](#remerciements) [Présentation](#présentation) | [Fonctionnalités principales](#fonctionnalités-principales) | [Répartition du Git](#répartition-du-git) | [Prerequis](#prérequis) | [Fabriqué avec](#fabriqué-avec) | [Contributeurs](#contributeurs) | [Comment contribuer](#comment-contribuer) | [License](#license) | [Remerciements](#remerciements)
@ -33,37 +31,89 @@ HeartTrack est une application web PHP et mobile Android destinée aux sportifs
### Récapitulatif du Projet ### Récapitulatif du Projet
Le projet HeartTrack, avec son application HeartTrack, vise à offrir une solution Open Source d'analyse des données de fréquence cardiaque, en mettant l'accent sur les besoins des sportifs et des coachs. L'application sera capable de traiter et d'interpréter les données de manière intelligente, fournissant ainsi des informations précieuses pour optimiser les performances sportives et la santé. Ce dépôt contient une application Blazor conçue pour faciliter l'administration des utilisateurs au sein de votre application. L'application utilise le framework Blazor, qui permet le développement d'applications web interactives avec .NET.
## Fonctionnalités principales
1. **Gestion des Utilisateurs**: Ajoutez, modifiez et supprimez des utilisateurs de manière simple et efficace.
2. **Rôles Utilisateurs**: Attribuez des rôles à chaque utilisateur pour définir leurs permissions et accès.
3. **Tableau de Bord Convivial**: Interface utilisateur intuitive pour une expérience d'administration agréable.
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 ## Répartition du Git
[**Sources**](Sources/) : **Code de l'application** [**Sources**](Sources/HeartTrack) : **Code de l'application**
[**Documents**](Documents/README_DOCUMENTS.md) : **Documentation de l'application et diagrammes**
<!-- [**Wiki**](https://codefirst.iut.uca.fr/git/HeartDev/Web/wiki/PHP) : **Wiki de notre projet (attendus PHP)** -->
--- ---
Le projet HeartTrack utilise un modèle de flux de travail Git (Gitflow) pour organiser le développement. Voici une brève explication des principales branches : Le projet HeartTrack utilise un modèle de flux de travail Git (Gitflow) pour organiser le développement. Voici une brève explication des principales branches :
- **branche prod** : Cette branche contient la version de production stable de l'application. Les modifications sur cette branche sont généralement destinées à des mises en production. - **branche WORK-NAME** : Cette branche contient la version de travail des différents membres de l'équipe. Les modifications sur cette branche sont bien souvent réalisé par le nom du membre en question.
- **branche master** : La branche master est similaire à la branche de production, mais elle peut contenir des fonctionnalités en cours de développement qui sont presque prêtes pour une mise en production. - **branche master** : La branche master est similaire à la branche de production, mais elle contient la version stable et final de notre application.
- **branche test** : Cette branche est utilisée pour permettre différents tests sur l'application. ### API PHP
- **branche issue** : Pour chaque problème (issue) que vous résolvez, vous devez créer une branche portant le nom de l'issue, par exemple, "issue_#32_nom" où 32 est le numéro de l'issue et nom est une description courte de l'issue. Une fois l'issue résolue, assurez-vous de mettre à jour le changelog et de créer une merge request. L'application Blazor utilise une API en PHP pour récupérer les données depuis la base de données.
- **branche démo** : Cette branche est utilisée pour déployer une version démo de l'application. Elle est mise à jour avec les dernières fonctionnalités en développement. 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`.
## Documentation
Documentation et informations à propos de `HearthTrack` disponible [ici]()
### Prérequis ### Prérequis
* [Visual Studio Code](https://code.visualstudio.com/) - Exemple d'IDE gratuit * [Visual Studio](https://visualstudio.microsoft.com/fr/vs/) - IDE
* [Git](https://git-scm.com/) - Gestion de version * [Git](https://git-scm.com/) - Gestion de version
* [PostgreSQL](https://www.postgresql.org/) - Base de Données * [.NET SDK](https://dotnet.microsoft.com/download) - Platform open-source pour le développement d'applications
## Installation et Exécution
1. Clonez ce dépôt sur votre machine locale :
```bash
git clone https://codefirst.iut.uca.fr/git/HeartDev/Admin.git
```
2. Lacer Visual Studio et ouvrez le projet `HeartTrack.sln` dans le dossier `Sources/HeartTrack`.
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.
Comme ceci :
```csharp
// Add Data Services
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceAPI>();
builder.Services.AddScoped<ITicketDataService, TicketDataServiceAPI>();
```
### Fabriqué avec ### Fabriqué avec
* [Visual Studio](https://visualstudio.microsoft.com/fr/vs/) - IDE * [Visual Studio](https://visualstudio.microsoft.com/fr/vs/) - IDE
@ -73,7 +123,6 @@ Documentation et informations à propos de `HearthTrack` disponible [ici]()
* [Blazor](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor) - Framework Web * [Blazor](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor) - Framework Web
* [C#](https://docs.microsoft.com/fr-fr/dotnet/csharp/) - Langage * [C#](https://docs.microsoft.com/fr-fr/dotnet/csharp/) - Langage
* [HTML 5, CSS 3](https://developer.mozilla.org/fr/docs/Web/HTML) - Langages * [HTML 5, CSS 3](https://developer.mozilla.org/fr/docs/Web/HTML) - Langages
* [Doxygen](https://codefirst.iut.uca.fr/sonar/) - Documentation
## Contributeurs ## Contributeurs
* [Antoine PEREDERII](https://codefirst.iut.uca.fr/git/antoine.perederii) * [Antoine PEREDERII](https://codefirst.iut.uca.fr/git/antoine.perederii)
@ -83,7 +132,7 @@ Documentation et informations à propos de `HearthTrack` disponible [ici]()
* [David D'HALMEIDA](https://codefirst.iut.uca.fr/git/david.d_almeida) * [David D'HALMEIDA](https://codefirst.iut.uca.fr/git/david.d_almeida)
## Comment contribuer ## Comment contribuer
1. Forkez le projet (<https://codefirst.iut.uca.fr/git/HeartDev/Web>) 1. Forkez le projet (<https://codefirst.iut.uca.fr/git/HeartDev/Admin>)
2. Créez votre branche (`git checkout -b feature/featureName`) 2. Créez votre branche (`git checkout -b feature/featureName`)
3. commit vos changements (`git commit -am 'Add some feature'`) 3. commit vos changements (`git commit -am 'Add some feature'`)
4. Push sur la branche (`git push origin feature/featureName`) 4. Push sur la branche (`git push origin feature/featureName`)

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

@ -1,13 +0,0 @@
namespace HeartTrack.Data;
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}

@ -1,20 +0,0 @@
namespace HeartTrack.Data;
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
{
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
}).ToArray());
}
}

@ -0,0 +1,20 @@
# 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"]

@ -1,32 +0,0 @@
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)
};
}
}
}

@ -8,16 +8,32 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" /> <PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Blazorise" Version="1.4.1" />
<PackageReference Include="Blazorise.Bootstrap" Version="1.4.0" /> <PackageReference Include="Blazorise.Bootstrap" Version="1.4.0" />
<PackageReference Include="Blazorise.DataGrid" Version="1.4.0" /> <PackageReference Include="Blazorise.DataGrid" Version="1.4.0" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.0" /> <PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" /> <PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" />
<PackageReference Include="MudBlazor" Version="6.12.0" /> <PackageReference Include="MudBlazor" Version="6.12.0" />
<PackageReference Include="xunit" Version="2.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Components\" /> <Folder Include="Services\ActivityDataService\" />
<Folder Include="Models\Activity\" />
<Folder Include="wwwroot\data\" />
<Folder Include="Services\TicketDataService\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Remove="Services\ActivityDataService\" />
<None Remove="Models\Activity\" />
<None Remove="Services\DataLocalService\" />
<None Remove="Services\ReportDataService\" />
<None Remove="Services\UserDataService\" />
<None Remove="Services\TicketDataService\" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\data\" />
</ItemGroup>
</Project> </Project>

@ -1,4 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188 VisualStudioVersion = 17.8.34330.188

@ -0,0 +1,20 @@
namespace HeartTrack.Models
{
public class Activity
{
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 int EffortRessenti { get; set; }
public float Variability { get; set; }
public float Variance { get; set; }
public float StandardDeviation { get; set; }
public float Average { get; set; }
public int Maximum { get; set; }
public int Minimum { get; set; }
public float AvrTemperature { get; set; }
public bool HasAutoPause { get; set; }
}
}

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

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

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

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

@ -1,10 +1,33 @@
@page "/activities" @page "/activities"
@using HeartTrack.Models
<PageTitle>Activities</PageTitle> <PageTitle>Activities</PageTitle>
<h1>Activity list</h1> <h1>@Localizer["Title"]</h1>
This is the activity list of users. <p>
@Localizer["Description"]
<SurveyPrompt Title="How is Blazor working for you?" /> </p>
<DataGrid TItem="Activity"
Data="@activities"
ReadData="@OnReadData"
TotalItems="@totalActivity"
PageSize="10"
ShowPager
Responsive>
<DataGridColumn TItem="Activity" Field="@nameof(Activity.IdActivity)" Caption="Id" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Type)" Caption="Type" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Date)" Caption="Date" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.StartTime)" Caption="@Localizer["StartTime"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.EndTime)" Caption="@Localizer["EndTime"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.EffortRessenti)" Caption="@Localizer["EffortRessenti"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Variability)" Caption="@Localizer["Variability"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Variance)" Caption="@Localizer["Variance"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.StandardDeviation)" Caption="@Localizer["StandardDeviation"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Average)" Caption="@Localizer["Average"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Maximum)" Caption="Maximum" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.Minimum)" Caption="Minimum" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.AvrTemperature)" Caption="@Localizer["AvrTemperature"]" />
<DataGridColumn TItem="Activity" Field="@nameof(Activity.HasAutoPause)" Caption="@Localizer["HasAutoPause"]" />
</DataGrid>

@ -0,0 +1,28 @@
using System;
using System.Net.Http;
using Blazorise.DataGrid;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using HeartTrack.Services.ActivityDataService;
namespace HeartTrack.Pages
{
public partial class Activities
{
private List<Activity> activities;
private int totalActivity;
[Inject]
private IActivityDataService ActivitiesDataService { get; set; }
[Inject]
public IStringLocalizer<Activities> Localizer { get; set; }
private async Task OnReadData()
{
this.activities = await this.ActivitiesDataService.getAllActivities();
this.totalActivity = activities.Count();
}
}
}

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

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using HeartTrack.Models; using HeartTrack.Models;
using HeartTrack.Services; using HeartTrack.Services;
using HeartTrack.Services.TicketDataService;
namespace HeartTrack.Pages namespace HeartTrack.Pages
{ {
@ -10,7 +11,7 @@ namespace HeartTrack.Pages
{ {
[Inject] [Inject]
public ILocalStorageService LocalStorage { get; set; } public ITicketDataService TicketStorage { get; set; }
[Inject] [Inject]
public NavigationManager NavigationManager { get; set; } public NavigationManager NavigationManager { get; set; }
@ -18,20 +19,13 @@ namespace HeartTrack.Pages
[Inject] [Inject]
public IWebHostEnvironment WebHostEnvironment { get; set; } public IWebHostEnvironment WebHostEnvironment { get; set; }
/// <summary>
/// The current item model
/// </summary>
public TicketModel ticketModel = new(){}; public TicketModel ticketModel = new(){};
private async void HandleValidSubmit() private async void HandleValidSubmit()
{ {
// Get the current data var currentData = await TicketStorage.getAllTickets();
var currentData = await LocalStorage.GetItemAsync<List<Ticket>>("data");
// Simulate the Id
ticketModel.Id = currentData.Max(s => s.Id) + 1; ticketModel.Id = currentData.Max(s => s.Id) + 1;
// Add the item to the current data
currentData.Add(new Ticket currentData.Add(new Ticket
{ {
Id = ticketModel.Id, Id = ticketModel.Id,
@ -41,9 +35,7 @@ namespace HeartTrack.Pages
Urgence = ticketModel.Urgence*/ Urgence = ticketModel.Urgence*/
}); });
// Save the data await TicketStorage.SaveAllTickets(currentData);
await LocalStorage.SetItemAsync("data", currentData);
NavigationManager.NavigateTo("tickets"); NavigationManager.NavigateTo("tickets");
} }

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

@ -1,30 +0,0 @@
@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>
<SurveyPrompt Title="How is Blazor working for you?" />
<DataGrid TItem="User"
Data="@users"
ReadData="@OnReadData"
TotalItems="@totalUser"
PageSize="10"
ShowPager
Responsive>
<DataGridColumn TItem="User" Field="@nameof(User.Id)" Caption="Id" />
<DataGridColumn TItem="User" Field="@nameof(User.Username)" Caption="@Localizer["Username"]" />
<DataGridColumn TItem="User" Field="@nameof(User.Nom)" Caption="@Localizer["FirstN"]" />
<DataGridColumn TItem="User" Field="@nameof(User.Prenom)" Caption="@Localizer["LastN"]" />
<DataGridColumn Caption="" />
</DataGrid>

@ -1,66 +0,0 @@
using Blazored.LocalStorage;
using Blazorise;
using Blazorise.DataGrid;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
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 IStringLocalizer<BannedUsers> 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<User[]>("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<User[]>($"{NavigationManager.BaseUri}fake-data.json").Result;
await LocalStorage.SetItemAsync("data", originalData);
}
}
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<Data[]>( $"http://my-api/api/data?page={e.Page}&pageSize={e.PageSize}" );
var response = (await LocalStorage.GetItemAsync<User[]>("data")).Skip((e.Page - 1) * e.PageSize).Take(e.PageSize).ToList();
if (!e.CancellationToken.IsCancellationRequested)
{
totalUser = (await LocalStorage.GetItemAsync<List<User>>("data")).Count;
users = new List<User>(response); // an actual data for the current page
}
}
}
}

@ -1,10 +0,0 @@
@page "/reports"
<PageTitle>Reports</PageTitle>
<h1>Report list</h1>
This is the report list of users.
<SurveyPrompt Title="How is Blazor working for you?" />

@ -1,20 +0,0 @@
@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>
}

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

@ -3,6 +3,7 @@ using Blazorise;
using Blazorise.DataGrid; using Blazorise.DataGrid;
using HeartTrack.Models; using HeartTrack.Models;
using HeartTrack.Services; using HeartTrack.Services;
using HeartTrack.Services.TicketDataService;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
using System; using System;
@ -25,11 +26,14 @@ namespace HeartTrack.Pages
public ILocalStorageService LocalStorage { get; set; } public ILocalStorageService LocalStorage { get; set; }
[Inject] [Inject]
public IDataService DataService { get; set; } public ITicketDataService TicketService { get; set; }
[Inject] [Inject]
public NavigationManager NavigationManager { get; set; } public NavigationManager NavigationManager { get; set; }
[Inject]
private ISnackbar Snackbar { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender) protected override async Task OnAfterRenderAsync(bool firstRender)
{ {
// Do not treat this action if is not the first render // Do not treat this action if is not the first render
@ -70,11 +74,10 @@ namespace HeartTrack.Pages
private async void OnClose(int id) private async void OnClose(int id)
{ {
await TicketService.Close(id);
await DataService.Close(id);
// Reload the page
NavigationManager.NavigateTo("tickets", true); NavigationManager.NavigateTo("tickets", true);
Snackbar.Add("Ticket fermé !");
} }
private void OnView(int id) private void OnView(int id)
@ -87,35 +90,11 @@ namespace HeartTrack.Pages
NavigationManager.NavigateTo("tickets/add"); NavigationManager.NavigateTo("tickets/add");
} }
private async void OnDelete(int id) private async void OnDelete(Ticket t)
{ {
await DataService.Delete(id); await TicketService.RemoveTicket(t);
// Reload the page
NavigationManager.NavigateTo("tickets", true); 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();
}*/
} }
} }

@ -13,9 +13,7 @@
<p> <p>
Description: @ticket.Description Description: @ticket.Description
</p> </p>
<p>
Urgence: @ticket.Urgence
</p>
<p> <p>
Status: @ticket.isCheck Status: @ticket.isCheck
</p> </p>
<MudButton @OnClick="OnNavigateOnReturnClicked">Return</MudButton>

@ -1,5 +1,6 @@
using HeartTrack.Models; using HeartTrack.Models;
using HeartTrack.Services; using HeartTrack.Services;
using HeartTrack.Services.TicketDataService;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace HeartTrack.Pages namespace HeartTrack.Pages
@ -12,7 +13,7 @@ namespace HeartTrack.Pages
private Ticket ticket { get; set; } = new(); private Ticket ticket { get; set; } = new();
[Inject] [Inject]
public IDataService DataService { get; set; } public ITicketDataService TicketService { get; set; }
[Inject] [Inject]
public NavigationManager NavigationManager { get; set; } public NavigationManager NavigationManager { get; set; }
@ -22,7 +23,7 @@ namespace HeartTrack.Pages
protected async Task OnInitializedAsync() protected async Task OnInitializedAsync()
{ {
var item = await DataService.GetByID(Id); var item = await TicketService.getTicketById(Id);
ticket = new Ticket ticket = new Ticket
{ {
@ -30,9 +31,13 @@ namespace HeartTrack.Pages
Username = item.Username, Username = item.Username,
Contexte = item.Contexte, Contexte = item.Contexte,
Description = item.Description, Description = item.Description,
Urgence = item.Urgence,
isCheck = item.isCheck isCheck = item.isCheck
}; };
} }
private void OnNavigateOnReturnClicked()
{
NavigationManager.NavigateTo("/tickets", true);
}
} }
} }

@ -1,6 +1,3 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using HeartTrack.Data;
using Blazorise; using Blazorise;
using Blazorise.Bootstrap; using Blazorise.Bootstrap;
using Blazorise.Icons.FontAwesome; using Blazorise.Icons.FontAwesome;
@ -8,23 +5,63 @@ using Microsoft.AspNetCore.Localization;
using System.Globalization; using System.Globalization;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Blazored.LocalStorage; using Blazored.LocalStorage;
using HeartTrack.Services; using HeartTrack.Services.ActivityDataService;
using Microsoft.AspNetCore.Components.Authorization; using HeartTrack.Services.TicketDataService;
using MudBlazor.Services; using MudBlazor.Services;
using HeartTrack.Services.ActivityDataServiceFactice;
using HeartTrack.Services.TicketDataServiceFactice;
using MudBlazor;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
// Add Badge Component services // Add Badge Component services
builder.Services.AddMudServices(); 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;
});
// Add services to the container. // Add services to the container.
builder.Services.AddRazorPages(); builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor(); builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddHttpClient(); builder.Services.AddHttpClient();
builder.Services.AddScoped<IDataService, DataLocalService>(); // Add Data Services
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceFactice>();
builder.Services.AddScoped<ITicketDataService, TicketDataServiceFactice>();
builder.Services.AddBlazorise()
.AddBootstrapProviders()
.AddFontAwesomeIcons();
// Add the controller of the app
builder.Services.AddControllers();
// Add the localization to the app and specify the resources path
builder.Services.AddLocalization(opts => { opts.ResourcesPath = "Resources"; });
// Configure the localtization
builder.Services.Configure<RequestLocalizationOptions>(options =>
{
// Set the default culture of the web site
options.DefaultRequestCulture = new RequestCulture(new CultureInfo("en-US"));
// Declare the supported culture
options.SupportedCultures = new List<CultureInfo> { new CultureInfo("en-US"), new CultureInfo("fr-FR") };
options.SupportedUICultures = new List<CultureInfo> { new CultureInfo("en-US"), new CultureInfo("fr-FR") };
});
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddHttpClient();
builder.Services.AddBlazorise() builder.Services.AddBlazorise()
.AddBootstrapProviders() .AddBootstrapProviders()
@ -84,4 +121,3 @@ app.MapBlazorHub();
app.MapFallbackToPage("/_Host"); app.MapFallbackToPage("/_Host");
app.Run(); app.Run();

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>List d'activités</value>
</data>
<data name="Description" xml:space="preserve">
<value>This is t.</value>
</data>
<data name="StartTime" xml:space="preserve">
<value>helle</value>
</data>
<data name="EndTime" xml:space="preserve">
<value>Last e</value>
</data>
<data name="EffortRessenti" xml:space="preserve">
<value>Efforressenti</value>
</data>
<data name="Variability" xml:space="preserve">
<value>Variablity</value>
</data>
<data name="StandardDeviation" xml:space="preserve">
<value>Standard deviation</value>
</data>
<data name="Average" xml:space="preserve">
<value>Average</value>
</data>
<data name="AvrTemperature" xml:space="preserve">
<value>Average temperature</value>
</data>
<data name="HasAutoPause" xml:space="preserve">
<value>Has auto pause</value>
</data>
</root>

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Activities List</value>
</data>
<data name="Description" xml:space="preserve">
<value>This is the activity list of users.</value>
</data>
<data name="StartTime" xml:space="preserve">
<value>First name</value>
</data>
<data name="EndTime" xml:space="preserve">
<value>Last name</value>
</data>
<data name="EffortRessenti" xml:space="preserve">
<value>Effort ressenti</value>
</data>
<data name="Variability" xml:space="preserve">
<value>Variability</value>
</data>
<data name="StandardDeviation" xml:space="preserve">
<value>Standard deviation</value>
</data>
<data name="Average" xml:space="preserve">
<value>Average</value>
</data>
<data name="AvrTemperature" xml:space="preserve">
<value>Average temperature</value>
</data>
<data name="HasAutoPause" xml:space="preserve">
<value>Has auto pause</value>
</data>
</root>

@ -0,0 +1,87 @@
using System;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.ActivityDataService
{
public class ActivityDataServiceAPI : IActivityDataService
{
[Inject]
private HttpClient _clientHttp { get; set; }
public ActivityDataServiceAPI(HttpClient clientHttp)
{
this._clientHttp = clientHttp;
}
public async Task AddActivity(Activity a)
{
HttpResponseMessage response = await _clientHttp.PostAsJsonAsync("http://localhost:8080/api/activities", a);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Activité avec l'id " + a.IdActivity + " ajouté avec succès");
}
else
{
Console.WriteLine("API - Problème ajout Activité");
}
}
public async Task<Activity> getActivityById(int id)
{
Activity activity = await _clientHttp.GetFromJsonAsync<Activity>("http://localhost:8080/api/activities/{id}");
return activity;
}
public async Task<List<Activity>> getAllActivities()
{
List<Activity> lActivities = await _clientHttp.GetFromJsonAsync<List<Activity>>("http://localhost:8080/api/activities");
return lActivities;
}
public async Task RemoveActivity(Activity a)
{
HttpResponseMessage response = await _clientHttp.DeleteAsync($"http://localhost:8080/api/activities/{a.IdActivity}");
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Activité avec l'id " + a.IdActivity + " supprimé avec succès");
}
else
{
Console.WriteLine("API - Problème suppression Activité");
}
}
public async Task SaveAllActivities(List<Activity> list)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync("http://localhost:8080/api/activities", list);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - List d'activités sauvegardé avec succès");
}
else
{
Console.WriteLine("API - Problème sauvegarde List d'activités");
}
}
public async Task UpdateActivity(Activity a)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync($"http://localhost:8080/api/activities/{a.IdActivity}", a);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Activité avec l'id " + a.IdActivity + " mis à jour avec succès");
}
else
{
Console.WriteLine("API - Problème mise à jour Activité");
}
}
}
}

@ -0,0 +1,140 @@
using System;
using Blazored.LocalStorage;
using HeartTrack.Models;
using HeartTrack.Services.ActivityDataService;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.ActivityDataServiceFactice
{
public class ActivityDataServiceFactice : IActivityDataService
{
[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 ActivityDataServiceFactice(HttpClient clientHttp, ILocalStorageService localStorage, NavigationManager navigationManager)
{
this._clientHttp = clientHttp;
this._localStorage = localStorage;
this._navigationManager = navigationManager;
this.EmplacementLocalStorage = "activitiesData";
this.EmplacementJson = $"{_navigationManager.BaseUri}data/fake-activities.json";
}
public async Task AddActivity(Activity a)
{
List<Activity> data = await getAllActivities();
data.Add(a);
await this.SaveAllActivities(data);
}
public async Task<Activity> getActivityById(int id)
{
Console.WriteLine("Passage dans le getFromPseudo...");
List<Activity> activities = await getAllActivities();
Activity? temp = null;
foreach (Activity a in activities)
{
if (a.IdActivity == id)
{
temp = a;
}
}
return temp;
}
public async Task<List<Activity>> getAllActivities()
{
List<Activity> lActivities = new List<Activity>();
lActivities = await this.getActivitiesFromLocalStorage();
if(lActivities.Count == 0)
{
lActivities = await this.getActivitiesFromJson(this.EmplacementJson);
await this.saveActivitiesLocalStorage(lActivities);
}
return lActivities;
}
private async Task<List<Activity>> getActivitiesFromJson(String cheminVersJson)
{
List<Activity> activitiesDeserialiser = new List<Activity>();
var data = await _clientHttp.GetFromJsonAsync<Activity[]>(cheminVersJson);
activitiesDeserialiser = data.ToList();
return activitiesDeserialiser;
}
private async Task<List<Activity>> getActivitiesFromLocalStorage()
{
List<Activity> activitiesFromLocalStorage = null;
var data = await _localStorage.GetItemAsync<Activity[]>(EmplacementLocalStorage);
if (data == null)
{
activitiesFromLocalStorage = new List<Activity>();
}
else
{
activitiesFromLocalStorage = data.ToList();
}
return activitiesFromLocalStorage;
}
public async Task RemoveActivity(Activity a)
{
List<Activity> data = await getAllActivities();
int index = -1;
foreach (Activity temp in data)
{
if (temp.IdActivity == a.IdActivity)
{
index = data.IndexOf(temp);
}
}
if (index != -1)
{
data.RemoveAt(index);
}
await this.SaveAllActivities(data);
data = await this.getAllActivities();
}
public async Task SaveAllActivities(List<Activity> list)
{
await this.saveActivitiesLocalStorage(list);
}
private async Task saveActivitiesLocalStorage(List<Activity> lActivities)
{
await _localStorage.SetItemAsync(this.EmplacementLocalStorage, lActivities);
}
public async Task UpdateActivity(Activity a)
{
await this.RemoveActivity(a);
await this.AddActivity(a);
}
}
}

@ -0,0 +1,21 @@
using System;
using HeartTrack.Models;
namespace HeartTrack.Services.ActivityDataService
{
public interface IActivityDataService
{
public Task<List<Activity>> getAllActivities();
public Task SaveAllActivities(List<Activity> list);
public Task AddActivity(Activity u);
public Task RemoveActivity(Activity u);
public Task UpdateActivity(Activity u);
public Task<Activity> getActivityById(int id);
}
}

@ -1,133 +0,0 @@
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;
}
}
}

@ -1,17 +0,0 @@
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,22 @@
using System;
using HeartTrack.Models;
namespace HeartTrack.Services.TicketDataService
{
public interface ITicketDataService
{
public Task<List<Ticket>> getAllTickets();
public Task SaveAllTickets(List<Ticket> list);
public Task AddTicket(Ticket t);
public Task RemoveTicket(Ticket t);
public Task UpdateTicket(Ticket t);
public Task<Ticket> getTicketById(int id);
public Task Close(int Id);
}
}

@ -0,0 +1,91 @@
using System;
using HeartTrack.Models;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.TicketDataService
{
public class TicketDataServiceAPI : ITicketDataService
{
[Inject]
private HttpClient _clientHttp { get; set; }
public TicketDataServiceAPI(HttpClient clientHttp)
{
this._clientHttp = clientHttp;
}
public async Task AddTicket(Ticket t)
{
HttpResponseMessage response = await _clientHttp.PostAsJsonAsync("http://localhost:8080/api/tickets", t);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Ticket avec l'id " + t.Id + " ajouté avec succès");
}
else
{
Console.WriteLine("API - Problème ajout Ticket");
}
}
public async Task<Ticket> getTicketById(int id)
{
Ticket Ticket = await _clientHttp.GetFromJsonAsync<Ticket>("http://localhost:8080/api/tickets/{id}");
return Ticket;
}
public async Task<List<Ticket>> getAllTickets()
{
List<Ticket> lTickets = await _clientHttp.GetFromJsonAsync<List<Ticket>>("http://localhost:8080/api/tickets");
return lTickets;
}
public async Task RemoveTicket(Ticket t)
{
HttpResponseMessage response = await _clientHttp.DeleteAsync($"http://localhost:8080/api/tickets/{t.Id}");
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Ticket avec l'id " + t.Id + " supprimé avec succès");
}
else
{
Console.WriteLine("API - Problème suppression Ticket");
}
}
public async Task SaveAllTickets(List<Ticket> list)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync("http://localhost:8080/api/tickets", list);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - List de tickets sauvegardé avec succès");
}
else
{
Console.WriteLine("API - Problème sauvegarde List de tickets");
}
}
public async Task UpdateTicket(Ticket t)
{
HttpResponseMessage response = await _clientHttp.PutAsJsonAsync($"http://localhost:8080/api/tickets/{t.Id}", t);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("API - Ticket avec l'id " + t.Id + " mis à jour avec succès");
}
else
{
Console.WriteLine("API - Problème mise à jour Ticket");
}
}
public async Task Close(int id)
{
}
}
}

@ -0,0 +1,144 @@
using System;
using Blazored.LocalStorage;
using HeartTrack.Models;
using HeartTrack.Services.TicketDataService;
using Microsoft.AspNetCore.Components;
namespace HeartTrack.Services.TicketDataServiceFactice
{
public class TicketDataServiceFactice : ITicketDataService
{
[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 TicketDataServiceFactice(HttpClient clientHttp, ILocalStorageService localStorage, NavigationManager navigationManager)
{
this._clientHttp = clientHttp;
this._localStorage = localStorage;
this._navigationManager = navigationManager;
this.EmplacementLocalStorage = "ticketsData";
this.EmplacementJson = $"{_navigationManager.BaseUri}data/fake-tickets.json";
}
public async Task AddTicket(Ticket t)
{
List<Ticket> data = await getAllTickets();
data.Add(t);
await this.SaveAllTickets(data);
}
public async Task<Ticket> getTicketById(int id)
{
List<Ticket> tickets = await getAllTickets();
Ticket? temp = null;
foreach (Ticket t in tickets)
{
if (t.Id == id)
{
temp = t;
}
}
return temp;
}
public async Task<List<Ticket>> getAllTickets()
{
List<Ticket> lTickets = new List<Ticket>();
lTickets = await this.getTicketsFromLocalStorage();
if (lTickets.Count == 0)
{
lTickets = await this.getTicketsFromJson(this.EmplacementJson);
await this.saveTicketsLocalStorage(lTickets);
}
return lTickets;
}
private async Task<List<Ticket>> getTicketsFromJson(String cheminVersJson)
{
List<Ticket> TicketsDeserialiser = new List<Ticket>();
var data = await _clientHttp.GetFromJsonAsync<Ticket[]>(cheminVersJson);
TicketsDeserialiser = data.ToList();
return TicketsDeserialiser;
}
private async Task<List<Ticket>> getTicketsFromLocalStorage()
{
List<Ticket> TicketsFromLocalStorage = null;
var data = await _localStorage.GetItemAsync<Ticket[]>(EmplacementLocalStorage);
if (data == null)
{
TicketsFromLocalStorage = new List<Ticket>();
}
else
{
TicketsFromLocalStorage = data.ToList();
}
return TicketsFromLocalStorage;
}
public async Task RemoveTicket(Ticket t)
{
// 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 == t.Id);
// Delete item in
currentData.Remove(item);
// Save the data
await _localStorage.SetItemAsync("data", currentData);
}
public async Task SaveAllTickets(List<Ticket> list)
{
await this.saveTicketsLocalStorage(list);
}
private async Task saveTicketsLocalStorage(List<Ticket> lTickets)
{
await _localStorage.SetItemAsync(this.EmplacementLocalStorage, lTickets);
}
public async Task UpdateTicket(Ticket t)
{
await this.RemoveTicket(t);
await this.AddTicket(t);
}
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);
}
}
}

@ -1,42 +1,12 @@
@using System.Globalization @using System.Globalization
@inject NavigationManager NavigationManager
<p> <p>
<label> <label>
<select @bind="Culture"> <select @bind="Culture">
@foreach (var culture in supportedCultures) @foreach (var culture in @supportedCultures)
{ {
<option value="@culture">@culture.DisplayName</option> <option value="@culture">@culture.DisplayName</option>
} }
</select> </select>
</label> </label>
</p> </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);
}
}
}

@ -0,0 +1,42 @@
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,38 +17,15 @@
<span class="navbat-toggler-icon"></span> <span class="navbat-toggler-icon"></span>
</MudIconButton> </MudIconButton>
<MudSpacer /> <MudSpacer />
<MudIconButton Icon="@Icons.Material.Filled.ManageAccounts" Color="Color.Inherit" Edge="Edge.End" @onclick="ToggleProfilMenu"/> <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>
</MudAppBar> </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"> <article class="content px-4">
@Body @Body
</article> </article>
</main> </main>
</div> </div>
@code {
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
}
private void ToggleProfilMenu()
{
}
}

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

@ -11,40 +11,16 @@
<span class="oi oi-home" aria-hidden="true"></span> @Localizer["Global"] <span class="oi oi-home" aria-hidden="true"></span> @Localizer["Global"]
</NavLink> </NavLink>
</div> </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"> <div class="nav-item px-3">
<NavLink class="nav-link" href="activities"> <NavLink class="nav-link" href="activities">
<span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["Activity"] <span class="oi oi-list-rich" aria-hidden="true"></span> @Localizer["Activity"]
</NavLink> </NavLink>
</div> </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"> <div class="nav-item px-3">
<NavLink class="nav-link" href="tickets"> <NavLink class="nav-link" href="tickets">
<span class="oi oi-plus" aria-hidden="true"></span> @Localizer["Ticket"] <span class="oi oi-plus" aria-hidden="true"></span> @Localizer["Ticket"]
</NavLink> </NavLink>
</div> </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> </nav>
</div> </div>

@ -1,17 +0,0 @@
<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; }
}

@ -0,0 +1,25 @@
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("",""));
}
}
}

@ -0,0 +1,37 @@
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);
}
}
}

@ -0,0 +1,42 @@
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);
}
}
}

@ -0,0 +1,40 @@
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);
}
}
}

@ -0,0 +1,52 @@
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);
}
}
}

@ -0,0 +1,24 @@
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());
}
}
}

@ -0,0 +1,25 @@
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,418 @@
[
{
"idActivity": 1,
"type": "Type2",
"date": "2014-01-16",
"startTime": "2022-01-18",
"endTime": "1990-12-23",
"effortRessenti": 5,
"variability": 31.9135,
"variance": 47.9027,
"standardDeviation": 51.4366,
"average": 77.616,
"maximum": 156,
"minimum": 99,
"avrTemperature": 47.9859,
"hasAutoPause": false
},
{
"idActivity": 2,
"type": "Type1",
"date": "2018-11-27",
"startTime": "2008-09-06",
"endTime": "1971-04-16",
"effortRessenti": 2,
"variability": 63.2869,
"variance": 4.3233,
"standardDeviation": 36.6456,
"average": 14.0372,
"maximum": 182,
"minimum": 57,
"avrTemperature": 47.8921,
"hasAutoPause": true
},
{
"idActivity": 3,
"type": "Type2",
"date": "2018-01-24",
"startTime": "2009-03-24",
"endTime": "1941-05-20",
"effortRessenti": 4,
"variability": 66.0437,
"variance": 40.1499,
"standardDeviation": 85.1707,
"average": 52.538,
"maximum": 114,
"minimum": 41,
"avrTemperature": 48.6091,
"hasAutoPause": true
},
{
"idActivity": 4,
"type": "Type3",
"date": "2014-07-05",
"startTime": "1954-10-02",
"endTime": "2019-11-13",
"effortRessenti": 3,
"variability": 72.5219,
"variance": 88.7179,
"standardDeviation": 56.3285,
"average": 99.2423,
"maximum": 101,
"minimum": 35,
"avrTemperature": 99.5707,
"hasAutoPause": false
},
{
"idActivity": 5,
"type": "Type1",
"date": "2020-07-27",
"startTime": "1970-07-09",
"endTime": "2014-01-07",
"effortRessenti": 1,
"variability": 91.2868,
"variance": 35.2977,
"standardDeviation": 89.1283,
"average": 24.5516,
"maximum": 185,
"minimum": 55,
"avrTemperature": 61.2443,
"hasAutoPause": false
},
{
"idActivity": 6,
"type": "Type3",
"date": "2022-01-21",
"startTime": "1988-07-11",
"endTime": "1947-10-08",
"effortRessenti": 2,
"variability": 39.2403,
"variance": 68.3035,
"standardDeviation": 48.4541,
"average": 15.0519,
"maximum": 87,
"minimum": 61,
"avrTemperature": 24.96,
"hasAutoPause": true
},
{
"idActivity": 7,
"type": "Type2",
"date": "2020-07-04",
"startTime": "1966-07-04",
"endTime": "1953-11-28",
"effortRessenti": 3,
"variability": 77.9106,
"variance": 50.2753,
"standardDeviation": 27.6544,
"average": 73.1399,
"maximum": 178,
"minimum": 80,
"avrTemperature": 70.0154,
"hasAutoPause": true
},
{
"idActivity": 8,
"type": "Type3",
"date": "2021-11-01",
"startTime": "1966-06-30",
"endTime": "1966-10-08",
"effortRessenti": 5,
"variability": 12.8896,
"variance": 91.5997,
"standardDeviation": 28.1367,
"average": 63.2516,
"maximum": 99,
"minimum": 64,
"avrTemperature": 47.2724,
"hasAutoPause": false
},
{
"idActivity": 9,
"type": "Type1",
"date": "2020-10-18",
"startTime": "1993-02-09",
"endTime": "1922-01-12",
"effortRessenti": 2,
"variability": 75.0622,
"variance": 28.5926,
"standardDeviation": 84.1056,
"average": 82.6735,
"maximum": 184,
"minimum": 58,
"avrTemperature": 2.5165,
"hasAutoPause": true
},
{
"idActivity": 10,
"type": "Type3",
"date": "2019-07-21",
"startTime": "1978-01-14",
"endTime": "1921-10-28",
"effortRessenti": 2,
"variability": 38.4167,
"variance": 8.9565,
"standardDeviation": 79.1064,
"average": 71.7045,
"maximum": 189,
"minimum": 41,
"avrTemperature": 11.3153,
"hasAutoPause": false
},
{
"idActivity": 11,
"type": "Type2",
"date": "2015-01-10",
"startTime": "1982-05-10",
"endTime": "2000-06-20",
"effortRessenti": 2,
"variability": 7.298,
"variance": 84.2038,
"standardDeviation": 59.7613,
"average": 24.1556,
"maximum": 84,
"minimum": 40,
"avrTemperature": 79.2884,
"hasAutoPause": true
},
{
"idActivity": 12,
"type": "Type1",
"date": "2014-12-15",
"startTime": "2003-07-20",
"endTime": "1957-10-10",
"effortRessenti": 4,
"variability": 6.1594,
"variance": 39.0998,
"standardDeviation": 87.1683,
"average": 99.7483,
"maximum": 84,
"minimum": 36,
"avrTemperature": 90.0641,
"hasAutoPause": true
},
{
"idActivity": 13,
"type": "Type3",
"date": "2019-07-09",
"startTime": "1977-03-04",
"endTime": "1960-01-01",
"effortRessenti": 4,
"variability": 44.0535,
"variance": 12.5373,
"standardDeviation": 58.7271,
"average": 19.4843,
"maximum": 193,
"minimum": 76,
"avrTemperature": 22.6955,
"hasAutoPause": true
},
{
"idActivity": 14,
"type": "Type2",
"date": "2023-12-11",
"startTime": "1954-06-28",
"endTime": "1993-06-24",
"effortRessenti": 2,
"variability": 10.3723,
"variance": 54.257,
"standardDeviation": 69.0052,
"average": 97.0453,
"maximum": 181,
"minimum": 72,
"avrTemperature": 81.2482,
"hasAutoPause": false
},
{
"idActivity": 15,
"type": "Type1",
"date": "2018-07-02",
"startTime": "2024-01-03",
"endTime": "1964-08-30",
"effortRessenti": 2,
"variability": 48.2932,
"variance": 67.7662,
"standardDeviation": 94.5576,
"average": 98.3297,
"maximum": 177,
"minimum": 38,
"avrTemperature": 91.9669,
"hasAutoPause": true
},
{
"idActivity": 16,
"type": "Type1",
"date": "2018-07-06",
"startTime": "2012-12-28",
"endTime": "2014-04-26",
"effortRessenti": 1,
"variability": 26.7247,
"variance": 8.6121,
"standardDeviation": 32.8475,
"average": 36.0507,
"maximum": 135,
"minimum": 95,
"avrTemperature": 64.4691,
"hasAutoPause": true
},
{
"idActivity": 17,
"type": "Type2",
"date": "2022-07-08",
"startTime": "1934-08-04",
"endTime": "1948-01-16",
"effortRessenti": 3,
"variability": 24.5678,
"variance": 89.474,
"standardDeviation": 6.4851,
"average": 80.388,
"maximum": 198,
"minimum": 65,
"avrTemperature": 73.0159,
"hasAutoPause": false
},
{
"idActivity": 18,
"type": "Type3",
"date": "2020-08-08",
"startTime": "1943-01-04",
"endTime": "1984-11-01",
"effortRessenti": 4,
"variability": 15.8206,
"variance": 10.1982,
"standardDeviation": 89.2815,
"average": 60.1575,
"maximum": 177,
"minimum": 55,
"avrTemperature": 95.3616,
"hasAutoPause": false
},
{
"idActivity": 19,
"type": "Type1",
"date": "2017-01-31",
"startTime": "1995-01-14",
"endTime": "1967-07-28",
"effortRessenti": 2,
"variability": 10.3217,
"variance": 25.3434,
"standardDeviation": 64.5326,
"average": 6.7419,
"maximum": 83,
"minimum": 72,
"avrTemperature": 19.6569,
"hasAutoPause": false
},
{
"idActivity": 20,
"type": "Type3",
"date": "2017-05-29",
"startTime": "1959-03-03",
"endTime": "1943-08-27",
"effortRessenti": 2,
"variability": 12.9503,
"variance": 90.5546,
"standardDeviation": 57.812,
"average": 44.4189,
"maximum": 144,
"minimum": 79,
"avrTemperature": 95.1186,
"hasAutoPause": false
},
{
"idActivity": 21,
"type": "Type1",
"date": "2015-10-03",
"startTime": "1946-05-27",
"endTime": "1934-06-04",
"effortRessenti": 3,
"variability": 59.5777,
"variance": 61.9804,
"standardDeviation": 46.6558,
"average": 11.234,
"maximum": 144,
"minimum": 73,
"avrTemperature": 72.5805,
"hasAutoPause": false
},
{
"idActivity": 22,
"type": "Type1",
"date": "2015-04-05",
"startTime": "1948-02-07",
"endTime": "1925-04-24",
"effortRessenti": 3,
"variability": 4.6783,
"variance": 66.7362,
"standardDeviation": 79.8471,
"average": 52.3693,
"maximum": 141,
"minimum": 85,
"avrTemperature": 48.7024,
"hasAutoPause": false
},
{
"idActivity": 23,
"type": "Type1",
"date": "2023-06-05",
"startTime": "1920-11-12",
"endTime": "1926-06-26",
"effortRessenti": 5,
"variability": 67.8302,
"variance": 33.2865,
"standardDeviation": 4.516,
"average": 17.2584,
"maximum": 150,
"minimum": 47,
"avrTemperature": 52.2994,
"hasAutoPause": true
},
{
"idActivity": 24,
"type": "Type2",
"date": "2014-03-03",
"startTime": "1988-05-05",
"endTime": "1944-06-29",
"effortRessenti": 1,
"variability": 12.7751,
"variance": 92.9296,
"standardDeviation": 76.843,
"average": 32.2267,
"maximum": 114,
"minimum": 77,
"avrTemperature": 80.627,
"hasAutoPause": true
},
{
"idActivity": 25,
"type": "Type3",
"date": "2016-07-01",
"startTime": "1927-11-09",
"endTime": "2011-12-16",
"effortRessenti": 3,
"variability": 45.0597,
"variance": 37.5072,
"standardDeviation": 6.6945,
"average": 70.5156,
"maximum": 81,
"minimum": 32,
"avrTemperature": 57.5543,
"hasAutoPause": false
},
{
"idActivity": 26,
"type": "Type3",
"date": "2020-06-25",
"startTime": "1940-12-10",
"endTime": "1944-05-02",
"effortRessenti": 2,
"variability": 20.6298,
"variance": 54.2174,
"standardDeviation": 56.4106,
"average": 4.487,
"maximum": 112,
"minimum": 98,
"avrTemperature": 80.8548,
"hasAutoPause": false
}
]

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

@ -1,178 +0,0 @@
[
{
"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"
}
]

@ -1,379 +0,0 @@
[
{
"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