From 974bd287c508ab0d41398b4c986860f492356740 Mon Sep 17 00:00:00 2001 From: "Philipp Heil (zkdev)" Date: Tue, 16 Jun 2026 16:12:44 +0200 Subject: [PATCH 1/2] feat(rescorings): Allow rescorings to same category again Useful to allow commenting on findings without re-rating. Signed-off-by: Philipp Heil (zkdev) --- src/rescoring.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/rescoring.js b/src/rescoring.js index 93a0386..9c3efac 100644 --- a/src/rescoring.js +++ b/src/rescoring.js @@ -172,10 +172,7 @@ const rescoringIdentity = (rescoring) => { const rescoringNeedsComment = (rescoring) => { return ( rescoring.matching_rules.includes(META_RESCORING_RULES.CUSTOM_RESCORING) - && ( - rescoring.severity !== rescoring.originalSeverityProposal - || rescoring.due_date !== rescoring.originalDueDate - ) && !rescoring.comment + && !rescoring.comment ) } @@ -3663,10 +3660,6 @@ const RescoringModal = ({ // input and the due date has changed return ( selectedRescorings.find((r) => rescoringIdentity(r) === rescoringIdentity(rescoring)) - && ( - rescoring.severity !== categoriseRescoringProposal({rescoring, findingCfg}).id - || rescoring.due_date !== rescoring.originalDueDate - ) ) }) const filteredOutRescoringsLength = filteredRescorings ? selectedRescorings.length - allowedRescorings.length : 0 From d07f9d53c0397e0c8833eebfcc88c9e6a821e2d8 Mon Sep 17 00:00:00 2001 From: "Philipp Heil (zkdev)" Date: Tue, 16 Jun 2026 16:23:45 +0200 Subject: [PATCH 2/2] fix(rescoring): Only validate to-be applied rescorings Now that rescorings to the very same category are allowed again, we cannot rely on the severity-did-change semantic any longer to control validation. Instead, only validate those which are selected and intended to be sent to backend. Signed-off-by: Philipp Heil (zkdev) --- src/rescoring.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rescoring.js b/src/rescoring.js index 9c3efac..a855f30 100644 --- a/src/rescoring.js +++ b/src/rescoring.js @@ -169,10 +169,11 @@ const rescoringIdentity = (rescoring) => { } -const rescoringNeedsComment = (rescoring) => { +const rescoringNeedsComment = (rescoring, isSelected = true) => { return ( rescoring.matching_rules.includes(META_RESCORING_RULES.CUSTOM_RESCORING) && !rescoring.comment + && isSelected ) } @@ -2668,7 +2669,7 @@ const RescoringContentTableRow = ({ defaultValue={rescoring.comment} onChange={(e) => delayRescoringUpdate({comment: e.target.value})} onClick={(e) => e.stopPropagation()} - error={rescoringNeedsComment(rescoring)} + error={rescoringNeedsComment(rescoring, Boolean(selectedRescorings.find((r) => rescoringIdentity(r) === rescoringIdentity(rescoring))))} size='small' maxRows={4} InputProps={{ @@ -3439,7 +3440,7 @@ const Rescore = ({ Apply Rescoring - const customRescoringsWithoutComment = rescorings.filter(rescoringNeedsComment) + const customRescoringsWithoutComment = rescorings.filter(r => rescoringNeedsComment(r, true)) if (customRescoringsWithoutComment.length > 0) return { - // only rescorings are allowed iff their severity has changed OR they allow a custom due date - // input and the due date has changed + // only rescorings are allowed iff they are selected and not filtered out return ( selectedRescorings.find((r) => rescoringIdentity(r) === rescoringIdentity(rescoring)) ) @@ -3856,7 +3856,7 @@ const RescoringModal = ({ filteredOutRescoringsLength > 0 &&