mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
* refactor: fix warning by codemod * refactor: fix warning of Dropdown * perf: use memo * refactor: resolve SchemaInitializer * refactor: fix lint * refactor: remove SettingsForm * refactor: resolve SchemaInitializer * refactor: fix lint * refactor: move useMenuItem to root dir * chore: fix conflicts * refactor: resolve SchemaSetting * refactor: fix lint * test: fix failed * chore: upgrade Vite * fix: fix style * refactor: fix lint * refactor: extract component * refactor: resovle Menu * refactor: resolve Tabs * refactor(getPopupContainer): should return the unique div * refactor(Drawer): change style to rootStyle and className to rootClassName * chore: update yarn.lock * fix: fix T-432 * fix: fix T-338 * fix: fix T-490 * fix: collection fields * fix: fix style * fix: fix T-500 * fix: fix SettingMenu error (close T-516) * fix: fix tanslation of Map (T-506) * style: fix style (T-508) * fix: fix schemaSetting switch of mobile (T-517) * fix: fix T-518 * fix: fix T-524 * fix: fix T-507 * perf: optimize SchemaInitializer.Button * perf: optimize SchemaSettings * fix: fix serch of SchemaInitializer (T-547) * chore: change delay * fix: fix button style (T-548) * fix: fix scroll bar * fix: update yarn.lock * fix: fix build error * fix: should update sideMenu when change it * fix: fix build error * chore: mouseEnterDelay * fix: fix group menu can not selected
31 lines
906 B
TypeScript
31 lines
906 B
TypeScript
import { CopyOutlined } from '@ant-design/icons';
|
|
import { OverridingFieldAction as OverridingCollectionFieldAction } from '@nocobase/client';
|
|
import React from 'react';
|
|
import { useCancelAction, useCreateAction } from '../action-hooks';
|
|
import { getPopupContainer } from '../utils';
|
|
|
|
const useOverridingCollectionField = (record) => {
|
|
const collectionName = record.targetCollection;
|
|
const { run } = useCreateAction(collectionName);
|
|
return {
|
|
async run() {
|
|
await run();
|
|
},
|
|
};
|
|
};
|
|
|
|
export const OverrideFieldAction = ({ item: record }) => {
|
|
return (
|
|
<OverridingCollectionFieldAction
|
|
item={{ ...record }}
|
|
scope={{
|
|
useCancelAction,
|
|
useOverridingCollectionField: () => useOverridingCollectionField(record),
|
|
}}
|
|
getContainer={getPopupContainer}
|
|
>
|
|
<CopyOutlined className="btn-override" />
|
|
</OverridingCollectionFieldAction>
|
|
);
|
|
};
|