Skip to content

Commit

Permalink
Revert "docs: client components (nocobase#4151)" (nocobase#4215)
Browse files Browse the repository at this point in the history
This reverts commit dee44be.
  • Loading branch information
dream2023 authored Apr 29, 2024
1 parent dee44be commit 3107c71
Show file tree
Hide file tree
Showing 227 changed files with 789 additions and 7,691 deletions.
188 changes: 17 additions & 171 deletions packages/core/client/.dumirc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import path from 'path';
import glob from 'glob';
import _ from 'lodash'
import { getUmiConfig } from '@nocobase/devtools/umiConfig';
import { defineConfig } from 'dumi';
Expand All @@ -9,6 +11,19 @@ const lang = process.env.DOC_LANG;

console.log('process.env.DOC_LANG', lang);

const componentsDir = 'src/schema-component/antd';

function getComponentsMenu() {
const cwd = path.join(__dirname, componentsDir);
const ignores = ['table/index.md', 'form/index.md']; // 老版本,不需要展示
const files = glob.sync('*/index.md', { cwd, ignore: ignores });

return files.map((file) => ({
title: _.upperFirst(_.camelCase(file.replace('/index.md', ''))),
link: `/components/${file.replace('/index.md', '')}`,
}));
}

export default defineConfig({
hash: true,
alias: {
Expand All @@ -24,7 +39,7 @@ export default defineConfig({
resolve: {
docDirs: [`./docs/${lang}`],
atomDirs: [
{ type: 'component', dir: 'src/schema-component/antd' },
{ type: 'component', dir: componentsDir },
],
},
locales: [
Expand Down Expand Up @@ -77,10 +92,6 @@ export default defineConfig({
title: 'PluginSettingsManager',
link: '/core/application/plugin-settings-manager',
},
{
title: 'Request',
link: '/core/request',
},
],
},
{
Expand Down Expand Up @@ -214,172 +225,7 @@ export default defineConfig({
]
}
],
'/components': [
{
title: 'Action',
type: 'group',
children: [
{
"title": "Action",
"link": "/components/action"
},
{
"title": "Filter",
"link": "/components/filter"
},
]
},
{
title: 'Field',
type: 'group',
children: [
{
"title": "Checkbox",
"link": "/components/checkbox"
},
{
"title": "Cascader",
"link": "/components/cascader"
},
{
"title": "ColorPicker",
"link": "/components/color-picker"
},
{
"title": "ColorSelect",
"link": "/components/color-select"
},
{
"title": "DatePicker",
"link": "/components/date-picker"
},
{
"title": "TimePicker",
"link": "/components/time-picker"
},
{
"title": "IconPicker",
"link": "/components/icon-picker"
},
{
"title": "InputNumber",
"link": "/components/input-number"
},
{
"title": "Input",
"link": "/components/input"
},
{
"title": "Password",
"link": "/components/password"
},
{
"title": "Percent",
"link": "/components/percent"
},
{
"title": "Radio",
"link": "/components/radio"
},
{
"title": "Select",
"link": "/components/select"
},
{
"title": "RemoteSelect",
"link": "/components/remote-select"
},
{
"title": "TreeSelect",
"link": "/components/tree-select"
},
{
"title": "Upload",
"link": "/components/upload"
},
{
"title": "CollectionSelect",
"link": "/components/collection-select"
},
{
"title": "Cron",
"link": "/components/cron"
},
{
"title": "Markdown",
"link": "/components/markdown"
},
{
"title": "Variable",
"link": "/components/variable"
}
]
},
{
title: 'Block',
type: 'group',
children: [
{
"title": "BlockItem",
"link": "/components/block-item"
},
{
"title": "CardItem",
"link": "/components/card-item"
},
{
"title": "FormItem",
"link": "/components/form-item"
},
{
"title": "FormV2",
"link": "/components/form-v2"
},
{
"title": "TableV2",
"link": "/components/table-v2"
},
{
"title": "Details",
"link": "/components/details"
},
{
"title": "GridCard",
"link": "/components/grid-card"
},
{
"title": "Grid",
"link": "/components/grid"
},
// {
// "title": "List",
// "link": "/components/list"
// },
]
},
{
title: 'Others',
type: 'group',
children: [
{
"title": "Tabs",
"link": "/components/tabs"
},
{
"title": "ErrorFallback",
"link": "/components/error-fallback"
},
{
"title": "G2Plot",
"link": "/components/g2plot"
},
{
"title": "Preview",
"link": "/components/preview"
},
]
},
]
'/components': getComponentsMenu(),
// '/ui-schema': [
// {
// title: 'Overview',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Table 中的字段信息及列表数据,都是存储在数据库中的。

- `DataBlockProvider`:封装了下面的所有组件,并提供了区块属性
- [CollectionProvider](/core/data-source/collection-provider) / [AssociationProvider](/core/data-source/association-provider): 根据 `DataBlockProvider` 提供的上下文信息,查询对应数据表数据及关系字段信息并传递
- [BlockResourceProvider](/core/data-block/data-block-resource-provider): 根据 `DataBlockProvider` 提供的上下文信息,构建区块 [Resource](/core/request) API,用于区块数据的增删改查
- [BlockResourceProvider](/core/data-block/data-block-resource-provider): 根据 `DataBlockProvider` 提供的上下文信息,构建区块 [Resource](https://docs.nocobase.com/api/sdk#resource-action) API,用于区块数据的增删改查
- [BlockRequestProvider](/core/data-block/data-block-request-provider): 根据 `DataBlockProvider` 提供的上下文信息,自动调用 `BlockResourceProvider` 提供的 `resource.get()``resource.list()` 发起请求,得到区块数据,并传递
- [CollectionRecordProvider](/core/data-source/record-provider): 对于 `resource.get()` 场景,会自动嵌套 `CollectionRecordProvider` 并将 `resource.get()` 请求结果传递下去,`resource.list()` 场景则需要自行使用 `CollectionRecordProvider` 提供数据记录

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DataBlockResourceProvider

根据 `DataBlockProvider` 中的 `collection``association``sourceId` 等属性,构建好 [resource](/core/request) 对象,方便子组件对区块数据的增删改查操作,其内置在 [DataBlockProvider](/core/data-block/data-block-provider)
根据 `DataBlockProvider` 中的 `collection``association``sourceId` 等属性,构建好 [resource](https://docs.nocobase.com/api/sdk#resource-action) 对象,方便子组件对区块数据的增删改查操作,其内置在 [DataBlockProvider](/core/data-block/data-block-provider)


## useDataBlockResource
Expand Down
24 changes: 0 additions & 24 deletions packages/core/client/docs/en-US/core/request/demos/demo1.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions packages/core/client/docs/en-US/core/request/demos/demo2.tsx

This file was deleted.

69 changes: 0 additions & 69 deletions packages/core/client/docs/en-US/core/request/demos/demo3.tsx

This file was deleted.

Loading

0 comments on commit 3107c71

Please sign in to comment.