Skip to content

Commit e50b8b2

Browse files
text list attribute
1 parent 89c5d40 commit e50b8b2

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/components/projects/projectId/attributes/attributeId/ExecutionContainer.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,16 @@ export default function ExecutionContainer(props: ExecutionContainerProps) {
7575
const sampleRecordsFinal = useMemo(() => {
7676
if (sampleRecords && sampleRecords.calculatedAttributesDisplay) {
7777
return sampleRecords.calculatedAttributesDisplay.map((record: any, index) => {
78-
const calculatedValue = currentAttributesRef.current.dataType != DataTypeEnum.EMBEDDING_LIST ? record : { id: record.id, value: JSON.parse(record.value) }
78+
let calculatedValue;
79+
if (currentAttributesRef.current.dataType == DataTypeEnum.EMBEDDING_LIST) {
80+
calculatedValue = { id: record.id, value: JSON.parse(record.value) };
81+
}
82+
if (currentAttributesRef.current.dataType == DataTypeEnum.TEXT_LIST) {
83+
calculatedValue = { id: record.id, value: JSON.stringify(record) };
84+
}
85+
else {
86+
calculatedValue = record
87+
}
7988
return {
8089
...record,
8190
onClick: viewRecordDetails(index),
@@ -85,7 +94,6 @@ export default function ExecutionContainer(props: ExecutionContainerProps) {
8594
);
8695
}
8796
}, [sampleRecords]);
88-
8997
return (<div>
9098
<div className="mt-8 text-sm leading-5">
9199
<div className="text-gray-700 font-medium mr-2">
@@ -136,7 +144,7 @@ export default function ExecutionContainer(props: ExecutionContainerProps) {
136144
<div key={record.id} className="divide-y divide-gray-200 bg-white">
137145
<div className="flex-shrink-0 border-b border-gray-200 shadow-sm flex justify-between items-center">
138146
<div className="flex items-center text-xs leading-5 text-gray-500 font-normal mx-4 my-3 text-justify">
139-
{String(record.value)}
147+
{String(record?.calculatedValue?.value)}
140148
</div>
141149
<div className="flex items-center justify-center mr-5 ml-auto">
142150
<KernButton

src/types/shared/general.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ export enum DataTypeEnum {
2222
EMBEDDING_LIST = "EMBEDDING_LIST",
2323
LLM_RESPONSE = "LLM_RESPONSE",
2424
PERMISSION = "PERMISSION",
25+
TEXT_LIST = "TEXT_LIST",
2526
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const DATA_TYPES = [
1111
{ name: 'Embedding List', value: 'EMBEDDING_LIST' },
1212
{ name: 'LLM Response', value: 'LLM_RESPONSE' },
1313
{ name: 'Permission', value: 'PERMISSION' },
14+
{ name: 'Text List', value: 'TEXT_LIST' }
1415
];
1516

1617
export const ATTRIBUTES_VISIBILITY_STATES = [

0 commit comments

Comments
 (0)