Skip to content

Commit

Permalink
fix(api): "dossier de validation" menu entry is now inactive if the c…
Browse files Browse the repository at this point in the history
…andidacy status is not advanced enough
  • Loading branch information
agarbe committed Sep 2, 2024
1 parent 1fe2381 commit 0c38cb2
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,18 @@ export const getActiveCandidacyMenu = async ({
]
: ["DEMANDE_FINANCEMENT_ENVOYE", "DOSSIER_DE_VALIDATION_SIGNALE"];

menuEntryStatus = editableStatus.includes(activeCandidacyStatus)
? "ACTIVE_WITH_EDIT_HINT"
: "ACTIVE_WITHOUT_HINT";
const isCandidacyStatusAdvancedEnoughToEditDossierDeValidation =
isCandidacyStatusEqualOrAboveGivenStatus(activeCandidacyStatus);

if (
editableStatus.some((s) =>
isCandidacyStatusAdvancedEnoughToEditDossierDeValidation(s),
)
) {
menuEntryStatus = editableStatus.includes(activeCandidacyStatus)
? "ACTIVE_WITH_EDIT_HINT"
: "ACTIVE_WITHOUT_HINT";
}

url = buildUrl({
suffix: "dossier-de-validation-aap",
Expand Down

0 comments on commit 0c38cb2

Please sign in to comment.