Merge branch 'next' into develop

This commit is contained in:
chenos 2024-08-26 10:25:20 +08:00
commit 73eeda3bf7
125 changed files with 594 additions and 383 deletions

View File

@ -6,6 +6,10 @@ concurrency:
on:
workflow_dispatch:
inputs:
is_feat:
description: 'is feat'
type: boolean
jobs:
push-commit:
@ -78,7 +82,7 @@ jobs:
echo "packages/pro-plugins/" >> .git/info/exclude
bash release.sh $IS_FEAT
env:
IS_FEAT: false
IS_FEAT: ${{ inputs.is_feat && '--is-feat' || '' }}
- name: push pro plugins
continue-on-error: true
uses: ad-m/github-push-action@master

View File

@ -7,6 +7,137 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v1.3.0-beta](https://github.com/nocobase/nocobase/compare/v1.2.39-alpha...v1.3.0-beta) - 2024-08-25
### Merged
- feat(plugin-workflow-mailer): add variables [`#5120`](https://github.com/nocobase/nocobase/pull/5120)
- feat(client): add constant props api for variable input [`#5116`](https://github.com/nocobase/nocobase/pull/5116)
- fix(data-vi): add size settings for pie, bar and dualAxes [`#5113`](https://github.com/nocobase/nocobase/pull/5113)
- fix(mobile): avoid crashing [`#5109`](https://github.com/nocobase/nocobase/pull/5109)
- fix(varaible): resolve error on template block submission [`#5103`](https://github.com/nocobase/nocobase/pull/5103)
- feat: allows to filter child nodes in tree table blocks [`#5096`](https://github.com/nocobase/nocobase/pull/5096)
- feat: allow to set distinct for query measures [`#5091`](https://github.com/nocobase/nocobase/pull/5091)
- feat(kanban): add support for opening via URL [`#5083`](https://github.com/nocobase/nocobase/pull/5083)
- feat: create file record via path [`#5088`](https://github.com/nocobase/nocobase/pull/5088)
- refactor: update Chinese translation for "Style" [`#5078`](https://github.com/nocobase/nocobase/pull/5078)
- fix: resolve tab switching issue [`#5081`](https://github.com/nocobase/nocobase/pull/5081)
- fix(kanban): correct componentType to 'Kanban' [`#5080`](https://github.com/nocobase/nocobase/pull/5080)
- refactor: markdown rendering engine [`#5079`](https://github.com/nocobase/nocobase/pull/5079)
- fix(embed): fix the problem that switching tabs doesn't work [`#5074`](https://github.com/nocobase/nocobase/pull/5074)
- refactor: datetime field support timezone, defaultToCurrentTime, and onUpdateToCurrentTime [`#5012`](https://github.com/nocobase/nocobase/pull/5012)
- feat(data-vi): allow to set link for statistic chart [`#5073`](https://github.com/nocobase/nocobase/pull/5073)
- refactor(plugin-workflow): add calculation nodes group [`#5035`](https://github.com/nocobase/nocobase/pull/5035)
- fix(mobile): fix 'Edit link' setting [`#5068`](https://github.com/nocobase/nocobase/pull/5068)
- fix: html rendering in markdown block [`#5064`](https://github.com/nocobase/nocobase/pull/5064)
- fix: gridCard blocks cannot flip pages when using API data sources [`#5066`](https://github.com/nocobase/nocobase/pull/5066)
- fix(template): refresh parent data on submit button click in referenced template block [`#5057`](https://github.com/nocobase/nocobase/pull/5057)
- fix: html rendering in markdown block [`#5062`](https://github.com/nocobase/nocobase/pull/5062)
- fix(m2m-array): check naming collision [`#5059`](https://github.com/nocobase/nocobase/pull/5059)
- style: table column congirure fields bar style improve [`#5055`](https://github.com/nocobase/nocobase/pull/5055)
- fix(inherit): fix 'Add new' button for inherited collectons [`#5049`](https://github.com/nocobase/nocobase/pull/5049)
- feat(client): add parse options for variable input [`#5043`](https://github.com/nocobase/nocobase/pull/5043)
- fix(iframe): fix the popup contained Iframe block does not work [`#5039`](https://github.com/nocobase/nocobase/pull/5039)
- fix(plugin-workflow-aggregate): limit aggregate instruction to only work on db data source [`#5033`](https://github.com/nocobase/nocobase/pull/5033)
- fix: extend collection cache bug [`#5031`](https://github.com/nocobase/nocobase/pull/5031)
- feat: encryption field [`#4975`](https://github.com/nocobase/nocobase/pull/4975)
- fix: mobile auth [`#5015`](https://github.com/nocobase/nocobase/pull/5015)
- fix(client): show original field input component after cleared variable [`#5028`](https://github.com/nocobase/nocobase/pull/5028)
- feat: support to add Settings block in mobile [`#5025`](https://github.com/nocobase/nocobase/pull/5025)
- style: action style improve [`#5018`](https://github.com/nocobase/nocobase/pull/5018)
- fix: bug [`#5009`](https://github.com/nocobase/nocobase/pull/5009)
- feat: adapt desktop blocks to mobile [`#4945`](https://github.com/nocobase/nocobase/pull/4945)
- fix(CI): continue on error [`#4999`](https://github.com/nocobase/nocobase/pull/4999)
- fix: markdown block should supports the markdown syntax [`#5003`](https://github.com/nocobase/nocobase/pull/5003)
- fix: disabled action to maintain font color on mouse hover (#4988) [`#5000`](https://github.com/nocobase/nocobase/pull/5000)
- fix: disabled action to maintain font color on mouse hover (#4988) [`#4998`](https://github.com/nocobase/nocobase/pull/4998)
- refactor: support dynamic field component [`#4932`](https://github.com/nocobase/nocobase/pull/4932)
- feat: mobile modal bug [`#4976`](https://github.com/nocobase/nocobase/pull/4976)
- fix(T-4927): table performance bug [`#4978`](https://github.com/nocobase/nocobase/pull/4978)
- refactor: pc block & action compatible with mobile devices [`#4935`](https://github.com/nocobase/nocobase/pull/4935)
- feat: markdown & iframe html support handlebars as rendering engin [`#4946`](https://github.com/nocobase/nocobase/pull/4946)
- fix(data-vi): issue of fixed height setting has no effect [`#4960`](https://github.com/nocobase/nocobase/pull/4960)
- fix(client): fix variable input value type [`#4955`](https://github.com/nocobase/nocobase/pull/4955)
- fix: remove theme token [`#4947`](https://github.com/nocobase/nocobase/pull/4947)
- fix: ignore pro [`#4928`](https://github.com/nocobase/nocobase/pull/4928)
- fix: prevent URL change on clicking unconfigured association field [`#4919`](https://github.com/nocobase/nocobase/pull/4919)
- feat(data-vi): optimize style settings for chart blocks [`#4940`](https://github.com/nocobase/nocobase/pull/4940)
- chore: skip app supervisor [`#4937`](https://github.com/nocobase/nocobase/pull/4937)
- fix: mobile style bug [`#4934`](https://github.com/nocobase/nocobase/pull/4934)
- fix: build image ci [`#4929`](https://github.com/nocobase/nocobase/pull/4929)
- feat: plugin mobile v2 [`#4777`](https://github.com/nocobase/nocobase/pull/4777)
- refactor(test): change mock cluster constructor arguments [`#4917`](https://github.com/nocobase/nocobase/pull/4917)
- fix: fix custom request linkage rules problem [`#4913`](https://github.com/nocobase/nocobase/pull/4913)
- refactor(server): simplify api for publishing sync message [`#4912`](https://github.com/nocobase/nocobase/pull/4912)
- chore: data source api [`#4588`](https://github.com/nocobase/nocobase/pull/4588)
- feat(server): add cluster mode for starting app [`#4895`](https://github.com/nocobase/nocobase/pull/4895)
- Revert "fix(client): sub application name (#4886)" [`#4887`](https://github.com/nocobase/nocobase/pull/4887)
- fix(client): sub application name [`#4886`](https://github.com/nocobase/nocobase/pull/4886)
- refactor: optimize e2e workflow [`#4883`](https://github.com/nocobase/nocobase/pull/4883)
- refactor(client): allow to select null value explicitly in variable input [`#4869`](https://github.com/nocobase/nocobase/pull/4869)
- chore: next release ci [`#4861`](https://github.com/nocobase/nocobase/pull/4861)
- test: add locator for approval workflow to enable the withdraw button [`#4859`](https://github.com/nocobase/nocobase/pull/4859)
- refactor(server): sync manager and ci [`#4858`](https://github.com/nocobase/nocobase/pull/4858)
- fix(Table): fix styling issue with fixed columns [`#4857`](https://github.com/nocobase/nocobase/pull/4857)
- feat(database): new field type many to many (array) [`#4708`](https://github.com/nocobase/nocobase/pull/4708)
- feat(server): add sync-manager [`#4780`](https://github.com/nocobase/nocobase/pull/4780)
- chore(router): disable using replace strategy when closing popups or subpages [`#4838`](https://github.com/nocobase/nocobase/pull/4838)
- fix(plugin-manager): fix issue with inability to scroll on plugin management page [`#4837`](https://github.com/nocobase/nocobase/pull/4837)
- fix: adjust the margin of the Add block button in the grid layout [`#4820`](https://github.com/nocobase/nocobase/pull/4820)
- fix: base ref [`#4829`](https://github.com/nocobase/nocobase/pull/4829)
- feat: open subpages within the main page [`#4797`](https://github.com/nocobase/nocobase/pull/4797)
- feat(client): add `disabled` option to props of SchemaSettingsItem [`#4817`](https://github.com/nocobase/nocobase/pull/4817)
- fix(popups): correct value for filterByTk [`#4792`](https://github.com/nocobase/nocobase/pull/4792)
- refactor: include sourceId in popup URL [`#4788`](https://github.com/nocobase/nocobase/pull/4788)
- Merge branch 'main' into next [`#4791`](https://github.com/nocobase/nocobase/pull/4791)
- feat(client): support linkage style in table and form [`#4467`](https://github.com/nocobase/nocobase/pull/4467)
- feat: enable direct dialog opening via URL and support for page mode [`#4706`](https://github.com/nocobase/nocobase/pull/4706)
- refactor: rewrite the UI of the code scanner. [`#4677`](https://github.com/nocobase/nocobase/pull/4677)
- feat(plugin-workflow): add date range options to system variables [`#4728`](https://github.com/nocobase/nocobase/pull/4728)
### Commits
- Revert "refactor: datetime field support timezone, defaultToCurrentTime, and onUpdateToCurrentTime (#5012)" [`ded5f26`](https://github.com/nocobase/nocobase/commit/ded5f26c09afed11d27652933ac8550375b3a34d)
- fix: remove schema [`f696c67`](https://github.com/nocobase/nocobase/commit/f696c67b5e5f47ce344e2691d970ec74f451d183)
- chore(versions): 😊 publish v1.3.0-beta [`dea6a58`](https://github.com/nocobase/nocobase/commit/dea6a58878acaf9220f7cf13868adc8cdf38f780)
## [v1.2.39-alpha](https://github.com/nocobase/nocobase/compare/v1.2.38-alpha...v1.2.39-alpha) - 2024-08-25
### Merged
- fix: the time zone defaults to the system time zone [`#5121`](https://github.com/nocobase/nocobase/pull/5121)
- fix(plugin-workflow-parallel): fix missed transaction causing dead lock in mysql [`#5118`](https://github.com/nocobase/nocobase/pull/5118)
- fix: action linkage rules not working correctly in tree table [`#5107`](https://github.com/nocobase/nocobase/pull/5107)
- fix(data-vi): allow to map integer enum value [`#5115`](https://github.com/nocobase/nocobase/pull/5115)
- fix: markdown test [`#5117`](https://github.com/nocobase/nocobase/pull/5117)
- chore(deps): bump tsconfig-paths from 3.15.0 to 4.2.0 [`#5051`](https://github.com/nocobase/nocobase/pull/5051)
- fixmarkdown demo rendering failure [`#5114`](https://github.com/nocobase/nocobase/pull/5114)
- fix(filter): should not filter out zero [`#5106`](https://github.com/nocobase/nocobase/pull/5106)
- style: filter form block action bar style improve [`#5108`](https://github.com/nocobase/nocobase/pull/5108)
- refactor: description for simple pagination mode [`#5110`](https://github.com/nocobase/nocobase/pull/5110)
### Commits
- chore(versions): 😊 publish v1.2.39-alpha [`9e30752`](https://github.com/nocobase/nocobase/commit/9e3075218ade26c156b583af8d7166fd630c4d17)
- chore: update changelog [`2b34f3b`](https://github.com/nocobase/nocobase/commit/2b34f3b6bd09d9d8a83a23c6e701cee748460ad4)
- Update README.zh-CN.md [`75c7fd6`](https://github.com/nocobase/nocobase/commit/75c7fd67964d74d291c2f97efa0c458113b7870b)
## [v1.2.38-alpha](https://github.com/nocobase/nocobase/compare/v1.2.37-alpha...v1.2.38-alpha) - 2024-08-22
### Merged
- fix: issue where data couldn't be submitted after deleting a row with required field in the subform [`#5101`](https://github.com/nocobase/nocobase/pull/5101)
- refactor: collection support simplePaginate [`#5099`](https://github.com/nocobase/nocobase/pull/5099)
- fix: button field assignment to only update visible fields [`#5104`](https://github.com/nocobase/nocobase/pull/5104)
- fix(client): fix upload preview image [`#5102`](https://github.com/nocobase/nocobase/pull/5102)
- fix: column index calculation error in table block [`#5100`](https://github.com/nocobase/nocobase/pull/5100)
- chore: optimize translation [`#5092`](https://github.com/nocobase/nocobase/pull/5092)
### Commits
- chore(versions): 😊 publish v1.2.38-alpha [`ce19841`](https://github.com/nocobase/nocobase/commit/ce198410f9e49a842ca91bccf8100c2602f7acfe)
- chore: update changelog [`8d29a6e`](https://github.com/nocobase/nocobase/commit/8d29a6ee81436301bb03bcf39ead38ba084477bb)
## [v1.2.37-alpha](https://github.com/nocobase/nocobase/compare/v1.2.36-alpha...v1.2.37-alpha) - 2024-08-21
### Merged

View File

@ -13,14 +13,12 @@ RUN npx npm-cli-adduser --username test --password test -e test@nocobase.com -r
RUN apt-get update && apt-get install -y jq
WORKDIR /tmp
COPY . /tmp
RUN cd /tmp && \
NEWVERSION="$(cat lerna.json | jq '.version' | tr -d '"').$(date +'%Y%m%d%H%M%S')" \
&& tmp=$(mktemp) \
&& jq ".version = \"${NEWVERSION}\"" lerna.json > "$tmp" && mv "$tmp" lerna.json
RUN yarn install && yarn build --no-dts
RUN git checkout -b release-$(date +'%Y%m%d%H%M%S') \
&& yarn version:alpha -y
RUN cd /tmp && \
NEWVERSION="$(cat lerna.json | jq '.version' | tr -d '"').$(date +'%Y%m%d%H%M%S')" \
&& git checkout -b release-$(date +'%Y%m%d%H%M%S') \
&& yarn lerna version ${NEWVERSION} -y --no-git-tag-version
RUN git config user.email "test@mail.com" \
&& git config user.name "test" && git add . \
&& git commit -m "chore(versions): test publish packages"

View File

@ -2,11 +2,14 @@
https://github.com/nocobase/nocobase/assets/1267426/29623e45-9a48-4598-bb9e-9dd173ade553
## 感谢你的支持
## 感谢支持
<a href="https://trendshift.io/repositories/4112" target="_blank"><img src="https://trendshift.io/api/badge/repositories/4112" alt="nocobase%2Fnocobase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://www.producthunt.com/posts/nocobase?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-nocobase" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=456520&theme=light&period=weekly&topic_id=267" alt="NocoBase - Scalability&#0045;first&#0044;&#0032;open&#0045;source&#0032;no&#0045;code&#0032;platform | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
## 加入我们
我们正在招聘远程 **全栈开发工程师****测试工程师****技术培训与文档专家**。 欢迎对 NocoBase 有强烈兴趣的伙伴加入。[查看详情](https://www.nocobase.com/cn/recruitment)
## 最近重要更新
- [v1.0.1-alpha.1:区块支持高度设置 - 2024/06/07](https://docs-cn.nocobase.com/welcome/changelog/20240607)
- [v1.0.0-alpha.15:新增插件、改进「配置操作」交互 - 2024/05/19](https://docs-cn.nocobase.com/welcome/changelog/20240519)

View File

@ -1,5 +1,5 @@
{
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClientArgs": ["--ignore-engines"],

View File

@ -1,13 +1,13 @@
{
"name": "@nocobase/acl",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@nocobase/resourcer": "1.3.0-alpha",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/resourcer": "1.4.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"minimatch": "^5.1.1"
},
"repository": {

View File

@ -1,14 +1,14 @@
{
"name": "@nocobase/actions",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@nocobase/cache": "1.3.0-alpha",
"@nocobase/database": "1.3.0-alpha",
"@nocobase/resourcer": "1.3.0-alpha"
"@nocobase/cache": "1.4.0-alpha",
"@nocobase/database": "1.4.0-alpha",
"@nocobase/resourcer": "1.4.0-alpha"
},
"repository": {
"type": "git",

View File

@ -30,10 +30,12 @@ function findArgs(ctx: Context) {
}
async function listWithPagination(ctx: Context) {
const { page = DEFAULT_PAGE, pageSize = DEFAULT_PER_PAGE, simplePaginate } = ctx.action.params;
const { page = DEFAULT_PAGE, pageSize = DEFAULT_PER_PAGE } = ctx.action.params;
const repository = getRepositoryFromParams(ctx);
const { simplePaginate } = repository.collection?.options || {};
const options = {
context: ctx,
...findArgs(ctx),

View File

@ -1,17 +1,17 @@
{
"name": "@nocobase/app",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@nocobase/database": "1.3.0-alpha",
"@nocobase/preset-nocobase": "1.3.0-alpha",
"@nocobase/server": "1.3.0-alpha"
"@nocobase/database": "1.4.0-alpha",
"@nocobase/preset-nocobase": "1.4.0-alpha",
"@nocobase/server": "1.4.0-alpha"
},
"devDependencies": {
"@nocobase/client": "1.3.0-alpha"
"@nocobase/client": "1.4.0-alpha"
},
"repository": {
"type": "git",

View File

@ -1,16 +1,16 @@
{
"name": "@nocobase/auth",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@nocobase/actions": "1.3.0-alpha",
"@nocobase/cache": "1.3.0-alpha",
"@nocobase/database": "1.3.0-alpha",
"@nocobase/resourcer": "1.3.0-alpha",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/actions": "1.4.0-alpha",
"@nocobase/cache": "1.4.0-alpha",
"@nocobase/database": "1.4.0-alpha",
"@nocobase/resourcer": "1.4.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"@types/jsonwebtoken": "^8.5.8",
"jsonwebtoken": "^8.5.1"
},

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/build",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "Library build tool based on rollup.",
"main": "lib/index.js",
"types": "./lib/index.d.ts",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/cache",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/cli",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./src/index.js",
@ -8,7 +8,7 @@
"nocobase": "./bin/index.js"
},
"dependencies": {
"@nocobase/app": "1.3.0-alpha",
"@nocobase/app": "1.4.0-alpha",
"@types/fs-extra": "^11.0.1",
"@umijs/utils": "3.5.20",
"chalk": "^4.1.1",
@ -25,7 +25,7 @@
"tsx": "^4.6.2"
},
"devDependencies": {
"@nocobase/devtools": "1.3.0-alpha"
"@nocobase/devtools": "1.4.0-alpha"
},
"repository": {
"type": "git",

View File

@ -16,6 +16,7 @@ const { readFile, writeFile } = require('fs').promises;
const { existsSync, mkdirSync, cpSync, writeFileSync } = require('fs');
const dotenv = require('dotenv');
const fs = require('fs');
const moment = require('moment-timezone');
exports.isPackageValid = (pkg) => {
try {
@ -296,6 +297,25 @@ function buildIndexHtml(force = false) {
exports.buildIndexHtml = buildIndexHtml;
function getTimezonesByOffset(offset) {
if (!/^[+-]\d{1,2}:\d{2}$/.test(offset)) {
return offset;
}
const offsetMinutes = moment.duration(offset).asMinutes();
return moment.tz.names().find((timezone) => {
return moment.tz(timezone).utcOffset() === offsetMinutes;
});
}
function areTimeZonesEqual(timeZone1, timeZone2) {
if (timeZone1 === timeZone2) {
return true;
}
timeZone1 = getTimezonesByOffset(timeZone1);
timeZone2 = getTimezonesByOffset(timeZone2);
return moment.tz(timeZone1).format() === moment.tz(timeZone2).format();
}
exports.initEnv = function initEnv() {
const env = {
APP_ENV: 'development',
@ -305,7 +325,7 @@ exports.initEnv = function initEnv() {
API_CLIENT_STORAGE_PREFIX: 'NOCOBASE_',
DB_DIALECT: 'sqlite',
DB_STORAGE: 'storage/db/nocobase.sqlite',
DB_TIMEZONE: '+00:00',
// DB_TIMEZONE: '+00:00',
DB_UNDERSCORED: parseEnv('DB_UNDERSCORED'),
DEFAULT_STORAGE_TYPE: 'local',
LOCAL_STORAGE_DEST: 'storage/uploads',
@ -376,4 +396,19 @@ exports.initEnv = function initEnv() {
process.env.API_BASE_URL = process.env.APP_SERVER_BASE_URL + process.env.API_BASE_PATH;
process.env.__env_modified__ = true;
}
if (!process.env.TZ) {
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
process.env.TZ = getTimezonesByOffset(process.env.DB_TIMEZONE || timeZone);
}
if (!process.env.DB_TIMEZONE) {
process.env.DB_TIMEZONE = process.env.TZ;
}
if (!areTimeZonesEqual(process.env.DB_TIMEZONE, process.env.TZ)) {
throw new Error(
`process.env.DB_TIMEZONE="${process.env.DB_TIMEZONE}" and process.env.TZ="${process.env.TZ}" are different`,
);
}
};

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/client",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "lib/index.js",
"module": "es/index.mjs",
@ -26,9 +26,9 @@
"@formily/reactive-react": "^2.2.27",
"@formily/shared": "^2.2.27",
"@formily/validator": "^2.2.27",
"@nocobase/evaluators": "1.3.0-alpha",
"@nocobase/sdk": "1.3.0-alpha",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/evaluators": "1.4.0-alpha",
"@nocobase/sdk": "1.4.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"ahooks": "^3.7.2",
"antd": "^5.12.8",
"antd-style": "3.4.5",
@ -78,6 +78,5 @@
"axios-mock-adapter": "^1.20.0",
"dumi": "2.2.14",
"dumi-theme-nocobase": "^0.2.28"
},
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
}
}

View File

@ -26,8 +26,9 @@ export const FilterFormBlockProvider = withDynamicSchemaProps((props) => {
<ActionBarProvider
forceProps={{
style: {
overflowY: 'auto',
width: '100%',
overflowX: 'auto',
maxWidth: '100%',
float: 'right',
},
}}
>

View File

@ -166,11 +166,6 @@ export const TableBlockProvider = withDynamicSchemaProps((props) => {
params['tree'] = true;
}
}
if (pagingMode === 'simplePaginate') {
params['simplePaginate'] = true;
} else {
delete params?.['simplePaginate'];
}
const form = useMemo(() => createForm(), [treeTable]);
// 在解析变量的时候不渲染,避免因为重复请求数据导致的资源浪费

View File

@ -24,6 +24,7 @@ export class GeneralCollectionTemplate extends CollectionTemplate {
'inherits',
'category',
'description',
'simplePaginate',
'presetFields',
);
}

View File

@ -60,6 +60,15 @@ export const defaultConfigurableProperties = {
'x-decorator': 'FormItem',
'x-component': 'Input.TextArea',
},
simplePaginate: {
'x-content': '{{t("Use simple pagination mode")}}',
type: 'string',
name: 'simplePaginate',
'x-decorator': 'FormItem',
'x-component': 'Checkbox',
description:
'{{t("Skip getting the total number of table records during paging to speed up loading. It is recommended to enable this option for data tables with a large amount of data")}}',
},
presetFields: {
title: '{{t("Preset fields")}}',
type: 'void',
@ -92,6 +101,7 @@ export type DefaultConfigurableKeys =
| 'updatedAt'
| 'sortable'
| 'description'
| 'simplePaginate'
| 'presetFields';
export const getConfigurableProperties = (...keys: DefaultConfigurableKeys[]) => {

View File

@ -196,6 +196,32 @@ describe('transformToFilter', () => {
expect(filter).toEqual(expectedFilter);
});
it('should keep 0 value', () => {
const valuesWithZero = {
field1: 0,
field2: 'value2',
};
const expectedFilter = {
$and: [
{
field1: {
$eq: 0,
},
},
{
field2: {
$ne: 'value2',
},
},
],
};
const filter = transformToFilter(valuesWithZero, operators, getCollectionJoinField, collectionName);
expect(filter).toEqual(expectedFilter);
});
it('should handle null values', () => {
const valuesWithNull = {
field1: null,

View File

@ -144,7 +144,7 @@ export const transformToFilter = (
key = `${key}.${collectionField.targetKey || 'id'}`;
}
if (!value) {
if (!value && value !== 0 && value !== false) {
return null;
}

View File

@ -968,8 +968,8 @@
"Open in new window": "新窗口打开",
"is none of": "不包含任何一个",
"is any of": "包含任何一个",
"Paging mode": "分页模式",
"Simple Paginate": "简单分页",
"Use simple pagination mode": "使用简单分页模式",
"Sorry, the page you visited does not exist.": "抱歉,你访问的页面不存在。",
"Set Template Engine": "设置模板引擎"
"Set Template Engine": "设置模板引擎",
"Skip getting the total number of table records during paging to speed up loading. It is recommended to enable this option for data tables with a large amount of data": "在分页时跳过获取表记录总数,以加快加载速度,建议对有大量数据的数据表开启此选项"
}

View File

@ -25,7 +25,6 @@ import { setDefaultSortingRulesSchemaSettingsItem } from '../../../../schema-set
import { setTheDataScopeSchemaSettingsItem } from '../../../../schema-settings/setTheDataScopeSchemaSettingsItem';
import { useBlockTemplateContext } from '../../../../schema-templates/BlockTemplateProvider';
import { setDataLoadingModeSettingsItem } from '../details-multi/setDataLoadingModeSettingsItem';
import { SchemaSettingsPagingMode } from '../../../../schema-settings/SchemaSettingsPagingMode';
export const tableBlockSettings = new SchemaSettings({
name: 'blockSettings:table',
@ -187,10 +186,6 @@ export const tableBlockSettings = new SchemaSettings({
};
},
},
{
name: 'pagingMode',
Component: SchemaSettingsPagingMode,
},
{
name: 'ConnectDataBlocks',
Component: SchemaSettingsConnectDataBlocks,

View File

@ -100,7 +100,7 @@ export const Action: ComposedAction = withDynamicSchemaProps(
const tarComponent = useComponent(component) || component;
const { modal } = App.useApp();
const variables = useVariables();
const localVariables = useLocalVariables({ currentForm: { values: recordData } as any });
const localVariables = useLocalVariables({ currentForm: { values: recordData, readPretty: false } as any });
const { getAriaLabel } = useGetAriaLabelOfAction(title);
const service = useDataBlockRequest();

View File

@ -15,6 +15,7 @@ import { action } from '@formily/reactive';
import { each } from '@formily/shared';
import { Button, Card, Divider, Tooltip } from 'antd';
import React, { useCallback, useContext } from 'react';
import { spliceArrayState } from '@formily/core/esm/shared/internals';
import { useTranslation } from 'react-i18next';
import { FormActiveFieldsProvider } from '../../../block-provider/hooks/useFormActiveFields';
import { useCollection } from '../../../data-source';
@ -186,6 +187,10 @@ const ToManyNester = observer(
style={{ zIndex: 1000, color: '#a8a3a3' }}
onClick={() => {
action(() => {
spliceArrayState(field as any, {
startIndex: index,
deleteCount: 1,
});
field.value.splice(index, 1);
return field.onInput(field.value);
});

View File

@ -65,4 +65,17 @@ describe('removeNullCondition', () => {
const result = removeNullCondition(filter);
expect(result).toEqual(expected);
});
it('should keep 0 value', () => {
const filter = {
field1: 0,
field2: 'value2',
};
const expected = {
field1: 0,
field2: 'value2',
};
const result = removeNullCondition(filter);
expect(result).toEqual(expected);
});
});

View File

@ -30,11 +30,7 @@ describe('Markdown', () => {
describe('Markdown.Void', function () {
it('should display the value of user input', async () => {
const { container } = render(
<MemoryRouter>
<App2 />
</MemoryRouter>,
);
const { container } = render(<App2 />);
const button = container.querySelector('.ant-btn') as HTMLButtonElement;
expect(button).not.toBeNull();

View File

@ -1,5 +1,3 @@
/**
* title: Markdown.Void
*/
@ -8,6 +6,7 @@ import { observer, useField } from '@formily/react';
import { Markdown, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
import { Button } from 'antd';
import React from 'react';
import { Router } from 'react-router-dom';
const schema = {
type: 'object',
@ -49,8 +48,10 @@ const Editable = observer(
export default () => {
return (
<SchemaComponentProvider components={{ Editable, Markdown, FormItem }}>
<SchemaComponent schema={schema} />
</SchemaComponentProvider>
<Router location={window.location} navigator={null}>
<SchemaComponentProvider components={{ Editable, Markdown, FormItem }}>
<SchemaComponent schema={schema} />
</SchemaComponentProvider>
</Router>
);
};

View File

@ -292,7 +292,7 @@ export const PagePopups = (props: { paramsList?: PopupParams[] }) => {
setRootSchema(rootSchema);
};
run();
}, [fieldSchema.root, getPopupSchemaFromSchema, popupParams, requestSchema, savePopupSchemaToSchema]);
}, [fieldSchema, getPopupSchemaFromSchema, popupParams, requestSchema, savePopupSchemaToSchema]);
const components = useMemo(() => ({ PagePopupsItemProvider }), []);
@ -444,7 +444,7 @@ function findSchemaByUid(uid: string, rootSchema: Schema, resultRef: { value: Sc
resultRef = resultRef || {
value: null,
};
rootSchema.mapProperties((schema) => {
rootSchema?.mapProperties?.((schema) => {
if (schema['x-uid'] === uid) {
resultRef.value = schema;
} else {

View File

@ -30,7 +30,6 @@ import {
} from '../../../schema-settings';
import { SchemaSettingsBlockHeightItem } from '../../../schema-settings/SchemaSettingsBlockHeightItem';
import { SchemaSettingsBlockTitleItem } from '../../../schema-settings/SchemaSettingsBlockTitleItem';
import { SchemaSettingsPagingMode } from '../../../schema-settings/SchemaSettingsPagingMode';
import { SchemaSettingsConnectDataBlocks } from '../../../schema-settings/SchemaSettingsConnectDataBlocks';
import { SchemaSettingsDataScope } from '../../../schema-settings/SchemaSettingsDataScope';
import { SchemaSettingsTemplate } from '../../../schema-settings/SchemaSettingsTemplate';
@ -303,7 +302,6 @@ export const TableBlockDesigner = () => {
});
}}
/>
<SchemaSettingsPagingMode />
<SchemaSettingsConnectDataBlocks type={FilterBlockType.TABLE} emptyDescription={t('No blocks to connect')} />
{supportTemplate && <SchemaSettingsDivider />}
{supportTemplate && (

View File

@ -219,10 +219,6 @@ describe('Table.settings', () => {
},
],
},
{
title: 'Paging mode',
type: 'select',
},
{
title: 'Save as template',
type: 'modal',

View File

@ -26,51 +26,7 @@ export const isPdf = (file) => {
return match(file.mimetype || file.type, 'application/pdf');
};
export const toMap = (fileList: any) => {
if (!fileList) {
return [];
}
if (typeof fileList !== 'object') {
return [];
}
let list = fileList;
if (!Array.isArray(fileList)) {
if (Object.keys({ ...fileList }).length === 0) {
return [];
}
list = [fileList];
}
return list.map((item) => {
return [item.id || item.uid, toItem(item)];
});
};
export const toImages = (fileList) => {
if (!fileList) {
return [];
}
if (typeof fileList !== 'object') {
return [];
}
if (Object.keys(fileList).length === 0) {
return [];
}
let list = fileList;
if (!Array.isArray(fileList) && typeof fileList === 'object') {
list = [fileList];
}
return list.map((item) => {
return {
...item,
title: item.title || item.name,
imageUrl: getImageByUrl(item.url, {
exclude: ['.png', '.jpg', '.jpeg', '.gif'],
}),
};
});
};
export const toArr = (value) => {
const toArr = (value) => {
if (!isValid(value)) {
return [];
}
@ -210,9 +166,11 @@ export const toItem = (file) => {
...file,
id: file.id || file.uid,
title: file.title || file.name,
imageUrl: getImageByUrl(file.url, {
exclude: ['.png', '.jpg', '.jpeg', '.gif'],
}),
imageUrl: isImage(file)
? file.url
: getImageByUrl(file.url, {
exclude: ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.bmp', '.ico'],
}),
};
};

View File

@ -118,10 +118,19 @@ const ConstantTypes = {
},
};
function getTypedConstantOption(type: string, types: true | string[], fieldNames) {
type UseTypeConstantType = true | (string | [string, Record<string, any>])[];
function getTypedConstantOption(type: string, types: UseTypeConstantType, fieldNames) {
const allTypes = Object.values(ConstantTypes).filter((item) => item.value !== 'null');
const children = (
types ? allTypes.filter((item) => (Array.isArray(types) && types.includes(item.value)) || types === true) : allTypes
types
? allTypes.filter(
(item) =>
(Array.isArray(types) &&
types.filter((t) => (Array.isArray(t) ? t[0] === item.value : t === item.value)).length) ||
types === true,
)
: allTypes
).map((item) =>
Object.keys(item).reduce(
(result, key) =>
@ -150,7 +159,7 @@ export type VariableInputProps = {
onChange: (value: string, optionPath?: any[]) => void;
children?: any;
button?: React.ReactElement;
useTypedConstant?: true | string[];
useTypedConstant?: UseTypeConstantType;
changeOnSelect?: CascaderProps['changeOnSelect'];
fieldNames?: CascaderProps['fieldNames'];
disabled?: boolean;
@ -214,6 +223,9 @@ export function Input(props: VariableInputProps) {
}, [type, useTypedConstant]);
const ConstantComponent = constantOption && !children ? constantOption.component : NullComponent;
const constantComponentProps = Array.isArray(useTypedConstant)
? (useTypedConstant.find((item) => Array.isArray(item) && item[0] === type)?.[1] as Record<string, any>) ?? {}
: {};
let cValue;
if (value == null) {
if (children && isFieldValue) {
@ -403,7 +415,13 @@ export function Input(props: VariableInputProps) {
{children && isFieldValue ? (
children
) : ConstantComponent ? (
<ConstantComponent role="button" aria-label="variable-constant" value={value} onChange={onChange} />
<ConstantComponent
role="button"
aria-label="variable-constant"
{...constantComponentProps}
value={value}
onChange={onChange}
/>
) : null}
</div>
)}

View File

@ -653,7 +653,15 @@ export const SchemaSettingsActionModalItem: FC<SchemaSettingsActionModalItemProp
const submitHandler = useCallback(async () => {
await form.submit();
try {
await onSubmit?.(cloneDeep(form.values));
const allValues = form.values;
// 过滤掉那些在表单 Schema 中未定义的字段
const visibleValues = Object.keys(allValues).reduce((result, key) => {
if (form.query(key).take()) {
result[key] = allValues[key];
}
return result;
}, {});
await onSubmit?.(cloneDeep(visibleValues));
setVisible(false);
} catch (err) {
console.error(err);

View File

@ -1,61 +0,0 @@
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import { Field } from '@formily/core';
import { useField, useFieldSchema } from '@formily/react';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useTableBlockContext } from '../block-provider';
import { useDesignable } from '../schema-component/hooks/useDesignable';
import { SchemaSettingsSelectItem } from './SchemaSettings';
export function SchemaSettingsPagingMode() {
const field = useField<Field>();
const fieldSchema = useFieldSchema();
const { t } = useTranslation();
const { dn } = useDesignable();
const { service } = useTableBlockContext();
const options = [
{
value: 'default',
label: t('Default'),
},
{
value: 'simplePaginate',
label: t('Simple Paginate'),
},
];
return (
<SchemaSettingsSelectItem
key="paging-mode"
title={t('Paging mode')}
options={options}
value={field.decoratorProps.pagingMode || 'default'}
onChange={(pagingMode) => {
fieldSchema['x-decorator-props'].pagingMode = pagingMode;
const params = { ...service.params?.[0] };
if (pagingMode === 'simplePaginate') {
params['simplePaginate'] = true;
} else {
delete params['simplePaginate'];
}
service.run({ params });
field.decoratorProps.pagingMode = pagingMode;
dn.emit('patch', {
schema: {
['x-uid']: fieldSchema['x-uid'],
'x-decorator-props': fieldSchema['x-decorator-props'],
},
});
dn.refresh();
}}
/>
);
}

View File

@ -21,7 +21,6 @@ export * from './SchemaSettingsSortingRule';
export * from './SchemaSettingsTemplate';
export * from './SchemaSettingsBlockHeightItem';
export * from './setDefaultSortingRulesSchemaSettingsItem';
export * from './SchemaSettingsPagingMode';
export * from './setTheDataScopeSchemaSettingsItem';
export * from './SchemaSettingsRenderEngine';
export * from './hooks/useGetAriaLabelOfDesigner';

View File

@ -1,6 +1,6 @@
{
"name": "create-nocobase-app",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "src/index.js",
"license": "AGPL-3.0",
"dependencies": {

View File

@ -1,16 +1,16 @@
{
"name": "@nocobase/data-source-manager",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@nocobase/actions": "1.3.0-alpha",
"@nocobase/cache": "1.3.0-alpha",
"@nocobase/database": "1.3.0-alpha",
"@nocobase/resourcer": "1.3.0-alpha",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/actions": "1.4.0-alpha",
"@nocobase/cache": "1.4.0-alpha",
"@nocobase/database": "1.4.0-alpha",
"@nocobase/resourcer": "1.4.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"@types/jsonwebtoken": "^8.5.8",
"jsonwebtoken": "^8.5.1"
},

View File

@ -38,10 +38,12 @@ function findArgs(ctx: Context) {
}
async function listWithPagination(ctx: Context) {
const { page = 1, pageSize = 50, simplePaginate } = ctx.action.params;
const { page = 1, pageSize = 50 } = ctx.action.params;
const repository = ctx.getCurrentRepository();
const { simplePaginate } = repository.collection?.options || {};
const options = {
context: ctx,
...findArgs(ctx),

View File

@ -1,13 +1,13 @@
{
"name": "@nocobase/database",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"license": "AGPL-3.0",
"dependencies": {
"@nocobase/logger": "1.3.0-alpha",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/logger": "1.4.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"async-mutex": "^0.3.2",
"chalk": "^4.1.1",
"cron-parser": "4.4.0",

View File

@ -114,6 +114,8 @@ export interface CollectionOptions extends Omit<ModelOptions, 'name' | 'hooks'>
tree?: string;
template?: string;
simplePaginate?: boolean;
/**
* where is the collection from
*

View File

@ -1,13 +1,13 @@
{
"name": "@nocobase/devtools",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"license": "AGPL-3.0",
"main": "./src/index.js",
"dependencies": {
"@nocobase/build": "1.3.0-alpha",
"@nocobase/client": "1.3.0-alpha",
"@nocobase/test": "1.3.0-alpha",
"@nocobase/build": "1.4.0-alpha",
"@nocobase/client": "1.4.0-alpha",
"@nocobase/test": "1.4.0-alpha",
"@types/koa": "^2.13.4",
"@types/koa-bodyparser": "^4.3.4",
"@types/lodash": "^4.14.177",
@ -39,7 +39,7 @@
"ts-loader": "^7.0.4",
"ts-node": "9.1.1",
"ts-node-dev": "1.1.8",
"tsconfig-paths": "^3.12.0",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.6.2",
"typescript": "5.1.3",
"umi": "^4.0.69"

View File

@ -1,13 +1,13 @@
{
"name": "@nocobase/evaluators",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"license": "AGPL-3.0",
"dependencies": {
"@formulajs/formulajs": "4.2.0",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"mathjs": "^10.6.0"
},
"repository": {

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/logger",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "nocobase logging library",
"license": "AGPL-3.0",
"main": "./lib/index.js",

View File

@ -1,12 +1,12 @@
{
"name": "@nocobase/resourcer",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"license": "AGPL-3.0",
"dependencies": {
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"deepmerge": "^4.2.2",
"koa-compose": "^4.1.0",
"lodash": "^4.17.21",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/sdk",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/server",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
"license": "AGPL-3.0",
@ -10,18 +10,18 @@
"@koa/cors": "^3.1.0",
"@koa/multer": "^3.0.2",
"@koa/router": "^9.4.0",
"@nocobase/acl": "1.3.0-alpha",
"@nocobase/actions": "1.3.0-alpha",
"@nocobase/auth": "1.3.0-alpha",
"@nocobase/cache": "1.3.0-alpha",
"@nocobase/data-source-manager": "1.3.0-alpha",
"@nocobase/database": "1.3.0-alpha",
"@nocobase/evaluators": "1.3.0-alpha",
"@nocobase/logger": "1.3.0-alpha",
"@nocobase/resourcer": "1.3.0-alpha",
"@nocobase/sdk": "1.3.0-alpha",
"@nocobase/telemetry": "1.3.0-alpha",
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/acl": "1.4.0-alpha",
"@nocobase/actions": "1.4.0-alpha",
"@nocobase/auth": "1.4.0-alpha",
"@nocobase/cache": "1.4.0-alpha",
"@nocobase/data-source-manager": "1.4.0-alpha",
"@nocobase/database": "1.4.0-alpha",
"@nocobase/evaluators": "1.4.0-alpha",
"@nocobase/logger": "1.4.0-alpha",
"@nocobase/resourcer": "1.4.0-alpha",
"@nocobase/sdk": "1.4.0-alpha",
"@nocobase/telemetry": "1.4.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"@types/decompress": "4.2.4",
"@types/ini": "^1.3.31",
"@types/koa-send": "^4.1.3",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/telemetry",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "nocobase telemetry library",
"license": "AGPL-3.0",
"main": "./lib/index.js",
@ -11,7 +11,7 @@
"directory": "packages/telemetry"
},
"dependencies": {
"@nocobase/utils": "1.3.0-alpha",
"@nocobase/utils": "1.4.0-alpha",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/instrumentation": "^0.46.0",
"@opentelemetry/resources": "^1.19.0",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/test",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "lib/index.js",
"module": "./src/index.ts",
"types": "./lib/index.d.ts",
@ -51,7 +51,7 @@
},
"dependencies": {
"@faker-js/faker": "8.1.0",
"@nocobase/server": "1.3.0-alpha",
"@nocobase/server": "1.4.0-alpha",
"@playwright/test": "^1.45.3",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/utils",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
"license": "AGPL-3.0",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "权限控制",
"description": "Based on roles, resources, and actions, access control can precisely manage interface configuration permissions, data operation permissions, menu access permissions, and plugin permissions.",
"description.zh-CN": "基于角色、资源和操作的权限控制,可以精确控制界面配置权限、数据操作权限、菜单访问权限、插件权限。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/acl",
@ -33,6 +33,5 @@
"type": "git",
"url": "git+https://github.com/nocobase/nocobase.git",
"directory": "packages/plugins/acl"
},
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-bulk-edit",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-bulk-edit",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-bulk-edit",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-bulk-update",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-bulk-update",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-bulk-update",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-custom-request",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-custom-request",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-custom-request",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-duplicate",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-duplicate",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-duplicate",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "操作:导出记录",
"description": "Export filtered records to excel, you can configure which fields to export.",
"description.zh-CN": "导出筛选后的记录到 Excel 中,可以配置导出哪些字段。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-export",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "操作:导入记录",
"description": "Import records using excel templates. You can configure which fields to import and templates will be generated automatically.",
"description.zh-CN": "使用 Excel 模板导入数据,可以配置导入哪些字段,自动生成模板。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-import",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-print",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/action-print",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-print",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-api-doc",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "API documentation",
"displayName.zh-CN": "API 文档",
"description": "An OpenAPI documentation generator for NocoBase HTTP API.",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "认证API 密钥",
"description": "Allows users to use API key to access application's HTTP API",
"description.zh-CN": "允许用户使用 API 密钥访问应用的 HTTP API",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/api-keys",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-audit-logs",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Audit logs (deprecated)",
"displayName.zh-CN": "审计日志(废弃)",
"description": "This plugin is deprecated. There will be a new audit log plugin in the future.",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "认证:短信",
"description": "SMS authentication.",
"description.zh-CN": "通过短信验证码认证身份。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/auth-sms",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/auth-sms",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-auth",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/auth",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/auth",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "应用的备份与还原",
"description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
"description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/backup-restore",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "区块iframe",
"description": "Create an iframe block on the page to embed and display external web pages or content.",
"description.zh-CN": "在页面上创建和管理iframe用于嵌入和展示外部网页或内容。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/block-iframe",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-block-workbench",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Block: Workbench",
"displayName.zh-CN": "区块:工作台",
"description": "Add buttons for actions, links, etc. in the workbench block to quickly initiate actions and jump pages.",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-calendar",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Calendar",
"displayName.zh-CN": "日历",
"description": "Provides callendar collection template and block for managing date data, typically for date/time related information such as events, appointments, tasks, and so on.",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "图表(废弃)",
"description": "The plugin has been deprecated, please use the data visualization plugin instead.",
"description.zh-CN": "已废弃插件,请使用数据可视化插件代替。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"license": "AGPL-3.0",
"devDependencies": {

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "WEB 客户端",
"description": "Provides a client interface for the NocoBase server",
"description.zh-CN": "为 NocoBase 服务端提供客户端界面",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"license": "AGPL-3.0",
"devDependencies": {

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据表: SQL",
"description": "Provides SQL collection template",
"description.zh-CN": "提供 SQL 数据表模板",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"homepage": "https://docs-cn.nocobase.com/handbook/collection-sql",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/collection-sql",
"main": "dist/server/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-collection-tree",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Collection: Tree",
"displayName.zh-CN": "数据表:树",
"description": "Provides tree collection template",
@ -9,7 +9,6 @@
"Collections"
],
"main": "dist/server/index.js",
"dependencies": {},
"peerDependencies": {
"@nocobase/client": "1.x",
"@nocobase/server": "1.x",

View File

@ -14,7 +14,7 @@ import lodash from 'lodash';
export default class extends Migration {
on = 'afterLoad'; // 'beforeLoad' or 'afterLoad'
appVersion = '<=1.3.0-alpha';
appVersion = '<=1.3.0-beta';
async up() {
await this.db.sequelize.transaction(async (transaction) => {

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据源:主数据库",
"description": "NocoBase main database, supports relational databases such as MySQL, PostgreSQL, SQLite and so on.",
"description.zh-CN": "NocoBase 主数据库,支持 MySQL、PostgreSQL、SQLite 等关系型数据库。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/data-source-main",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/data-source-main",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-data-source-manager",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"displayName": "Data source manager",
"displayName.zh-CN": "数据源管理",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-data-visualization",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Data visualization",
"displayName.zh-CN": "数据可视化",
"description": "Provides data visualization feature, including chart block and chart filter block, support line charts, area charts, bar charts and more than a dozen kinds of charts, you can also extend more chart types.",

View File

@ -0,0 +1,44 @@
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import { processData } from '../utils';
describe('utils', () => {
it('processFields', () => {
expect(
processData(
[
{
name: 'tag',
type: 'bigInt',
interface: 'select',
uiSchema: {
type: 'string',
enum: [
{
value: '1',
label: 'Yes',
},
{
value: '2',
label: 'No',
},
],
},
label: 'Tag',
value: 'tag',
key: 'tag',
},
],
[{ tag: 1 }],
{},
),
).toEqual([{ tag: 'Yes' }]);
});
});

View File

@ -13,7 +13,12 @@ import { ChartType } from '../chart';
export class Bar extends G2PlotChart {
constructor() {
super({ name: 'bar', title: 'Bar Chart', Component: G2PlotBar, config: ['isGroup', 'isStack', 'isPercent'] });
super({
name: 'bar',
title: 'Bar Chart',
Component: G2PlotBar,
config: ['isGroup', 'isStack', 'isPercent', 'size'],
});
}
init: ChartType['init'] = (fields, { measures, dimensions }) => {

View File

@ -61,6 +61,7 @@ export class DualAxes extends G2PlotChart {
},
},
},
'size',
];
}

View File

@ -27,6 +27,7 @@ export class Pie extends G2PlotChart {
title: 'colorField',
required: true,
},
'size',
];
}

View File

@ -93,7 +93,7 @@ export const processData = (selectedFields: FieldOption[], data: any[], scope: a
if (Array.isArray(value)) {
return value.map((v) => parseEnum(field, v));
}
const option = options.find((option) => option.value === value);
const option = options.find((option) => option.value === (value?.toString?.() || value));
return Schema.compile(option?.label || value, scope);
};
return data.map((record) => {

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-disable-pm-add",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"peerDependencies": {
"@nocobase/client": "1.x",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "错误处理器",
"description": "Handling application errors and exceptions.",
"description.zh-CN": "处理应用程序中的错误和异常。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-field-china-region",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Administrative divisions of China",
"displayName.zh-CN": "中国行政区划",
"description": "Provides data and field type for administrative divisions of China.",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据表字段:公式",
"description": "Configure and store the results of calculations between multiple field values in the same record, supporting both Math.js and Excel formula functions.",
"description.zh-CN": "可以配置并存储同一条记录的多字段值之间的计算结果,支持 Math.js 和 Excel formula functions 两种引擎",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/field-formula",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据表字段:多对多 (数组)",
"description": "Allows to create many to many relationships between two models by storing an array of unique keys of the target model.",
"description.zh-CN": "支持通过在数组中存储目标表唯一键的方式建立多对多关系。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"peerDependencies": {
"@nocobase/client": "1.x",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据表字段Markdown(Vditor)",
"description": "Used to store Markdown and render it using Vditor editor, supports common Markdown syntax such as list, code, quote, etc., and supports uploading images, recordings, etc.It also allows for instant rendering, where what you see is what you get.",
"description.zh-CN": "用于存储 Markdown并使用 Vditor 编辑器渲染,支持常见 Markdown 语法,如列表,代码,引用等,并支持上传图片,录音等。同时可以做到即时渲染,所见即所得。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/field-markdown-vditor",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据表字段:自动编码",
"description": "Automatically generate codes based on configured rules, supporting combinations of dates, numbers, and text.",
"description.zh-CN": "根据配置的规则自动生成编码,支持日期、数字、文本的组合。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/field-sequence",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-file-manager",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "File manager",
"displayName.zh-CN": "文件管理器",
"description": "Provides files storage services with files collection template and attachment field.",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-gantt",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"displayName": "Block: Gantt",
"displayName.zh-CN": "区块:甘特图",
"description": "Provides Gantt block.",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "可视化数据表管理",
"description": "An ER diagram-like tool. Currently only the Master database is supported.",
"description.zh-CN": "类似 ER 图的工具,目前只支持主数据库。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/graph-collection-manager",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-kanban",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/block-kanban",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/block-kanban",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-localization",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/localization-management",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/localization-management",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "日志",
"description": "Server-side logs, mainly including API request logs and system runtime logs, and allows to package and download log files.",
"description.zh-CN": "服务端日志,主要包括接口请求日志和系统运行日志,并支持打包和下载日志文件。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/logger",

View File

@ -2,7 +2,7 @@
"name": "@nocobase/plugin-map",
"displayName": "Block: Map",
"displayName.zh-CN": "区块:地图",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"description": "Map block, support Gaode map and Google map, you can also extend more map types.",
"description.zh-CN": "地图区块,支持高德地图和 Google 地图,你也可以扩展更多地图类型。",
"license": "AGPL-3.0",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-mobile-client",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/mobile-client",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/mobile-client",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-mobile",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/mobile",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/mobile",

View File

@ -7,16 +7,16 @@
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import React, { FC, useCallback } from 'react';
import { Space, Tabs, TabsProps } from 'antd-mobile';
import { useParams, useNavigate, Navigate } from 'react-router-dom';
import React, { FC, useCallback } from 'react';
import { Navigate, useNavigate, useParams } from 'react-router-dom';
import { useMobileRoutes } from '../../../../mobile-providers';
import { DndContext, DndContextProps, Icon, SortableItem } from '@nocobase/client';
import { useStyles } from './styles';
import { MobilePageTabsSettings } from './settings';
import { MobilePageTabInitializer } from './initializer';
import { useMobileRoutes } from '../../../../mobile-providers';
import { useMobilePage } from '../../context';
import { MobilePageTabInitializer } from './initializer';
import { MobilePageTabsSettings } from './settings';
import { useStyles } from './styles';
export const MobilePageTabs: FC = () => {
const { activeTabBarItem, resource, refresh } = useMobileRoutes();
@ -26,7 +26,7 @@ export const MobilePageTabs: FC = () => {
const { styles } = useStyles();
const { tabSchemaUid } = useParams<{ tabSchemaUid: string }>();
const [activeKey, setActiveKey] = React.useState<string>(() => {
return tabSchemaUid || activeTabBarItem?.children[0]?.schemaUid;
return tabSchemaUid || activeTabBarItem?.children?.[0]?.schemaUid;
});
const handleChange: TabsProps['onChange'] = (schemaUid) => {
setActiveKey(schemaUid);

View File

@ -2,7 +2,7 @@
"name": "@nocobase/plugin-mock-collections",
"displayName": "mock-collections",
"description": "mock-collections",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"license": "AGPL-3.0",
"peerDependencies": {

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "多应用管理器",
"description": "Dynamically create multiple apps without separate deployments.",
"description.zh-CN": "无需单独部署即可动态创建多个应用。",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/multi-app-manager",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "多应用数据表共享",
"description": "",
"description.zh-CN": "",
"version": "1.3.0-alpha",
"version": "1.4.0-alpha",
"main": "./dist/server/index.js",
"devDependencies": {
"@formily/react": "2.x",

Some files were not shown because too many files have changed in this diff Show More