feat(client): upgrade antd to 5.19.4, designable mode can edit component schema directly now. close #1432 (#1434)

Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#1434
This commit is contained in:
sealday 2024-08-02 02:26:19 +08:00
parent b8eac59a07
commit e5156a44a9
54 changed files with 1552 additions and 1101 deletions

View File

@ -1,20 +1,11 @@
################# DOCKER #################
ADMINER_PORT=10101
DB_MYSQL_PORT=10102
DB_POSTGRES_PORT=10103
VERDACCIO_PORT=10104
# VERDACCIO_URL=http://host.docker.internal:10104/
################# TACHYBASE APPLICATION #################
# !!! When `APP_ENV=production`, opening http://localhost:13000/ will show "Not Found".
# !!! It is recommended to use nginx to proxy static files. For example https://github.com/tachybase/tachybase/blob/main/docker/tachybase/tachybase.conf
APP_ENV=development
APP_PORT=13000
APP_PORT=3000
APP_KEY=test-key
# experimental support
EXTENSION_UI_BASE_PATH=/adapters/
API_BASE_PATH=/api/
API_BASE_URL=

View File

@ -93,7 +93,7 @@
],
"overrides": {
"@types/node": "20.14.2",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "1.11.10"
}
}

View File

@ -24,7 +24,7 @@
"@tachybase/sdk": "workspace:*",
"@tachybase/utils": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"antd-style": "3.6.2",
"axios": "^1.6.2",
"classnames": "^2.3.1",

View File

@ -4,7 +4,7 @@ import { ISchema, useFieldSchema } from '@tachybase/schema';
import { saveAs } from 'file-saver';
import { useTranslation } from 'react-i18next';
import { useAPIClient } from '../../api-client';
import { useAPIClient, useRequest } from '../../api-client';
import { createDesignable, useDesignable } from '../../schema-component';
import { SchemaSettingsItemType } from './types';
@ -25,7 +25,6 @@ export const defaultSettingItems = [
type: 'item',
useComponentProps() {
const { t } = useTranslation();
const { dn } = useDesignable();
const api = useAPIClient();
const fieldSchema = useFieldSchema();
@ -94,6 +93,70 @@ export const defaultSettingItems = [
};
},
},
{
name: 'edit',
type: 'modal',
useComponentProps() {
const { t } = useTranslation();
const { refresh } = useDesignable();
const api = useAPIClient();
const fieldSchema = useFieldSchema();
const dn = useMemo(() => {
const dn = createDesignable({ t, api, refresh, current: fieldSchema.parent });
dn.loadAPIClientEvents();
return dn;
}, [t, api, refresh, fieldSchema]);
const { data } = useRequest(async () => {
const { data } = await api.request({
url: `/uiSchemas:getJsonSchema/${fieldSchema['x-uid']}?includeAsyncNode=true`,
});
return data;
});
return {
width: '800px',
hide: !data,
schema: () => {
if (!data) {
return {
title: t('Edit loading.'),
};
} else {
return {
type: 'object',
title: t('Edit'),
properties: {
schema: {
type: 'string',
title: '{{ t("Schema") }}',
required: true,
default: JSON.stringify(data?.data || {}, null, 2),
'x-decorator': 'FormItem',
'x-component': 'CodeMirror',
'x-component-props': {
defaultLanguage: 'JSON',
height: '500px',
},
},
} as ISchema,
};
}
},
title: t('Edit'),
onSubmit: async ({ schema }) => {
dn.emit('patch', {
schema: JSON.parse(schema),
});
dn.refresh();
},
};
},
},
{
name: 'divider',
type: 'divider',
},
],
} as SchemaSettingsItemType,
];

View File

@ -55,3 +55,4 @@ export * from './custom-cascader';
export * from './unixTimestamp';
export * from './nanoIDInput';
export { PageHeader } from '@ant-design/pro-layout';
export { CodeMirror } from '@tachybase/components';

View File

@ -20,7 +20,7 @@
"@formily/shared": "2.3.1",
"@formily/validator": "2.3.1",
"@monaco-editor/react": "^4.6.0",
"antd": "5.19.1",
"antd": "5.19.4",
"classnames": "^2.5.1",
"dayjs": "^1.11.11",
"react-sticky-box": "^1.0.2"

View File

@ -7,7 +7,7 @@
"dependencies": {
"@hapi/topo": "^6.0.0",
"@rc-component/mini-decimal": "^1.1.0",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "^1.11.9",
"dedupe": "^3.0.2",
"deepmerge": "^4.2.2",

View File

@ -7,7 +7,7 @@
"@tachybase/schema": "workspace:*",
"@types/lodash": "^4.17.5",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"antd-mobile": "^5.36.1",
"antd-mobile-icons": "^0.3.0",
"lodash": "4.17.21",

View File

@ -15,7 +15,7 @@
"@tachybase/schema": "workspace:*",
"@types/lodash": "~4.17.5",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"classnames": "^2.3.1",
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.8",

View File

@ -3,7 +3,7 @@
"version": "0.0.55",
"main": "dist/server/index.js",
"devDependencies": {
"antd": "5.19.1"
"antd": "5.19.4"
},
"peerDependencies": {
"@tachybase/client": "workspace:*",

View File

@ -12,7 +12,7 @@
"@tachybase/schema": "workspace:*",
"@types/lodash": "4.17.5",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "^1.11.8",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",

View File

@ -14,7 +14,7 @@
"@tachybase/schema": "workspace:*",
"@types/jsonwebtoken": "^8.5.8",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"async-mutex": "^0.3.2",
"jsonwebtoken": "^8.5.1",
"lodash": "4.17.21",

View File

@ -12,7 +12,7 @@
"@ant-design/icons": "^5.3.7",
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react-i18next": "^14.1.2",
"react-router-dom": "^6.25.1"

View File

@ -10,7 +10,7 @@
"main": "dist/server/index.js",
"devDependencies": {
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"react-i18next": "^14.1.2",
"react-router-dom": "^6.25.1"
},

View File

@ -10,7 +10,7 @@
"main": "dist/server/index.js",
"devDependencies": {
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react-i18next": "^14.1.2"
},

View File

@ -8,7 +8,7 @@
"types": "./dist/server/index.d.ts",
"devDependencies": {
"@ant-design/icons": "~5.3.7",
"antd": "5.19.1",
"antd": "5.19.4",
"react-i18next": "^14.1.2",
"swagger-ui-dist": "^5.3.1"
},

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@tachybase/schema": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "^1.11.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@ -10,7 +10,7 @@
"devDependencies": {
"@ant-design/icons": "~5.3.7",
"@tachybase/components": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"react": "^18.3.1",
"react-i18next": "^14.1.2"
},

View File

@ -10,7 +10,7 @@
"devDependencies": {
"@ant-design/icons": "~5.3.7",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"cron": "^3.1.7",
"react": "^18.3.1",
"react-i18next": "^14.1.2",

View File

@ -16,7 +16,7 @@
"@types/archiver": "^5.3.1",
"@types/file-saver": "^2.0.7",
"@types/lodash": "4.17.5",
"antd": "5.19.1",
"antd": "5.19.4",
"archiver": "^5.3.1",
"content-disposition": "^0.5.4",
"dayjs": "^1.11.8",

View File

@ -14,7 +14,7 @@
"@ant-design/icons": "~5.3.7",
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"cron-parser": "4.4.0",
"dayjs": "^1.11.8",
"lodash": "^4.17.21",

View File

@ -10,7 +10,7 @@
"main": "./dist/server/index.js",
"devDependencies": {
"@ant-design/icons": "~5.3.7",
"antd": "5.19.1",
"antd": "5.19.4",
"react-i18next": "^14.1.2",
"react-router-dom": "~6.25.1"
},

View File

@ -6,7 +6,7 @@
"license": "Apache-2.0",
"main": "./dist/server/index.js",
"devDependencies": {
"antd": "5.19.1",
"antd": "5.19.4",
"cronstrue": "^2.11.0",
"koa-send": "^5.0.1",
"koa-static": "^5.0.0"

View File

@ -6,7 +6,7 @@
"@ant-design/icons": "~5.3.7",
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "^1.11.8",
"lodash": "^4.17.21",
"react-i18next": "^14.1.2"

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"file-saver": "^2.0.5",
"lodash": "~4.17.21",
"react-i18next": "^14.1.2",

View File

@ -13,7 +13,7 @@
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react-i18next": "^14.1.2",
"react-router-dom": "^6.25.1",

View File

@ -14,7 +14,7 @@
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "^1.11.8",
"deepmerge": "^4.2.2",
"koa-compose": "^4.1.0",

View File

@ -11,7 +11,7 @@
"@alicloud/openapi-client": "^0.4.10",
"@alicloud/tea-util": "^1.4.9",
"@ant-design/icons": "^5.3.7",
"antd": "5.19.1",
"antd": "5.19.4",
"react-router-dom": "^6.25.1"
},
"peerDependencies": {

View File

@ -3,7 +3,7 @@
"version": "0.21.82",
"main": "dist/server/index.js",
"dependencies": {
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "^4.17.21",
"mysql2": "^3.9.1",
"pg": "^8.11.3",

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@ant-design/icons": "^5.3.7",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"koa-send": "^5.0.1",
"vditor": "^3.10.3"
},

View File

@ -17,7 +17,7 @@
"@tachybase/schema": "workspace:*",
"@types/koa-multer": "^1.0.1",
"@types/multer": "^1.4.5",
"antd": "5.19.1",
"antd": "5.19.4",
"cos-nodejs-sdk-v5": "^2.11.14",
"koa-static": "^5.0.0",
"lodash": "4.17.21",

View File

@ -13,7 +13,7 @@
"@ctrl/tinycolor": "^3.6.0",
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react-i18next": "^14.1.2"
},

View File

@ -20,7 +20,7 @@
"@antv/x6-react-shape": "^2.0.0",
"@tachybase/schema": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"dagre": "^0.8.5",
"lodash": "4.17.21",
"react": "^18.3.1",

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@ant-design/icons": "~5.3.7",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"react": "^18.3.1",
"react-i18next": "^14.1.2",
"react-iframe": "~1.8.5"

View File

@ -14,7 +14,7 @@
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"@types/node-xlsx": "^0.15.1",
"antd": "5.19.1",
"antd": "5.19.4",
"file-saver": "^2.0.5",
"lodash": "4.17.21",
"mathjs": "^10.6.0",

View File

@ -12,7 +12,7 @@
"@ant-design/icons": "^5.3.7",
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react-beautiful-dnd": "^13.1.0",
"react-i18next": "^14.1.2"

View File

@ -12,7 +12,7 @@
"@ant-design/icons": "^5.3.7",
"@tachybase/schema": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"deepmerge": "^4.3.1",
"react-i18next": "^14.1.2"
},

View File

@ -12,7 +12,7 @@
"@ant-design/icons": "^5.3.7",
"@types/tar-fs": "^2.0.2",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"react-i18next": "^14.1.2",
"tar-fs": "^3.0.4"
},

View File

@ -19,7 +19,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react": "~18.3.1",
"react-dom": "~18.3.1",

View File

@ -12,7 +12,7 @@
"@types/react": "~18.3.3",
"@types/react-dom": "~18.3.0",
"ahooks": "3.x",
"antd": "5.19.1",
"antd": "5.19.4",
"antd-mobile": "^5.36.1",
"antd-mobile-icons": "^0.3.0",
"lodash": "4.17.21",

View File

@ -10,7 +10,7 @@
"main": "./dist/server/index.js",
"devDependencies": {
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"async-mutex": "^0.3.2",
"lodash": "4.17.21",
"mysql2": "^2.3.3",

View File

@ -9,7 +9,7 @@
"main": "./dist/server/index.js",
"devDependencies": {
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"react": "~18.3.1",
"react-i18next": "^14.1.2"

View File

@ -13,7 +13,7 @@
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"ahooks": "^3.7.2",
"antd": "5.19.1",
"antd": "5.19.4",
"nanoid": "3.3.4",
"openid-client": "^5.4.2",
"react": "~18.3.1",

View File

@ -12,7 +12,7 @@
"@ant-design/icons": "~5.3.7",
"@node-saml/node-saml": "^4.0.2",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"react": "~18.3.1",
"react-i18next": "^14.1.2",
"react-router-dom": "^6.25.1"

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"cron-parser": "4.4.0",
"dayjs": "^1.11.8",
"lodash": "4.17.21",

View File

@ -10,7 +10,7 @@
"main": "./dist/server/index.js",
"devDependencies": {
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"react": "~18.3.1",
"react-i18next": "^14.1.2"
},

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@ant-design/icons": "~5.3.7",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"rc-tree-select": "5.5.5",
"react": "~18.3.1",

View File

@ -13,7 +13,7 @@
"@arvinxu/layout-kit": "^1",
"@ctrl/tinycolor": "^3.6.0",
"@types/lodash": "4.17.5",
"antd": "5.19.1",
"antd": "5.19.4",
"lodash": "4.17.21",
"rc-util": "^5.32.0",
"react": "^18.3.1",

View File

@ -11,7 +11,7 @@
"devDependencies": {
"@tachybase/schema": "workspace:*",
"@types/jsonwebtoken": "^8.5.8",
"antd": "5.19.1",
"antd": "5.19.4",
"jsonwebtoken": "^8.5.1",
"react-i18next": "^14.1.2"
},

View File

@ -14,7 +14,7 @@
"@alicloud/tea-util": "1.4.4",
"@tachybase/components": "workspace:*",
"@tachybase/schema": "workspace:*",
"antd": "5.19.1",
"antd": "5.19.4",
"dayjs": "^1.11.8",
"react": "~18.3.1",
"react-i18next": "^14.1.2",

View File

@ -8,7 +8,7 @@
"dependencies": {
"@ant-design/icons": "^5.3.7",
"@types/xml2js": "^0.4.14",
"antd": "^5.18.3",
"antd": "5.19.4",
"axios": "^1.7.2",
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",

View File

@ -9,7 +9,7 @@
"dependencies": {
"@ant-design/icons": "^5.3.7",
"ahooks": "^3.8.0",
"antd": "5.19.1",
"antd": "5.19.4",
"axios": "^1.7.2",
"react-router-dom": "^6.25.1"
},

View File

@ -21,7 +21,7 @@
"@types/file-saver": "^2.0.7",
"@types/lodash": "^4.17.5",
"@types/qrcode": "^1.5.5",
"antd": "5.19.1",
"antd": "5.19.4",
"axios": "^1.6.2",
"cron-parser": "4.4.0",
"file-saver": "^2.0.5",

File diff suppressed because it is too large Load Diff