mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 10:35:37 +00:00
fix: enhance logic
This commit is contained in:
parent
3b2f070128
commit
ca065c29d2
@ -123,7 +123,7 @@ export const Categories = () => {
|
||||
actionColumns,
|
||||
];
|
||||
const handleSelectionChange = (selection: GridRowSelectionModel) =>
|
||||
deleteDialogCtl.saveData?.(selection as string[]);
|
||||
deleteDialogCtl.setData?.(selection as string[]);
|
||||
|
||||
return (
|
||||
<Grid container gap={3} flexDirection="column">
|
||||
@ -158,7 +158,7 @@ export const Categories = () => {
|
||||
</Button>
|
||||
</Grid>
|
||||
) : null}
|
||||
{deleteDialogCtl?.data?.length && (
|
||||
{deleteDialogCtl.data?.length ? (
|
||||
<Grid item>
|
||||
<Button
|
||||
startIcon={<DeleteIcon />}
|
||||
@ -169,7 +169,7 @@ export const Categories = () => {
|
||||
{t("button.delete")}
|
||||
</Button>
|
||||
</Grid>
|
||||
)}
|
||||
) : null}
|
||||
</Grid>
|
||||
</PageHeader>
|
||||
</Grid>
|
||||
|
@ -158,7 +158,7 @@ export const ContextVars = () => {
|
||||
actionColumns,
|
||||
];
|
||||
const handleSelectionChange = (selection: GridRowSelectionModel) =>
|
||||
deleteDialogCtl.saveData?.(selection as string[]);
|
||||
deleteDialogCtl.setData?.(selection as string[]);
|
||||
|
||||
return (
|
||||
<Grid container gap={3} flexDirection="column">
|
||||
@ -193,7 +193,7 @@ export const ContextVars = () => {
|
||||
</Button>
|
||||
</Grid>
|
||||
) : null}
|
||||
{deleteDialogCtl?.data?.length && (
|
||||
{deleteDialogCtl.data?.length ? (
|
||||
<Grid item>
|
||||
<Button
|
||||
startIcon={<DeleteIcon />}
|
||||
@ -204,7 +204,7 @@ export const ContextVars = () => {
|
||||
{t("button.delete")}
|
||||
</Button>
|
||||
</Grid>
|
||||
)}
|
||||
) : null}
|
||||
</Grid>
|
||||
</PageHeader>
|
||||
<Grid item xs={12}>
|
||||
|
@ -170,7 +170,7 @@ const NlpEntity = () => {
|
||||
actionEntityColumns,
|
||||
];
|
||||
const handleSelectionChange = (selection: GridRowSelectionModel) =>
|
||||
deleteDialogCtl.saveData?.(selection as string[]);
|
||||
deleteDialogCtl.setData?.(selection as string[]);
|
||||
|
||||
return (
|
||||
<Grid item xs={12}>
|
||||
@ -202,7 +202,7 @@ const NlpEntity = () => {
|
||||
</Button>
|
||||
</Grid>
|
||||
) : null}
|
||||
{deleteDialogCtl?.data?.length && (
|
||||
{deleteDialogCtl.data?.length ? (
|
||||
<Grid item>
|
||||
<Button
|
||||
startIcon={<DeleteIcon />}
|
||||
@ -213,7 +213,7 @@ const NlpEntity = () => {
|
||||
{t("button.delete")}
|
||||
</Button>
|
||||
</Grid>
|
||||
)}
|
||||
) : null}
|
||||
</Grid>
|
||||
<Grid mt={3}>
|
||||
<DataGrid
|
||||
|
@ -291,7 +291,7 @@ export default function NlpSample() {
|
||||
actionColumns,
|
||||
];
|
||||
const handleSelectionChange = (selection: GridRowSelectionModel) =>
|
||||
deleteDialogCtl.saveData?.(selection as string[]);
|
||||
deleteDialogCtl.setData?.(selection as string[]);
|
||||
const handleImportChange = async (file: File) => {
|
||||
await importDataset(file);
|
||||
};
|
||||
@ -396,7 +396,7 @@ export default function NlpSample() {
|
||||
{t("button.export")}
|
||||
</Button>
|
||||
) : null}
|
||||
{deleteDialogCtl.data && (
|
||||
{deleteDialogCtl.data?.length ? (
|
||||
<Grid item>
|
||||
<Button
|
||||
startIcon={<DeleteIcon />}
|
||||
@ -407,7 +407,7 @@ export default function NlpSample() {
|
||||
{t("button.delete")}
|
||||
</Button>
|
||||
</Grid>
|
||||
)}
|
||||
) : null}
|
||||
</ButtonGroup>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
@ -151,7 +151,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
|
||||
|
||||
const canHaveSynonyms = nlpEntity?.lookups?.[0] === NlpLookups.keywords;
|
||||
const handleSelectionChange = (selection: GridRowSelectionModel) =>
|
||||
deleteDialogCtl.saveData?.(selection as string[]);
|
||||
deleteDialogCtl.setData?.(selection as string[]);
|
||||
|
||||
return (
|
||||
<Grid container gap={2} flexDirection="column">
|
||||
@ -202,7 +202,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
|
||||
{t("button.add")}
|
||||
</Button>
|
||||
) : null}
|
||||
{deleteDialogCtl?.data?.length && (
|
||||
{deleteDialogCtl.data?.length ? (
|
||||
<Grid item>
|
||||
<Button
|
||||
startIcon={<DeleteIcon />}
|
||||
@ -213,7 +213,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
|
||||
{t("button.delete")}
|
||||
</Button>
|
||||
</Grid>
|
||||
)}
|
||||
) : null}
|
||||
</ButtonGroup>
|
||||
</Grid>
|
||||
</PageHeader>
|
||||
|
Loading…
Reference in New Issue
Block a user