Skip to content
Snippets Groups Projects
Commit 3408ad2a authored by Mathias Chouet's avatar Mathias Chouet Committed by mathias.chouet
Browse files

Option in calculator config to disable calculation permanently

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