mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix(user-data-sync): fix the issue where the "retry" button is not displayed in the task list (#6079)
This commit is contained in:
parent
b89901e0d9
commit
87513c0c9c
@ -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,
|
||||
|
@ -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',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user