Skip to content

fix: BROS-111: Hide PII when Annotator Firewall is enabled #7813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions web/libs/editor/src/components/TaskSummary/LabelingSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<AnnotationSummary> }) => {
Expand All @@ -34,12 +35,20 @@ const convertPredictionResult = (result: MSTResult) => {

const columnHelper = createColumnHelper<AnnotationSummary>();

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) ?? [])
Expand Down Expand Up @@ -82,8 +91,8 @@ export const LabelingSummary = ({ annotations: all, controls, onSelect }: Props)
>
{annotation.type === "prediction" && <IconSparks size={18} />}
</Userpic>
<span>{annotation.user?.displayName ?? annotation.createdBy}</span>
<span>#{annotation.id}</span>
<span>{annotation.createdBy}</span>
{!hideInfo && <span>#{annotation.id}</span>}
</button>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ const TaskSummary = ({ annotations: all, store: annotationStore }: TaskSummaryPr
<div className="p-4">
<h2 className="px-4 mb-4">Review Summary</h2>
<NumbersSummary values={values} />
<LabelingSummary annotations={annotations} controls={controls} onSelect={onSelect} />
<LabelingSummary
annotations={annotations}
controls={controls}
onSelect={onSelect}
hideInfo={annotationStore.store.hasInterface("annotations:hide-info")}
/>
<h2 className="px-4">Task Data</h2>
<DataSummary data_types={dataTypes} />
</div>
Expand Down
Loading