Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
AE-1987: If recipient didn't answer, related fields are marked as opt…
Browse files Browse the repository at this point in the history
…ional in schema and hidden in UI for käskypäätös / varsinainen päätös toimenpidetype
  • Loading branch information
Juholei committed Oct 6, 2023
1 parent 7d1b92b commit 7561f59
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/pages/valvonta-kaytto/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,44 @@ export const toimenpidePublish = (templates, toimenpide) =>
],
toimenpide
);
// TODO: Siisti toisteisuus, pakollisuudet kentille sen perusteella saatiinko vastaus

const recipientAnswered = R.path(
[
'type-specific-data',
'osapuoli-specific-data',
index,
'recipient-answered'
],
toimenpide
);
// TODO: Siisti toisteisuus
return R.compose(
R.over(
R.lensProp('statement-sv'),
addRequiredValidator(
Toimenpiteet.isDecisionOrderActualDecision(toimenpide)
Toimenpiteet.isDecisionOrderActualDecision(toimenpide) &&
recipientAnswered
)
),
R.over(
R.lensProp('statement-fi'),
addRequiredValidator(
Toimenpiteet.isDecisionOrderActualDecision(toimenpide)
Toimenpiteet.isDecisionOrderActualDecision(toimenpide) &&
recipientAnswered
)
),
R.over(
R.lensProp('answer-commentary-sv'),
addRequiredValidator(
Toimenpiteet.isDecisionOrderActualDecision(toimenpide)
Toimenpiteet.isDecisionOrderActualDecision(toimenpide) &&
recipientAnswered
)
),
R.over(
R.lensProp('answer-commentary-fi'),
addRequiredValidator(
Toimenpiteet.isDecisionOrderActualDecision(toimenpide)
Toimenpiteet.isDecisionOrderActualDecision(toimenpide) &&
recipientAnswered
)
),
R.over(
Expand Down

0 comments on commit 7561f59

Please sign in to comment.