From 1d2b46ea1b46221890ecc47d5f55ec4b67e4d392 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 17 Jun 2022 08:49:08 +0800 Subject: [PATCH] docs: update doc --- docs/en-US/release-notes.md | 19 ++++- docs/zh-CN/charts.md | 3 - docs/zh-CN/release-notes.md | 19 ++++- .../src/schema-component/antd/chart/Chart.tsx | 5 -- .../src/schema-component/antd/chart/index.ts | 1 - .../antd/g2plot/demos/demo1.tsx | 84 +++++++++++++++++++ .../antd/{chart => g2plot}/index.md | 4 +- .../client/src/schema-component/antd/index.ts | 1 - 8 files changed, 121 insertions(+), 15 deletions(-) delete mode 100644 docs/zh-CN/charts.md delete mode 100644 packages/core/client/src/schema-component/antd/chart/Chart.tsx delete mode 100644 packages/core/client/src/schema-component/antd/chart/index.ts create mode 100644 packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx rename packages/core/client/src/schema-component/antd/{chart => g2plot}/index.md (60%) diff --git a/docs/en-US/release-notes.md b/docs/en-US/release-notes.md index 4b041721b..3d961209c 100644 --- a/docs/en-US/release-notes.md +++ b/docs/en-US/release-notes.md @@ -2,6 +2,19 @@ ## To be released +- fix(plugin-export): allow to configure in acl +- fix: sign in/sign up with enter key +- fix(client): percent precision +- feat: association field block (#493) +- feat: plugin export (#479) +- fix: create or delete collection error (#501) +- feat: update collections & fields (#500) +- fix: rollback when field creation fails (#498) +- fix(client): set `dropdownMatchSelectWidth` to false globally (#497) +- fix(client): no-key warning in user menu items (#496) +- Feat(plugin workflow): cron field for schedule trigger configuration (#495) +- feat: audit logs (#494) +- fix(client): language settings - feat(client): improve locale - refactor(plugin-workflow): add revision column to execution (#491) - fix(plugin-multi-app-manager): fix pg cannot create database block tests @@ -29,12 +42,14 @@ ### New Features -- Fields: formula、relationships(o2o, o2m, m2o, m2m) -- Blocks: charts(g2plot) +- Fields: Formula、Relationships(o2o, o2m, m2o, m2m) +- Blocks: Charts(g2plot) +- Plugins: Audit logs, Export ### Break Changes - The value of the percentage field, such as 20%, the new version is 0.2, the old version is 20 +- Deleted the sub-table field and used the one-to-many field instead ## 2022/06/01 ~ v0.7.0-alpha.83 diff --git a/docs/zh-CN/charts.md b/docs/zh-CN/charts.md deleted file mode 100644 index 737f053db..000000000 --- a/docs/zh-CN/charts.md +++ /dev/null @@ -1,3 +0,0 @@ -# Charts - - diff --git a/docs/zh-CN/release-notes.md b/docs/zh-CN/release-notes.md index 06066ef78..007b932d7 100644 --- a/docs/zh-CN/release-notes.md +++ b/docs/zh-CN/release-notes.md @@ -2,6 +2,19 @@ ## To be released +- fix(plugin-export): allow to configure in acl +- fix: sign in/sign up with enter key +- fix(client): percent precision +- feat: association field block (#493) +- feat: plugin export (#479) +- fix: create or delete collection error (#501) +- feat: update collections & fields (#500) +- fix: rollback when field creation fails (#498) +- fix(client): set `dropdownMatchSelectWidth` to false globally (#497) +- fix(client): no-key warning in user menu items (#496) +- Feat(plugin workflow): cron field for schedule trigger configuration (#495) +- feat: audit logs (#494) +- fix(client): language settings - feat(client): improve locale - refactor(plugin-workflow): add revision column to execution (#491) - fix(plugin-multi-app-manager): fix pg cannot create database block tests @@ -29,12 +42,14 @@ ### New Features -- Fields: formula、relationships(o2o, o2m, m2o, m2m) -- Blocks: charts(g2plot) +- Fields: Formula、Relationships(o2o, o2m, m2o, m2m) +- Blocks: Charts(g2plot) +- Plugins: Audit logs, Export ### Break Changes - The value of the percentage field, such as 20%, the new version is 0.2, the old version is 20 +- Deleted the sub-table field and used the one-to-many field instead ## 2022/06/01 ~ v0.7.0-alpha.83 diff --git a/packages/core/client/src/schema-component/antd/chart/Chart.tsx b/packages/core/client/src/schema-component/antd/chart/Chart.tsx deleted file mode 100644 index 6a813f227..000000000 --- a/packages/core/client/src/schema-component/antd/chart/Chart.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; - -export const Chart = () => { - return
Chart
; -}; diff --git a/packages/core/client/src/schema-component/antd/chart/index.ts b/packages/core/client/src/schema-component/antd/chart/index.ts deleted file mode 100644 index c9f6de63f..000000000 --- a/packages/core/client/src/schema-component/antd/chart/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Chart'; diff --git a/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx new file mode 100644 index 000000000..794bfbca7 --- /dev/null +++ b/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx @@ -0,0 +1,84 @@ +import { APIClient, APIClientProvider, G2Plot, SchemaComponent, SchemaComponentProvider } from '@nocobase/client'; +import MockAdapter from 'axios-mock-adapter'; +import React from 'react'; + +const api = new APIClient(); + +const mock = new MockAdapter(api.axios); + +mock.onGet('/test').reply(200, { + data: [ + { + Date: '2010-01', + scales: 1998, + }, + { + Date: '2010-02', + scales: 1850, + }, + { + Date: '2010-03', + scales: 1720, + }, + { + Date: '2010-04', + scales: 1818, + }, + { + Date: '2010-05', + scales: 1920, + }, + { + Date: '2010-06', + scales: 1802, + }, + { + Date: '2010-07', + scales: 1945, + }, + { + Date: '2010-08', + scales: 1856, + }, + { + Date: '2010-09', + scales: 2107, + }, + ], +}); + +const fetchData = async (api: APIClient, options) => { + const response = await api.request(options); + return response?.data?.data; +}; + +const schema = { + type: 'void', + name: 'line', + 'x-designer': 'G2Plot.Designer', + 'x-decorator': 'CardItem', + 'x-component': 'G2Plot', + 'x-component-props': { + plot: 'Line', + config: { + data: '{{ fetchData(api, { url: "/test" }) }}', + padding: 'auto', + xField: 'Date', + yField: 'scales', + xAxis: { + // type: 'timeCat', + tickCount: 5, + }, + }, + }, +}; + +export default () => { + return ( + + + + + + ); +}; diff --git a/packages/core/client/src/schema-component/antd/chart/index.md b/packages/core/client/src/schema-component/antd/g2plot/index.md similarity index 60% rename from packages/core/client/src/schema-component/antd/chart/index.md rename to packages/core/client/src/schema-component/antd/g2plot/index.md index 561232252..5ccc6f5f5 100644 --- a/packages/core/client/src/schema-component/antd/chart/index.md +++ b/packages/core/client/src/schema-component/antd/g2plot/index.md @@ -5,4 +5,6 @@ group: path: /schema-components --- -# Chart 待定 +# G2Plot + + diff --git a/packages/core/client/src/schema-component/antd/index.ts b/packages/core/client/src/schema-component/antd/index.ts index d4ca4432f..d97193be7 100644 --- a/packages/core/client/src/schema-component/antd/index.ts +++ b/packages/core/client/src/schema-component/antd/index.ts @@ -3,7 +3,6 @@ export * from './block-item'; export * from './calendar'; export * from './card-item'; export * from './cascader'; -export * from './chart'; export * from './checkbox'; export * from './color-select'; export * from './date-picker';