diff --git a/packages/core/client/src/built-in/assistant/Assistant.provider.tsx b/packages/core/client/src/built-in/assistant/Assistant.provider.tsx
index 3dd366805..1287e6305 100644
--- a/packages/core/client/src/built-in/assistant/Assistant.provider.tsx
+++ b/packages/core/client/src/built-in/assistant/Assistant.provider.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { useContextMenu, useDesignable, useHotkeys } from '@tachybase/client';
+import { Icon, useContextMenu, useDesignable, useHotkeys } from '@tachybase/client';
import {
CalculatorOutlined,
@@ -30,7 +30,7 @@ export const AssistantProvider = ({ children }) => {
}>
} onClick={() => setOpen(true)} />
}
+ icon={}
type={designable ? 'primary' : 'default'}
onClick={() => setDesignable(!designable)}
/>
diff --git a/packages/core/client/src/locale/en_US.json b/packages/core/client/src/locale/en_US.json
index 19d254fdd..9911ea0ad 100644
--- a/packages/core/client/src/locale/en_US.json
+++ b/packages/core/client/src/locale/en_US.json
@@ -149,6 +149,7 @@
"Select grouping field": "Select grouping field",
"Media": "Media",
"Markdown": "Markdown",
+ "Demonstration text": "Demonstration text",
"Wysiwyg": "Wysiwyg",
"Chart blocks": "Chart blocks",
"Column chart": "Column chart",
@@ -157,7 +158,7 @@
"Pie chart": "Pie chart",
"Area chart": "Area chart",
"Other chart": "Other chart",
- "Other blocks": "Other blocks",
+ "Other blocks": "Advanced blocks",
"In configuration": "In configuration",
"Chart title": "Chart title",
"Chart type": "Chart type",
@@ -843,5 +844,6 @@
"Disable Right Menu":"Disable Right Menu",
"Full Screen":"Full Screen",
"Designer Mode":"Designer Mode",
+ "Embedded page": "Embedded page",
"There are no full screen blocks available at the current location":"There are no full screen blocks available at the current location"
}
diff --git a/packages/core/client/src/locale/zh-CN.json b/packages/core/client/src/locale/zh-CN.json
index 45c12af16..2210692e4 100644
--- a/packages/core/client/src/locale/zh-CN.json
+++ b/packages/core/client/src/locale/zh-CN.json
@@ -176,7 +176,7 @@
"Pie chart": "饼图",
"Area chart": "面积图",
"Other chart": "其他图表",
- "Other blocks": "其他区块",
+ "Other blocks": "高级区块",
"In configuration": "配置中",
"Chart title": "图表标题",
"Chart type": "图表类型",
@@ -958,5 +958,7 @@
"Designer Mode":"设计者模式",
"There are no full screen blocks available at the current location":"当前位置没有可全屏区块",
"Exit Full Screen":"退出全屏",
+ "Embedded page": "嵌入页面",
+ "Demonstration text": "演示文本",
"User settings":"个人设置"
}
diff --git a/packages/core/client/src/modules/actions/add-new/createFormBlockInitializers.tsx b/packages/core/client/src/modules/actions/add-new/createFormBlockInitializers.tsx
index 004598870..926a3928e 100644
--- a/packages/core/client/src/modules/actions/add-new/createFormBlockInitializers.tsx
+++ b/packages/core/client/src/modules/actions/add-new/createFormBlockInitializers.tsx
@@ -32,7 +32,7 @@ export const createFormBlockInitializers_deprecated = new CompatibleSchemaInitia
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -89,7 +89,7 @@ export const createFormBlockInitializers = new CompatibleSchemaInitializer(
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/core/client/src/modules/actions/add-record/customizeCreateFormBlockInitializers.tsx b/packages/core/client/src/modules/actions/add-record/customizeCreateFormBlockInitializers.tsx
index f98ddeef9..823384352 100644
--- a/packages/core/client/src/modules/actions/add-record/customizeCreateFormBlockInitializers.tsx
+++ b/packages/core/client/src/modules/actions/add-record/customizeCreateFormBlockInitializers.tsx
@@ -30,7 +30,7 @@ export const customizeCreateFormBlockInitializers_deprecated = new CompatibleSch
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -65,7 +65,7 @@ export const customizeCreateFormBlockInitializers = new CompatibleSchemaInitiali
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/core/client/src/modules/actions/view-edit-popup/RecordFormBlockInitializers.tsx b/packages/core/client/src/modules/actions/view-edit-popup/RecordFormBlockInitializers.tsx
index b338cdfc4..a22a5da4c 100644
--- a/packages/core/client/src/modules/actions/view-edit-popup/RecordFormBlockInitializers.tsx
+++ b/packages/core/client/src/modules/actions/view-edit-popup/RecordFormBlockInitializers.tsx
@@ -29,7 +29,7 @@ export const recordFormBlockInitializers = new SchemaInitializer({
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/core/client/src/modules/blocks/other-blocks/markdown/MarkdownBlockInitializer.tsx b/packages/core/client/src/modules/blocks/other-blocks/markdown/MarkdownBlockInitializer.tsx
index 44cb0df03..4dd32724e 100644
--- a/packages/core/client/src/modules/blocks/other-blocks/markdown/MarkdownBlockInitializer.tsx
+++ b/packages/core/client/src/modules/blocks/other-blocks/markdown/MarkdownBlockInitializer.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { FormOutlined } from '@ant-design/icons';
+import { FileTextOutlined } from '@ant-design/icons';
import { useTranslation } from 'react-i18next';
import { SchemaInitializerItem, useSchemaInitializer, useSchemaInitializerItem } from '../../../../application';
@@ -13,7 +13,7 @@ export const MarkdownBlockInitializer = () => {
return (
}
+ icon={}
onClick={() => {
insert({
type: 'void',
diff --git a/packages/core/client/src/modules/page/BlockInitializers.tsx b/packages/core/client/src/modules/page/BlockInitializers.tsx
index d532e63aa..995e79224 100644
--- a/packages/core/client/src/modules/page/BlockInitializers.tsx
+++ b/packages/core/client/src/modules/page/BlockInitializers.tsx
@@ -66,7 +66,7 @@ export const blockInitializers_deprecated = new CompatibleSchemaInitializer({
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -137,7 +137,7 @@ export const blockInitializers = new CompatibleSchemaInitializer(
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/core/client/src/schema-component/antd/menu/Menu.tsx b/packages/core/client/src/schema-component/antd/menu/Menu.tsx
index dcb80c5e5..face30532 100644
--- a/packages/core/client/src/schema-component/antd/menu/Menu.tsx
+++ b/packages/core/client/src/schema-component/antd/menu/Menu.tsx
@@ -11,8 +11,8 @@ import {
} from '@tachybase/schema';
import { error } from '@tachybase/utils/client';
-import { AppstoreOutlined, InsertRowAboveOutlined, MoreOutlined } from '@ant-design/icons';
-import { Menu as AntdMenu, Button, Card, Col, Dropdown, MenuProps, Popover, Row } from 'antd';
+import { AppstoreAddOutlined } from '@ant-design/icons';
+import { Menu as AntdMenu, Button, Card, MenuProps, Popover } from 'antd';
import { createPortal } from 'react-dom';
import { useTranslation } from 'react-i18next';
@@ -203,7 +203,7 @@ const HeaderMenu = ({
);
}}
>
- } />
+ } />
diff --git a/packages/core/client/src/schema-component/core/DesignableSwitch.tsx b/packages/core/client/src/schema-component/core/DesignableSwitch.tsx
index 3e18be397..2642a0a9c 100644
--- a/packages/core/client/src/schema-component/core/DesignableSwitch.tsx
+++ b/packages/core/client/src/schema-component/core/DesignableSwitch.tsx
@@ -6,6 +6,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
import { useTranslation } from 'react-i18next';
import { useDesignable } from '..';
+import { Icon } from '../../icon';
import { useToken } from '../../style';
export const DesignableSwitch = () => {
@@ -24,7 +25,7 @@ export const DesignableSwitch = () => {
}
+ icon={}
title={t('UI Editor')}
style={style}
onClick={() => {
diff --git a/packages/core/client/src/schema-initializer/buttons/RecordBlockInitializers.tsx b/packages/core/client/src/schema-initializer/buttons/RecordBlockInitializers.tsx
index da2446ad6..cebd7ffd5 100644
--- a/packages/core/client/src/schema-initializer/buttons/RecordBlockInitializers.tsx
+++ b/packages/core/client/src/schema-initializer/buttons/RecordBlockInitializers.tsx
@@ -353,7 +353,7 @@ export const recordBlockInitializers_deprecated = new CompatibleSchemaInitialize
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -450,7 +450,7 @@ export const recordBlockInitializers = new CompatibleSchemaInitializer(
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-action-bulk-edit/src/client/BulkEditBlockInitializers.tsx b/packages/plugins/@tachybase/plugin-action-bulk-edit/src/client/BulkEditBlockInitializers.tsx
index cc6cb2200..eaebf304c 100644
--- a/packages/plugins/@tachybase/plugin-action-bulk-edit/src/client/BulkEditBlockInitializers.tsx
+++ b/packages/plugins/@tachybase/plugin-action-bulk-edit/src/client/BulkEditBlockInitializers.tsx
@@ -31,7 +31,7 @@ export const CreateFormBulkEditBlockInitializers: SchemaInitializer = new Schema
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -67,7 +67,7 @@ export const BulkEditBlockInitializers_deprecated = new CompatibleSchemaInitiali
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -101,7 +101,7 @@ export const bulkEditBlockInitializers = new CompatibleSchemaInitializer(
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-calendar/src/client/schema-initializer/items/CalendarBlockInitializer.tsx b/packages/plugins/@tachybase/plugin-calendar/src/client/schema-initializer/items/CalendarBlockInitializer.tsx
index 66d0118e1..40c956e5a 100644
--- a/packages/plugins/@tachybase/plugin-calendar/src/client/schema-initializer/items/CalendarBlockInitializer.tsx
+++ b/packages/plugins/@tachybase/plugin-calendar/src/client/schema-initializer/items/CalendarBlockInitializer.tsx
@@ -14,7 +14,7 @@ import {
import { FormLayout } from '@tachybase/components';
import { SchemaOptionsContext } from '@tachybase/schema';
-import { FormOutlined } from '@ant-design/icons';
+import { CalendarOutlined } from '@ant-design/icons';
import { useTranslation } from '../../../locale';
import { createCalendarBlockUISchema } from '../createCalendarBlockUISchema';
@@ -39,7 +39,7 @@ export const CalendarBlockInitializer = ({
}
+ icon={}
onCreateBlockSchema={async (options) => {
if (createBlockSchema) {
return createBlockSchema(options);
diff --git a/packages/plugins/@tachybase/plugin-iframe-block/src/client/IframeBlockInitializer.tsx b/packages/plugins/@tachybase/plugin-iframe-block/src/client/IframeBlockInitializer.tsx
index d94f3e319..f84c83f9e 100644
--- a/packages/plugins/@tachybase/plugin-iframe-block/src/client/IframeBlockInitializer.tsx
+++ b/packages/plugins/@tachybase/plugin-iframe-block/src/client/IframeBlockInitializer.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { SchemaInitializerItem, useSchemaInitializer, useSchemaInitializerItem } from '@tachybase/client';
-import { FormOutlined } from '@ant-design/icons';
+import { Html5Outlined } from '@ant-design/icons';
export const IframeBlockInitializer = () => {
const { insert } = useSchemaInitializer();
@@ -9,7 +9,7 @@ export const IframeBlockInitializer = () => {
return (
}
+ icon={}
onClick={() => {
insert({
type: 'void',
diff --git a/packages/plugins/@tachybase/plugin-iframe-block/src/client/index.ts b/packages/plugins/@tachybase/plugin-iframe-block/src/client/index.ts
index 77c99b4bf..b6afffe22 100644
--- a/packages/plugins/@tachybase/plugin-iframe-block/src/client/index.ts
+++ b/packages/plugins/@tachybase/plugin-iframe-block/src/client/index.ts
@@ -1,34 +1,33 @@
import { Plugin } from '@tachybase/client';
import { IframeBlockProvider } from './IframeBlockProvider';
-import { iframeBlockSchemaSettings, iframeBlockSchemaSettings_deprecated } from './schemaSettings';
+import { iframeBlockSchemaSettings } from './schemaSettings';
export class IframeBlockPlugin extends Plugin {
async load() {
- this.app.schemaSettingsManager.add(iframeBlockSchemaSettings_deprecated);
this.app.schemaSettingsManager.add(iframeBlockSchemaSettings);
this.app.use(IframeBlockProvider);
const blockInitializers = this.app.schemaInitializerManager.get('page:addBlock');
blockInitializers?.add('otherBlocks.iframe', {
- title: '{{t("Iframe")}}',
+ title: '{{t("Embedded page")}}',
Component: 'IframeBlockInitializer',
});
const createFormBlockInitializers = this.app.schemaInitializerManager.get('popup:addNew:addBlock');
createFormBlockInitializers?.add('otherBlocks.iframe', {
- title: '{{t("Iframe")}}',
+ title: '{{t("Embedded page")}}',
Component: 'IframeBlockInitializer',
});
const recordBlockInitializers = this.app.schemaInitializerManager.get('popup:common:addBlock');
recordBlockInitializers?.add('otherBlocks.iframe', {
- title: '{{t("Iframe")}}',
+ title: '{{t("Embedded page")}}',
Component: 'IframeBlockInitializer',
});
const recordFormBlockInitializers = this.app.schemaInitializerManager.get('RecordFormBlockInitializers');
recordFormBlockInitializers?.add('otherBlocks.iframe', {
- title: '{{t("Iframe")}}',
+ title: '{{t("Embedded page")}}',
Component: 'IframeBlockInitializer',
});
}
diff --git a/packages/plugins/@tachybase/plugin-iframe-block/src/client/schemaSettings.ts b/packages/plugins/@tachybase/plugin-iframe-block/src/client/schemaSettings.ts
index ba656fd7d..1f87b9478 100644
--- a/packages/plugins/@tachybase/plugin-iframe-block/src/client/schemaSettings.ts
+++ b/packages/plugins/@tachybase/plugin-iframe-block/src/client/schemaSettings.ts
@@ -3,150 +3,6 @@ import { ISchema, uid, useField, useFieldSchema } from '@tachybase/schema';
import { useTranslation } from 'react-i18next';
-/**
- * @deprecated
- */
-export const iframeBlockSchemaSettings_deprecated = new SchemaSettings({
- name: 'iframeBlockSchemaSettings',
- items: [
- {
- name: 'EditIframe',
- type: 'modal',
- useComponentProps() {
- const field = useField();
- const fieldSchema = useFieldSchema();
- const { t } = useTranslation();
- const { dn } = useDesignable();
- const api = useAPIClient();
- const { mode, url, htmlId, height = '60vh' } = fieldSchema['x-component-props'] || {};
-
- const saveHtml = async (html: string) => {
- const options = {
- values: { html },
- };
- if (htmlId) {
- // eslint-disable-next-line no-unsafe-optional-chaining
- const { data } = await api.resource('iframeHtml').update?.({ ...options, filterByTk: htmlId });
- return data?.data?.[0] || { id: htmlId };
- } else {
- // eslint-disable-next-line no-unsafe-optional-chaining
- const { data } = await api.resource('iframeHtml').create?.(options);
- return data?.data;
- }
- };
-
- const submitHandler = async ({ mode, url, html, height }) => {
- const componentProps = fieldSchema['x-component-props'] || {};
- componentProps['mode'] = mode;
- componentProps['height'] = height;
- componentProps['url'] = url;
- if (mode === 'html') {
- const data = await saveHtml(html);
- componentProps['htmlId'] = data.id;
- }
- fieldSchema['x-component-props'] = componentProps;
- field.componentProps = { ...componentProps };
- field.data = { v: uid() };
- dn.emit('patch', {
- schema: {
- 'x-uid': fieldSchema['x-uid'],
- 'x-component-props': componentProps,
- },
- });
- };
-
- return {
- title: t('Edit iframe'),
- asyncGetInitialValues: async () => {
- const values = {
- mode,
- url,
- height,
- };
- if (htmlId) {
- // eslint-disable-next-line no-unsafe-optional-chaining
- const { data } = await api.resource('iframeHtml').get?.({ filterByTk: htmlId });
- values['html'] = data?.data?.html || '';
- }
- return values;
- },
- schema: {
- type: 'object',
- title: t('Edit iframe'),
- properties: {
- mode: {
- title: '{{t("Mode")}}',
- 'x-component': 'Radio.Group',
- 'x-decorator': 'FormItem',
- required: true,
- default: 'url',
- enum: [
- { value: 'url', label: t('URL') },
- { value: 'html', label: t('html') },
- ],
- },
- url: {
- title: t('URL'),
- type: 'string',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- required: true,
- 'x-reactions': {
- dependencies: ['mode'],
- fulfill: {
- state: {
- hidden: '{{$deps[0] === "html"}}',
- },
- },
- },
- },
- html: {
- title: t('html'),
- type: 'string',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input.TextArea',
- required: true,
- 'x-reactions': {
- dependencies: ['mode'],
- fulfill: {
- state: {
- hidden: '{{$deps[0] === "url"}}',
- },
- },
- },
- },
- height: {
- title: t('Height'),
- type: 'string',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- required: true,
- },
- },
- } as ISchema,
- onSubmit: submitHandler,
- };
- },
- },
- {
- name: 'divider',
- type: 'divider',
- },
- {
- name: 'delete',
- type: 'remove',
- useComponentProps() {
- return {
- removeParentsIfNoChildren: true,
- breakRemoveOn: {
- 'x-component': 'Grid',
- },
- };
- },
- },
- ],
-});
-
export const iframeBlockSchemaSettings = new SchemaSettings({
name: 'blockSettings:iframe',
items: [
diff --git a/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/initializers/BlockInitializers.ts b/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/initializers/BlockInitializers.ts
index 3fa14669a..49ccacfc7 100644
--- a/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/initializers/BlockInitializers.ts
+++ b/packages/plugins/@tachybase/plugin-mobile-client/src/client/core/schema/initializers/BlockInitializers.ts
@@ -61,7 +61,7 @@ export const mBlockInitializers_deprecated = new CompatibleSchemaInitializer({
},
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
{
@@ -148,7 +148,7 @@ export const mBlockInitializers = new CompatibleSchemaInitializer(
},
{
name: 'markdown',
- title: tval('Markdown'),
+ title: tval('Demonstration text'),
Component: 'MarkdownBlockInitializer',
},
{
diff --git a/packages/plugins/@tachybase/plugin-snapshot-field/src/client/SnapshotBlock/SnapshotBlockInitializers/SnapshotBlockInitializers.tsx b/packages/plugins/@tachybase/plugin-snapshot-field/src/client/SnapshotBlock/SnapshotBlockInitializers/SnapshotBlockInitializers.tsx
index 5f0a055b5..2b722cc88 100644
--- a/packages/plugins/@tachybase/plugin-snapshot-field/src/client/SnapshotBlock/SnapshotBlockInitializers/SnapshotBlockInitializers.tsx
+++ b/packages/plugins/@tachybase/plugin-snapshot-field/src/client/SnapshotBlock/SnapshotBlockInitializers/SnapshotBlockInitializers.tsx
@@ -31,7 +31,7 @@ export const snapshotBlockInitializers_deprecated = new CompatibleSchemaInitiali
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -66,7 +66,7 @@ export const snapshotBlockInitializers = new CompatibleSchemaInitializer(
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-approval/approver-interface/ApproverAddBlock.initializer.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-approval/approver-interface/ApproverAddBlock.initializer.tsx
index c3fd1d566..38c1efc73 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-approval/approver-interface/ApproverAddBlock.initializer.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-approval/approver-interface/ApproverAddBlock.initializer.tsx
@@ -76,7 +76,7 @@ export const ApproverAddBlockInitializer = new SchemaInitializer({
const values = Array.from(approvalFormOptions.getValues());
return values.map((item: ApprovalFormType) => {
// NOTE: 这里通过赋别名,避免 eslint 检查 hooks 语法,无法提交
- // eslint-disable-next-line react-hooks/rules-of-hooks
+
const { useInitializer: getInitializer } = item.config;
return getInitializer({ allCollections });
});
@@ -90,7 +90,7 @@ export const ApproverAddBlockInitializer = new SchemaInitializer({
{
name: 'markdown',
type: 'item',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-carbon-copy/show-interface/CarbonCopyDetail.initializer.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-carbon-copy/show-interface/CarbonCopyDetail.initializer.tsx
index 5b6d31930..712971165 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-carbon-copy/show-interface/CarbonCopyDetail.initializer.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/instruction-carbon-copy/show-interface/CarbonCopyDetail.initializer.tsx
@@ -66,7 +66,7 @@ export const CarbonCopyDetailInitializer = new SchemaInitializer({
{
name: 'markdown',
type: 'item',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherAddBlockButton.initializer.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherAddBlockButton.initializer.tsx
index 679d8b64e..43ec0f6c1 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherAddBlockButton.initializer.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/configuration/trigger/launcher-interface/LauncherAddBlockButton.initializer.tsx
@@ -30,7 +30,7 @@ export const LauncherAddBlockButtonIntializer = new SchemaInitializer({
{
name: 'markdown',
type: 'item',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/ApprovalBlock.schema.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/ApprovalBlock.schema.tsx
index 2a2000b17..ae9b34243 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/ApprovalBlock.schema.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/ApprovalBlock.schema.tsx
@@ -26,41 +26,45 @@ export class SCApprovalBlock extends Plugin {
}
}
-const schemaItems = [
+export const schemaItems = [
{
- type: 'itemGroup',
- name: 'Launch',
- title: `{{t("Launch", { ns: "${NAMESPACE}" })}}`,
- children: [
- {
- type: 'item',
- title: `{{t("Launch", { ns: "${NAMESPACE}" })}}`,
- 'x-component': 'ApprovalBlock.Launch.Application',
- collection: 'workflows',
- action: 'list',
- },
- {
- type: 'item',
- title: `{{t("MyLaunch", { ns: "${NAMESPACE}" })}}`,
- 'x-component': 'ApprovalBlock.Launch',
- collection: 'approvals',
- params: {
- appends: [
- 'createdBy.nickname',
- 'workflow.title',
- 'workflow.enabled',
- 'records.id',
- 'records.status',
- 'records.node.title',
- ],
- except: ['data'],
- },
- },
- ],
+ type: 'item',
+ icon: 'ClockCircleOutlined',
+ title: `{{t("Initiate Request", { ns: "${NAMESPACE}" })}}`,
+ 'x-component': 'ApprovalBlock.Launch.Application',
+ collection: 'workflows',
+ action: 'list',
+ Component: 'ApprovalBlock.BlockInitializer',
+ useInsert: () => {
+ return (schema) => {
+ console.log('🚀 ~ file: ApprovalBlock.schema.tsx:45 ~ return ~ schema:', schema);
+ };
+ },
},
{
type: 'item',
- title: `{{t("Todos", { ns: "${NAMESPACE}" })}}`,
+ icon: 'AuditOutlined',
+ Component: 'ApprovalBlock.BlockInitializer',
+ title: `{{t("My Requests", { ns: "${NAMESPACE}" })}}`,
+ 'x-component': 'ApprovalBlock.Launch',
+ collection: 'approvals',
+ params: {
+ appends: [
+ 'createdBy.nickname',
+ 'workflow.title',
+ 'workflow.enabled',
+ 'records.id',
+ 'records.status',
+ 'records.node.title',
+ ],
+ except: ['data'],
+ },
+ },
+ {
+ type: 'item',
+ icon: 'FormOutlined',
+ Component: 'ApprovalBlock.BlockInitializer',
+ title: `{{t("My Pending Tasks", { ns: "${NAMESPACE}" })}}`,
'x-component': 'ApprovalBlock.Todos',
collection: 'approvalRecords',
params: {
@@ -84,7 +88,9 @@ const schemaItems = [
},
{
type: 'item',
- title: `{{t("CarbonCopy", { ns: "${NAMESPACE}" })}}`,
+ icon: 'MailOutlined',
+ Component: 'ApprovalBlock.BlockInitializer',
+ title: `{{t("CC'd to Me", { ns: "${NAMESPACE}" })}}`,
'x-decorator': 'CarbonCopyBlockProvider',
'x-component': 'CarbonCopyCenter',
'x-toolbar': 'BlockSchemaToolbar',
@@ -112,7 +118,7 @@ const schemaItems = [
},
];
-const getSchemaInsert = ({ item }) => {
+export const getSchemaInsert = ({ item }) => {
const id = uid();
const {
collection,
@@ -156,7 +162,5 @@ export const ApprovalBlockComponent = () => {
insert(schema);
};
- return (
- } {...schemaInitializerItem} items={schemaItems} onClick={onClick} />
- );
+ return ;
};
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/plugin.ts b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/plugin.ts
index 0d0064410..7d43ac7ac 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/plugin.ts
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/plugin.ts
@@ -1,8 +1,8 @@
-import { Plugin } from '@tachybase/client';
+import { Plugin, useSchemaInitializer } from '@tachybase/client';
import { tval } from '../../locale';
import { KitApprovalCommon } from '../approval-common/plugin';
-import { ApprovalBlockComponent, SCApprovalBlock } from './ApprovalBlock.schema';
+import { ApprovalBlockComponent, getSchemaInsert, SCApprovalBlock, schemaItems } from './ApprovalBlock.schema';
import { ViewActionLaunch } from './launch/VC.ViewActionLaunch';
import { ProviderApprovalUpdateForm } from './todos/ApprovalUpdateForm.provider';
import { ViewActionTodos } from './todos/VC.ViewActionTodos';
@@ -22,12 +22,12 @@ export class KitApprovalBlock extends Plugin {
ProviderApprovalUpdateForm: ProviderApprovalUpdateForm,
});
- this.app.schemaInitializerManager.get('page:addBlock').add('otherBlocks.approval', {
+ this.app.schemaInitializerManager.get('page:addBlock').add('otherBlocks.workflow.approval', {
key: 'approvalBlock',
name: 'approvalBlock',
- type: 'item',
+ type: 'itemGroup',
title: tval('Approval'),
- Component: 'ApprovalBlock.BlockInitializer',
+ children: schemaItems,
icon: 'AuditOutlined',
});
}
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/index.ts b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/index.tsx
similarity index 51%
rename from packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/index.ts
rename to packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/index.tsx
index cf876e188..877955f9b 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/index.ts
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/index.tsx
@@ -1,15 +1,13 @@
+import React from 'react';
import { Plugin } from '@tachybase/client';
+import { PartitionOutlined } from '@ant-design/icons';
+
import WorkflowPlugin from '../..';
import { NAMESPACE } from '../../locale';
import Manual from './instruction';
-import { addCustomFormField, addCustomFormField_deprecated } from './instruction/forms/custom';
-import {
- addActionButton,
- addActionButton_deprecated,
- addBlockButton,
- addBlockButton_deprecated,
-} from './instruction/SchemaConfig';
+import { addCustomFormField } from './instruction/forms/custom';
+import { addActionButton, addBlockButton } from './instruction/SchemaConfig';
import { WorkflowTodo } from './WorkflowTodo';
import { WorkflowTodoBlockInitializer } from './WorkflowTodoBlockInitializer';
@@ -20,18 +18,31 @@ export class PluginManual extends Plugin {
const workflow = this.app.pm.get('workflow') as WorkflowPlugin;
workflow.registerInstruction('manual', Manual);
- this.app.schemaInitializerManager.add(addBlockButton_deprecated);
this.app.schemaInitializerManager.add(addBlockButton);
- this.app.schemaInitializerManager.add(addActionButton_deprecated);
this.app.schemaInitializerManager.add(addActionButton);
- this.app.schemaInitializerManager.add(addCustomFormField_deprecated);
this.app.schemaInitializerManager.add(addCustomFormField);
const blockInitializers = this.app.schemaInitializerManager.get('page:addBlock');
- blockInitializers.add('otherBlocks.workflowTodos', {
- title: `{{t("Workflow todos", { ns: "${NAMESPACE}" })}}`,
- Component: 'WorkflowTodoBlockInitializer',
- icon: 'CheckSquareOutlined',
+ blockInitializers.add('otherBlocks.workflow', {
+ name: 'workflow',
+ title: `{{t("Workflow", { ns: "${NAMESPACE}" })}}`,
+ type: 'subMenu',
+ icon: ,
+ children: [
+ {
+ name: 'common',
+ title: `{{t("Common", { ns: "${NAMESPACE}" })}}`,
+ type: 'itemGroup',
+ children: [
+ {
+ name: 'todos',
+ title: `{{t("Workflow todos", { ns: "${NAMESPACE}" })}}`,
+ Component: 'WorkflowTodoBlockInitializer',
+ icon: 'CheckSquareOutlined',
+ },
+ ],
+ },
+ ],
});
}
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/SchemaConfig.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/SchemaConfig.tsx
index d70500dc3..e29af09ee 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/SchemaConfig.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/SchemaConfig.tsx
@@ -12,6 +12,7 @@ import {
InitializerWithSwitch,
SchemaComponent,
SchemaComponentContext,
+ SchemaInitializer,
SchemaInitializerItem,
SchemaInitializerItemType,
SchemaSettingsBlockTitleItem,
@@ -104,11 +105,8 @@ const blockTypeNames = {
record: `{{t("Data record", { ns: "${NAMESPACE}" })}}`,
};
-/**
- * @deprecated
- */
-export const addBlockButton_deprecated = new CompatibleSchemaInitializer({
- name: 'AddBlockButton',
+export const addBlockButton = new SchemaInitializer({
+ name: 'workflowManual:popup:configureUserInterface:addBlock',
wrap: gridRowColWrap,
title: '{{t("Add block")}}',
items: [
@@ -135,7 +133,7 @@ export const addBlockButton_deprecated = new CompatibleSchemaInitializer({
{
name: 'nodes',
type: 'subMenu',
- title: `{{t("Node result", { ns: "workflow" })}}`,
+ title: `{{t("Node result", { ns: "${NAMESPACE}" })}}`,
children: nodeBlockInitializers,
},
]
@@ -164,7 +162,7 @@ export const addBlockButton_deprecated = new CompatibleSchemaInitializer({
children: [
{
name: 'markdown',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
Component: 'MarkdownBlockInitializer',
},
],
@@ -172,74 +170,6 @@ export const addBlockButton_deprecated = new CompatibleSchemaInitializer({
],
});
-export const addBlockButton = new CompatibleSchemaInitializer(
- {
- name: 'workflowManual:popup:configureUserInterface:addBlock',
- wrap: gridRowColWrap,
- title: '{{t("Add block")}}',
- items: [
- {
- type: 'itemGroup',
- name: 'dataBlocks',
- title: '{{t("Data blocks")}}',
- hideIfNoChildren: true,
- useChildren() {
- const workflowPlugin = usePlugin(WorkflowPlugin);
- const current = useNodeContext();
- const nodes = useAvailableUpstreams(current);
- const triggerInitializers = [useTriggerInitializers()].filter(Boolean);
- const nodeBlockInitializers = nodes
- .map((node) => {
- const instruction = workflowPlugin.instructions.get(node.type);
- return instruction?.useInitializers?.(node);
- })
- .filter(Boolean);
- const dataBlockInitializers: any = [
- ...triggerInitializers,
- ...(nodeBlockInitializers.length
- ? [
- {
- name: 'nodes',
- type: 'subMenu',
- title: `{{t("Node result", { ns: "${NAMESPACE}" })}}`,
- children: nodeBlockInitializers,
- },
- ]
- : []),
- ].filter(Boolean);
- return dataBlockInitializers;
- },
- },
- {
- type: 'itemGroup',
- name: 'form',
- title: '{{t("Form")}}',
- useChildren() {
- const dm = useDataSourceManager();
- const allCollections = dm.getAllCollections();
- return Array.from(manualFormTypes.getValues()).map((item: ManualFormType) => {
- const { useInitializer: getInitializer } = item.config;
- return getInitializer({ allCollections });
- });
- },
- },
- {
- type: 'itemGroup',
- name: 'otherBlocks',
- title: '{{t("Other blocks")}}',
- children: [
- {
- name: 'markdown',
- title: '{{t("Markdown")}}',
- Component: 'MarkdownBlockInitializer',
- },
- ],
- },
- ],
- },
- addBlockButton_deprecated,
-);
-
function AssignedFieldValues() {
const ctx = useContext(SchemaComponentContext);
const { t } = useTranslation();
@@ -418,11 +348,8 @@ function ActionInitializer() {
);
}
-/**
- * @deprecated
- */
-export const addActionButton_deprecated = new CompatibleSchemaInitializer({
- name: 'AddActionButton',
+export const addActionButton = new SchemaInitializer({
+ name: 'workflowManual:form:configureActions',
title: '{{t("Configure actions")}}',
items: [
{
@@ -452,40 +379,6 @@ export const addActionButton_deprecated = new CompatibleSchemaInitializer({
],
});
-export const addActionButton = new CompatibleSchemaInitializer(
- {
- name: 'workflowManual:form:configureActions',
- title: '{{t("Configure actions")}}',
- items: [
- {
- name: 'jobStatusResolved',
- title: `{{t("Continue the process", { ns: "${NAMESPACE}" })}}`,
- Component: ContinueInitializer,
- action: JOB_STATUS.RESOLVED,
- actionProps: {
- type: 'primary',
- },
- },
- {
- name: 'jobStatusRejected',
- title: `{{t("Terminate the process", { ns: "${NAMESPACE}" })}}`,
- Component: ActionInitializer,
- action: JOB_STATUS.REJECTED,
- actionProps: {
- danger: true,
- },
- },
- {
- name: 'jobStatusPending',
- title: `{{t("Save temporarily", { ns: "${NAMESPACE}" })}}`,
- Component: ActionInitializer,
- action: JOB_STATUS.PENDING,
- },
- ],
- },
- addActionButton_deprecated,
-);
-
// NOTE: fake useAction for ui configuration
function useSubmit() {
// const { values, submit, id: formId } = useForm();
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/forms/custom.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/forms/custom.tsx
index 9060bf2c0..beab7f0f0 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/forms/custom.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/forms/custom.tsx
@@ -7,6 +7,7 @@ import {
gridRowColWrap,
RecordProvider,
SchemaComponent,
+ SchemaInitializer,
SchemaInitializerItem,
SchemaInitializerItems,
SchemaInitializerItemType,
@@ -336,28 +337,14 @@ const CustomItemsComponent = (props) => {
);
};
-/**
- * @deprecated
- */
-export const addCustomFormField_deprecated = new CompatibleSchemaInitializer({
- name: 'AddCustomFormField',
+export const addCustomFormField = new SchemaInitializer({
+ name: 'workflowManual:customForm:configureFields',
wrap: gridRowColWrap,
insertPosition: 'beforeEnd',
title: "{{t('Configure fields')}}",
ItemsComponent: CustomItemsComponent,
});
-export const addCustomFormField = new CompatibleSchemaInitializer(
- {
- name: 'workflowManual:customForm:configureFields',
- wrap: gridRowColWrap,
- insertPosition: 'beforeEnd',
- title: "{{t('Configure fields')}}",
- ItemsComponent: CustomItemsComponent,
- },
- addCustomFormField_deprecated,
-);
-
function CustomFormFieldInitializer() {
const itemConfig = useSchemaInitializerItem();
const { insert, setVisible } = useSchemaInitializer();
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/configuration/show-interface/NoticeDetail.initializer.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/configuration/show-interface/NoticeDetail.initializer.tsx
index df4832a33..170997874 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/configuration/show-interface/NoticeDetail.initializer.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/configuration/show-interface/NoticeDetail.initializer.tsx
@@ -66,7 +66,7 @@ export const NoticeDetailInitializer = new SchemaInitializer({
{
name: 'markdown',
type: 'item',
- title: '{{t("Markdown")}}',
+ title: '{{t("Demonstration text")}}',
component: 'MarkdownBlockInitializer',
},
],
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/usage/kit.ts b/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/usage/kit.ts
index 5c1a05c3a..46fe7e3d4 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/usage/kit.ts
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/notice/usage/kit.ts
@@ -14,7 +14,7 @@ export class KitUsage extends Plugin {
NoticeBlockInitializer: NoticeBlockInitializer,
});
- this.app.schemaInitializerManager.get('page:addBlock').add('otherBlocks.notice', {
+ this.app.schemaInitializerManager.get('page:addBlock').add('otherBlocks.workflow.common.notice', {
key: 'noticeBlock',
name: 'noticeBlock',
type: 'item',
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/webhook/plugin.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/webhook/plugin.tsx
index 75c3495e2..62012fc92 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/webhook/plugin.tsx
+++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/webhook/plugin.tsx
@@ -8,15 +8,22 @@ const DispatcherSvg = () => (
);
-const Dispatcher = (props) => ;
+const DesignSvg = () => (
+
+);
-Icon.register({ Dispatcher });
+const Dispatcher = (props) => ;
+const Design = (props) => ;
+
+Icon.register({ Dispatcher, Design });
export class PluginWebhook extends Plugin {
async load() {
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json b/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json
index be3247071..e1393dca3 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json
+++ b/packages/plugins/@tachybase/plugin-workflow/src/locale/en-US.json
@@ -282,7 +282,12 @@
"Are you sure you want to resubmit it?": "Are you sure you want to resubmit it?",
"MyLaunch": "MyLaunch",
"CarbonCopy": "CarbonCopy",
+ "Initiate Request": "Initiate Request",
+ "My Requests": "My Requests",
+ "CC'd to Me": "CC'd to Me",
+ "My Pending Tasks": "My Pending Tasks",
+ "Common": "Common",
"ApprovalCarbonCopy": "Approval:CarbonCopy",
"Approval Launch": "Approval Launch",
"needAuthorization": "needAuthorization"
-}
\ No newline at end of file
+}
diff --git a/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json b/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json
index d176de94c..7e20dacfe 100644
--- a/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json
+++ b/packages/plugins/@tachybase/plugin-workflow/src/locale/zh-CN.json
@@ -211,7 +211,7 @@
"No repeat": "不重复",
"Node result": "节点数据",
"Node type": "节点类型",
- "Notice Center": "工作流:通知中心",
+ "Notice Center": "通知中心",
"Notice blocks": "通知区块",
"Notice": "通知",
"Off": "停用",
@@ -366,5 +366,10 @@
"CarbonCopy": "抄送",
"ApprovalCarbonCopy": "审批:抄送",
"Approval Launch": "审批发起",
+ "Initiate Request": "发起申请",
+ "My Requests": "我的申请",
+ "CC'd to Me": "抄送我的",
+ "My Pending Tasks": "我的代办",
+ "Common": "通用",
"needAuthorization": "是否携带权限校验"
-}
\ No newline at end of file
+}