feat: add grid display for NLU values based on types of NLU entity

This commit is contained in:
Mohamed Marrouchi 2025-03-21 13:40:51 +01:00
parent e0a77302cc
commit d17b920fcf

View File

@ -81,6 +81,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
},
});
const [selectedNlpValues, setSelectedNlpValues] = useState<string[]>([]);
const shouldIncludeSynonyms = nlpEntity?.lookups.includes("keywords");
const actionColumns = useActionColumns<INlpValue>(
EntityType.NLP_VALUE,
[
@ -102,16 +103,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
],
t("label.operations"),
);
const columns: GridColDef<INlpValue>[] = [
{
flex: 3,
field: "value",
headerName: t("label.value"),
sortable: true,
disableColumnMenu: true,
renderHeader,
},
{
const synonymsColumn = {
flex: 3,
field: "synonyms",
headerName: t("label.synonyms"),
@ -123,8 +115,17 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
},
disableColumnMenu: true,
renderHeader,
};
const columns: GridColDef<INlpValue>[] = [
{
flex: 3,
field: "value",
headerName: t("label.value"),
sortable: true,
disableColumnMenu: true,
renderHeader,
},
...(shouldIncludeSynonyms ? [synonymsColumn] : []),
{
maxWidth: 140,
field: "createdAt",