diff --git a/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupBlockConfigure.tsx b/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupBlockConfigure.tsx index 7e70e5a60..f20917878 100644 --- a/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupBlockConfigure.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupBlockConfigure.tsx @@ -2,7 +2,7 @@ import { SchemaSettingsItem } from '@nocobase/client'; import React, { useContext } from 'react'; import { useTranslation } from '../../locale'; import { Modal } from 'antd'; -import { GroupBlockContext } from '../../schema-initializer/GroupBlockInitializer'; +import { GroupBlockContext } from '../../schema-initializer/blocks/GroupBlockInitializer'; export const GroupBlockConfigure = (props) => { const { t } = useTranslation(); diff --git a/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupConfigure.tsx b/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupConfigure.tsx index e6888b9d5..7c143cdd2 100644 --- a/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupConfigure.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/components/GroupBlockConfigure/GroupConfigure.tsx @@ -3,7 +3,7 @@ import { useDesignable, useFieldNames, useFilterBlock } from '@nocobase/client'; import { App, Button, Flex, Input, Modal, Select } from 'antd'; import React, { useContext, useEffect, useState } from 'react'; import { useTranslation } from '../../locale'; -import { GroupBlockContext } from '../../schema-initializer/GroupBlockInitializer'; +import { GroupBlockContext } from '../../schema-initializer/blocks/GroupBlockInitializer'; import { transformers } from './transformers'; import { DeleteOutlined, PullRequestOutlined } from '@ant-design/icons'; import { uid } from '@formily/shared'; diff --git a/packages/plugins/@hera/plugin-core/src/client/index.tsx b/packages/plugins/@hera/plugin-core/src/client/index.tsx index 109bd0174..f5bf0a6e6 100644 --- a/packages/plugins/@hera/plugin-core/src/client/index.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/index.tsx @@ -24,13 +24,12 @@ import { useSetFilterScopeVisible, AfterSuccess, } from './schema-settings'; -import { useCreateActionProps } from './hooks/useCreateActionProps'; +import { useCreateActionProps } from './schema-initializer/actions/hooks/useCreateActionProps'; import { useCustomizeUpdateActionProps } from './hooks/useCustomizeUpdateActionProps'; import { useFilterBlockActionProps } from './hooks/useFilterBlockActionProps'; import { useFilterFormCustomProps } from './hooks/useFilterFormCustomProps'; import { useGetCustomAssociatedComponents } from './hooks/useGetCustomAssociatedComponents'; import { useGetCustomComponents } from './hooks/useGetCustomComponents'; -import { useOutboundActionProps } from './hooks/useOutboundActionProps'; import { AdminLayout, DetailsPage, HomePage, OutboundPage, PageLayout } from './pages'; import { Configuration, HomePageConfiguration, LinkManager } from './settings-manager-components'; import { @@ -71,6 +70,7 @@ import { GroupBlockInitializer, GroupBlockProvider, GroupBlockToolbar, + OutboundActionHelper, OutboundButton, OutboundLinkActionInitializer, PDFViewerBlockInitializer, @@ -81,7 +81,13 @@ import { pdfViewActionInitializer, usePDFViewerPrintActionProps, } from './schema-initializer'; -import { SheetBlock, SheetBlockInitializer, SheetBlockProvider, SheetBlockToolbar, sheetBlockSettings } from './schema-initializer/SheetBlockInitializer'; +import { + SheetBlock, + SheetBlockInitializer, + SheetBlockProvider, + SheetBlockToolbar, + sheetBlockSettings, +} from './schema-initializer/blocks/SheetBlockInitializer'; export { usePDFViewerRef } from './schema-initializer'; export * from './components/custom-components/custom-components'; @@ -182,7 +188,6 @@ export class PluginCoreClient extends Plugin { useFilterFormCustomProps, useGetCustomAssociatedComponents, useGetCustomComponents, - useOutboundActionProps, usePDFViewerPrintActionProps, }); @@ -216,8 +221,6 @@ export class PluginCoreClient extends Plugin { // @ts-ignore Designer: MenuDesigner, }, - OutboundButton, - OutboundLinkActionInitializer, PDFViewerBlockInitializer, PDFViewerPrintActionInitializer, PDFViewerProvider, @@ -232,7 +235,6 @@ export class PluginCoreClient extends Plugin { SheetBlockProvider, SheetBlockToolbar, }); - } async registerRouters() { @@ -263,15 +265,6 @@ export class PluginCoreClient extends Plugin { title: '筛选区块添加一对一的引用', Component: 'FilterAssociatedFields', }; - const outboundItem = { - type: 'item', - name: 'enableActions.outbound', - title: '外链', - Component: 'OutboundLinkActionInitializer', - schema: { - 'x-align': 'right', - }, - }; const calendarBlockItem = { name: 'calendarV2', title: '{{t("Calendar")}}', @@ -298,8 +291,6 @@ export class PluginCoreClient extends Plugin { Component: 'FilterFormItemCustom', }; this.schemaInitializerManager.add(pdfViewActionInitializer); - this.app.schemaInitializerManager.addItem('TableActionInitializers', outboundItem.name, outboundItem); - this.app.schemaInitializerManager.get('ReadPrettyFormActionInitializers').add(outboundItem.name, outboundItem); this.app.schemaInitializerManager.get('BlockInitializers').add(calendarBlockItem.name, calendarBlockItem); this.app.schemaInitializerManager.get('BlockInitializers').add(settingBlockItem.name, settingBlockItem); this.app.schemaInitializerManager.get('BlockInitializers').add('dataBlocks.groupBlock', { @@ -311,7 +302,6 @@ export class PluginCoreClient extends Plugin { Component: 'SheetBlockInitializer', }); this.app.schemaInitializerManager.get('KanbanActionInitializers').add(refreshActionItem.name, refreshActionItem); - this.app.schemaInitializerManager.get('KanbanActionInitializers').add(outboundItem.name, outboundItem); this.app.schemaInitializerManager.get('FilterFormItemInitializers').add(associationFields.name, associationFields); this.app.schemaInitializerManager.addItem('FilterFormItemInitializers', 'custom-item-divider', { type: 'divider', @@ -364,6 +354,7 @@ export class PluginCoreClient extends Plugin { async load() { this.locale = new Locale(this.app); + await new OutboundActionHelper(this.app).load(); await this.registerTricks(); await this.registerScopesAndComponents(); await this.registerSettings(); diff --git a/packages/plugins/@hera/plugin-core/src/client/locale.tsx b/packages/plugins/@hera/plugin-core/src/client/locale.tsx index 627bd5bc6..50d6bfa95 100644 --- a/packages/plugins/@hera/plugin-core/src/client/locale.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/locale.tsx @@ -1,4 +1,4 @@ -import { Application, useApp, tval as nTval } from '@nocobase/client'; +import { Application, useApp, tval as nTval, i18n } from '@nocobase/client'; const NAMESPACE = '@hera/plugin-core'; @@ -21,3 +21,7 @@ export const useTranslation = (): any => { }; export const tval = (key: string) => nTval(key, { ns: NAMESPACE }); + +export function lang(key: string) { + return i18n.t(key, { ns: NAMESPACE }); +} diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-components/PDFViewer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-components/PDFViewer.tsx index 5b3708881..87e300e39 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-components/PDFViewer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-components/PDFViewer.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { PDFViewer } from '../components/PDFViewer'; import { Space } from 'antd'; import { css } from '@nocobase/client'; -import { usePDFViewerRef } from '../schema-initializer/PDFVIewerBlockInitializer'; +import { usePDFViewerRef } from '../schema-initializer/blocks/PDFVIewerBlockInitializer'; export const InternalPDFViewer = (props) => { const { usePdfPath: useMaybePdfPath } = props; diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/DetailsActionInitializers.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/DetailsActionInitializers.tsx deleted file mode 100644 index 8f3054131..000000000 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/DetailsActionInitializers.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import { useCollection_deprecated } from '@nocobase/client'; - -const useVisibleCollection = () => { - const collection = useCollection_deprecated(); - return (collection.template !== 'view' || collection?.writableView) && collection.template !== 'sql'; -}; - -// 表单的操作配置 -export const DetailsActionInitializers = { - title: '{{t("Configure actions")}}', - icon: 'SettingOutlined', - style: { - marginLeft: 8, - }, - items: [ - { - type: 'itemGroup', - title: '{{t("Enable actions")}}', - children: [ - { - type: 'item', - title: '{{t("Edit")}}', - component: 'UpdateActionInitializer', - schema: { - 'x-component': 'Action', - 'x-decorator': 'ACLActionProvider', - 'x-component-props': { - type: 'primary', - }, - }, - }, - { - type: 'item', - title: '{{t("Delete")}}', - component: 'DestroyActionInitializer', - schema: { - 'x-component': 'Action', - 'x-decorator': 'ACLActionProvider', - }, - }, - { - type: 'item', - title: '{{t("Duplicate")}}', - component: 'DuplicateActionInitializer', - schema: { - 'x-component': 'Action', - 'x-action': 'duplicate', - 'x-decorator': 'ACLActionProvider', - 'x-component-props': { - type: 'primary', - }, - }, - }, - ], - }, - { - type: 'divider', - }, - { - type: 'subMenu', - title: '{{t("Customize")}}', - children: [ - { - type: 'item', - title: '{{t("Popup")}}', - component: 'CustomizeActionInitializer', - schema: { - type: 'void', - title: '{{ t("Popup") }}', - 'x-action': 'customize:popup', - 'x-designer': 'Action.Designer', - 'x-component': 'Action', - 'x-component-props': { - openMode: 'drawer', - }, - properties: { - drawer: { - type: 'void', - title: '{{ t("Popup") }}', - 'x-component': 'Action.Container', - 'x-component-props': { - className: 'nb-action-popup', - }, - properties: { - tabs: { - type: 'void', - 'x-component': 'Tabs', - 'x-component-props': {}, - 'x-initializer': 'TabPaneInitializers', - properties: { - tab1: { - type: 'void', - title: '{{t("Details")}}', - 'x-component': 'Tabs.TabPane', - 'x-designer': 'Tabs.Designer', - 'x-component-props': {}, - properties: { - grid: { - type: 'void', - 'x-component': 'Grid', - 'x-initializer': 'RecordBlockInitializers', - properties: {}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - type: 'item', - title: '{{t("Update record")}}', - component: 'CustomizeActionInitializer', - schema: { - title: '{{ t("Update record") }}', - 'x-component': 'Action', - 'x-designer': 'Action.Designer', - 'x-action': 'customize:update', - 'x-decorator': 'ACLActionProvider', - 'x-acl-action': 'update', - 'x-action-settings': { - assignedValues: {}, - onSuccess: { - manualClose: true, - redirecting: false, - successMessage: '{{t("Updated successfully")}}', - }, - }, - 'x-component-props': { - useProps: '{{ useCustomizeUpdateActionProps }}', - }, - }, - visible: useVisibleCollection, - }, - { - type: 'item', - title: '{{t("Custom request")}}', - component: 'CustomRequestInitializer', - visible: useVisibleCollection, - }, - ], - }, - ], -}; diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/OutboundLinkActionInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/OutboundLinkActionInitializer.tsx deleted file mode 100644 index 036bc2c42..000000000 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/OutboundLinkActionInitializer.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import { ActionInitializer } from '@nocobase/client'; -import { Popover, Space, Button, Input } from 'antd'; -import { useFieldSchema } from '@formily/react'; -import { useProps } from '@nocobase/client'; -import { ShareAltOutlined } from '@ant-design/icons'; - -export const OutboundLinkActionInitializer = (props) => { - const schema = { - title: '外链', - 'x-action': 'outbound', - 'x-component': 'OutboundButton', - 'x-designer': 'Action.Designer', - 'x-component-props': { - icon: 'ShareAltOutlined', - useProps: '{{ useOutboundActionProps }}', - }, - }; - return ; -}; - -export const OutboundButton = (props) => { - const { onClick } = useProps(props); - const schema = useFieldSchema(); - const url = window.location.href.split('/', 3).join('/'); - return ( - - - - - } - > - - - ); -}; diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/CreateSubmitActionInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/CreateSubmitActionInitializer.tsx similarity index 66% rename from packages/plugins/@hera/plugin-core/src/client/schema-initializer/CreateSubmitActionInitializer.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/CreateSubmitActionInitializer.tsx index ddd6242f3..59ff3bd30 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/CreateSubmitActionInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/CreateSubmitActionInitializer.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { ActionInitializer } from '@nocobase/client'; +import { ActionInitializer, tval } from '@nocobase/client'; -export const CreateSubmitActionInitializer = (props) => { +export const CreateSubmitActionInitializer: React.FC = (props) => { const schema = { - title: '{{ t("Submit") }}', + title: tval('Submit'), 'x-action': 'submit', 'x-component': 'Action', 'x-designer': 'Action.Designer', @@ -20,3 +20,4 @@ export const CreateSubmitActionInitializer = (props) => { }; return ; }; +CreateSubmitActionInitializer.displayName = 'CreateSubmitActionInitializer'; diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/OutboundLinkActionInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/OutboundLinkActionInitializer.tsx new file mode 100644 index 000000000..c3d42eda4 --- /dev/null +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/OutboundLinkActionInitializer.tsx @@ -0,0 +1,78 @@ +import React from 'react'; +import { ActionInitializer, Application } from '@nocobase/client'; +import { Popover, Space, Button, Input } from 'antd'; +import { useFieldSchema } from '@formily/react'; +import { useProps } from '@nocobase/client'; +import { ShareAltOutlined } from '@ant-design/icons'; +import { lang, tval, useTranslation } from '../../locale'; +import { useOutboundActionProps } from './hooks/useOutboundActionProps'; + +export class OutboundActionHelper { + constructor(private app: Application) {} + + async load() { + this.app.addScopes({ + useOutboundActionProps, + }); + this.app.addComponents({ + OutboundButton, + OutboundLinkActionInitializer, + }); + const outboundItem = { + type: 'item', + name: 'enableActions.outbound', + title: lang('outbound'), + Component: 'OutboundLinkActionInitializer', + schema: { + 'x-align': 'right', + }, + }; + this.app.schemaInitializerManager.addItem('table:configureActions', outboundItem.name, outboundItem); + this.app.schemaInitializerManager.addItem('details:configureActions', outboundItem.name, outboundItem); + this.app.schemaInitializerManager.addItem('kanban:configureActions', outboundItem.name, outboundItem); + } +} + +export const OutboundLinkActionInitializer: React.FC = (props) => { + const schema = { + title: tval('outbound'), + 'x-action': 'outbound', + 'x-component': 'OutboundButton', + 'x-designer': 'Action.Designer', + 'x-component-props': { + icon: 'ShareAltOutlined', + useProps: '{{ useOutboundActionProps }}', + }, + }; + return ; +}; +OutboundLinkActionInitializer.displayName = 'OutboundLinkActionInitializer'; + +export const OutboundButton: React.FC = (props) => { + const { onClick } = useProps(props); + const schema = useFieldSchema(); + // FIXME 处理多应用情况 + const url = window.location.href.split('/', 3).join('/'); + const { t } = useTranslation(); + return ( + + + + + } + > + + + ); +}; +OutboundButton.displayName = 'OutboundButton'; diff --git a/packages/plugins/@hera/plugin-core/src/client/hooks/useCreateActionProps.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/hooks/useCreateActionProps.tsx similarity index 98% rename from packages/plugins/@hera/plugin-core/src/client/hooks/useCreateActionProps.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/hooks/useCreateActionProps.tsx index 17849ea98..2ba45f999 100644 --- a/packages/plugins/@hera/plugin-core/src/client/hooks/useCreateActionProps.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/hooks/useCreateActionProps.tsx @@ -19,14 +19,15 @@ import { useTranslation } from 'react-i18next'; import { App, message } from 'antd'; import { useNavigate, useParams } from 'react-router-dom'; import { isURL } from '@nocobase/utils/client'; -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; import _ from 'lodash'; +import { tval } from '../../../locale'; const pageDetailsViewer = 'PageLayout'; const viewerSchema: ISchema = { type: 'void', - title: '{{ t("View record") }}', + title: tval('View record'), 'x-component': pageDetailsViewer, 'x-component-props': { className: 'nb-action-popup', @@ -34,7 +35,7 @@ const viewerSchema: ISchema = { properties: { page: { type: 'void', - title: '详情页面', + title: tval('Detail page'), 'x-designer': 'Page.Designer', 'x-component': 'Page', 'x-component-props': { disablePageHeader: true }, diff --git a/packages/plugins/@hera/plugin-core/src/client/hooks/useOutboundActionProps.ts b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/hooks/useOutboundActionProps.ts similarity index 68% rename from packages/plugins/@hera/plugin-core/src/client/hooks/useOutboundActionProps.ts rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/hooks/useOutboundActionProps.ts index 6b06d4f62..de1e55f4a 100644 --- a/packages/plugins/@hera/plugin-core/src/client/hooks/useOutboundActionProps.ts +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/actions/hooks/useOutboundActionProps.ts @@ -1,21 +1,24 @@ import { message } from 'antd'; import { useFieldSchema } from '@formily/react'; import copy from 'copy-to-clipboard'; +import { useTranslation } from '../../../locale'; export const useOutboundActionProps = () => { let schema = useFieldSchema(); + const { t } = useTranslation(); while (!('x-decorator-props' in schema)) { schema = schema.parent; } + // FIXME: 处理多应用路径 const url = window.location.href.split('/', 3).join('/'); return { async onClick() { const c = copy(`${url}/r/${schema['x-uid']}`); if (c) { - message.success('链接保存成功'); + message.success(t('Save link successful')); } else { - message.success('链接保存失败'); + message.success(t('Save link failed')); } }, }; diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/CalendarBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/CalendarBlockInitializer.tsx similarity index 98% rename from packages/plugins/@hera/plugin-core/src/client/schema-initializer/CalendarBlockInitializer.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/CalendarBlockInitializer.tsx index 0aeb68e7f..384b0edd4 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/CalendarBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/CalendarBlockInitializer.tsx @@ -13,7 +13,7 @@ import { } from '@nocobase/client'; import React, { useContext } from 'react'; import { useTranslation } from 'react-i18next'; -import { createCalendarBlockSchema } from './utils'; +import { createCalendarBlockSchema } from '../utils'; export const CalendarBlockInitializer = () => { const { insert } = useSchemaInitializer(); diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/GroupBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx similarity index 95% rename from packages/plugins/@hera/plugin-core/src/client/schema-initializer/GroupBlockInitializer.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx index f930dd651..840a2406c 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/GroupBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx @@ -16,8 +16,8 @@ import { import React, { createContext, useState } from 'react'; import { uid } from '@nocobase/utils/client'; import { Checkbox, Spin } from 'antd'; -import { GroupBlockConfigure } from '../components/GroupBlockConfigure/GroupBlockConfigure'; -import { GroupConfigure } from '../components/GroupBlockConfigure/GroupConfigure'; +import { GroupBlockConfigure } from '../../components/GroupBlockConfigure/GroupBlockConfigure'; +import { GroupConfigure } from '../../components/GroupBlockConfigure/GroupConfigure'; export const GroupBlockContext = createContext({}); diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/PDFVIewerBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/PDFVIewerBlockInitializer.tsx similarity index 100% rename from packages/plugins/@hera/plugin-core/src/client/schema-initializer/PDFVIewerBlockInitializer.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/PDFVIewerBlockInitializer.tsx diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/SettingBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx similarity index 93% rename from packages/plugins/@hera/plugin-core/src/client/schema-initializer/SettingBlockInitializer.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx index a6193632b..6211bbf70 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/SettingBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx @@ -12,7 +12,7 @@ import { useSchemaInitializerItem, } from '@nocobase/client'; import React, { useContext } from 'react'; -import { useTranslation } from '../locale'; +import { tval, useTranslation } from '../../locale'; export const SettingBlockInitializer = () => { const { insert } = useSchemaInitializer(); @@ -41,7 +41,7 @@ export const SettingBlockInitializer = () => { schema={{ properties: { id: { - title: t('Please select'), + title: tval('Please select'), enum: result.data.data.map((item) => { return { label: item[titleField], @@ -68,7 +68,7 @@ export const SettingBlockInitializer = () => { collection: collection.name, action: 'get', filterByTk: values.id, - actionInitializers: 'UpdateFormActionInitializers', + actionInitializers: 'editForm:configureActions', }); insert(formSchema); }} diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/SheetBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SheetBlockInitializer.tsx similarity index 97% rename from packages/plugins/@hera/plugin-core/src/client/schema-initializer/SheetBlockInitializer.tsx rename to packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SheetBlockInitializer.tsx index 1f36eef97..007fa86ff 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/SheetBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SheetBlockInitializer.tsx @@ -13,7 +13,7 @@ import { import React, { createContext, useRef } from 'react'; import { uid } from '@nocobase/utils/client'; import { Button, Spin } from 'antd'; -import Sheet, { SheetRef } from '../components/Sheet'; +import Sheet, { SheetRef } from '../../components/Sheet'; export const SheetBlockContext = createContext({}); diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/index.ts b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/index.ts index a50566ffa..12ee3def2 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/index.ts +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/index.ts @@ -1,8 +1,8 @@ export * from './FilterFormItemCustomInitializer/FilterFormItemCustom'; -export * from './CalendarBlockInitializer'; -export * from './PDFVIewerBlockInitializer'; -export * from './OutboundLinkActionInitializer'; -export * from './CreateSubmitActionInitializer'; +export * from './blocks/CalendarBlockInitializer'; +export * from './blocks/PDFVIewerBlockInitializer'; +export * from './actions/OutboundLinkActionInitializer'; +export * from './actions/CreateSubmitActionInitializer'; export * from './FilterAssociatedFields'; -export * from './SettingBlockInitializer'; -export * from './GroupBlockInitializer'; +export * from './blocks/SettingBlockInitializer'; +export * from './blocks/GroupBlockInitializer';