mirror of
https://github.com/hexastack/hexabot
synced 2025-05-08 06:44:49 +00:00
Merge branch 'main' into feat/add-doc-field-nlp-values
This commit is contained in:
commit
c2670feea3
@ -81,6 +81,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
|
||||
},
|
||||
});
|
||||
const [selectedNlpValues, setSelectedNlpValues] = useState<string[]>([]);
|
||||
const shouldIncludeSynonyms = !nlpEntity?.lookups.includes("trait");
|
||||
const actionColumns = useActionColumns<INlpValue>(
|
||||
EntityType.NLP_VALUE,
|
||||
[
|
||||
@ -102,6 +103,19 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
|
||||
],
|
||||
t("label.operations"),
|
||||
);
|
||||
const synonymsColumn = {
|
||||
flex: 3,
|
||||
field: "synonyms",
|
||||
headerName: t("label.synonyms"),
|
||||
sortable: true,
|
||||
renderCell: (params) => {
|
||||
return params.row?.expressions?.map((exp, index) => (
|
||||
<Chip sx={{ margin: 0.8 }} label={exp} variant="inbox" key={index} />
|
||||
));
|
||||
},
|
||||
disableColumnMenu: true,
|
||||
renderHeader,
|
||||
};
|
||||
const columns: GridColDef<INlpValue>[] = [
|
||||
{
|
||||
flex: 3,
|
||||
@ -119,20 +133,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
|
||||
disableColumnMenu: true,
|
||||
renderHeader,
|
||||
},
|
||||
{
|
||||
flex: 3,
|
||||
field: "synonyms",
|
||||
headerName: t("label.synonyms"),
|
||||
sortable: true,
|
||||
renderCell: (params) => {
|
||||
return params.row?.expressions?.map((exp, index) => (
|
||||
<Chip sx={{ margin: 0.8 }} label={exp} variant="inbox" key={index} />
|
||||
));
|
||||
},
|
||||
disableColumnMenu: true,
|
||||
renderHeader,
|
||||
},
|
||||
|
||||
...(shouldIncludeSynonyms ? [synonymsColumn] : []),
|
||||
{
|
||||
maxWidth: 140,
|
||||
field: "createdAt",
|
||||
|
Loading…
Reference in New Issue
Block a user