Skip to content
Snippets Groups Projects
Commit df076e61 authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix #164 - système de rapport de bug par email

parent 769aeb04
No related branches found
No related tags found
1 merge request!44Resolve "Ajouter un système de rapport de bug, qui envoie un email contenant le fichier de session"
75-section-parametree-calculer-systematiquement-toutes-les-variables-meme-avec-un-parametre-qui-varie
master
......@@ -89,6 +89,10 @@
<mat-icon>settings</mat-icon>
{{ uitextSidenavParams }}
</a>
<a id="side-nav-bug-report" (click)="reportBug(); sidenav.close()">
<mat-icon>report_problem</mat-icon>
{{ uitextSidenavReportBug }}
</a>
<a id="side-nav-help" target="_blank" href="assets/docs-fr/" (click)="sidenav.close()">
<mat-icon>help</mat-icon>
{{ uitextSidenavHelp }}
......
......@@ -152,6 +152,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
return this.intlService.localizeText("INFO_MENU_EMPTY_SESSION_TITLE");
}
public get uitextSidenavReportBug() {
return this.intlService.localizeText("INFO_MENU_REPORT_BUG");
}
public get uitextSidenavHelp() {
return this.intlService.localizeText("INFO_MENU_HELP_TITLE");
}
......@@ -411,6 +415,22 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
});
}
/**
* Demande au client d'envoyer un email (génère un lien mailto:), pré-rempli
* avec un texte standard, et le contenu de la session au format JSON
*/
public reportBug() {
const recipient = "cassiopee@g-eau.fr";
const subject = "[ISSUE] " + this.intlService.localizeText("INFO_REPORT_BUG_SUBJECT");
let body = this.intlService.localizeText("INFO_REPORT_BUG_BODY");
// add session description
body += Session.getInstance().serialise();
body = encodeURIComponent(body);
const mailtoURL = `mailto:${recipient}?subject=${subject}&body=${body}`;
window.location.href = mailtoURL;
}
public get revisionInfo(): any {
return {
jalhyd: {
......
......@@ -139,6 +139,7 @@
"INFO_MENU_HELP_TITLE": "Help",
"INFO_MENU_LOAD_SESSION_TITLE": "Load session",
"INFO_MENU_NOUVELLE_CALC": "New calculation module",
"INFO_MENU_REPORT_BUG": "Report an issue",
"INFO_MENU_SAVE_SESSION_TITLE": "Save session",
"INFO_MENU_SELECT_CALC": "Select calculator module",
"INFO_MENU_EMPTY_SESSION_TITLE": "New session",
......@@ -212,6 +213,8 @@
"INFO_REMOUS_LARGEUR_BERGE": "Width at embankment level = %B% m",
"INFO_REMOUS_RESSAUT_DEHORS": "Hydraulic jump detected %sens% abscissa %x% m",
"INFO_REMOUS_RESSAUT_HYDRO": "Hydraulic jump detected between abscissa %xmin% and %xmax% m",
"INFO_REPORT_BUG_SUBJECT": "Issue report",
"INFO_REPORT_BUG_BODY": "This is an issue report.\n\nPlease describe quickly the issue you encoutered, and the steps you followed.\n\n1. ...\n2. ...\n\n\nDO NOT MODIFY TEXT BELOW THIS LINE\n--------------------------------------------\n\n",
"INFO_REQUIRES": "requires",
"INFO_SECTIONPARAMETREE_TITRE": "Parametric section",
"INFO_SECTIONPARAMETREE_TITRE_COURT": "Param. section",
......
......@@ -136,6 +136,7 @@
"INFO_LINKED_VALUE_EXTRA_RESULT_OF": "%s (%s, résultat complémentaire de %s)",
"INFO_MENU_HELP_TITLE": "Aide",
"INFO_MENU_LOAD_SESSION_TITLE": "Charger une session",
"INFO_MENU_REPORT_BUG": "Signaler un problème",
"INFO_MENU_SAVE_SESSION_TITLE": "Enregistrer la session",
"INFO_MENU_SELECT_CALC": "Choisir un module de calcul",
"INFO_MENU_EMPTY_SESSION_TITLE": "Nouvelle session",
......@@ -212,6 +213,8 @@
"INFO_REMOUS_LARGEUR_BERGE": "Largeur au niveau des berges = %B% m",
"INFO_REMOUS_RESSAUT_DEHORS": "Ressaut hydraulique détecté à l'%sens% de l'abscisse %x% m",
"INFO_REMOUS_RESSAUT_HYDRO": "Ressaut hydraulique détecté entre les abscisses %xmin% et %xmax% m",
"INFO_REPORT_BUG_SUBJECT": "Rapport d'erreur",
"INFO_REPORT_BUG_BODY": "Ceci est un rapport d'erreur.\n\nMerci de décrire rapidement ci-dessous le problème rencontré, et les étapes qui vous y ont mené.\n\n1. ...\n2. ...\n\n\nNE PAS MODIFIER LE TEXTE SOUS CETTE LIGNE\n--------------------------------------------\n\n",
"INFO_REQUIRES": "dépend de",
"INFO_SECTIONPARAMETREE_TITRE": "Section paramétrée",
"INFO_SECTIONPARAMETREE_TITRE_COURT": "Sec. param.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment