Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2025-01-16 10:32:16 +00:00
commit 9df77bdcc2
2 changed files with 25 additions and 5 deletions

View File

@ -248,6 +248,29 @@ const Tasks = () => {
) : null;
};
const Retry = () => {
const { t } = useUserDataSyncSourceTranslation();
const record = useCollectionRecordData();
if (record.status !== 'failed') {
return null;
}
return (
<SchemaComponent
scope={{ t }}
schema={{
type: 'void',
properties: {
retry: {
title: '{{ t("Retry") }}',
'x-component': 'Action.Link',
'x-use-component-props': 'useRetryActionProps',
},
},
}}
/>
);
};
export const UserDataSyncSource: React.FC = () => {
const { t } = useUserDataSyncSourceTranslation();
const [types, setTypes] = useState([]);
@ -277,7 +300,7 @@ export const UserDataSyncSource: React.FC = () => {
<ExtendCollectionsProvider collections={[sourceCollection]}>
<SchemaComponent
schema={userDataSyncSourcesSchema}
components={{ AddNew, Options, Tasks }}
components={{ AddNew, Options, Tasks, Retry }}
scope={{
types,
t,

View File

@ -290,10 +290,7 @@ export const tasksTableBlockSchema: ISchema = {
properties: {
sync: {
type: 'void',
title: '{{ t("Retry") }}',
'x-component': 'Action.Link',
'x-use-component-props': 'useRetryActionProps',
'x-display': '{{ $record.status === "failed" ? "visible" : "hidden" }}',
'x-component': 'Retry',
},
},
},