Skip to content

Commit 19ab989

Browse files
committed
feat(fagerh): keep only file active and emploi blocks for ESRP parcours steps
1 parent 7ebb2a2 commit 19ab989

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

forms/fagerh/index.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4452,7 +4452,27 @@ <h2>Validation finale</h2>
44524452
}];
44534453
}
44544454
if (isParcoursConditionalStep(currentConditionalId)) {
4455-
// Parcours mobilisés: détail des blocs aligné sur le modèle ESRP (pas de bloc unique dédié).
4455+
const fileActive = Number(state.fileActive || 0);
4456+
const sortiesFilled = isFilledNumberString(state.sorties);
4457+
const sortiesAvantTermeFilled = isFilledNumberString(state.sortiesAvantTerme);
4458+
const sortiesTermeFilled = isFilledNumberString(state.sortiesTerme);
4459+
const sorties = getConditionalSortiesTotal(state);
4460+
const sortiesSplitSum = getConditionalSortiesSplitSum(state);
4461+
const journees = Number(state.journees || 0);
4462+
const fileBlockDone = fileActive >= 0
4463+
&& sortiesFilled
4464+
&& sortiesAvantTermeFilled
4465+
&& sortiesTermeFilled
4466+
&& sorties >= 0
4467+
&& journees > 0
4468+
&& Math.abs(sortiesSplitSum - sorties) < 0.0001;
4469+
const emploiKeys = getEmploiRequiredFieldKeys(currentConditionalId);
4470+
const emploiRow = state?.directAvecOrp?.row || {};
4471+
const emploiDone = emploiKeys.length ? emploiKeys.every((key) => isFilledNumberString(emploiRow[key])) : false;
4472+
return [
4473+
{ key: 'fileactive', label: 'File active & journées', done: fileBlockDone },
4474+
{ key: 'suivi_emploi', label: "Suivi vers l'emploi", done: emploiDone },
4475+
];
44564476
}
44574477
if (isDirectSansOrpCadrageConditionalStep(currentConditionalId)) {
44584478
const directSansOrpPecBlock = evaluateDirectSansOrpPecBlock(state, currentConditionalId);
@@ -5712,6 +5732,12 @@ <h2>Validation finale</h2>
57125732
block.style.display = isShown ? '' : 'none';
57135733
block.dataset.renderable = isShown ? '1' : '0';
57145734
});
5735+
} else if (isParcoursStep) {
5736+
conditionalCoherenceSections.querySelectorAll('.cond-block').forEach((block) => {
5737+
const isShown = block.getAttribute('data-block-key') === 'suivi_emploi';
5738+
block.style.display = isShown ? '' : 'none';
5739+
block.dataset.renderable = isShown ? '1' : '0';
5740+
});
57155741
} else if (isSpecialIndirectStep) {
57165742
conditionalCoherenceSections.querySelectorAll('.cond-block').forEach((block) => {
57175743
const isShown = block.getAttribute('data-block-key') === 'indirect';

0 commit comments

Comments
 (0)