From c71f45ca6a15149703fdf12f4d0f68a226d10a7e Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 27 Apr 2022 20:23:33 +0800 Subject: [PATCH] feat: improve code --- .env.example | 1 + packages/app/client/src/pages/document.ejs | 23 +++++++++++++++++++ .../src/acl/Configuration/RoleConfigure.tsx | 8 +++---- .../src/acl/Configuration/schemas/roles.ts | 2 +- packages/core/client/src/locale/zh_CN.ts | 6 ++++- .../resources/templates/load-src-from-npm.js | 6 ++--- 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 783b92cb22..eeabcc8734 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,7 @@ SERVER_BASE_PATH=/api/ SERVER_BASE_URL= DB_DIALECT=sqlite +DB_STORAGE=db.sqlite # DB_HOST=localhost # DB_PORT=5432 diff --git a/packages/app/client/src/pages/document.ejs b/packages/app/client/src/pages/document.ejs index f1de646ee4..c5197757bc 100644 --- a/packages/app/client/src/pages/document.ejs +++ b/packages/app/client/src/pages/document.ejs @@ -7,6 +7,29 @@ + diff --git a/packages/core/client/src/acl/Configuration/RoleConfigure.tsx b/packages/core/client/src/acl/Configuration/RoleConfigure.tsx index 64fb8b9854..548daaf770 100644 --- a/packages/core/client/src/acl/Configuration/RoleConfigure.tsx +++ b/packages/core/client/src/acl/Configuration/RoleConfigure.tsx @@ -47,11 +47,11 @@ export const RoleConfigure = () => { title: t('Configure permissions'), 'x-decorator': 'FormItem', 'x-component': 'Checkbox', - 'x-content': '允许配置系统,包括界面配置、数据表配置、权限配置、系统配置等全部配置项', + 'x-content': t('Allows configuration of the whole system, including UI, collections, permissions, etc.'), }, 'strategy.actions': { - title: t('General action permissions'), - description: '所有数据表都默认使用通用数据操作权限;同时,可以针对每个数据表单独配置权限。', + title: t('Global action permissions'), + description: t('All collections use general action permissions by default; permission configured individually will override the default one.'), 'x-component': 'StrategyActions', 'x-decorator': 'FormItem', }, @@ -59,7 +59,7 @@ export const RoleConfigure = () => { title: t('Menu permissions'), 'x-decorator': 'FormItem', 'x-component': 'Checkbox', - 'x-content': '新增菜单项默认允许访问', + 'x-content': t('New menu items are allowed to be accessed by default.'), }, }, }} diff --git a/packages/core/client/src/acl/Configuration/schemas/roles.ts b/packages/core/client/src/acl/Configuration/schemas/roles.ts index fd9acaa437..c4ce726d61 100644 --- a/packages/core/client/src/acl/Configuration/schemas/roles.ts +++ b/packages/core/client/src/acl/Configuration/schemas/roles.ts @@ -241,7 +241,7 @@ export const roleSchema: ISchema = { properties: { tab1: { type: 'void', - title: '{{t("Global permissions")}}', + title: '{{t("General permissions")}}', 'x-component': 'Tabs.TabPane', 'x-component-props': {}, properties: { diff --git a/packages/core/client/src/locale/zh_CN.ts b/packages/core/client/src/locale/zh_CN.ts index 52118a40fd..be95b0892b 100644 --- a/packages/core/client/src/locale/zh_CN.ts +++ b/packages/core/client/src/locale/zh_CN.ts @@ -364,8 +364,12 @@ export default { 'Role display name': '角色名称', 'Default role': '默认角色', - + 'All collections use general action permissions by default; permission configured individually will override the default one.': '所有数据表都默认使用通用数据操作权限;同时,可以针对每个数据表单独配置权限。', + 'Allows configuration of the whole system, including UI, collections, permissions, etc.': '允许配置系统,包括界面配置、数据表配置、权限配置、系统配置等全部配置项', + 'New menu items are allowed to be accessed by default.': '新增菜单项默认允许访问', 'Global permissions': '全局配置', + 'General permissions': '通用配置', + 'Global action permissions': '全局操作权限', 'General action permissions': '通用操作权限', 'Action display name': '操作名称', 'Allow': '允许', diff --git a/packages/core/create-nocobase-app/src/resources/templates/load-src-from-npm.js b/packages/core/create-nocobase-app/src/resources/templates/load-src-from-npm.js index 251c4b3fcd..4a15562808 100644 --- a/packages/core/create-nocobase-app/src/resources/templates/load-src-from-npm.js +++ b/packages/core/create-nocobase-app/src/resources/templates/load-src-from-npm.js @@ -40,9 +40,9 @@ module.exports = async (packageName, target) => { cwd: target, strip: 1, k: true, - filter(path, entry) { - return !(path.startsWith('package/lib') || path.startsWith('package/esm') || path.startsWith('package/dist')); - }, + // filter(path, entry) { + // return !(path.startsWith('package/lib') || path.startsWith('package/esm') || path.startsWith('package/dist')); + // }, }); await fsP.unlink(tarballFile);