2022-03-27 15:51:48 +08:00
|
|
|
import React from "react";
|
2022-06-29 23:42:03 +08:00
|
|
|
import { ResourceActionProvider, useRecord } from "@nocobase/client";
|
2022-03-27 15:51:48 +08:00
|
|
|
|
2022-11-11 23:37:41 +08:00
|
|
|
export const ExecutionResourceProvider = ({ request, filter = {}, ...others }) => {
|
2022-03-27 15:51:48 +08:00
|
|
|
const workflow = useRecord();
|
|
|
|
const props = {
|
|
|
|
...others,
|
|
|
|
request: {
|
|
|
|
...request,
|
|
|
|
params: {
|
|
|
|
...request?.params,
|
|
|
|
filter: {
|
|
|
|
...(request?.params?.filter),
|
2022-11-11 23:37:41 +08:00
|
|
|
key: workflow.key,
|
2022-03-27 15:51:48 +08:00
|
|
|
}
|
|
|
|
}
|
2022-11-11 23:37:41 +08:00
|
|
|
}
|
2022-03-27 15:51:48 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ResourceActionProvider {...props} />
|
|
|
|
);
|
|
|
|
}
|