Skip to content

Table Maintenance #3440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/CippCards/CippPropertyListCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ export const CippPropertyListCard = (props) => {
action: item,
ready: true,
});
createDialog.handleOpen();
if (item?.noConfirm) {
item.customFunction(item, data, {});
} else {
createDialog.handleOpen();
}
}
}
disabled={handleActionDisabled(data, item)}
Expand Down
17 changes: 13 additions & 4 deletions src/components/CippComponents/CippApiDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const CippApiDialog = (props) => {
bulkRequest: api.multiPost === false,
onResult: (result) => {
setPartialResults((prevResults) => [...prevResults, result]);
if (api?.onSuccess) {
api.onSuccess(result);
}
},
});
const actionGetRequest = ApiGetCall({
Expand All @@ -50,6 +53,9 @@ export const CippApiDialog = (props) => {
bulkRequest: api.multiPost === false,
onResult: (result) => {
setPartialResults((prevResults) => [...prevResults, result]);
if (api?.onSuccess) {
api.onSuccess(result);
}
},
});

Expand All @@ -58,6 +64,8 @@ export const CippApiDialog = (props) => {
return api.dataFunction(row);
}
var newData = {};
console.log("the received row", row);
console.log("the received dataObject", dataObject);

if (api?.postEntireRow) {
newData = row;
Expand Down Expand Up @@ -85,6 +93,7 @@ export const CippApiDialog = (props) => {
}
});
}
console.log("output", newData);
return newData;
};
const tenantFilter = useSettings().currentTenant;
Expand Down Expand Up @@ -209,10 +218,10 @@ export const CippApiDialog = (props) => {
}
useEffect(() => {
if (api.noConfirm) {
formHook.handleSubmit(onSubmit)();
createDialog.handleClose();
formHook.handleSubmit(onSubmit)(); // Submits the form on mount
createDialog.handleClose(); // Closes the dialog after submitting
}
}, [api.noConfirm]);
}, [api.noConfirm]); // Run effect only when api.noConfirm changes

const handleClose = () => {
createDialog.handleClose();
Expand Down Expand Up @@ -251,7 +260,7 @@ export const CippApiDialog = (props) => {
Close
</Button>
<Button variant="contained" type="submit">
{actionGetRequest.isSuccess || actionPostRequest.isSuccess ? "Resubmit" : "Submit"}
Confirm
</Button>
</DialogActions>
</form>
Expand Down
5 changes: 5 additions & 0 deletions src/layouts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ export const nativeMenuItems = [
path: "/cipp/advanced/timers",
roles: ["superadmin"],
},
{
title: "Table Maintenance",
path: "/cipp/advanced/table-maintenance",
roles: ["superadmin"],
}
],
},
],
Expand Down
Loading
Loading