From 3f4c92860c987fdcc7499255b32298a19daa7998 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Fri, 12 Dec 2025 08:48:07 +0200 Subject: [PATCH 1/8] Potential fix for code scanning alert no. 71: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/apps/review/src/lib/utils/metadataMatching.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/apps/review/src/lib/utils/metadataMatching.ts b/src/apps/review/src/lib/utils/metadataMatching.ts index e41c6fd58..aa18006f1 100644 --- a/src/apps/review/src/lib/utils/metadataMatching.ts +++ b/src/apps/review/src/lib/utils/metadataMatching.ts @@ -112,9 +112,14 @@ export function findMetadataPhaseMatch( return { source: 'stringExact' } } - const escapedTarget = escapeRegexLiteral(target) - .replace(/ /g, '\\ ') - const sepInsensitive = new RegExp(`\\b${escapedTarget.replace(/\\ /g, '[-_\\s]+')}\\b`) + // Replace all sequences of space, underscore, or hyphen in the target with a placeholder + const WORDSEP_PLACEHOLDER = '__WORDSEP__'; + const sepPattern = /[ \-_]+/g; + const targetWithPlaceholder = target.replace(sepPattern, WORDSEP_PLACEHOLDER); + // Properly escape ALL regex metacharacters (including backslash), leaving the placeholder intact + const escapedTarget = escapeRegexLiteral(targetWithPlaceholder) + .replace(new RegExp(escapeRegexLiteral(WORDSEP_PLACEHOLDER), 'g'), '[-_\\s]+'); + const sepInsensitive = new RegExp(`\\b${escapedTarget}\\b`); if (sepInsensitive.test(normalizedMetadata)) { return { source: 'stringBoundary' } } From 99c96d7978205ded939ef074346f8776a4299d3f Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Fri, 12 Dec 2025 08:54:21 +0200 Subject: [PATCH 2/8] Potential fix for code scanning alert no. 69: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../lib/components/FieldMarkdownEditor/FieldMarkdownEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/review/src/lib/components/FieldMarkdownEditor/FieldMarkdownEditor.tsx b/src/apps/review/src/lib/components/FieldMarkdownEditor/FieldMarkdownEditor.tsx index 58897ba0c..6a76e9139 100644 --- a/src/apps/review/src/lib/components/FieldMarkdownEditor/FieldMarkdownEditor.tsx +++ b/src/apps/review/src/lib/components/FieldMarkdownEditor/FieldMarkdownEditor.tsx @@ -135,7 +135,7 @@ const toggleStrategy = { }, italic: (start: any, end: any) => { const startType = start.replace(/(\*|_)(?![\s\S]*(\*|_))/, '') - const endType = end.replace(/(\*|_)/, '') + const endType = end.replace(/(\*|_)/g, '') return { endType, startType } }, strikethrough: (start: any, end: any) => { From 020c2300b7303c6627503afe108d66bc53fc1dd9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Dec 2025 06:56:28 +0000 Subject: [PATCH 3/8] Initial plan From 6bd27a917976691037302ae3cab29d7f0e408564 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Dec 2025 07:02:31 +0000 Subject: [PATCH 4/8] Fix ESLint semicolon errors in metadataMatching.ts Co-authored-by: kkartunov <5585002+kkartunov@users.noreply.github.com> --- src/apps/review/src/lib/utils/metadataMatching.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/apps/review/src/lib/utils/metadataMatching.ts b/src/apps/review/src/lib/utils/metadataMatching.ts index aa18006f1..2279bfe00 100644 --- a/src/apps/review/src/lib/utils/metadataMatching.ts +++ b/src/apps/review/src/lib/utils/metadataMatching.ts @@ -113,13 +113,13 @@ export function findMetadataPhaseMatch( } // Replace all sequences of space, underscore, or hyphen in the target with a placeholder - const WORDSEP_PLACEHOLDER = '__WORDSEP__'; - const sepPattern = /[ \-_]+/g; - const targetWithPlaceholder = target.replace(sepPattern, WORDSEP_PLACEHOLDER); + const WORDSEP_PLACEHOLDER = '__WORDSEP__' + const sepPattern = /[ \-_]+/g + const targetWithPlaceholder = target.replace(sepPattern, WORDSEP_PLACEHOLDER) // Properly escape ALL regex metacharacters (including backslash), leaving the placeholder intact const escapedTarget = escapeRegexLiteral(targetWithPlaceholder) - .replace(new RegExp(escapeRegexLiteral(WORDSEP_PLACEHOLDER), 'g'), '[-_\\s]+'); - const sepInsensitive = new RegExp(`\\b${escapedTarget}\\b`); + .replace(new RegExp(escapeRegexLiteral(WORDSEP_PLACEHOLDER), 'g'), '[-_\\s]+') + const sepInsensitive = new RegExp(`\\b${escapedTarget}\\b`) if (sepInsensitive.test(normalizedMetadata)) { return { source: 'stringBoundary' } } From 3ec6382d491bb5c4f486031bd0c1bb1304d2e0de Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Fri, 12 Dec 2025 10:43:53 +0100 Subject: [PATCH 5/8] Revert "fix(PM-2573): show only submissions with passed screening score" --- .../components/TableReview/TableReview.tsx | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/apps/review/src/lib/components/TableReview/TableReview.tsx b/src/apps/review/src/lib/components/TableReview/TableReview.tsx index 17c2662ac..eb07bb1bb 100644 --- a/src/apps/review/src/lib/components/TableReview/TableReview.tsx +++ b/src/apps/review/src/lib/components/TableReview/TableReview.tsx @@ -266,21 +266,11 @@ export const TableReview: FC = (props: TableReviewProps) => { const minimumPassingScoreByScorecardId = useScorecardPassingScores(scorecardIds) const aggregatedRows = useMemo(() => { - const rows = aggregatedSubmissionRows - .filter(aggregated => { - const reviews = aggregated.reviews ?? [] - const myReviewDetail = reviews.find(review => { - const resourceId = review.reviewInfo?.resourceId ?? review.resourceId - return resourceId ? myReviewerResourceIds.has(resourceId) : false - }) - - return !!myReviewDetail?.reviewId - }) - .map(aggregated => ({ - ...(aggregated.submission ?? {}), - ...aggregated.submission, - aggregated, - })) as SubmissionRow[] + const rows = aggregatedSubmissionRows.map(aggregated => ({ + ...(aggregated.submission ?? {}), + ...aggregated.submission, + aggregated, + })) as SubmissionRow[] if (!restrictToLatest) { return rows From 730a58af756b314c8c5be5c57959da96abe7e7dc Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Fri, 12 Dec 2025 10:45:01 +0100 Subject: [PATCH 6/8] deploy revert --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f3cac937..0cd8f2298 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -226,7 +226,7 @@ workflows: branches: only: - dev - - pm-3141_3 + - revert-1373-pm-2573 - deployQa: context: org-global From 4b2432450041a3cb5da973780a80437c6b4888a7 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Fri, 12 Dec 2025 11:42:32 +0100 Subject: [PATCH 7/8] fix: add manager comment button showing to submitters and normal reviewer --- .../ReviewManagerComment/ReviewManagerComment.tsx | 3 ++- .../ScorecardViewer/ScorecardViewer.context.tsx | 4 ++++ .../Scorecard/ScorecardViewer/ScorecardViewer.tsx | 2 ++ .../src/lib/components/TableAppeals/TableAppeals.tsx | 1 + .../TableAppealsResponse/TableAppealsResponse.tsx | 5 +++-- .../src/lib/components/common/TableColumnRenderers.tsx | 10 ++++++++-- src/apps/review/src/lib/components/common/types.ts | 2 ++ src/apps/review/src/lib/utils/routes.ts | 6 +++++- .../reviews/components/ReviewViewer/ReviewViewer.tsx | 6 ++++++ 9 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/ReviewResponse/ReviewManagerComment/ReviewManagerComment.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/ReviewResponse/ReviewManagerComment/ReviewManagerComment.tsx index 99ace9f3c..82f26a1a8 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/ReviewResponse/ReviewManagerComment/ReviewManagerComment.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/ReviewResponse/ReviewManagerComment/ReviewManagerComment.tsx @@ -31,6 +31,7 @@ interface ReviewManagerCommentProps { const ReviewManagerComment: FC = props => { const { isManagerEdit, + canAddManagerComment, isSavingManagerComment, addManagerComment, }: ScorecardViewerContextValue = useScorecardViewerContext() @@ -131,7 +132,7 @@ const ReviewManagerComment: FC = props => { )} - {!showCommentForm && !comment && isManagerEdit && ( + {!showCommentForm && !comment && isManagerEdit && canAddManagerComment && (