Skip to content
Snippets Groups Projects
Commit 9c398df6 authored by François Grand's avatar François Grand
Browse files

feat: add application setup option to fold result messages log by default

refs #519
parent c9e3fbe2
No related branches found
No related tags found
1 merge request!151Resolve "Journal de calcul repliable"
Pipeline #139598 passed
......@@ -88,6 +88,12 @@
{{ uitextEnableEmptyFieldsOnFormInit }}
</mat-checkbox>
<!-- display result messages log folded by default -->
<mat-checkbox id="cb_foldedMessageLog" class="wrapped-checkbox" name="foldedMessageLog" [(ngModel)]="foldedMessageLog"
[ngModelOptions]="{standalone: true}">
{{ uitextEnableFoldedMessageLog }}
</mat-checkbox>
<!-- langue -->
<mat-form-field>
<mat-select [placeholder]="uitextLanguage" [(value)]="currentLanguageCode"
......
......@@ -84,6 +84,15 @@ export class ApplicationSetupComponent implements Observer, OnInit {
this.appSetupService.enableEmptyFieldsOnFormInit = v;
}
/** fold result messages log by default */
public get foldedMessageLog(): boolean {
return this.appSetupService.foldedMessageLog;
}
public set foldedMessageLog(v: boolean) {
this.appSetupService.foldedMessageLog = v;
}
public get uitextTitle(): string {
return this.intlService.localizeText("INFO_SETUP_TITLE");
}
......@@ -116,6 +125,10 @@ export class ApplicationSetupComponent implements Observer, OnInit {
return this.intlService.localizeText("INFO_SETUP_ENABLE_EMPTY_FIELDS");
}
public get uitextEnableFoldedMessageLog(): string {
return this.intlService.localizeText("INFO_SETUP_FOLDED_RESULT_MESSAGES_LOG");
}
public get uitextMustBeANumber(): string {
return this.intlService.localizeText("ERROR_PARAM_MUST_BE_A_NUMBER");
}
......
<mat-expansion-panel *ngIf="hasEntries" expanded>
<mat-expansion-panel *ngIf="hasEntries" [expanded]="expandedStatus">
<mat-expansion-panel-header>
<mat-panel-title>
{{ uitextTitreJournal }}
......
import { Component, Input } from "@angular/core";
import { ApplicationSetupService } from "app/services/app-setup.service";
import { cLog, Message } from "jalhyd";
......@@ -21,9 +22,15 @@ export class LogComponent {
@Input()
public logTitle: string;
// expanded/folded panel state
public expandedStatus: boolean;
constructor(
private intlService: I18nService,
) { }
private appSetupService: ApplicationSetupService
) {
this.expandedStatus = !this.appSetupService.foldedMessageLog;
}
public get uitextTitreJournal() {
if (this.logTitle) {
......
......@@ -25,6 +25,7 @@ export class ApplicationSetupService extends Observable {
public enableNotifications = true;
public enableHotkeys = false;
private _enableEmptyFieldsOnFormInit = true;
private _foldedMessageLog = false;
public set computePrecision(p: number) {
this._computePrecision = p;
......@@ -54,6 +55,14 @@ export class ApplicationSetupService extends Observable {
this._enableEmptyFieldsOnFormInit = b;
}
public get foldedMessageLog() {
return this._foldedMessageLog;
}
public set foldedMessageLog(b: boolean) {
this._foldedMessageLog = b;
}
/**
* just stores the current language preference, does not transmit it to I18nService, that is
* not available here.
......
......@@ -586,6 +586,7 @@
"INFO_SETUP_ENABLE_HOTKEYS": "Enable keyboard shortcuts",
"INFO_SETUP_ENABLE_EMPTY_FIELDS": "Create new calculators with empty fields (no default values)",
"INFO_SETUP_ENABLE_NOTIFICATIONS": "Enable on-screen notifications",
"INFO_SETUP_FOLDED_RESULT_MESSAGES_LOG": "Fold result messages log by default",
"INFO_SETUP_LANGUAGE": "Language",
"INFO_SETUP_NEWTON_MAX_ITER": "Solver iteration limit",
"INFO_SETUP_PRECISION_AFFICHAGE": "Number of displayed decimals",
......
......@@ -587,6 +587,7 @@
"INFO_SETUP_ENABLE_HOTKEYS": "Activer les raccourcis clavier",
"INFO_SETUP_ENABLE_EMPTY_FIELDS": "Créer les nouveaux modules avec des champs vides (aucune valeur par défaut)",
"INFO_SETUP_ENABLE_NOTIFICATIONS": "Activer les notifications à l'écran",
"INFO_SETUP_FOLDED_RESULT_MESSAGES_LOG": "Replier le journal de calcul par défaut",
"INFO_SETUP_LANGUAGE": "Langue",
"INFO_SETUP_NEWTON_MAX_ITER": "Solveur&nbsp;: nombre d'itérations maximum",
"INFO_SETUP_PRECISION_AFFICHAGE": "Nombre de décimales affichées",
......
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