Merge branch 'develop' into 1921

This commit is contained in:
Zeke Zhang 2025-04-20 18:42:41 +08:00
commit bef7fa69bd
124 changed files with 884 additions and 294 deletions

View File

@ -0,0 +1,119 @@
name: Build Image (Internal)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
ref_name:
description: 'Branch or tag name to release'
jobs:
get-plugins:
uses: nocobase/nocobase/.github/workflows/get-plugins.yml@main
secrets: inherit
push-docker:
runs-on: ubuntu-latest
needs: get-plugins
services:
verdaccio:
image: verdaccio/verdaccio:5
ports:
- 4873:4873
steps:
- name: Set Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Get info
id: get-info
shell: bash
run: |
if [[ "${{ inputs.ref_name || github.ref_name }}" =~ "beta" ]]; then
echo "defaultTag=$(echo 'beta')" >> $GITHUB_OUTPUT
echo "proRepos=$(echo '${{ needs.get-plugins.outputs.beta-plugins }}')" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.ref_name || github.ref_name }}" =~ "alpha" ]]; then
echo "defaultTag=$(echo 'alpha')" >> $GITHUB_OUTPUT
echo "proRepos=$(echo '${{ needs.get-plugins.outputs.alpha-plugins }}')" >> $GITHUB_OUTPUT
else
# rc
echo "defaultTag=$(echo 'latest')" >> $GITHUB_OUTPUT
echo "proRepos=$(echo '${{ needs.get-plugins.outputs.rc-plugins }}')" >> $GITHUB_OUTPUT
fi
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.NOCOBASE_APP_ID }}
private-key: ${{ secrets.NOCOBASE_APP_PRIVATE_KEY }}
repositories: nocobase,pro-plugins,${{ join(fromJSON(steps.get-info.outputs.proRepos), ',') }},${{ join(fromJSON(needs.get-plugins.outputs.custom-plugins), ',') }}
skip-token-revoke: true
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref_name || github.ref_name }}
- name: yarn install
run: |
yarn install
- name: Checkout pro-plugins
uses: actions/checkout@v3
with:
repository: nocobase/pro-plugins
path: packages/pro-plugins
ref: ${{ inputs.ref_name || github.ref_name }}
token: ${{ steps.app-token.outputs.token }}
- name: Clone pro repos
shell: bash
run: |
for repo in ${{ join(fromJSON(steps.get-info.outputs.proRepos), ' ') }} ${{ join(fromJSON(needs.get-plugins.outputs.custom-plugins), ' ') }}
do
git clone -b ${{ inputs.ref_name || github.ref_name }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
done
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
nocobase/nocobase
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Aliyun Container Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.ALI_DOCKER_REGISTRY }}
username: ${{ secrets.ALI_DOCKER_USERNAME }}
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
- name: Set variables
run: |
target_directory="./packages/pro-plugins/@nocobase"
subdirectories=$(find "$target_directory" -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | tr '\n' ' ')
trimmed_variable=$(echo "$subdirectories" | xargs)
packageNames="@nocobase/${trimmed_variable// / @nocobase/}"
pluginNames="${trimmed_variable//plugin-/}"
BEFORE_PACK_NOCOBASE="yarn add @nocobase/plugin-notifications @nocobase/plugin-disable-pm-add $packageNames -W --production"
APPEND_PRESET_LOCAL_PLUGINS="notifications,disable-pm-add,${pluginNames// /,}"
echo "var1=$BEFORE_PACK_NOCOBASE" >> $GITHUB_OUTPUT
echo "var2=$APPEND_PRESET_LOCAL_PLUGINS" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
build-args: |
VERDACCIO_URL=http://localhost:4873/
COMMIT_HASH=${GITHUB_SHA}
PLUGINS_DIRS=pro-plugins
BEFORE_PACK_NOCOBASE=${{ steps.vars.outputs.var1 }}
APPEND_PRESET_LOCAL_PLUGINS=${{ steps.vars.outputs.var2 }}
push: true
tags: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:${{ steps.get-info.outputs.defaultTag }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }}

View File

@ -1,5 +1,5 @@
{
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClientArgs": ["--ignore-engines"],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,12 +1,12 @@
{
"name": "@nocobase/cache",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"description": "",
"license": "AGPL-3.0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@nocobase/lock-manager": "1.7.0-alpha.10",
"@nocobase/lock-manager": "1.7.0-alpha.11",
"bloom-filters": "^3.0.1",
"cache-manager": "^5.2.4",
"cache-manager-redis-yet": "^4.1.2"

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/client",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "lib/index.js",
"module": "es/index.mjs",
@ -27,9 +27,9 @@
"@formily/reactive-react": "^2.2.27",
"@formily/shared": "^2.2.27",
"@formily/validator": "^2.2.27",
"@nocobase/evaluators": "1.7.0-alpha.10",
"@nocobase/sdk": "1.7.0-alpha.10",
"@nocobase/utils": "1.7.0-alpha.10",
"@nocobase/evaluators": "1.7.0-alpha.11",
"@nocobase/sdk": "1.7.0-alpha.11",
"@nocobase/utils": "1.7.0-alpha.11",
"ahooks": "^3.7.2",
"antd": "5.24.2",
"antd-style": "3.7.1",

View File

@ -314,15 +314,15 @@ export const ACLActionProvider = (props) => {
const schema = useFieldSchema();
const currentUid = schema['x-uid'];
let actionPath = schema['x-acl-action'];
const editablePath = ['create', 'update', 'destroy', 'importXlsx'];
// 只兼容这些数据表资源按钮
const resourceActionPath = ['create', 'update', 'destroy', 'importXlsx', 'export'];
if (!actionPath && resource && schema['x-action'] && editablePath.includes(schema['x-action'])) {
if (!actionPath && resource && schema['x-action'] && resourceActionPath.includes(schema['x-action'])) {
actionPath = `${resource}:${schema['x-action']}`;
}
if (actionPath && !actionPath?.includes(':')) {
actionPath = `${resource}:${actionPath}`;
}
const params = useMemo(
() => actionPath && parseAction(actionPath, { schema, recordPkValue }),
[parseAction, actionPath, schema, recordPkValue],
@ -340,7 +340,7 @@ export const ACLActionProvider = (props) => {
return <ACLActionParamsContext.Provider value={params}>{props.children}</ACLActionParamsContext.Provider>;
}
//视图表无编辑权限时不显示
if (editablePath.includes(actionPath) || editablePath.includes(actionPath?.split(':')[1])) {
if (resourceActionPath.includes(actionPath) || resourceActionPath.includes(actionPath?.split(':')[1])) {
if ((collection && collection.template !== 'view') || collection?.writableView) {
return <ACLActionParamsContext.Provider value={params}>{props.children}</ACLActionParamsContext.Provider>;
}

View File

@ -309,6 +309,7 @@ test.describe('configure actions column', () => {
await page.getByText('Actions', { exact: true }).hover({ force: true });
await page.getByLabel('designer-schema-initializer-TableV2.Column-TableV2.ActionColumnDesigner-').hover();
await page.getByRole('menuitem', { name: 'Delete' }).click();
await page.mouse.move(500, 0);
// await page.getByText('Actions', { exact: true }).hover({ force: true });
// await page.getByLabel('designer-schema-initializer-TableV2.Column-TableV2.ActionColumnDesigner-').hover();

View File

@ -12,9 +12,9 @@ import { useCollection_deprecated, useCollectionFilterOptions } from '../../../.
import { useCollectionRecordData } from '../../../../data-source';
import { useTranslation } from 'react-i18next';
import { useCompile } from '../../../';
import { useBlockContext } from '../../../../block-provider/BlockProvider';
import { usePopupVariable } from '../../../../schema-settings/VariableInput/hooks';
import { useCurrentRoleVariable } from '../../../../schema-settings/VariableInput/hooks';
import { useFormBlockContext } from '../../../../block-provider';
export const useAfterSuccessOptions = () => {
const collection = useCollection_deprecated();
@ -23,7 +23,7 @@ export const useAfterSuccessOptions = () => {
const userFieldOptions = useCollectionFilterOptions('users', 'main');
const compile = useCompile();
const recordData = useCollectionRecordData();
const { name: blockType } = useBlockContext() || {};
const { form } = useFormBlockContext();
const [fields, userFields] = useMemo(() => {
return [compile(fieldsOptions), compile(userFieldOptions)];
}, [fieldsOptions, userFieldOptions]);
@ -32,7 +32,7 @@ export const useAfterSuccessOptions = () => {
const record = useCollectionRecordData();
return useMemo(() => {
return [
(record || blockType === 'form') && {
(record || form) && {
value: '$record',
label: t('Response record', { ns: 'client' }),
children: [...fields],
@ -62,5 +62,5 @@ export const useAfterSuccessOptions = () => {
children: null,
},
].filter(Boolean);
}, [recordData, t, fields, blockType, userFields]);
}, [recordData, t, fields, form, userFields]);
};

View File

@ -252,8 +252,9 @@ DatePicker.FilterWithPicker = function FilterWithPicker(props: any) {
const value = Array.isArray(props.value) ? props.value[0] : props.value;
const compile = useCompile();
const fieldSchema = useFieldSchema();
const targetPicker = value ? inferPickerType(value, picker) : picker;
const targetDateFormat = getPickerFormat(targetPicker) || format;
const initPicker = value ? inferPickerType(value, picker) : picker;
const [targetPicker, setTargetPicker] = useState(initPicker);
const targetDateFormat = getPickerFormat(initPicker) || format;
const newProps = {
utc,
inputReadOnly: isMobileMedia,
@ -271,13 +272,6 @@ DatePicker.FilterWithPicker = function FilterWithPicker(props: any) {
};
const field: any = useField();
const [stateProps, setStateProps] = useState(newProps);
useEffect(() => {
newProps.picker = targetPicker;
const dateTimeFormat = getDateTimeFormat(targetPicker, targetDateFormat, showTime, timeFormat);
newProps.format = dateTimeFormat;
setStateProps(newProps);
}, [targetPicker]);
return (
<Space.Compact style={{ width: '100%' }}>
<Select
@ -307,6 +301,7 @@ DatePicker.FilterWithPicker = function FilterWithPicker(props: any) {
},
])}
onChange={(value) => {
setTargetPicker(value);
const format = getPickerFormat(value);
const dateTimeFormat = getDateTimeFormat(value, format, showTime, timeFormat);
field.setComponentProps({

View File

@ -93,7 +93,7 @@ export const useValues = (): UseValuesReturn => {
}, 100);
};
useEffect(value2data, [field.value, scopes]);
useEffect(value2data, [field.value.leftVar, scopes]);
const setLeftValue = useCallback(
(leftVar, paths) => {

View File

@ -97,6 +97,9 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => {
.ant-input-affix-wrapper {
border-radius: 0px;
}
.ant-checkbox-wrapper {
margin-left: 50%;
}
`}
>
{React.createElement(DynamicComponent, {

View File

@ -274,6 +274,13 @@ function getSubscriber(
// 在 FormItem 中有使用这个属性来判断字段是否被隐藏
field.data.hidden = true;
// 如果字段是必填的,并且被隐藏(保留值)了,那么就需要把 required 设置为 false否则有可能会导致表单验证失败
// 进而导致点击提交按钮无效的问题。
if (field.required) {
field.required = false;
field.data.prevRequired = true;
}
requestAnimationFrame(() => {
field.setState((state) => {
state.display = 'visible';
@ -295,6 +302,13 @@ function getSubscriber(
field.data = field.data || {};
// 在 FormItem 中有使用这个属性来判断字段是否被隐藏
field.data.hidden = false;
// 当“隐藏(保留值)”的字段再次显示时,恢复“必填”的状态
if (fieldName === 'display' && lastState?.value === 'visible' && field.data.prevRequired) {
delete field.data.prevRequired;
field.required = true;
}
requestAnimationFrame(() => {
field.setState((state) => {
state[fieldName] = lastState?.value;

View File

@ -24,6 +24,7 @@ import { useCurrentFormContext } from '../VariableInput/hooks/useFormVariable';
import { LinkageRuleActionGroup } from './LinkageRuleActionGroup';
import { EnableLinkage } from './components/EnableLinkage';
import { ArrayCollapse } from './components/LinkageHeader';
import { useFlag } from '../../flag-provider';
export interface Props {
dynamicComponent: any;
@ -65,11 +66,12 @@ function transformConditionData(condition: Condition, variableKey: '$nForm' | '$
rightVar: value,
};
}
function getActiveContextName(contextList: { name: string; ctx: any }[]): string | null {
const priority = ['$nForm', '$nRecord'];
for (const name of priority) {
const item = contextList.find((ctx) => ctx.name === name && ctx.ctx);
if (item) return name;
function getActiveContextName(underNester, shouldDisplayCurrentForm): string | null {
if (underNester) {
return '$iteration';
}
if (shouldDisplayCurrentForm) {
return '$nForm';
}
return '$nRecord';
}
@ -97,15 +99,16 @@ export const FormLinkageRules = withDynamicSchemaProps(
const { getAllCollectionsInheritChain } = useCollectionManager_deprecated();
const parentRecordData = useCollectionParentRecordData();
const { shouldDisplayCurrentForm } = useCurrentFormContext();
const variableKey = getActiveContextName(localVariables);
const components = useMemo(() => ({ ArrayCollapse }), []);
const { isInSubTable, isInSubForm } = useFlag();
const variableKey = getActiveContextName(isInSubTable || isInSubForm, shouldDisplayCurrentForm);
const schema = useMemo(
() => ({
type: 'object',
properties: {
rules: {
type: 'array',
default: transformDefaultValue(defaultValues, shouldDisplayCurrentForm ? variableKey : '$nRecord'),
default: transformDefaultValue(defaultValues, variableKey),
'x-component': 'ArrayCollapse',
'x-decorator': 'FormItem',
'x-component-props': {

View File

@ -84,7 +84,7 @@ import { AssociationOrCollectionProvider, useDataBlockProps } from '../data-sour
import { useDataSourceManager } from '../data-source/data-source/DataSourceManagerProvider';
import { useDataSourceKey } from '../data-source/data-source/DataSourceProvider';
import { useFilterBlock } from '../filter-provider/FilterProvider';
import { FlagProvider } from '../flag-provider';
import { FlagProvider, useFlag } from '../flag-provider';
import { useGlobalTheme } from '../global-theme';
import { useCollectMenuItem, useCollectMenuItems, useMenuItem } from '../hooks/useMenuItem';
import {
@ -1129,6 +1129,7 @@ export const SchemaSettingsLinkageRules = function LinkageRules(props) {
return gridSchema?.[dataKey] || fieldSchema?.[dataKey] || [];
}, [gridSchema, fieldSchema, dataKey]);
const title = titleMap[category] || t('Linkage rules');
const flagVales = useFlag();
const schema = useMemo<ISchema>(
() => ({
type: 'object',
@ -1180,7 +1181,16 @@ export const SchemaSettingsLinkageRules = function LinkageRules(props) {
);
return (
<SchemaSettingsModalItem title={title} components={components} width={770} schema={schema} onSubmit={onSubmit} />
<SchemaSettingsModalItem
title={title}
components={components}
width={770}
schema={schema}
onSubmit={onSubmit}
ModalContextProvider={(props) => {
return <FlagProvider {...flagVales}>{props.children}</FlagProvider>;
}}
/>
);
};

View File

@ -10,6 +10,7 @@
import { expect, test } from '@nocobase/test/e2e';
import {
formFieldDependsOnSubtableFieldsWithLinkageRules,
whenARequiredFieldIsSetToHideRetainValueItShouldBeAbleToSubmitTheFormNormally,
whenClearingARelationshipFieldTheValueOfTheAssociatedFieldShouldBeCleared,
whenSetToHideRetainedValueItShouldNotImpactTheFieldSDefaultValueVariables,
} from './template';
@ -83,6 +84,28 @@ test.describe('linkage rules', () => {
).toBeVisible();
});
test('When a required field is set to "Hide (retain value)", it should be able to submit the form normally', async ({
mockPage,
page,
}) => {
await mockPage(whenARequiredFieldIsSetToHideRetainValueItShouldBeAbleToSubmitTheFormNormally).goto();
// 1. 输入昵称
await page
.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname')
.getByRole('textbox')
.fill('123456');
// 2. 点击提交
await page.getByLabel('action-Action-Submit-submit-').click();
// 3. 应该能正常提交,不应该被拦截
await page.reload();
await expect(
page.getByLabel('block-item-CardItem-users-table').getByRole('cell', { name: '123456' }),
).toBeVisible();
});
test('When clearing a relationship field, the value of the associated field should be cleared', async ({
page,
mockPage,

View File

@ -2215,3 +2215,376 @@ export const accessControlActionWithTable = {
'x-index': 1,
},
};
export const whenARequiredFieldIsSetToHideRetainValueItShouldBeAbleToSubmitTheFormNormally = {
tabSchema: {
type: 'void',
'x-component': 'Grid',
'x-initializer': 'page:addBlock',
properties: {
phefo1qp4yu: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Row',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
e94p5oj6num: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Col',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
fpwdszedqqt: {
type: 'void',
version: '2.0',
'x-toolbar': 'BlockSchemaToolbar',
'x-settings': 'blockSettings:createForm',
'x-component': 'CardItem',
'x-decorator': 'FormBlockProvider',
'x-acl-action': 'users:create',
'x-app-version': '1.6.21',
'x-decorator-props': {
collection: 'users',
dataSource: 'main',
},
'x-acl-action-props': {
skipScopeCheck: true,
},
_isJSONSchemaObject: true,
'x-use-decorator-props': 'useCreateFormBlockDecoratorProps',
properties: {
fy0innr5s9v: {
type: 'void',
version: '2.0',
'x-component': 'FormV2',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
'x-use-component-props': 'useCreateFormBlockProps',
properties: {
grid: {
type: 'void',
'x-uid': '7wwn4d0722h',
version: '2.0',
'x-component': 'Grid',
'x-app-version': '1.6.21',
'x-initializer': 'form:configureFields',
'x-linkage-rules': [
{
actions: [
{
operator: 'hidden',
targetFields: ['username'],
},
],
condition: {
$and: [],
},
},
],
_isJSONSchemaObject: true,
properties: {
t9ik3qkj7mv: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Row',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
szfeenblh7q: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Col',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
username: {
type: 'string',
version: '2.0',
'x-toolbar': 'FormItemSchemaToolbar',
'x-settings': 'fieldSettings:FormItem',
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-app-version': '1.6.21',
'x-component-props': {},
'x-collection-field': 'users.username',
_isJSONSchemaObject: true,
'x-uid': 'w7j6pbapyz2',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '4p4e653i4sg',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'ojqn0csar3b',
'x-async': false,
'x-index': 1,
},
ij66m020mn5: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Row',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
'95nih4mt2lf': {
type: 'void',
version: '2.0',
'x-component': 'Grid.Col',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
nickname: {
type: 'string',
version: '2.0',
'x-toolbar': 'FormItemSchemaToolbar',
'x-settings': 'fieldSettings:FormItem',
'x-component': 'CollectionField',
'x-decorator': 'FormItem',
'x-app-version': '1.6.21',
'x-component-props': {},
'x-collection-field': 'users.nickname',
_isJSONSchemaObject: true,
'x-uid': 'rpmd8swoor7',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'h0z7u62fwn3',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'b3v741bdvtt',
'x-async': false,
'x-index': 2,
},
},
'x-async': false,
'x-index': 1,
},
o5pser9a4zy: {
type: 'void',
version: '2.0',
'x-component': 'ActionBar',
'x-app-version': '1.6.21',
'x-initializer': 'createForm:configureActions',
'x-component-props': {
layout: 'one-column',
},
_isJSONSchemaObject: true,
properties: {
g5aat11143b: {
type: 'void',
title: '{{ t("Submit") }}',
version: '2.0',
'x-action': 'submit',
'x-toolbar': 'ActionSchemaToolbar',
'x-settings': 'actionSettings:createSubmit',
'x-component': 'Action',
'x-app-version': '1.6.21',
'x-action-settings': {},
'x-component-props': {
type: 'primary',
htmlType: 'submit',
},
_isJSONSchemaObject: true,
'x-use-component-props': 'useCreateActionProps',
'x-uid': 'doarbo27x5f',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'n5j6q3dfzst',
'x-async': false,
'x-index': 2,
},
},
'x-uid': '1k05k8tv3fp',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '4bq4fts48ec',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'tgjtas03gh6',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'raas2rrgtgq',
'x-async': false,
'x-index': 1,
},
gqnjk39afuj: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Row',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
fvn883pa5lt: {
type: 'void',
version: '2.0',
'x-component': 'Grid.Col',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
'0wlnuaz623s': {
type: 'void',
version: '2.0',
'x-toolbar': 'BlockSchemaToolbar',
'x-settings': 'blockSettings:table',
'x-component': 'CardItem',
'x-decorator': 'TableBlockProvider',
'x-acl-action': 'users:list',
'x-app-version': '1.6.21',
'x-filter-targets': [],
'x-decorator-props': {
action: 'list',
params: {
pageSize: 20,
},
rowKey: 'id',
dragSort: false,
showIndex: true,
collection: 'users',
dataSource: 'main',
},
_isJSONSchemaObject: true,
'x-use-decorator-props': 'useTableBlockDecoratorProps',
properties: {
actions: {
type: 'void',
version: '2.0',
'x-component': 'ActionBar',
'x-app-version': '1.6.21',
'x-initializer': 'table:configureActions',
'x-component-props': {
style: {
marginBottom: 'var(--nb-spacing)',
},
},
_isJSONSchemaObject: true,
'x-uid': 'q7y8z49vkvs',
'x-async': false,
'x-index': 1,
},
e7dmvrnhhhw: {
type: 'array',
version: '2.0',
'x-component': 'TableV2',
'x-app-version': '1.6.21',
'x-initializer': 'table:configureColumns',
'x-component-props': {
rowKey: 'id',
rowSelection: {
type: 'checkbox',
},
},
_isJSONSchemaObject: true,
'x-use-component-props': 'useTableBlockProps',
properties: {
actions: {
type: 'void',
title: '{{ t("Actions") }}',
version: '2.0',
'x-toolbar': 'TableColumnSchemaToolbar',
'x-settings': 'fieldSettings:TableColumn',
'x-component': 'TableV2.Column',
'x-decorator': 'TableV2.Column.ActionBar',
'x-app-version': '1.6.21',
'x-initializer': 'table:configureItemActions',
'x-action-column': 'actions',
'x-toolbar-props': {
initializer: 'table:configureItemActions',
},
_isJSONSchemaObject: true,
properties: {
wwt3qrk0ro0: {
type: 'void',
version: '2.0',
'x-component': 'Space',
'x-decorator': 'DndContext',
'x-app-version': '1.6.21',
'x-component-props': {
split: '|',
},
_isJSONSchemaObject: true,
'x-uid': '58ymkonaijm',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '46zml84998i',
'x-async': false,
'x-index': 1,
},
d1qruxltt1t: {
type: 'void',
version: '2.0',
'x-toolbar': 'TableColumnSchemaToolbar',
'x-settings': 'fieldSettings:TableColumn',
'x-component': 'TableV2.Column',
'x-decorator': 'TableV2.Column.Decorator',
'x-app-version': '1.6.21',
_isJSONSchemaObject: true,
properties: {
nickname: {
version: '2.0',
'x-component': 'CollectionField',
'x-decorator': null,
'x-app-version': '1.6.21',
'x-read-pretty': true,
'x-component-props': {
ellipsis: true,
},
'x-decorator-props': {
labelStyle: {
display: 'none',
},
},
'x-collection-field': 'users.nickname',
_isJSONSchemaObject: true,
'x-uid': 'ut8m8l3qhzn',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'c2592dzb9s1',
'x-async': false,
'x-index': 2,
},
},
'x-uid': 'nntvcjy39cg',
'x-async': false,
'x-index': 2,
},
},
'x-uid': 'o5gizqch1wr',
'x-async': false,
'x-index': 1,
},
},
'x-uid': '8awil00a9wo',
'x-async': false,
'x-index': 1,
},
},
'x-uid': 'i1dnlv9n2k0',
'x-async': false,
'x-index': 2,
},
},
name: 'ri6dthungp3',
'x-uid': 'b2u59skxpsy',
'x-async': true,
'x-index': 1,
},
};

View File

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

View File

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

View File

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

View File

@ -1,13 +1,13 @@
{
"name": "@nocobase/devtools",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"description": "",
"license": "AGPL-3.0",
"main": "./src/index.js",
"dependencies": {
"@nocobase/build": "1.7.0-alpha.10",
"@nocobase/client": "1.7.0-alpha.10",
"@nocobase/test": "1.7.0-alpha.10",
"@nocobase/build": "1.7.0-alpha.11",
"@nocobase/client": "1.7.0-alpha.11",
"@nocobase/test": "1.7.0-alpha.11",
"@types/koa": "^2.15.0",
"@types/koa-bodyparser": "^4.3.4",
"@types/lodash": "^4.14.177",

View File

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

View File

@ -1,10 +1,10 @@
{
"name": "@nocobase/lock-manager",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "lib/index.js",
"license": "AGPL-3.0",
"devDependencies": {
"@nocobase/utils": "1.7.0-alpha.10",
"@nocobase/utils": "1.7.0-alpha.11",
"async-mutex": "^0.5.0"
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/telemetry",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"description": "nocobase telemetry library",
"license": "AGPL-3.0",
"main": "./lib/index.js",
@ -11,7 +11,7 @@
"directory": "packages/telemetry"
},
"dependencies": {
"@nocobase/utils": "1.7.0-alpha.10",
"@nocobase/utils": "1.7.0-alpha.11",
"@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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"@nocobase/server": "1.7.0-alpha.11",
"@playwright/test": "^1.45.3",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.0.0",

View File

@ -31,6 +31,21 @@ function getPageMenuSchema({ pageSchemaUid, tabSchemaUid, tabSchemaName }) {
};
}
function getPageMenuSchemaWithTabSchema({ tabSchema }) {
if (!tabSchema) {
return null;
}
return {
type: 'void',
'x-component': 'Page',
properties: {
[tabSchema.name]: tabSchema,
},
'x-uid': uid(),
};
}
export * from '@playwright/test';
export { defineConfig };
@ -193,10 +208,17 @@ export interface PageConfig {
*/
collections?: CollectionSetting[];
/**
* @deprecate Schema 使
* 使 tabSchema tab Schema tabSchema
*
* Schema
* @default undefined
*/
pageSchema?: any;
/**
* Tab Schema pageSchema tabSchema tabSchema
*/
tabSchema?: any;
/** 如果为 true 则表示不会更改 PageSchema 的 uid */
keepUid?: boolean;
/** 在 URL 中的 uid例如/admin/0ig6xhe03u2 */
@ -217,6 +239,7 @@ interface CreatePageOptions {
url?: PageConfig['url'];
name?: string;
pageSchema?: any;
tabSchema?: any;
/** 如果为 true 则表示不会更改 PageSchema 的 uid */
keepUid?: boolean;
/** 在 URL 中的 uid例如/admin/0ig6xhe03u2 */
@ -367,6 +390,7 @@ export class NocoPage {
type: this.options?.type,
name: this.options?.name,
pageSchema: this.options?.pageSchema,
tabSchema: this.options?.tabSchema,
url: this.options?.url,
keepUid: this.options?.keepUid,
pageUid: this.options?.pageUid,
@ -737,13 +761,16 @@ const updateUidOfPageSchema = (uiSchema: any) => {
* NocoBase
*/
const createPage = async (options?: CreatePageOptions) => {
const { type = 'page', url, name, pageSchema, keepUid, pageUid: pageUidFromOptions } = options || {};
const { type = 'page', url, name, pageSchema, tabSchema, keepUid, pageUid: pageUidFromOptions } = options || {};
const api = await request.newContext({
storageState: process.env.PLAYWRIGHT_AUTH_FILE,
});
const schema = getPageMenuSchemaWithTabSchema({ tabSchema }) || pageSchema;
const state = await api.storageState();
const headers = getHeaders(state);
const newPageSchema = keepUid ? pageSchema : updateUidOfPageSchema(pageSchema);
const newPageSchema = keepUid ? schema : updateUidOfPageSchema(schema);
const pageSchemaUid = newPageSchema?.['x-uid'] || uid();
const newTabSchemaUid = uid();
const newTabSchemaName = uid();

View File

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

View File

@ -69,12 +69,13 @@ export const toLocal = (value: dayjs.Dayjs) => {
};
const convertQuarterToFirstDay = (quarterStr) => {
if (dayjs(quarterStr).isValid()) {
try {
const year = parseInt(quarterStr.slice(0, 4)); // 提取年份
const quarter = parseInt(quarterStr.slice(-1)); // 提取季度数字
return dayjs().quarter(quarter).year(year);
} catch (error) {
return null;
}
return null;
};
const toMoment = (val: any, options?: Str2momentOptions) => {

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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/acl",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-bulk-edit",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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

@ -15,6 +15,17 @@ import Application from '@nocobase/server';
import axios from 'axios';
import CustomRequestPlugin from '../plugin';
function toJSON(value) {
if (typeof value === 'string') {
try {
return JSON.parse(value);
} catch (error) {
return value;
}
}
return value;
}
const getHeaders = (headers: Record<string, any>) => {
return Object.keys(headers).reduce((hds, key) => {
if (key.toLocaleLowerCase().startsWith('x-')) {
@ -168,7 +179,7 @@ export async function send(this: CustomRequestPlugin, ctx: Context, next: Next)
...omitNullAndUndefined(getParsedValue(arrayToObject(headers), variables)),
},
params: getParsedValue(arrayToObject(params), variables),
data: getParsedValue(data, variables),
data: getParsedValue(toJSON(data), variables),
};
const requestUrl = axios.getUri(axiosRequestConfig);

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-action-duplicate",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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

@ -4,7 +4,7 @@
"displayName.zh-CN": "AI 集成",
"description": "Support integration with AI services, providing AI-related workflow nodes to enhance business processing capabilities.",
"description.zh-CN": "支持接入 AI 服务,提供 AI 相关的工作流节点,增强业务处理能力。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "dist/server/index.js",
"peerDependencies": {
"@nocobase/client": "1.x",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-api-doc",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/api-keys",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "异步任务管理器",
"description": "Manage and monitor asynchronous tasks such as data import/export. Support task progress tracking and notification.",
"description.zh-CN": "管理和监控数据导入导出等异步任务。支持任务进度跟踪和通知。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "dist/server/index.js",
"peerDependencies": {
"@nocobase/client": "1.x",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-audit-logs",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/block-iframe",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "区块:模板",
"description": "Create and manage block templates for reuse on pages.",
"description.zh-CN": "创建和管理区块模板,用于在页面中重复使用。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/block-template",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-block-workbench",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"displayName": "Block: Action panel",
"displayName.zh-CN": "区块:操作面板",
"description": "Centrally manages and displays various actions, allowing users to efficiently perform tasks. It supports extensibility, with current action types including pop-ups, links, scanning, and custom requests.",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-calendar",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"displayName": "Collection: Tree",
"displayName.zh-CN": "数据表:树",
"description": "Provides tree collection template",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据源:主数据库",
"description": "NocoBase main database, supports relational databases such as PostgreSQL, MySQL, MariaDB and so on.",
"description.zh-CN": "NocoBase 主数据库,支持 PostgreSQL、MySQL、MariaDB 等关系型数据库。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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

@ -135,11 +135,10 @@ export const useChartFilter = () => {
'x-decorator': 'ChartFilterFormItem',
'x-data-source': dataSource,
'x-collection-field': `${fieldName}.${field.name}`,
...defaultOperator?.schema,
'x-component-props': {
utc: false,
underFilter: true,
...field.uiSchema?.['x-component-props'],
component: defaultOperator?.schema?.['x-component'],
'filter-operator': defaultOperator,
'data-source': dataSource,
'collection-field': `${fieldName}.${field.name}`,
@ -195,14 +194,15 @@ export const useChartFilter = () => {
'x-settings': 'chart:filterForm:item',
'x-toolbar': 'ChartFilterItemToolbar',
'x-decorator': 'ChartFilterFormItem',
'x-component': 'CollectionField',
'x-data-source': dataSource,
'x-collection-field': `${fieldName}.${child.name}`,
...child.schema,
title,
...defaultOperator?.schema,
'x-component-props': {
utc: false,
underFilter: true,
component: defaultOperator?.schema?.['x-component'],
'filter-operator': defaultOperator,
'data-source': dataSource,
'collection-field': `${fieldName}.${child.name}`,

View File

@ -56,6 +56,7 @@ function useFieldComponentName(): string {
const map = {
// AssociationField 的 mode 默认值是 Select
AssociationField: 'Select',
'DatePicker.FilterWithPicker': 'DatePicker',
};
const fieldComponentName =
fieldSchema?.['x-component-props']?.['mode'] ||
@ -163,15 +164,15 @@ const EditOperator = () => {
const setOperatorComponent = (operator: any, component: any, props = {}) => {
const componentProps = field.componentProps || {};
field.component = component;
field.componentProps = {
...componentProps,
component,
'filter-operator': operator,
...props,
};
fieldSchema['x-component'] = component;
fieldSchema['x-component-props'] = {
...fieldSchema['x-component-props'],
component,
'filter-operator': operator,
...props,
};
@ -179,9 +180,9 @@ const EditOperator = () => {
dn.emit('patch', {
schema: {
'x-uid': fieldSchema['x-uid'],
'x-component': component,
'x-component-props': {
...fieldSchema['x-component-props'],
component,
'filter-operator': operator,
...props,
},

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "部门",
"description": "Organize users by departments, set hierarchical relationships, link roles to control permissions, and use departments as variables in workflows and expressions.",
"description.zh-CN": "以部门来组织用户,设定上下级关系,绑定角色控制权限,并支持作为变量用于工作流和表达式。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "dist/server/index.js",
"peerDependencies": {
"@nocobase/actions": "1.x",

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-environment-variables",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-field-attachment-url",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "dist/server/index.js",
"displayName": "Collection field: Attachment(URL)",
"displayName.zh-CN": "数据表字段附件URL",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-field-china-region",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"displayName": "Collection field: 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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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-field-sort",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"displayName": "Collection field: Sort",
"displayName.zh-CN": "数据表字段:排序",

View File

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

View File

@ -11,7 +11,7 @@ import { StorageEngine } from 'multer';
export * from '../constants';
export { AttachmentModel, default, PluginFileManagerServer, StorageModel } from './server';
export { cloudFilenameGetter } from './utils';
export { StorageType } from './storages';
export { StorageEngine };

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-gantt",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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

@ -2,7 +2,7 @@
"name": "@nocobase/plugin-locale-tester",
"displayName": "Locale tester",
"displayName.zh-CN": "翻译测试工具",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"homepage": "https://github.com/nocobase/locales",
"main": "dist/server/index.js",
"peerDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-localization",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/mobile",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/mobile",

View File

@ -2,7 +2,7 @@
"name": "@nocobase/plugin-mock-collections",
"displayName": "mock-collections",
"description": "mock-collections",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"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.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "./dist/server/index.js",
"devDependencies": {
"@formily/react": "2.x",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-notification-email",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"displayName": "Notification: Email",
"displayName.zh-CN": "通知:电子邮件",
"description": "Used for sending email notifications with built-in SMTP transport.",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-notification-in-app-message",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"displayName": "Notification: In-app message",
"displayName.zh-CN": "通知:站内信",
"description": "It supports users in receiving real-time message notifications within the NocoBase application.",

View File

@ -7,11 +7,11 @@
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import React, { useEffect } from 'react';
import { observer } from '@formily/reactive-react';
import { useNavigate, useLocation } from 'react-router-dom';
import { MobileTabBarItem } from '@nocobase/plugin-mobile/client';
import { unreadMsgsCountObs, startMsgSSEStreamWithRetry, updateUnreadMsgsCount } from '../../observables';
import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { startMsgSSEStreamWithRetry, unreadMsgsCountObs, updateUnreadMsgsCount } from '../../observables';
const InnerMobileTabBarMessageItem = (props) => {
const navigate = useNavigate();
@ -19,9 +19,32 @@ const InnerMobileTabBarMessageItem = (props) => {
const onClick = () => {
navigate('/page/in-app-message');
};
useEffect(() => {
startMsgSSEStreamWithRetry();
const disposes: Array<() => void> = [];
disposes.push(startMsgSSEStreamWithRetry());
const disposeAll = () => {
while (disposes.length > 0) {
const dispose = disposes.pop();
dispose && dispose();
}
};
const onVisibilityChange = () => {
if (document.visibilityState === 'visible') {
disposes.push(startMsgSSEStreamWithRetry());
} else {
disposeAll();
}
};
document.addEventListener('visibilitychange', onVisibilityChange);
return () => {
disposeAll();
document.removeEventListener('visibilitychange', onVisibilityChange);
};
}, []);
const selected = props.url && location.pathname.startsWith(props.url);
return (

View File

@ -4,7 +4,7 @@
"description": "Provides a unified management service that includes channel configuration, logging, and other features, supporting the configuration of various notification channels, including in-app message and email.",
"displayName.zh-CN": "通知管理",
"description.zh-CN": "提供统一的管理服务,涵盖渠道配置、日志记录等功能,支持多种通知渠道的配置,包括站内信和电子邮件等。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"homepage": "https://docs.nocobase.com/handbook/notification-manager",
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/notification-manager",
"main": "dist/server/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-notifications",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"description": "",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-public-forms",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "dist/server/index.js",
"displayName": "Public forms",
"displayName.zh-CN": "公开表单",

View File

@ -1,6 +1,6 @@
{
"name": "@nocobase/plugin-sample-hello",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"main": "./dist/server/index.js",
"displayName": "Hello",
"displayName.zh-CN": "Hello",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "数据表字段:关系快照",
"description": "When adding a new record, create a snapshot for its relational record and save in the new record. The snapshot will not be updated when the relational record is updated.",
"description.zh-CN": "在添加数据时,为它的关系数据创建快照,并保存在当前的数据中。关系数据更新时,快照不会更新。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/field-snapshot",

View File

@ -4,7 +4,7 @@
"displayName.zh-CN": "系统设置",
"description": "Used to adjust the system title, logo, language, etc.",
"description.zh-CN": "用于调整系统的标题、LOGO、语言等。",
"version": "1.7.0-alpha.10",
"version": "1.7.0-alpha.11",
"license": "AGPL-3.0",
"main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/handbook/system-settings",

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