From 9495917e97dd937dc97751ced4b7357d17139269 Mon Sep 17 00:00:00 2001 From: Junyi Date: Sun, 4 Apr 2021 23:33:06 +0800 Subject: [PATCH] fix: minor problems (#72) --- README.md | 6 +++--- package.json | 4 ++-- packages/actions/src/actions/common.ts | 6 +++--- .../app/src/components/pages/AdminLoader/Actions/index.tsx | 2 +- .../app/src/components/pages/AdminLoader/Page/index.tsx | 2 +- .../src/components/pages/AdminLoader/View/Kanban/index.tsx | 2 +- packages/app/src/components/views/Field/index.tsx | 2 +- packages/resourcer/src/action.ts | 4 ---- packages/resourcer/src/index.ts | 3 ++- 9 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index f7a3487a82..88dd90d8ad 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,9 @@ Why choose NocoBase - Precise configuration of data manipulation rights, access rights to pages and menus - **Developer-friendly** - Microkernel architecture, flexible and easy to extend, with a robust plug-in system - - Node.js-based, using mainstream frameworks and technologies, including Koa, Sequelize, React, Ant Design, etc. - - Progressive development, low start-up difficulty, friendly to newcomers - - No abduction, no strong dependencies, can be used in any combination or extensions, can be used in existing projects + - Node.js-based, with popular frameworks and technologies, including Koa, Sequelize, React, Ant Design, etc. + - Progressive development, easy for getting-started, friendly to newcomers + - No binding, no strong dependencies, can be used in any combination or extensions, can be used in existing projects Architecture ---------- diff --git a/package.json b/package.json index e2cd60da50..9b69abeb68 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "private": true, "scripts": { "start": "cd packages/app && npm start", - "start-server": "cd packages/api && nodemon", - "start-client": "cd packages/app && umi dev", + "start-server": "cd packages/api && npm start", + "start-client": "cd packages/app && npx umi dev", "bootstrap": "lerna bootstrap --no-ci", "build": "father-build", "clean": "lerna clean", diff --git a/packages/actions/src/actions/common.ts b/packages/actions/src/actions/common.ts index bafb0da0f0..bce64d16e7 100644 --- a/packages/actions/src/actions/common.ts +++ b/packages/actions/src/actions/common.ts @@ -9,7 +9,7 @@ import { BELONGSTOMANY, whereCompare } from '@nocobase/database'; -import { DEFAULT_PAGE, DEFAULT_PER_PAGE } from '@nocobase/resourcer'; +import { PageParameter } from '@nocobase/resourcer'; import { filterByFields } from '../utils'; async function hasManyGet(instances, options: any = {}) { @@ -158,8 +158,8 @@ async function belongsToManyGet(instance, options) { */ export async function list(ctx: Context, next: Next) { const { - page = DEFAULT_PAGE, - perPage = DEFAULT_PER_PAGE, + page = PageParameter.DEFAULT_PAGE, + perPage = PageParameter.DEFAULT_PER_PAGE, sort = [], fields = [], filter = {}, diff --git a/packages/app/src/components/pages/AdminLoader/Actions/index.tsx b/packages/app/src/components/pages/AdminLoader/Actions/index.tsx index 1aa97f42cb..2b9bd27456 100644 --- a/packages/app/src/components/pages/AdminLoader/Actions/index.tsx +++ b/packages/app/src/components/pages/AdminLoader/Actions/index.tsx @@ -337,7 +337,7 @@ export function Actions(props) { {actions.map( action => ACTIONS.has(action.type) && ( -
+
+
{fields.map((field: any) => { return ( - + { diff --git a/packages/resourcer/src/action.ts b/packages/resourcer/src/action.ts index 6a219a73b4..033a201ab1 100644 --- a/packages/resourcer/src/action.ts +++ b/packages/resourcer/src/action.ts @@ -172,10 +172,6 @@ export interface ActionParams { [key: string]: any; } -export const DEFAULT_PAGE = PageParameter.DEFAULT_PAGE; -export const DEFAULT_PER_PAGE = PageParameter.DEFAULT_PER_PAGE; -export const MAX_PER_PAGE = PageParameter.MAX_PER_PAGE; - export class Action { protected handler: any; diff --git a/packages/resourcer/src/index.ts b/packages/resourcer/src/index.ts index 04a82c09fe..16e56b105d 100644 --- a/packages/resourcer/src/index.ts +++ b/packages/resourcer/src/index.ts @@ -3,7 +3,8 @@ import Resourcer from './resourcer'; export * from './utils'; export * from './middleware'; export * from './action'; +export * from './parameter'; export * from './resource'; export * from './resourcer'; -export default Resourcer; \ No newline at end of file +export default Resourcer;