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

Fix #103 bouton pour vider la session

parent 5e19d604
No related branches found
No related tags found
1 merge request!29Resolve "Remplacer mdbootstrap par angular-material"
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
</header> </header>
<main> <main>
<mat-sidenav-container fxFlexFill class="example-container"> <mat-sidenav-container fxFlexFill class="example-container">
<!-- side panel -->
<mat-sidenav class="sidenav" #sidenav fxLayout="column" > <mat-sidenav class="sidenav" #sidenav fxLayout="column" >
<div fxLayout="column"> <div fxLayout="column">
<a id="close-side-nav" class="closebtn" (click)="sidenav.close()">×</a> <a id="close-side-nav" class="closebtn" (click)="sidenav.close()">×</a>
...@@ -67,6 +67,10 @@ ...@@ -67,6 +67,10 @@
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
{{ uitextSidenavNewCalc }} {{ uitextSidenavNewCalc }}
</a> </a>
<a id="side-nav-empty-session" (click)="emptySession(); sidenav.close()">
<mat-icon>insert_drive_file</mat-icon>
{{ uitextSidenavEmptySession }}
</a>
<a id="side-nav-load-session" (click)="loadSession(); sidenav.close()"> <a id="side-nav-load-session" (click)="loadSession(); sidenav.close()">
<mat-icon>folder_open</mat-icon> <mat-icon>folder_open</mat-icon>
{{ uitextSidenavLoadSession }} {{ uitextSidenavLoadSession }}
......
...@@ -47,7 +47,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -47,7 +47,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
/** /**
* id du formulaire courant * id du formulaire courant
* on utilise pas directement FormulaireService.currentFormId pour éviter l'erreur * on utilise pas directement FormulaireService.currentFormId pour éviter l'erreur
* ExpressionChangedAfterItHasBeenCheckedError * ExpressionChangedAfterItHasBeenCheckedError
*/ */
private _currentFormId: string; private _currentFormId: string;
...@@ -124,6 +124,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -124,6 +124,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
return this.intlService.localizeText("INFO_MENU_SAVE_SESSION_TITLE"); return this.intlService.localizeText("INFO_MENU_SAVE_SESSION_TITLE");
} }
public get uitextSidenavEmptySession() {
return this.intlService.localizeText("INFO_MENU_EMPTY_SESSION_TITLE");
}
public get uitextSidenavHelp() { public get uitextSidenavHelp() {
return this.intlService.localizeText("INFO_MENU_HELP_TITLE"); return this.intlService.localizeText("INFO_MENU_HELP_TITLE");
} }
...@@ -268,7 +272,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -268,7 +272,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
const elems = []; const elems = [];
for (const c of calcList) { for (const c of calcList) {
if (c.selected) { if (c.selected) {
console.log(c.title);
const form: FormulaireDefinition = this.formulaireService.getFormulaireFromId(c.uid); const form: FormulaireDefinition = this.formulaireService.getFormulaireFromId(c.uid);
elems.push(form.JSONserialise()); elems.push(form.JSONserialise());
} }
...@@ -335,11 +338,17 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -335,11 +338,17 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
this._routerCurrentComponent = a; this._routerCurrentComponent = a;
} }
// flag d'affichage des repères des colonnes Bootstrap : uniquement en mode dev /**
// cf. src/environments/*, ng build --env=<mode> (par ex : ng build --env=prod) * restarts a fresh session by closing all calculators
public get ruler(): boolean { */
// return !environment.production; public emptySession() {
return false; // @TODO replace with nice modal
if (confirm(this.intlService.localizeText("INFO_EMPTY_SESSION_DIALOGUE_TEXT"))) {
for (const c of this._calculators) {
const form = this.formulaireService.getFormulaireFromId(c.uid);
this.closeCalculator(form);
}
}
} }
public loadSession() { public loadSession() {
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
"INFO_CONDUITEDISTRIBUTRICE_TITRE": "Distributor pipe", "INFO_CONDUITEDISTRIBUTRICE_TITRE": "Distributor pipe",
"INFO_COURBEREMOUS_TITRE": "Backwater curves", "INFO_COURBEREMOUS_TITRE": "Backwater curves",
"INFO_DEVER_TITRE": "Free flow weir stage-discharge laws", "INFO_DEVER_TITRE": "Free flow weir stage-discharge laws",
<<<<<<< 81116b3ae675b90a82d894f617c9a85f2f95782f
"INFO_EXTRARES_ENUM_MACRORUGOFLOWTYPE_0": "Emergent", "INFO_EXTRARES_ENUM_MACRORUGOFLOWTYPE_0": "Emergent",
"INFO_EXTRARES_ENUM_MACRORUGOFLOWTYPE_1": "Quasi-emergent", "INFO_EXTRARES_ENUM_MACRORUGOFLOWTYPE_1": "Quasi-emergent",
"INFO_EXTRARES_ENUM_MACRORUGOFLOWTYPE_2": "Submerged", "INFO_EXTRARES_ENUM_MACRORUGOFLOWTYPE_2": "Submerged",
...@@ -48,6 +49,17 @@ ...@@ -48,6 +49,17 @@
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1": "Partially submerged", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1": "Partially submerged",
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2": "Submerged", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2": "Submerged",
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3": "Zero flow", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3": "Zero flow",
=======
"INFO_EMPTY_SESSION_DIALOGUE_TEXT": "Warning ! All open calculators will be lost. Continue ?",
"INFO_EMPTY_SESSION_DIALOGUE_TITRE": "New session",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_0": "Weir",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_1": "Orifice",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_2": "Zero flow",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_0": "Free flow",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_1": "Partially submerged",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_2": "Submerged",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_3": "Zero flow",
>>>>>>> Fix #103 bouton pour vider la session
"INFO_EXTRARES_LIB_B": "Surface width (m)", "INFO_EXTRARES_LIB_B": "Surface width (m)",
"INFO_EXTRARES_LIB_CV": "Cv: Velocity coefficient", "INFO_EXTRARES_LIB_CV": "Cv: Velocity coefficient",
"INFO_EXTRARES_LIB_CVQT": "CV.QT: Corrected discharge (m³/s)", "INFO_EXTRARES_LIB_CVQT": "CV.QT: Corrected discharge (m³/s)",
...@@ -103,6 +115,7 @@ ...@@ -103,6 +115,7 @@
"INFO_MENU_LOAD_SESSION_TITLE": "Load session", "INFO_MENU_LOAD_SESSION_TITLE": "Load session",
"INFO_MENU_NOUVELLE_CALC": "New calculation module", "INFO_MENU_NOUVELLE_CALC": "New calculation module",
"INFO_MENU_SAVE_SESSION_TITLE": "Save session", "INFO_MENU_SAVE_SESSION_TITLE": "Save session",
"INFO_MENU_EMPTY_SESSION_TITLE": "New session",
"INFO_OPTION_NO": "No", "INFO_OPTION_NO": "No",
"INFO_OPTION_YES": "Yes", "INFO_OPTION_YES": "Yes",
"INFO_OUVRAGE": "Structure", "INFO_OUVRAGE": "Structure",
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"INFO_CALCULATOR_PARAMFIXES": "Paramètres fixés", "INFO_CALCULATOR_PARAMFIXES": "Paramètres fixés",
"INFO_CALCULATOR_VALEURS": "Valeurs", "INFO_CALCULATOR_VALEURS": "Valeurs",
"INFO_CLOISONS_TITRE": "Passe à bassin&nbsp;: Cloisons", "INFO_CLOISONS_TITRE": "Passe à bassin&nbsp;: Cloisons",
"INFO_CLOSE_DIALOGUE_TEXT": "Attention&nbsp! Les paramètres et résultats de la calculette seront perdus. Vraiment fermer&nbsp;?", "INFO_CLOSE_DIALOGUE_TEXT": "Attention&nbsp;! Les paramètres et résultats de la calculette seront perdus. Vraiment fermer&nbsp;?",
"INFO_CLOSE_DIALOGUE_TITRE": "Confirmer la fermeture", "INFO_CLOSE_DIALOGUE_TITRE": "Confirmer la fermeture",
"INFO_CONDUITEDISTRIBUTRICE_TITRE": "Conduite distributrice", "INFO_CONDUITEDISTRIBUTRICE_TITRE": "Conduite distributrice",
"INFO_COURBEREMOUS_TITRE": "Courbes de remous", "INFO_COURBEREMOUS_TITRE": "Courbes de remous",
...@@ -48,6 +48,15 @@ ...@@ -48,6 +48,15 @@
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1": "Partiellement noyé", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1": "Partiellement noyé",
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2": "Noyé", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2": "Noyé",
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3": "Débit nul", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3": "Débit nul",
"INFO_EMPTY_SESSION_DIALOGUE_TEXT": "Attention ! Toutes les calculettes ouvertes seront perdues. Continuer ?",
"INFO_EMPTY_SESSION_DIALOGUE_TITRE": "Démarrer une nouvelle session",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_0": "Surface libre",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_1": "En charge",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_MODE_2": "Débit nul",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_0": "Dénoyé",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_1": "Partiellement noyé",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_2": "Noyé",
"INFO_EXTRARES_ENUM_OUVRAGE_Q_REGIME_3": "Débit nul",
"INFO_EXTRARES_LIB_B": "Largeur au miroir (m)", "INFO_EXTRARES_LIB_B": "Largeur au miroir (m)",
"INFO_EXTRARES_LIB_CV": "Cv: Coefficient de vitesse d'approche", "INFO_EXTRARES_LIB_CV": "Cv: Coefficient de vitesse d'approche",
"INFO_EXTRARES_LIB_CVQT": "CV.QT: Débit corrigé (m³/s)", "INFO_EXTRARES_LIB_CVQT": "CV.QT: Débit corrigé (m³/s)",
...@@ -101,6 +110,7 @@ ...@@ -101,6 +110,7 @@
"INFO_MENU_HELP_TITLE": "Aide", "INFO_MENU_HELP_TITLE": "Aide",
"INFO_MENU_LOAD_SESSION_TITLE": "Charger une session", "INFO_MENU_LOAD_SESSION_TITLE": "Charger une session",
"INFO_MENU_SAVE_SESSION_TITLE": "Enregistrer la session", "INFO_MENU_SAVE_SESSION_TITLE": "Enregistrer la session",
"INFO_MENU_EMPTY_SESSION_TITLE": "Nouvelle session",
"INFO_MENU_NOUVELLE_CALC": "Nouveau module de calcul", "INFO_MENU_NOUVELLE_CALC": "Nouveau module de calcul",
"INFO_MACRORUGO_TITRE": "Passe à macro-rugosité", "INFO_MACRORUGO_TITRE": "Passe à macro-rugosité",
"INFO_OPTION_NO": "Non", "INFO_OPTION_NO": "Non",
......
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