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

Rapport de bug : ajout des titres de modules dans le fichier de session

parent f5e8f67d
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"
...@@ -301,8 +301,12 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -301,8 +301,12 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
* @param calcList modules to save * @param calcList modules to save
* @param filename * @param filename
*/ */
private saveSession(calcList: any[], filename) { private saveSession(calcList: any[], filename: string) {
const elems = []; const session: string = this.buildSessionFile(calcList);
this.formulaireService.downloadTextFile(session, filename);
}
private buildSessionFile(calcList: any[]): string {
const serialiseOptions: { [key: string]: {} } = {}; const serialiseOptions: { [key: string]: {} } = {};
for (const c of calcList) { for (const c of calcList) {
if (c.selected) { if (c.selected) {
...@@ -311,8 +315,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -311,8 +315,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
}; };
} }
} }
const session: string = Session.getInstance().serialise(serialiseOptions); return Session.getInstance().serialise(serialiseOptions);
this.formulaireService.downloadTextFile(session, filename);
} }
/** /**
...@@ -426,7 +429,19 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -426,7 +429,19 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
let body = this.intlService.localizeText("INFO_REPORT_BUG_BODY"); let body = this.intlService.localizeText("INFO_REPORT_BUG_BODY");
// add session description // add session description
let session = Session.getInstance().serialise();
// get all forms
const list = [];
for (const c of this._calculators) {
list.push({
title: c.title,
uid: c.uid,
selected: true
});
}
let session = this.buildSessionFile(list);
// compress
session = pako.deflate(session, { to: "string" }); // gzip (zlib) session = pako.deflate(session, { to: "string" }); // gzip (zlib)
session = btoa(session); // base64 session = btoa(session); // base64
......
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