mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-19 22:00:45 +00:00
Add Duplicate!
This commit is contained in:
@ -29,9 +29,15 @@ import BaseLayout from "qqq/layouts/BaseLayout";
|
||||
interface Props
|
||||
{
|
||||
table?: QTableMetaData;
|
||||
isDuplicate?: boolean
|
||||
}
|
||||
|
||||
function EntityEdit({table}: Props): JSX.Element
|
||||
EntityEdit.defaultProps = {
|
||||
table: null,
|
||||
isDuplicate: false
|
||||
};
|
||||
|
||||
function EntityEdit({table, isDuplicate}: Props): JSX.Element
|
||||
{
|
||||
const {id} = useParams();
|
||||
|
||||
@ -43,7 +49,7 @@ function EntityEdit({table}: Props): JSX.Element
|
||||
<Box mb={3}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<EntityForm table={table} id={id} />
|
||||
<EntityForm table={table} id={id} isDuplicate={isDuplicate} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
@ -54,8 +60,4 @@ function EntityEdit({table}: Props): JSX.Element
|
||||
);
|
||||
}
|
||||
|
||||
EntityEdit.defaultProps = {
|
||||
table: null,
|
||||
};
|
||||
|
||||
export default EntityEdit;
|
||||
|
@ -534,6 +534,13 @@ function RecordView({table, launchProcess}: Props): JSX.Element
|
||||
Create New
|
||||
</MenuItem>
|
||||
}
|
||||
{
|
||||
table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission &&
|
||||
<MenuItem onClick={() => navigate("duplicate")}>
|
||||
<ListItemIcon><Icon>copy</Icon></ListItemIcon>
|
||||
Create Duplicate
|
||||
</MenuItem>
|
||||
}
|
||||
{
|
||||
table.capabilities.has(Capability.TABLE_UPDATE) && table.editPermission &&
|
||||
<MenuItem onClick={() => navigate("edit")}>
|
||||
|
Reference in New Issue
Block a user