[] = controls.map((control) =>
columnHelper.display({
id: control.name,
header: () => (
@@ -71,7 +71,7 @@ export const LabelingSummary = ({ annotations: all, controls, onSelect }: Props)
const annotation = row.original;
return (
- onSelect(annotation)}>
+
+
);
},
});
diff --git a/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx b/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx
index f22c10b8b74e..449a1cfcd0cb 100644
--- a/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx
+++ b/web/libs/editor/src/components/TaskSummary/TaskSummary.tsx
@@ -29,9 +29,6 @@ const TaskSummary = ({ annotations: all, store: annotationStore }: TaskSummaryPr
}
};
- // Check if agreement should be shown based on project settings
- const showAgreement = annotationStore.store.project?.review_settings?.show_agreement_to_reviewers ?? true;
-
const controlTags: [string, MSTControlTag][] = allTags.filter(([_, control]) => control.isControlTag) as [
string,
MSTControlTag,
@@ -46,7 +43,7 @@ const TaskSummary = ({ annotations: all, store: annotationStore }: TaskSummaryPr
// place all controls with the same to_name together
const grouped = Object.groupBy(controlsList, (control) => control.to_name);
// show global classifications first, then labels, then per-regions
- const controls = Object.entries(grouped).flatMap(([_, controls]) => sortControls(controls!));
+ const controls = Object.entries(grouped).flatMap(([_, controls]) => sortControls(controls ?? []));
const objectTags: ObjectTagEntry[] = allTags.filter(
([_, tag]) => tag.isObjectTag && tag.value.includes("$"),
@@ -64,13 +61,15 @@ const TaskSummary = ({ annotations: all, store: annotationStore }: TaskSummaryPr
value:
"parsedValue" in object
? object.parsedValue
+ // @ts-expect-error dataObj and _url are very specific and not added to types
: (object.dataObj ?? object._url ?? object._value ?? object.value),
},
]),
);
const values = [
- ...(showAgreement && typeof task?.agreement === "number"
+ // if agreement is unavailable for current user it's undefined
+ ...(typeof task?.agreement === "number"
? [
{
title: "Agreement",
diff --git a/web/libs/editor/src/components/TaskSummary/labelings.tsx b/web/libs/editor/src/components/TaskSummary/labelings.tsx
index 235f56ae26a0..6858f0f9ee6b 100644
--- a/web/libs/editor/src/components/TaskSummary/labelings.tsx
+++ b/web/libs/editor/src/components/TaskSummary/labelings.tsx
@@ -11,6 +11,19 @@ const resultValue = (result: RawResult) => {
return result.value[result.type];
};
+const LabelingChip = ({ children }: { children: string | number }) => {
+ return (
+
+ {children}
+
+ );
+};
+
const LabelsRenderer: RendererType = (results, control) => {
const labels = results.flatMap(resultValue).flat();
@@ -25,6 +38,7 @@ const LabelsRenderer: RendererType = (results, control) => {
.map(([label, data]) => {
return (
= {
timeserieslabels: LabelsRenderer,
paragraphlabels: LabelsRenderer,
timelinelabels: LabelsRenderer,
- number: (results) => {
+ datetime: (results, control) => {
+ if (!results.length) return "-";
+ if (control.per_region) return null;
+
+ return resultValue(results[0]);
+ },
+ number: (results, control) => {
if (!results.length) return "-";
+ if (control.per_region) return null;
return resultValue(results[0]);
},
choices: (results) => {
const choices = results.flatMap(resultValue).flat();
- const unique = [...new Set(choices)];
+ const unique: string[] = [...new Set(choices)];
if (!choices.length) return null;
return (
{unique.map((choice) => (
-
- {choice}
-
+ {choice}
+ ))}
+
+ );
+ },
+ taxonomy: (results, control) => {
+ if (!results.length) return "-";
+ if (control.per_region) return null;
+
+ // @todo use `pathseparator` from control
+ const values: string[] = resultValue(results[0]).map((item: string[]) => item.join(" / "));
+
+ return (
+
+ {values.map((value) => (
+ {value}
))}
);
@@ -82,11 +110,25 @@ export const renderers: Record = {
if (!results.length) return "-";
if (control.per_region) return null;
- const value = resultValue(results[0]);
+ const texts: string[] = resultValue(results[0]);
- if (!value) return null;
+ if (!texts) return null;
+
+ // biome-ignore lint/suspicious/noArrayIndexKey: this piece won't be rerendered with updated data anyway and texts can be huge
+ return {texts.map((text, i) =>
{text}
)}
;
+ },
+ ranker: (results) => {
+ if (!results.length) return "-";
+
+ const value: Record = resultValue(results[0]);
- return {value};
+ return Object.entries(value).map(([bucket, items]) => {
+ return (
+
+ {bucket}: {items.map(item => {item})}
+
+ );
+ });
},
rating: (results, control) => {
if (!results.length) return "-";
diff --git a/web/libs/editor/src/stores/types.d.ts b/web/libs/editor/src/stores/types.d.ts
index a4b0ecb3f05f..12b708e07939 100644
--- a/web/libs/editor/src/stores/types.d.ts
+++ b/web/libs/editor/src/stores/types.d.ts
@@ -6,6 +6,7 @@ type RawResult = {
};
type MSTResult = {
+ toJSON(): unknown;
id: string;
area: MSTRegion;
annotation: MSTAnnotation;