Skip to content

Commit 5aaeb39

Browse files
Labeling page display fix
1 parent 5ced565 commit 5aaeb39

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/components/projects/projectId/labeling/sessionId/sub-components/LabelingSuiteLabeling.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { createLabel } from "@/src/services/base/labeling-tasks";
2828
import { addClassificationLabels, addExtractionLabel, deleteRecordLabelAssociationByIds, removeGoldStar, setGoldStar } from "@/src/services/base/labeling"
2929
import KernButton from "@/submodules/react-components/components/kern-button/KernButton"
3030
import { MemoIconAlertCircle, MemoIconAssembly, MemoIconBolt, MemoIconCode, MemoIconStar } from "@/submodules/react-components/components/kern-icons/icons"
31+
import { DataTypeEnum } from "@/src/types/shared/general"
3132

3233
const L_VARS = getDefaultLabelingVars();
3334

@@ -568,9 +569,20 @@ export default function LabelingSuiteLabeling() {
568569
}}
569570
setSelected={(start, end, e) => setSelected(attribute.id, start, end, e)} />) : (<>
570571
{(recordRequests.record.data[lVars.taskLookup[attribute.id].attribute.name] != null && recordRequests.record.data[lVars.taskLookup[attribute.id].attribute.name] !== '') ?
571-
(<p className={`break-words text-sm leading-5 font-normal text-gray-500 ${settings.main.lineBreaks != LineBreaksType.NORMAL ? (settings.main.lineBreaks == LineBreaksType.IS_PRE_WRAP ? 'whitespace-pre-wrap' : 'whitespace-pre-line') : ''}`}>
572-
{`${recordRequests.record.data[lVars.taskLookup[attribute.id].attribute.name]}`}
573-
</p>) : (<>
572+
(<>
573+
{(attribute.dataType == DataTypeEnum.TEXT_LIST || attribute.dataType == DataTypeEnum.EMBEDDING_LIST) ? <div className="flex flex-col gap-y-1 divide-y w-fit">
574+
{recordRequests.record.data[lVars.taskLookup[attribute.id].attribute.name].map((text, index) => (
575+
<p key={index} className={`break-words text-sm leading-5 font-normal text-gray-500 ${settings.main.lineBreaks != LineBreaksType.NORMAL ? (settings.main.lineBreaks == LineBreaksType.IS_PRE_WRAP ? 'whitespace-pre-wrap' : 'whitespace-pre-line') : ''}`}>
576+
{text}
577+
</p>
578+
))}
579+
</div> :
580+
<p className={`break-words text-sm leading-5 font-normal text-gray-500 ${settings.main.lineBreaks != LineBreaksType.NORMAL ? (settings.main.lineBreaks == LineBreaksType.IS_PRE_WRAP ? 'whitespace-pre-wrap' : 'whitespace-pre-line') : ''}`}>
581+
{`${recordRequests.record.data[lVars.taskLookup[attribute.id].attribute.name]}`}
582+
</p>
583+
}
584+
</>
585+
) : (<>
574586
<MemoIconAlertCircle className="text-yellow-700 inline-block h-5 w-5" />
575587
<span className="text-gray-500 text-sm font-normal italic">Not present in the
576588
record</span>

src/util/components/projects/projectId/settings/data-schema-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function getColorForDataType(dataType): string {
5555
case DataTypeEnum.FLOAT: return 'purple';
5656
case DataTypeEnum.EMBEDDING_LIST: return 'rose';
5757
case DataTypeEnum.LLM_RESPONSE: return 'emerald';
58-
case DataTypeEnum.TEXT_LIST: return 'blue';
58+
case DataTypeEnum.TEXT_LIST: return 'teal';
5959
default: return 'gray';
6060
}
6161
}

0 commit comments

Comments
 (0)