commit compras1 2911
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-29 05:28:30 +02:00
parent 1ddabbbdcc
commit 448948a487
137 changed files with 9481 additions and 1926 deletions
+18 -1
View File
@@ -1,8 +1,24 @@
export function markPreparationDirty(
form: HTMLFormElement,
dirty: boolean,
managed = false,
): void {
form.setAttribute('data-preparation-dirty', dirty ? 'true' : 'false');
if (managed) form.setAttribute('data-preparation-managed', 'true');
// Explicit query forms change consultation criteria, not a business preparation.
form.setAttribute(
'data-preparation-dirty',
dirty && form.getAttribute('data-query-form') !== 'true'
? 'true'
: 'false',
);
}
/** A form that publishes its own dirty state owns clearing and restoring it. */
export function usesGenericPreparationTracking(form: HTMLFormElement): boolean {
return (
form.getAttribute('data-query-form') !== 'true' &&
form.getAttribute('data-preparation-managed') !== 'true'
);
}
/** Recover restored preparations even when their effect ran before the guard subscribed. */
@@ -20,6 +36,7 @@ export function connectedDirtyForms(
].filter(
(form) =>
form.isConnected &&
form.getAttribute('data-query-form') !== 'true' &&
form.getAttribute('data-preparation-dirty') !== 'false',
);
}