From d398a7e8e8cadfd3c3d6fe70616c4b7f1456b060 Mon Sep 17 00:00:00 2001 From: hlomzik Date: Mon, 23 Jun 2025 10:15:27 +0100 Subject: [PATCH 1/3] fix: BROS-111: Hide PII when Annotator Firewall is enabled --- .../components/TaskSummary/LabelingSummary.tsx | 17 +++++++++++++---- .../src/components/TaskSummary/TaskSummary.tsx | 7 ++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx b/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx index ff914f6a2f31..d588248067a8 100644 --- a/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx +++ b/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx @@ -12,6 +12,7 @@ type Props = { annotations: MSTAnnotation[]; controls: ControlTag[]; onSelect: (entity: AnnotationSummary) => void; + hideInfo: boolean; }; const cellFn = (control: ControlTag, render: RendererType) => (props: { row: Row }) => { @@ -34,12 +35,20 @@ const convertPredictionResult = (result: MSTResult) => { const columnHelper = createColumnHelper(); -export const LabelingSummary = ({ annotations: all, controls, onSelect }: Props) => { +export const LabelingSummary = ({ hideInfo, annotations: all, controls, onSelect }: Props) => { + const currentUser = window.APP_SETTINGS?.user; const annotations: AnnotationSummary[] = all.map((annotation) => ({ id: annotation.pk, type: annotation.type, - user: annotation.user, - createdBy: annotation.user?.displayName ?? annotation.createdBy, + user: hideInfo ? { email: currentUser?.id === annotation.user?.id ? "Me" : "User" } : annotation.user, + createdBy: + annotation.type === "prediction" + ? annotation.createdBy + : hideInfo + ? currentUser?.id === annotation.user?.id + ? "Me" + : "User" + : annotation.user?.displayName ?? "User", results: annotation.type === "prediction" ? (annotation.results?.map(convertPredictionResult) ?? []) @@ -82,7 +91,7 @@ export const LabelingSummary = ({ annotations: all, controls, onSelect }: Props) > {annotation.type === "prediction" && } - {annotation.user?.displayName ?? annotation.createdBy} + {annotation.createdBy} #{annotation.id} ); diff --git a/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx b/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx index 0fcdbc3d429b..353220f2fd73 100644 --- a/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx +++ b/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx @@ -93,7 +93,12 @@ const TaskSummary = ({ annotations: all, store: annotationStore }: TaskSummaryPr

Review Summary

- +

Task Data

From e82a889aba6abce65c222252c8c19a8a947d590c Mon Sep 17 00:00:00 2001 From: hlomzik Date: Mon, 23 Jun 2025 11:33:30 +0100 Subject: [PATCH 2/3] Fix linting (again) --- web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx b/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx index d588248067a8..10e638f565a0 100644 --- a/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx +++ b/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx @@ -48,7 +48,7 @@ export const LabelingSummary = ({ hideInfo, annotations: all, controls, onSelect ? currentUser?.id === annotation.user?.id ? "Me" : "User" - : annotation.user?.displayName ?? "User", + : (annotation.user?.displayName ?? "User"), results: annotation.type === "prediction" ? (annotation.results?.map(convertPredictionResult) ?? []) From 1330132dcaee9ec13ab289a466a89aca7fcebd34 Mon Sep 17 00:00:00 2001 From: hlomzik Date: Mon, 23 Jun 2025 11:38:04 +0100 Subject: [PATCH 3/3] Hide id as well to remove bias --- web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx b/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx index 10e638f565a0..96c7bc0add4a 100644 --- a/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx +++ b/web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx @@ -92,7 +92,7 @@ export const LabelingSummary = ({ hideInfo, annotations: all, controls, onSelect {annotation.type === "prediction" && } {annotation.createdBy} - #{annotation.id} + {!hideInfo && #{annotation.id}} ); },