Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-09-04 08:58:02 +00:00
commit e1aa2e9e0a
2 changed files with 8 additions and 3 deletions

View File

@ -853,7 +853,7 @@ export const useUpdateActionProps = () => {
const form = useForm(); const form = useForm();
const filterByTk = useFilterByTk(); const filterByTk = useFilterByTk();
const { field, resource, __parent } = useBlockRequestContext(); const { field, resource, __parent } = useBlockRequestContext();
const { setVisible, setSubmitted, setFormValueChanged } = useActionContext(); const { setVisible, setFormValueChanged } = useActionContext();
const actionSchema = useFieldSchema(); const actionSchema = useFieldSchema();
const navigate = useNavigateNoUpdate(); const navigate = useNavigateNoUpdate();
const { fields, getField, name } = useCollection_deprecated(); const { fields, getField, name } = useCollection_deprecated();
@ -867,7 +867,7 @@ export const useUpdateActionProps = () => {
const { getActiveFieldsName } = useFormActiveFields() || {}; const { getActiveFieldsName } = useFormActiveFields() || {};
return { return {
async onClick() { async onClick(e?, callBack?) {
const { const {
assignedValues: originalAssignedValues = {}, assignedValues: originalAssignedValues = {},
onSuccess, onSuccess,
@ -930,8 +930,10 @@ export const useUpdateActionProps = () => {
}); });
actionField.data.loading = false; actionField.data.loading = false;
// __parent?.service?.refresh?.(); // __parent?.service?.refresh?.();
if (callBack) {
callBack?.();
}
setVisible?.(false); setVisible?.(false);
setSubmitted?.(true);
setFormValueChanged?.(false); setFormValueChanged?.(false);
if (!onSuccess?.successMessage) { if (!onSuccess?.successMessage) {
return; return;

View File

@ -172,6 +172,7 @@ export const Action: ComposedAction = withDynamicSchemaProps(
run, run,
confirm, confirm,
modal, modal,
setSubmitted: setParentSubmitted,
}; };
const buttonElement = RenderButton(buttonProps); const buttonElement = RenderButton(buttonProps);
@ -304,6 +305,7 @@ function RenderButton({
run, run,
confirm, confirm,
modal, modal,
setSubmitted,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { isPopupVisibleControlledByURL } = usePopupSettings(); const { isPopupVisibleControlledByURL } = usePopupSettings();
@ -322,6 +324,7 @@ function RenderButton({
if (onClick) { if (onClick) {
onClick(e, () => { onClick(e, () => {
if (refreshDataBlockRequest !== false) { if (refreshDataBlockRequest !== false) {
setSubmitted?.(true);
service?.refresh?.(); service?.refresh?.();
} }
}); });