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

View File

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