Skip to content
Snippets Groups Projects
Commit 08c8b268 authored by Mathias Chouet's avatar Mathias Chouet
Browse files

Option in calculator config to disable calculation permanently

parent 3e8d1752
No related branches found
No related tags found
No related merge requests found
...@@ -438,7 +438,7 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe ...@@ -438,7 +438,7 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe
*/ */
private updateUIValidity() { private updateUIValidity() {
this._isUIValid = false; this._isUIValid = false;
if (! this._formulaire.calculateDisabled) {
if (this._fieldsetComponents !== undefined) { if (this._fieldsetComponents !== undefined) {
this._isUIValid = this._fieldsetComponents.reduce( this._isUIValid = this._fieldsetComponents.reduce(
// callback // callback
...@@ -481,6 +481,7 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe ...@@ -481,6 +481,7 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe
this._isUIValid = this._isUIValid && this._pabTableComponent.isValid; this._isUIValid = this._isUIValid && this._pabTableComponent.isValid;
} }
} }
}
public getElementStyleDisplay(id: string) { public getElementStyleDisplay(id: string) {
const isDisplayed: boolean = this._formulaire.isDisplayed(id); const isDisplayed: boolean = this._formulaire.isDisplayed(id);
......
...@@ -45,6 +45,9 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs ...@@ -45,6 +45,9 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
/** aide en ligne pour les résultats */ /** aide en ligne pour les résultats */
protected _resultsHelpLinks: { [key: string]: string }; protected _resultsHelpLinks: { [key: string]: string };
/** set to true to definitely gray-out Calculate button */
protected _calculateDisabled = false;
/** fichier de configuration */ /** fichier de configuration */
private _jsonConfig: {}; private _jsonConfig: {};
...@@ -71,6 +74,10 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs ...@@ -71,6 +74,10 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
} }
} }
public get calculateDisabled(): boolean {
return this._calculateDisabled;
}
public get specificLocalisation() { public get specificLocalisation() {
return this._specificLocalisation; return this._specificLocalisation;
} }
...@@ -160,6 +167,9 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs ...@@ -160,6 +167,9 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
} }
this._helpLink = json["help"]; this._helpLink = json["help"];
this._resultsHelpLinks = json["resultsHelp"]; this._resultsHelpLinks = json["resultsHelp"];
if (json["calculateDisabled"] !== undefined) {
this._calculateDisabled = json["calculateDisabled"];
}
} }
/** called at the end of parseConfig() */ /** called at the end of parseConfig() */
......
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