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

Pas de snackbar lorsqu'on ferme un module

parent 3abba8f1
No related branches found
No related tags found
1 merge request!40Resolve "Amélioration du système de paramètres liés"
......@@ -409,7 +409,7 @@ export class FormulaireService extends Observable {
// reset the result panels of all forms depending on this one
// @TODO UI should detect model change instead of doing this manually
this.resetAllDependingFormsResults(form);
this.resetAllDependingFormsResults(form, [], false);
}
if (nub) {
// reset model results (important, also resets dependent Nubs results in chain)
......@@ -628,17 +628,19 @@ export class FormulaireService extends Observable {
* Resets the results of all forms depending on the given form "f"
* @param f
*/
public resetAllDependingFormsResults(f: FormulaireDefinition, visited: string[] = []) {
public resetAllDependingFormsResults(f: FormulaireDefinition, visited: string[] = [], notify: boolean = true) {
const dependingNubs = Session.getInstance().getDependingNubs(f.currentNub.uid);
for (const dn of dependingNubs) {
if (! visited.includes(dn.uid)) {
const form = this.getFormulaireFromNubId(dn.uid);
if (form.hasResults) {
form.resetResults(visited);
this.notificationsService.notify(
this.intlService.localizeText("INFO_SNACKBAR_RESULTS_INVALIDATED") + " " + form.calculatorName,
2000
);
if (notify) {
this.notificationsService.notify(
this.intlService.localizeText("INFO_SNACKBAR_RESULTS_INVALIDATED") + " " + form.calculatorName,
2000
);
}
}
}
}
......
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