refactor: migrate names (#1050)
Reviewed-on: daoyoucloud/tachybase#1050
This commit is contained in:
parent
95d2c2f1ee
commit
ccd799f85f
@ -6,10 +6,10 @@ DB_POSTGRES_PORT=10103
|
|||||||
VERDACCIO_PORT=10104
|
VERDACCIO_PORT=10104
|
||||||
# VERDACCIO_URL=http://host.docker.internal:10104/
|
# VERDACCIO_URL=http://host.docker.internal:10104/
|
||||||
|
|
||||||
################# NOCOBASE APPLICATION #################
|
################# TACHYBASE APPLICATION #################
|
||||||
|
|
||||||
# !!! When `APP_ENV=production`, opening http://localhost:13000/ will show "Not Found".
|
# !!! When `APP_ENV=production`, opening http://localhost:13000/ will show "Not Found".
|
||||||
# !!! It is recommended to use nginx to proxy static files. For example https://github.com/nocobase/nocobase/blob/main/docker/nocobase/nocobase.conf
|
# !!! It is recommended to use nginx to proxy static files. For example https://github.com/tachybase/tachybase/blob/main/docker/tachybase/tachybase.conf
|
||||||
APP_ENV=development
|
APP_ENV=development
|
||||||
APP_PORT=20000
|
APP_PORT=20000
|
||||||
APP_KEY=test-key-e2e
|
APP_KEY=test-key-e2e
|
||||||
@ -31,13 +31,13 @@ LOGGER_BASE_PATH=storage/e2e/logs
|
|||||||
################# DATABASE #################
|
################# DATABASE #################
|
||||||
|
|
||||||
DB_DIALECT=postgres
|
DB_DIALECT=postgres
|
||||||
DB_STORAGE=storage/e2e/db/nocobase.sqlite
|
DB_STORAGE=storage/e2e/db/tachybase.sqlite
|
||||||
DB_TABLE_PREFIX=
|
DB_TABLE_PREFIX=
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
DB_DATABASE=nocobase-e2e
|
DB_DATABASE=tachybase-e2e
|
||||||
DB_USER=nocobase
|
DB_USER=tachybase
|
||||||
DB_PASSWORD=nocobase
|
DB_PASSWORD=tachybase
|
||||||
# DB_LOGGING=on
|
# DB_LOGGING=on
|
||||||
# DB_UNDERSCORED=false
|
# DB_UNDERSCORED=false
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ DB_PASSWORD=nocobase
|
|||||||
INIT_ROOT_EMAIL=admin@tachybase.com
|
INIT_ROOT_EMAIL=admin@tachybase.com
|
||||||
INIT_ROOT_PASSWORD=admin123
|
INIT_ROOT_PASSWORD=admin123
|
||||||
INIT_ROOT_NICKNAME=Super Admin
|
INIT_ROOT_NICKNAME=Super Admin
|
||||||
INIT_ROOT_USERNAME=nocobase
|
INIT_ROOT_USERNAME=tachybase
|
||||||
|
|
||||||
# local or ali-oss
|
# local or ali-oss
|
||||||
DEFAULT_STORAGE_TYPE=local
|
DEFAULT_STORAGE_TYPE=local
|
||||||
|
10
.env.example
10
.env.example
@ -6,10 +6,10 @@ DB_POSTGRES_PORT=10103
|
|||||||
VERDACCIO_PORT=10104
|
VERDACCIO_PORT=10104
|
||||||
# VERDACCIO_URL=http://host.docker.internal:10104/
|
# VERDACCIO_URL=http://host.docker.internal:10104/
|
||||||
|
|
||||||
################# NOCOBASE APPLICATION #################
|
################# TACHYBASE APPLICATION #################
|
||||||
|
|
||||||
# !!! When `APP_ENV=production`, opening http://localhost:13000/ will show "Not Found".
|
# !!! When `APP_ENV=production`, opening http://localhost:13000/ will show "Not Found".
|
||||||
# !!! It is recommended to use nginx to proxy static files. For example https://github.com/nocobase/nocobase/blob/main/docker/nocobase/nocobase.conf
|
# !!! It is recommended to use nginx to proxy static files. For example https://github.com/tachybase/tachybase/blob/main/docker/tachybase/tachybase.conf
|
||||||
APP_ENV=development
|
APP_ENV=development
|
||||||
APP_PORT=13000
|
APP_PORT=13000
|
||||||
APP_KEY=test-key
|
APP_KEY=test-key
|
||||||
@ -32,13 +32,13 @@ LOGGER_FORMAT=
|
|||||||
################# DATABASE #################
|
################# DATABASE #################
|
||||||
|
|
||||||
DB_DIALECT=sqlite
|
DB_DIALECT=sqlite
|
||||||
DB_STORAGE=storage/db/nocobase.sqlite
|
DB_STORAGE=storage/db/tachybase.sqlite
|
||||||
DB_TABLE_PREFIX=
|
DB_TABLE_PREFIX=
|
||||||
# DB_HOST=localhost
|
# DB_HOST=localhost
|
||||||
# DB_PORT=5432
|
# DB_PORT=5432
|
||||||
# DB_DATABASE=postgres
|
# DB_DATABASE=postgres
|
||||||
# DB_USER=nocobase
|
# DB_USER=tachybase
|
||||||
# DB_PASSWORD=nocobase
|
# DB_PASSWORD=tachybase
|
||||||
# DB_LOGGING=on
|
# DB_LOGGING=on
|
||||||
# DB_UNDERSCORED=false
|
# DB_UNDERSCORED=false
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
################# NOCOBASE APPLICATION #################
|
################# TACHYBASE APPLICATION #################
|
||||||
|
|
||||||
APP_ENV=development
|
APP_ENV=development
|
||||||
APP_PORT=13000
|
APP_PORT=13000
|
||||||
@ -12,12 +12,12 @@ PROXY_TARGET_URL=
|
|||||||
################# DATABASE #################
|
################# DATABASE #################
|
||||||
|
|
||||||
DB_DIALECT=sqlite
|
DB_DIALECT=sqlite
|
||||||
DB_STORAGE=storage/db/nocobase-test.sqlite
|
DB_STORAGE=storage/db/tachybase-test.sqlite
|
||||||
# DB_HOST=localhost
|
# DB_HOST=localhost
|
||||||
# DB_PORT=5432
|
# DB_PORT=5432
|
||||||
# DB_DATABASE=nocobase-test
|
# DB_DATABASE=tachybase-test
|
||||||
# DB_USER=nocobase
|
# DB_USER=tachybase
|
||||||
# DB_PASSWORD=nocobase
|
# DB_PASSWORD=tachybase
|
||||||
# DB_LOGGING=on
|
# DB_LOGGING=on
|
||||||
|
|
||||||
################# CACHE #################
|
################# CACHE #################
|
||||||
@ -29,7 +29,7 @@ DB_STORAGE=storage/db/nocobase-test.sqlite
|
|||||||
INIT_ROOT_EMAIL=admin@tachybase.com
|
INIT_ROOT_EMAIL=admin@tachybase.com
|
||||||
INIT_ROOT_PASSWORD=admin123
|
INIT_ROOT_PASSWORD=admin123
|
||||||
INIT_ROOT_NICKNAME=Super Admin
|
INIT_ROOT_NICKNAME=Super Admin
|
||||||
INIT_ROOT_USERNAME=nocobase
|
INIT_ROOT_USERNAME=tachybase
|
||||||
|
|
||||||
# local or ali-oss
|
# local or ali-oss
|
||||||
DEFAULT_STORAGE_TYPE=local
|
DEFAULT_STORAGE_TYPE=local
|
||||||
|
22
Dockerfile
22
Dockerfile
@ -1,7 +1,7 @@
|
|||||||
FROM node:20-bullseye-slim as base
|
FROM node:20-bullseye-slim as base
|
||||||
RUN apt-get update && apt-get install -y nginx
|
RUN apt-get update && apt-get install -y nginx
|
||||||
RUN rm -rf /etc/nginx/sites-enabled/default
|
RUN rm -rf /etc/nginx/sites-enabled/default
|
||||||
COPY ./docker/nocobase/nocobase.conf /etc/nginx/sites-enabled/nocobase.conf
|
COPY ./docker/tachybase/tachybase.conf /etc/nginx/sites-enabled/tachybase.conf
|
||||||
|
|
||||||
FROM node:20-bullseye as build-template-app
|
FROM node:20-bullseye as build-template-app
|
||||||
ARG NPM_REGISTRY=https://registry.npmjs.org/
|
ARG NPM_REGISTRY=https://registry.npmjs.org/
|
||||||
@ -12,25 +12,25 @@ ENV PATH="$PNPM_HOME:$PATH"
|
|||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN cd /app && npx --registry $NPM_REGISTRY create-tachybase-app@$TACHYBASE_VERSION my-nocobase-app -a -e APP_ENV=production
|
RUN cd /app && npx --registry $NPM_REGISTRY create-tachybase-app@$TACHYBASE_VERSION my-tachybase-app -a -e APP_ENV=production
|
||||||
RUN pnpm config set registry $NPM_REGISTRY
|
RUN pnpm config set registry $NPM_REGISTRY
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd /app/my-nocobase-app && pnpm install --production
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd /app/my-tachybase-app && pnpm install --production
|
||||||
|
|
||||||
WORKDIR /app/my-nocobase-app
|
WORKDIR /app/my-tachybase-app
|
||||||
|
|
||||||
RUN cd /app \
|
RUN cd /app \
|
||||||
&& rm -rf my-nocobase-app/packages/app/client/src/.umi \
|
&& rm -rf my-tachybase-app/packages/app/client/src/.umi \
|
||||||
&& rm -rf nocobase.tar.gz \
|
&& rm -rf tachybase.tar.gz \
|
||||||
&& tar -zcf ./nocobase.tar.gz -C /app/my-nocobase-app .
|
&& tar -zcf ./tachybase.tar.gz -C /app/my-tachybase-app .
|
||||||
|
|
||||||
FROM base AS build-app
|
FROM base AS build-app
|
||||||
COPY --from=build-template-app /app/nocobase.tar.gz /app/nocobase.tar.gz
|
COPY --from=build-template-app /app/tachybase.tar.gz /app/tachybase.tar.gz
|
||||||
|
|
||||||
WORKDIR /app/nocobase
|
WORKDIR /app/tachybase
|
||||||
|
|
||||||
RUN mkdir -p /app/nocobase/storage/uploads/ && echo "$COMMIT_HASH" >> /app/nocobase/storage/uploads/COMMIT_HASH
|
RUN mkdir -p /app/tachybase/storage/uploads/ && echo "$COMMIT_HASH" >> /app/tachybase/storage/uploads/COMMIT_HASH
|
||||||
|
|
||||||
COPY ./docker/nocobase/docker-entrypoint.sh /app/
|
COPY ./docker/tachybase/docker-entrypoint.sh /app/
|
||||||
|
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
TachyCode is a scalability-first, open-source no-code development platform.
|
TachyCode is a scalability-first, open-source no-code development platform.
|
||||||
|
|
||||||
It is based on the last Apache version fork of the open-source NocoBase.
|
It is based on the last Apache version fork of the open-source TachyBase.
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
"name": "@tachybase/actions",
|
"name": "@tachybase/actions",
|
||||||
"version": "0.21.34",
|
"version": "0.21.34",
|
||||||
"description": "",
|
"description": "",
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
||||||
"directory": "packages/actions"
|
|
||||||
},
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
@ -18,6 +13,5 @@
|
|||||||
"koa": "^2.13.4",
|
"koa": "^2.13.4",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"sequelize": "^6.26.0"
|
"sequelize": "^6.26.0"
|
||||||
},
|
}
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,10 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
content: isDevCmd ? '' : `
|
content: isDevCmd ? '' : `
|
||||||
window['__webpack_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
|
window['__webpack_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
|
||||||
window['__nocobase_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
|
window['__tachybase_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
|
||||||
window['__nocobase_api_base_url__'] = '{{env.API_BASE_URL}}';
|
window['__tachybase_api_base_url__'] = '{{env.API_BASE_URL}}';
|
||||||
window['__nocobase_ws_url__'] = '{{env.WS_URL}}';
|
window['__tachybase_ws_url__'] = '{{env.WS_URL}}';
|
||||||
window['__nocobase_ws_path__'] = '{{env.WS_PATH}}';
|
window['__tachybase_ws_path__'] = '{{env.WS_PATH}}';
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -75,7 +75,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
chainWebpack(config, { env }) {
|
chainWebpack(config, { env }) {
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
config.plugin('ignore nocobase plugins').use(require('webpack').IgnorePlugin, [
|
config.plugin('ignore tachybase plugins').use(require('webpack').IgnorePlugin, [
|
||||||
{
|
{
|
||||||
resourceRegExp: new RegExp(pluginPrefix.join('|')),
|
resourceRegExp: new RegExp(pluginPrefix.join('|')),
|
||||||
},
|
},
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
import { Application } from '@tachybase/client';
|
import { Application } from '@tachybase/client';
|
||||||
import { TachyBaseClientPresetPlugin } from '@tachybase/preset-tachybase/client';
|
import { TachyBaseClientPresetPlugin } from '@tachybase/preset-tachybase/client';
|
||||||
|
|
||||||
import devDynamicImport from '../.plugins/index';
|
import devDynamicImport from '../.plugins/index';
|
||||||
|
|
||||||
export const app = new Application({
|
export const app = new Application({
|
||||||
apiClient: {
|
apiClient: {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
baseURL: window['__nocobase_api_base_url__'] || process.env.API_BASE_URL || '/api/',
|
baseURL: window['__tachybase_api_base_url__'] || process.env.API_BASE_URL || '/api/',
|
||||||
},
|
},
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
publicPath: window['__nocobase_public_path__'] || process.env.APP_PUBLIC_PATH || '/',
|
publicPath: window['__tachybase_public_path__'] || process.env.APP_PUBLIC_PATH || '/',
|
||||||
plugins: [TachyBaseClientPresetPlugin],
|
plugins: [TachyBaseClientPresetPlugin],
|
||||||
ws: {
|
ws: {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
url: window['__nocobase_ws_url__'] || process.env.WEBSOCKET_URL || '',
|
url: window['__tachybase_ws_url__'] || process.env.WEBSOCKET_URL || '',
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
basename: window['__nocobase_ws_path__'] || process.env.WS_PATH || '/ws',
|
basename: window['__tachybase_ws_path__'] || process.env.WS_PATH || '/ws',
|
||||||
},
|
},
|
||||||
loadRemotePlugins: true,
|
loadRemotePlugins: true,
|
||||||
devDynamicImport,
|
devDynamicImport,
|
||||||
|
@ -17,6 +17,5 @@
|
|||||||
"@tachybase/cache": "workspace:*",
|
"@tachybase/cache": "workspace:*",
|
||||||
"@tachybase/client": "workspace:*",
|
"@tachybase/client": "workspace:*",
|
||||||
"@tachybase/logger": "workspace:*"
|
"@tachybase/logger": "workspace:*"
|
||||||
},
|
}
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import { resolve } from 'path';
|
||||||
import { mockDatabase } from '@tachybase/database';
|
import { mockDatabase } from '@tachybase/database';
|
||||||
import { uid } from '@tachybase/utils';
|
import { uid } from '@tachybase/utils';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import execa from 'execa';
|
import execa from 'execa';
|
||||||
import { resolve } from 'path';
|
|
||||||
import { getPortPromise } from 'portfinder';
|
import { getPortPromise } from 'portfinder';
|
||||||
|
|
||||||
const delay = (timeout) => {
|
const delay = (timeout) => {
|
||||||
@ -53,7 +54,7 @@ const run = (command, args, options) => {
|
|||||||
|
|
||||||
const createDatabase = async () => {
|
const createDatabase = async () => {
|
||||||
if (process.env.DB_DIALECT === 'sqlite') {
|
if (process.env.DB_DIALECT === 'sqlite') {
|
||||||
return 'nocobase';
|
return 'tachybase';
|
||||||
}
|
}
|
||||||
const db = mockDatabase();
|
const db = mockDatabase();
|
||||||
const name = `d_${uid()}`;
|
const name = `d_${uid()}`;
|
||||||
@ -69,7 +70,7 @@ describe.skip('cli', () => {
|
|||||||
port: 13000,
|
port: 13000,
|
||||||
});
|
});
|
||||||
console.log(process.env.DB_DIALECT, port);
|
console.log(process.env.DB_DIALECT, port);
|
||||||
const dbFile = `storage/tests/db/nocobase-${uid()}.sqlite`;
|
const dbFile = `storage/tests/db/tachybase-${uid()}.sqlite`;
|
||||||
const env = {
|
const env = {
|
||||||
...process.env,
|
...process.env,
|
||||||
APP_PORT: `${port}`,
|
APP_PORT: `${port}`,
|
||||||
@ -78,15 +79,15 @@ describe.skip('cli', () => {
|
|||||||
SOCKET_PATH: `storage/tests/gateway-e2e-${uid()}.sock`,
|
SOCKET_PATH: `storage/tests/gateway-e2e-${uid()}.sock`,
|
||||||
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
||||||
};
|
};
|
||||||
const subprocess1 = await execa('pnpm', ['nocobase', 'install'], {
|
const subprocess1 = await execa('pnpm', ['tachybase', 'install'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
expect(subprocess1.stdout.includes('app installed successfully')).toBeTruthy();
|
expect(subprocess1.stdout.includes('app installed successfully')).toBeTruthy();
|
||||||
const subprocess2 = await execa('pnpm', ['nocobase', 'install'], {
|
const subprocess2 = await execa('pnpm', ['tachybase', 'install'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
expect(subprocess2.stdout.includes('app is installed')).toBeTruthy();
|
expect(subprocess2.stdout.includes('app is installed')).toBeTruthy();
|
||||||
const subprocess3 = await execa('pnpm', ['nocobase', 'install', '-f'], {
|
const subprocess3 = await execa('pnpm', ['tachybase', 'install', '-f'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
expect(subprocess3.stdout.includes('app reinstalled successfully')).toBeTruthy();
|
expect(subprocess3.stdout.includes('app reinstalled successfully')).toBeTruthy();
|
||||||
@ -98,7 +99,7 @@ describe.skip('cli', () => {
|
|||||||
const port = await getPortPromise({
|
const port = await getPortPromise({
|
||||||
port: 13000,
|
port: 13000,
|
||||||
});
|
});
|
||||||
const dbFile = `storage/tests/db/nocobase-${uid()}.sqlite`;
|
const dbFile = `storage/tests/db/tachybase-${uid()}.sqlite`;
|
||||||
const env = {
|
const env = {
|
||||||
...process.env,
|
...process.env,
|
||||||
APP_PORT: `${port}`,
|
APP_PORT: `${port}`,
|
||||||
@ -107,13 +108,13 @@ describe.skip('cli', () => {
|
|||||||
SOCKET_PATH: `storage/tests/gateway-e2e-${uid()}.sock`,
|
SOCKET_PATH: `storage/tests/gateway-e2e-${uid()}.sock`,
|
||||||
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
||||||
};
|
};
|
||||||
const subprocess1 = execa('pnpm', ['nocobase', 'dev', '--server'], {
|
const subprocess1 = execa('pnpm', ['tachybase', 'dev', '--server'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const code = await checkServer(port);
|
const code = await checkServer(port);
|
||||||
console.log(code);
|
console.log(code);
|
||||||
expect(code).toBe('APP_NOT_INSTALLED_ERROR');
|
expect(code).toBe('APP_NOT_INSTALLED_ERROR');
|
||||||
execa('pnpm', ['nocobase', 'install'], {
|
execa('pnpm', ['tachybase', 'install'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
@ -128,7 +129,7 @@ describe.skip('cli', () => {
|
|||||||
const port = await getPortPromise({
|
const port = await getPortPromise({
|
||||||
port: 13000,
|
port: 13000,
|
||||||
});
|
});
|
||||||
const dbFile = `storage/tests/db/nocobase-${uid()}.sqlite`;
|
const dbFile = `storage/tests/db/tachybase-${uid()}.sqlite`;
|
||||||
const env = {
|
const env = {
|
||||||
...process.env,
|
...process.env,
|
||||||
APP_PORT: `${port}`,
|
APP_PORT: `${port}`,
|
||||||
@ -137,10 +138,10 @@ describe.skip('cli', () => {
|
|||||||
SOCKET_PATH: `storage/tests/gateway-e2e-${uid()}.sock`,
|
SOCKET_PATH: `storage/tests/gateway-e2e-${uid()}.sock`,
|
||||||
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
||||||
};
|
};
|
||||||
await execa('pnpm', ['nocobase', 'install'], {
|
await execa('pnpm', ['tachybase', 'install'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const subprocess1 = execa('pnpm', ['nocobase', 'dev', '--server'], {
|
const subprocess1 = execa('pnpm', ['tachybase', 'dev', '--server'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const code = await checkServer(port);
|
const code = await checkServer(port);
|
||||||
@ -154,7 +155,7 @@ describe.skip('cli', () => {
|
|||||||
const port = await getPortPromise({
|
const port = await getPortPromise({
|
||||||
port: 13000,
|
port: 13000,
|
||||||
});
|
});
|
||||||
const dbFile = `storage/tests/db/nocobase-${uid()}.sqlite`;
|
const dbFile = `storage/tests/db/tachybase-${uid()}.sqlite`;
|
||||||
const env = {
|
const env = {
|
||||||
...process.env,
|
...process.env,
|
||||||
APP_PORT: `${port}`,
|
APP_PORT: `${port}`,
|
||||||
@ -164,13 +165,13 @@ describe.skip('cli', () => {
|
|||||||
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
||||||
};
|
};
|
||||||
console.log('DB_STORAGE:', dbFile);
|
console.log('DB_STORAGE:', dbFile);
|
||||||
const subprocess1 = execa('pnpm', ['nocobase', 'dev', '--server', '--quickstart'], {
|
const subprocess1 = execa('pnpm', ['tachybase', 'dev', '--server', '--quickstart'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const code = await checkServer(port);
|
const code = await checkServer(port);
|
||||||
expect(code).toBe(true);
|
expect(code).toBe(true);
|
||||||
subprocess1.cancel();
|
subprocess1.cancel();
|
||||||
const subprocess2 = execa('pnpm', ['nocobase', 'dev', '--server', '--quickstart'], {
|
const subprocess2 = execa('pnpm', ['tachybase', 'dev', '--server', '--quickstart'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const code2 = await checkServer(port);
|
const code2 = await checkServer(port);
|
||||||
@ -184,7 +185,7 @@ describe.skip('cli', () => {
|
|||||||
const port = await getPortPromise({
|
const port = await getPortPromise({
|
||||||
port: 13000,
|
port: 13000,
|
||||||
});
|
});
|
||||||
const dbFile = `storage/tests/db/nocobase-${uid()}.sqlite`;
|
const dbFile = `storage/tests/db/tachybase-${uid()}.sqlite`;
|
||||||
const env = {
|
const env = {
|
||||||
...process.env,
|
...process.env,
|
||||||
APP_PORT: `${port}`,
|
APP_PORT: `${port}`,
|
||||||
@ -194,13 +195,13 @@ describe.skip('cli', () => {
|
|||||||
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
||||||
};
|
};
|
||||||
console.log('DB_STORAGE:', dbFile);
|
console.log('DB_STORAGE:', dbFile);
|
||||||
await execa('pnpm', ['nocobase', 'install'], {
|
await execa('pnpm', ['tachybase', 'install'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const subprocess2 = await execa('pnpm', ['nocobase', 'upgrade'], {
|
const subprocess2 = await execa('pnpm', ['tachybase', 'upgrade'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
expect(subprocess2.stdout.includes('NocoBase has been upgraded')).toBe(true);
|
expect(subprocess2.stdout.includes('TachyBase has been upgraded')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('quickstart + upgrade', async () => {
|
test('quickstart + upgrade', async () => {
|
||||||
@ -209,7 +210,7 @@ describe.skip('cli', () => {
|
|||||||
const port = await getPortPromise({
|
const port = await getPortPromise({
|
||||||
port: 13000,
|
port: 13000,
|
||||||
});
|
});
|
||||||
const dbFile = `storage/tests/db/nocobase-${uid()}.sqlite`;
|
const dbFile = `storage/tests/db/tachybase-${uid()}.sqlite`;
|
||||||
const env = {
|
const env = {
|
||||||
...process.env,
|
...process.env,
|
||||||
APP_PORT: `${port}`,
|
APP_PORT: `${port}`,
|
||||||
@ -219,12 +220,12 @@ describe.skip('cli', () => {
|
|||||||
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
PM2_HOME: resolve(process.cwd(), `storage/tests/.pm2-${uid()}`),
|
||||||
};
|
};
|
||||||
console.log('DB_STORAGE:', dbFile);
|
console.log('DB_STORAGE:', dbFile);
|
||||||
const subprocess1 = execa('pnpm', ['nocobase', 'dev', '--server', '--quickstart'], {
|
const subprocess1 = execa('pnpm', ['tachybase', 'dev', '--server', '--quickstart'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
const code = await checkServer(port);
|
const code = await checkServer(port);
|
||||||
expect(code).toBe(true);
|
expect(code).toBe(true);
|
||||||
await execa('pnpm', ['nocobase', 'upgrade'], {
|
await execa('pnpm', ['tachybase', 'upgrade'], {
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
"name": "@tachybase/auth",
|
"name": "@tachybase/auth",
|
||||||
"version": "0.21.34",
|
"version": "0.21.34",
|
||||||
"description": "",
|
"description": "",
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
||||||
"directory": "packages/auth"
|
|
||||||
},
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
@ -18,6 +13,5 @@
|
|||||||
"@tachybase/utils": "workspace:*",
|
"@tachybase/utils": "workspace:*",
|
||||||
"@types/jsonwebtoken": "^8.5.8",
|
"@types/jsonwebtoken": "^8.5.8",
|
||||||
"jsonwebtoken": "^8.5.1"
|
"jsonwebtoken": "^8.5.1"
|
||||||
},
|
}
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"typings": "./index.d.ts",
|
"typings": "./index.d.ts",
|
||||||
"bin": {
|
"bin": {
|
||||||
"nocobase-build": "./bin/nocobase-build.js"
|
"tachybase-build": "./bin/tachybase-build.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
@ -40,6 +40,5 @@
|
|||||||
"vite-plugin-css-injected-by-js": "^3.2.1",
|
"vite-plugin-css-injected-by-js": "^3.2.1",
|
||||||
"vite-plugin-lib-inject-css": "1.2.0",
|
"vite-plugin-lib-inject-css": "1.2.0",
|
||||||
"yargs-parser": "13.1.2"
|
"yargs-parser": "13.1.2"
|
||||||
},
|
}
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ const clientGlobalFiles: string[] = ['src/**', '!src/server/**', ...globExcludeF
|
|||||||
const sourceGlobalFiles: string[] = ['src/**/*.{ts,js,tsx,jsx,mjs}', '!src/**/__tests__'];
|
const sourceGlobalFiles: string[] = ['src/**/*.{ts,js,tsx,jsx,mjs}', '!src/**/__tests__'];
|
||||||
|
|
||||||
const external = [
|
const external = [
|
||||||
// nocobase
|
// tachybase
|
||||||
'@tachybase/acl',
|
'@tachybase/acl',
|
||||||
'@tachybase/actions',
|
'@tachybase/actions',
|
||||||
'@tachybase/auth',
|
'@tachybase/auth',
|
||||||
@ -187,7 +187,7 @@ export async function buildServerDeps(cwd: string, serverFiles: string[], log: P
|
|||||||
if (excludePackages.length) {
|
if (excludePackages.length) {
|
||||||
tips.push(`These packages ${chalk.yellow(excludePackages.join(', '))} will be ${chalk.italic('exclude')}.`);
|
tips.push(`These packages ${chalk.yellow(excludePackages.join(', '))} will be ${chalk.italic('exclude')}.`);
|
||||||
}
|
}
|
||||||
tips.push(`For more information, please refer to: ${chalk.blue('https://docs.nocobase.com/development/deps')}.`);
|
tips.push(`For more information, please refer to: ${chalk.blue('https://docs.tachybase.com/development/deps')}.`);
|
||||||
log(tips.join(' '));
|
log(tips.join(' '));
|
||||||
|
|
||||||
if (!includePackages.length) return;
|
if (!includePackages.length) return;
|
||||||
|
@ -103,7 +103,7 @@ export function checkDependencies(packageJson: Record<string, any>, log: Log) {
|
|||||||
chalk.yellow(packages.join(', ')),
|
chalk.yellow(packages.join(', ')),
|
||||||
chalk.yellow('dependencies'),
|
chalk.yellow('dependencies'),
|
||||||
chalk.yellow('devDependencies'),
|
chalk.yellow('devDependencies'),
|
||||||
chalk.blue(chalk.blue('https://docs.nocobase.com/development/deps')),
|
chalk.blue(chalk.blue('https://docs.tachybase.com/development/deps')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ export function getUserConfig(cwd: string) {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CACHE_DIR = path.join(NODE_MODULES, '.cache', 'nocobase');
|
const CACHE_DIR = path.join(NODE_MODULES, '.cache', 'tachybase');
|
||||||
export function writeToCache(key: string, data: Record<string, any>) {
|
export function writeToCache(key: string, data: Record<string, any>) {
|
||||||
const cachePath = path.join(CACHE_DIR, `${key}.json`);
|
const cachePath = path.join(CACHE_DIR, `${key}.json`);
|
||||||
fs.ensureDirSync(path.dirname(cachePath));
|
fs.ensureDirSync(path.dirname(cachePath));
|
||||||
|
3
packages/core/cache/package.json
vendored
3
packages/core/cache/package.json
vendored
@ -14,6 +14,5 @@
|
|||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"redis": "^4.6.10"
|
"redis": "^4.6.10"
|
||||||
},
|
}
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"bin",
|
"bin",
|
||||||
"dist",
|
"dist",
|
||||||
"templates",
|
"templates",
|
||||||
"nocobase.conf.tpl"
|
"tachybase.conf.tpl"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rimraf dist && rollup -c",
|
"build": "rimraf dist && rollup -c",
|
||||||
|
@ -27,7 +27,7 @@ export default (cli: Command) => {
|
|||||||
}
|
}
|
||||||
process.env['VITE_CJS_IGNORE_WARNING'] = 'true';
|
process.env['VITE_CJS_IGNORE_WARNING'] = 'true';
|
||||||
|
|
||||||
await run('nocobase-build', [
|
await run('tachybase-build', [
|
||||||
...pkgs,
|
...pkgs,
|
||||||
options.version ? '--version' : '',
|
options.version ? '--version' : '',
|
||||||
!options.dts ? '--no-dts' : '',
|
!options.dts ? '--no-dts' : '',
|
||||||
|
@ -7,14 +7,14 @@ const __dirname = new URL('.', import.meta.url).pathname;
|
|||||||
|
|
||||||
export default (cli: Command) => {
|
export default (cli: Command) => {
|
||||||
cli.command('create-nginx-conf').action(async (name, options) => {
|
cli.command('create-nginx-conf').action(async (name, options) => {
|
||||||
const file = resolve(__dirname, '../../nocobase.conf.tpl');
|
const file = resolve(__dirname, '../../tachybase.conf.tpl');
|
||||||
const data = readFileSync(file, 'utf-8');
|
const data = readFileSync(file, 'utf-8');
|
||||||
const replaced = data
|
const replaced = data
|
||||||
.replace(/\{\{cwd\}\}/g, '/app/nocobase')
|
.replace(/\{\{cwd\}\}/g, '/app/tachybase')
|
||||||
.replace(/\{\{publicPath\}\}/g, process.env.APP_PUBLIC_PATH!)
|
.replace(/\{\{publicPath\}\}/g, process.env.APP_PUBLIC_PATH!)
|
||||||
.replace(/\{\{apiPort\}\}/g, process.env.APP_PORT!);
|
.replace(/\{\{apiPort\}\}/g, process.env.APP_PORT!);
|
||||||
|
|
||||||
const targetFile = resolve(process.cwd(), 'storage', 'nocobase.conf');
|
const targetFile = resolve(process.cwd(), 'storage', 'tachybase.conf');
|
||||||
writeFileSync(targetFile, replaced);
|
writeFileSync(targetFile, replaced);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -18,6 +18,6 @@ export default (cli: Command) => {
|
|||||||
});
|
});
|
||||||
if (options.watch) return;
|
if (options.watch) return;
|
||||||
}
|
}
|
||||||
await run('nocobase-build', [...pkgs, '--only-tar', options.version ? '--version' : '']);
|
await run('tachybase-build', [...pkgs, '--only-tar', options.version ? '--version' : '']);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,7 @@ export class PluginGenerator extends Generator {
|
|||||||
...this.context,
|
...this.context,
|
||||||
packageName: name,
|
packageName: name,
|
||||||
packageVersion,
|
packageVersion,
|
||||||
nocobaseVersion: "0.0.1",
|
tachybaseVersion: "0.0.1",
|
||||||
pascalCaseName: capitalize(camelize(name.split('/').pop())),
|
pascalCaseName: capitalize(camelize(name.split('/').pop())),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ export function initEnv() {
|
|||||||
APP_PORT: 13000,
|
APP_PORT: 13000,
|
||||||
API_BASE_PATH: '/api/',
|
API_BASE_PATH: '/api/',
|
||||||
DB_DIALECT: 'sqlite',
|
DB_DIALECT: 'sqlite',
|
||||||
DB_STORAGE: 'storage/db/nocobase.sqlite',
|
DB_STORAGE: 'storage/db/tachybase.sqlite',
|
||||||
DB_TIMEZONE: '+00:00',
|
DB_TIMEZONE: '+00:00',
|
||||||
DB_UNDERSCORED: parseEnv('DB_UNDERSCORED'),
|
DB_UNDERSCORED: parseEnv('DB_UNDERSCORED'),
|
||||||
DEFAULT_STORAGE_TYPE: 'local',
|
DEFAULT_STORAGE_TYPE: 'local',
|
||||||
|
@ -18,7 +18,7 @@ server {
|
|||||||
root {{cwd}}/node_modules/@tachybase/app/dist/client;
|
root {{cwd}}/node_modules/@tachybase/app/dist/client;
|
||||||
index index.html;
|
index index.html;
|
||||||
client_max_body_size 1000M;
|
client_max_body_size 1000M;
|
||||||
access_log /var/log/nginx/nocobase.log apm;
|
access_log /var/log/nginx/tachybase.log apm;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
@ -74,6 +74,5 @@
|
|||||||
"react": ">=18.0.0",
|
"react": ">=18.0.0",
|
||||||
"react-dom": ">=18.0.0",
|
"react-dom": ">=18.0.0",
|
||||||
"react-is": ">=18.0.0"
|
"react-is": ">=18.0.0"
|
||||||
},
|
}
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ const apiClient = new APIClient(instance);
|
|||||||
// 常规请求
|
// 常规请求
|
||||||
const response = await apiClient.request({ url });
|
const response = await apiClient.request({ url });
|
||||||
|
|
||||||
// NocoBase 特有的资源操作
|
// TachyBase 特有的资源操作
|
||||||
const response = await apiClient.resource('posts').list();
|
const response = await apiClient.resource('posts').list();
|
||||||
|
|
||||||
// 请求共享
|
// 请求共享
|
||||||
@ -100,7 +100,7 @@ run({
|
|||||||
|
|
||||||
<code src="./demos/demo2.tsx"></code>
|
<code src="./demos/demo2.tsx"></code>
|
||||||
|
|
||||||
或者是 NocoBase 的 resource & action 请求:
|
或者是 TachyBase 的 resource & action 请求:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const { data, run } = useRequest({
|
const { data, run } = useRequest({
|
||||||
@ -137,7 +137,7 @@ run(...params);
|
|||||||
function useResource(name: string, of?: string | number): IResource;
|
function useResource(name: string, of?: string | number): IResource;
|
||||||
```
|
```
|
||||||
|
|
||||||
资源是 NocoBase 的核心概念,包括:
|
资源是 TachyBase 的核心概念,包括:
|
||||||
|
|
||||||
- 独立资源,如 `posts`
|
- 独立资源,如 `posts`
|
||||||
- 关系资源,如 `posts.tags` `posts.user` `posts.comments`
|
- 关系资源,如 `posts.tags` `posts.user` `posts.comments`
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import { useLocalStorageState } from 'ahooks';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { useLocalStorageState } from 'ahooks';
|
||||||
|
|
||||||
import { SchemaComponentProvider } from '../schema-component/core';
|
import { SchemaComponentProvider } from '../schema-component/core';
|
||||||
import { ISchemaComponentProvider } from '../schema-component/types';
|
import { ISchemaComponentProvider } from '../schema-component/types';
|
||||||
|
|
||||||
const getKeyByName = (name) => {
|
const getKeyByName = (name) => {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return 'nocobase_designable'.toUpperCase();
|
return 'tachybase_designable'.toUpperCase();
|
||||||
}
|
}
|
||||||
return `nocobase_${name}_designable`.toUpperCase();
|
return `tachybase_${name}_designable`.toUpperCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
const SchemaComponentProviderWithLocalStorageState: React.FC<ISchemaComponentProvider & { appName?: string }> = (
|
const SchemaComponentProviderWithLocalStorageState: React.FC<ISchemaComponentProvider & { appName?: string }> = (
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { define, observable } from '@tachybase/schema';
|
import { define, observable } from '@tachybase/schema';
|
||||||
import { getSubAppName } from '@tachybase/sdk';
|
import { getSubAppName } from '@tachybase/sdk';
|
||||||
|
|
||||||
import { Application } from './Application';
|
import { Application } from './Application';
|
||||||
|
|
||||||
export type WebSocketClientOptions = {
|
export type WebSocketClientOptions = {
|
||||||
@ -89,7 +90,7 @@ export class WebSocketClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._reconnectTimes === 0) {
|
if (this._reconnectTimes === 0) {
|
||||||
console.log('[nocobase-ws]: connecting...');
|
console.log('[tachybase-ws]: connecting...');
|
||||||
}
|
}
|
||||||
if (this._reconnectTimes >= this.reconnectAttempts) {
|
if (this._reconnectTimes >= this.reconnectAttempts) {
|
||||||
return;
|
return;
|
||||||
@ -101,7 +102,7 @@ export class WebSocketClient {
|
|||||||
const ws = new WebSocket(this.getURL(), this.options.protocols);
|
const ws = new WebSocket(this.getURL(), this.options.protocols);
|
||||||
let pingIntervalTimer: any;
|
let pingIntervalTimer: any;
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
console.log('[nocobase-ws]: connected.');
|
console.log('[tachybase-ws]: connected.');
|
||||||
this.serverDown = false;
|
this.serverDown = false;
|
||||||
if (this._ws) {
|
if (this._ws) {
|
||||||
this.removeAllListeners();
|
this.removeAllListeners();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Application, Plugin } from '@tachybase/client';
|
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
import { Application, Plugin } from '@tachybase/client';
|
||||||
|
|
||||||
import { Link, Outlet, useLocation } from 'react-router-dom';
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
const Root = () => {
|
const Root = () => {
|
||||||
@ -52,7 +53,7 @@ class Test2Plugin extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class NocobasePresetPlugin extends Plugin {
|
class TachybasePresetPlugin extends Plugin {
|
||||||
async afterAdd() {
|
async afterAdd() {
|
||||||
// mock load remote plugin
|
// mock load remote plugin
|
||||||
await this.addRemotePlugin();
|
await this.addRemotePlugin();
|
||||||
@ -82,7 +83,7 @@ const app = new Application({
|
|||||||
router: {
|
router: {
|
||||||
type: 'hash',
|
type: 'hash',
|
||||||
},
|
},
|
||||||
plugins: [NocobasePresetPlugin],
|
plugins: [TachybasePresetPlugin],
|
||||||
components: { Root, Home, Team, About },
|
components: { Root, Home, Team, About },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Application, Plugin, RouterManager, useApp } from '@tachybase/client';
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
import { Application, Plugin, RouterManager, useApp } from '@tachybase/client';
|
||||||
|
|
||||||
import { Link, Navigate, Outlet, useParams } from 'react-router-dom';
|
import { Link, Navigate, Outlet, useParams } from 'react-router-dom';
|
||||||
|
|
||||||
const Root = () => {
|
const Root = () => {
|
||||||
@ -67,7 +68,7 @@ const AdminSetting = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class NocobasePresetPlugin extends Plugin {
|
class TachybasePresetPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
||||||
this.router.add('root', {
|
this.router.add('root', {
|
||||||
path: '/',
|
path: '/',
|
||||||
@ -90,7 +91,7 @@ class NocobasePresetPlugin extends Plugin {
|
|||||||
|
|
||||||
const app = new Application({
|
const app = new Application({
|
||||||
router: { type: 'hash' },
|
router: { type: 'hash' },
|
||||||
plugins: [NocobasePresetPlugin],
|
plugins: [TachybasePresetPlugin],
|
||||||
});
|
});
|
||||||
|
|
||||||
export default app.getRootComponent();
|
export default app.getRootComponent();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Application, NocoBaseBuildInPlugin } from '@tachybase/client';
|
import { Application, BuildinPlugin } from '@tachybase/client';
|
||||||
|
|
||||||
export const app = new Application({
|
export const app = new Application({
|
||||||
apiClient: {
|
apiClient: {
|
||||||
baseURL: process.env.API_BASE_URL,
|
baseURL: process.env.API_BASE_URL,
|
||||||
},
|
},
|
||||||
plugins: [NocoBaseBuildInPlugin],
|
plugins: [BuildinPlugin],
|
||||||
});
|
});
|
||||||
|
|
||||||
export default app.getRootComponent();
|
export default app.getRootComponent();
|
||||||
|
@ -6,7 +6,7 @@ group:
|
|||||||
|
|
||||||
# Application V2
|
# Application V2
|
||||||
|
|
||||||
<img src="https://nocobase.oss-cn-beijing.aliyuncs.com/5be7ebc2f47effef85be7a0c75cf76f9.png" style="max-width: 800px;" />
|
<img src="https://tachybase.oss-cn-beijing.aliyuncs.com/5be7ebc2f47effef85be7a0c75cf76f9.png" style="max-width: 800px;" />
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { ButtonProps } from 'antd';
|
|
||||||
import React, { FC, ReactNode, useCallback, useMemo } from 'react';
|
import React, { FC, ReactNode, useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
|
import { ButtonProps } from 'antd';
|
||||||
|
|
||||||
import { useCompile } from '../../../schema-component';
|
import { useCompile } from '../../../schema-component';
|
||||||
import { useApp } from '../../hooks';
|
import { useApp } from '../../hooks';
|
||||||
import { SchemaInitializerChild, SchemaInitializerItems } from '../components';
|
import { SchemaInitializerChild, SchemaInitializerItems } from '../components';
|
||||||
@ -148,7 +150,7 @@ export function useSchemaInitializerRender<P1 = ButtonProps, P2 = {}>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!initializer) {
|
if (!initializer) {
|
||||||
console.error(`[nocobase]: SchemaInitializer "${name}" not found`);
|
console.error(`[tachybase]: SchemaInitializer "${name}" not found`);
|
||||||
return {
|
return {
|
||||||
exists: false,
|
exists: false,
|
||||||
render: () => null,
|
render: () => null,
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { useApp } from '../../hooks';
|
import { GeneralField, Schema } from '@tachybase/schema';
|
||||||
import { SchemaSettingOptions } from '../types';
|
|
||||||
import React from 'react';
|
|
||||||
import { SchemaSettingsWrapper } from '../components';
|
|
||||||
import { SchemaSettingsProps } from '../../../schema-settings';
|
|
||||||
import { Schema } from '@tachybase/schema';
|
|
||||||
import { GeneralField } from '@tachybase/schema';
|
|
||||||
import { Designable } from '../../../schema-component';
|
import { Designable } from '../../../schema-component';
|
||||||
|
import { SchemaSettingsProps } from '../../../schema-settings';
|
||||||
|
import { useApp } from '../../hooks';
|
||||||
|
import { SchemaSettingsWrapper } from '../components';
|
||||||
import { defaultSettingItems } from '../SchemaSettingsDefaults';
|
import { defaultSettingItems } from '../SchemaSettingsDefaults';
|
||||||
|
import { SchemaSettingOptions } from '../types';
|
||||||
|
|
||||||
type UseSchemaSettingsRenderOptions<T = {}> = Omit<SchemaSettingOptions<T>, 'name' | 'items'> &
|
type UseSchemaSettingsRenderOptions<T = {}> = Omit<SchemaSettingOptions<T>, 'name' | 'items'> &
|
||||||
Omit<SchemaSettingsProps, 'title' | 'children'> & {
|
Omit<SchemaSettingsProps, 'title' | 'children'> & {
|
||||||
@ -28,7 +27,7 @@ export function useSchemaSettingsRender<T = {}>(name: string, options?: UseSchem
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!schemaSetting) {
|
if (!schemaSetting) {
|
||||||
console.error(`[nocobase]: SchemaSettings "${name}" not found`);
|
console.error(`[tachybase]: SchemaSettings "${name}" not found`);
|
||||||
return {
|
return {
|
||||||
exists: false,
|
exists: false,
|
||||||
render: () => null,
|
render: () => null,
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
import * as antdCssinjs from '@ant-design/cssinjs';
|
import React from 'react';
|
||||||
import * as antdIcons from '@ant-design/icons';
|
import * as tachybaseComponents from '@tachybase/components';
|
||||||
import * as dndKitAccessibility from '@dnd-kit/accessibility';
|
import * as tachybaseEvaluators from '@tachybase/evaluators/client';
|
||||||
import * as dndKitCore from '@dnd-kit/core';
|
|
||||||
import * as dndKitModifiers from '@dnd-kit/modifiers';
|
|
||||||
import * as dndKitSortable from '@dnd-kit/sortable';
|
|
||||||
import * as dndKitUtilities from '@dnd-kit/utilities';
|
|
||||||
import * as emotionCss from '@emotion/css';
|
|
||||||
import * as formilyCore from '@tachybase/schema';
|
import * as formilyCore from '@tachybase/schema';
|
||||||
import * as formilyJsonSchema from '@tachybase/schema';
|
import * as formilyJsonSchema from '@tachybase/schema';
|
||||||
import * as formilyPath from '@tachybase/schema';
|
import * as formilyPath from '@tachybase/schema';
|
||||||
@ -14,26 +9,32 @@ import * as formilyJsonReactive from '@tachybase/schema';
|
|||||||
import * as formilyReactiveReact from '@tachybase/schema';
|
import * as formilyReactiveReact from '@tachybase/schema';
|
||||||
import * as formilyShared from '@tachybase/schema';
|
import * as formilyShared from '@tachybase/schema';
|
||||||
import * as formilyValidator from '@tachybase/schema';
|
import * as formilyValidator from '@tachybase/schema';
|
||||||
import * as nocobaseEvaluators from '@tachybase/evaluators/client';
|
import * as tachybaseSchema from '@tachybase/schema';
|
||||||
import * as nocobaseClientUtils from '@tachybase/utils/client';
|
import * as tachybaseSDK from '@tachybase/sdk';
|
||||||
import * as nocobaseSDK from '@tachybase/sdk';
|
import * as tachybaseClientUtils from '@tachybase/utils/client';
|
||||||
import * as nocobaseSchema from '@tachybase/schema';
|
|
||||||
import * as nocobaseComponents from '@tachybase/components';
|
|
||||||
import { dayjs } from '@tachybase/utils/client';
|
import { dayjs } from '@tachybase/utils/client';
|
||||||
|
|
||||||
|
import * as antdCssinjs from '@ant-design/cssinjs';
|
||||||
|
import * as antdIcons from '@ant-design/icons';
|
||||||
|
import * as dndKitAccessibility from '@dnd-kit/accessibility';
|
||||||
|
import * as dndKitCore from '@dnd-kit/core';
|
||||||
|
import * as dndKitModifiers from '@dnd-kit/modifiers';
|
||||||
|
import * as dndKitSortable from '@dnd-kit/sortable';
|
||||||
|
import * as dndKitUtilities from '@dnd-kit/utilities';
|
||||||
|
import * as emotionCss from '@emotion/css';
|
||||||
import * as ahooks from 'ahooks';
|
import * as ahooks from 'ahooks';
|
||||||
import * as antd from 'antd';
|
import * as antd from 'antd';
|
||||||
import * as antdStyle from 'antd-style';
|
import * as antdStyle from 'antd-style';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import * as i18next from 'i18next';
|
import * as i18next from 'i18next';
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import React from 'react';
|
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import * as reactI18next from 'react-i18next';
|
import * as reactI18next from 'react-i18next';
|
||||||
import * as ReactRouter from 'react-router';
|
import * as ReactRouter from 'react-router';
|
||||||
import * as ReactRouterDom from 'react-router-dom';
|
import * as ReactRouterDom from 'react-router-dom';
|
||||||
import jsxRuntime from 'react/jsx-runtime';
|
import jsxRuntime from 'react/jsx-runtime';
|
||||||
import * as nocobaseClient from '../../index';
|
|
||||||
|
|
||||||
|
import * as tachybaseClient from '../../index';
|
||||||
import type { RequireJS } from './requirejs';
|
import type { RequireJS } from './requirejs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,16 +70,16 @@ export function defineGlobalDeps(requirejs: RequireJS) {
|
|||||||
requirejs.define('@formily/validator', () => formilyValidator);
|
requirejs.define('@formily/validator', () => formilyValidator);
|
||||||
requirejs.define('@formily/reactive-react', () => formilyReactiveReact);
|
requirejs.define('@formily/reactive-react', () => formilyReactiveReact);
|
||||||
|
|
||||||
// nocobase
|
// tachybase
|
||||||
requirejs.define('@tachybase/utils', () => nocobaseClientUtils);
|
requirejs.define('@tachybase/utils', () => tachybaseClientUtils);
|
||||||
requirejs.define('@tachybase/utils/client', () => nocobaseClientUtils);
|
requirejs.define('@tachybase/utils/client', () => tachybaseClientUtils);
|
||||||
requirejs.define('@tachybase/client', () => nocobaseClient);
|
requirejs.define('@tachybase/client', () => tachybaseClient);
|
||||||
requirejs.define('@tachybase/client/client', () => nocobaseClient);
|
requirejs.define('@tachybase/client/client', () => tachybaseClient);
|
||||||
requirejs.define('@tachybase/evaluators', () => nocobaseEvaluators);
|
requirejs.define('@tachybase/evaluators', () => tachybaseEvaluators);
|
||||||
requirejs.define('@tachybase/evaluators/client', () => nocobaseEvaluators);
|
requirejs.define('@tachybase/evaluators/client', () => tachybaseEvaluators);
|
||||||
requirejs.define('@tachybase/sdk', () => nocobaseSDK);
|
requirejs.define('@tachybase/sdk', () => tachybaseSDK);
|
||||||
requirejs.define('@tachybase/schema', () => nocobaseSchema);
|
requirejs.define('@tachybase/schema', () => tachybaseSchema);
|
||||||
requirejs.define('@tachybase/components', () => nocobaseComponents);
|
requirejs.define('@tachybase/components', () => tachybaseComponents);
|
||||||
|
|
||||||
// dnd-kit 相关
|
// dnd-kit 相关
|
||||||
requirejs.define('@dnd-kit/accessibility', () => dndKitAccessibility);
|
requirejs.define('@dnd-kit/accessibility', () => dndKitAccessibility);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
import type { DevDynamicImport } from '../Application';
|
||||||
import type { Plugin } from '../Plugin';
|
import type { Plugin } from '../Plugin';
|
||||||
import type { PluginData } from '../PluginManager';
|
import type { PluginData } from '../PluginManager';
|
||||||
import type { RequireJS } from './requirejs';
|
import type { RequireJS } from './requirejs';
|
||||||
import type { DevDynamicImport } from '../Application';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -63,7 +63,7 @@ export function processRemotePlugins(pluginData: PluginData[], resolve: (plugins
|
|||||||
|
|
||||||
if (emptyPlugins.length > 0) {
|
if (emptyPlugins.length > 0) {
|
||||||
console.error(
|
console.error(
|
||||||
'[nocobase load plugin error]: These plugins do not have an `export.default` exported content or there is an error in the plugins. error plugins: \r\n%s',
|
'[tachybase load plugin error]: These plugins do not have an `export.default` exported content or there is an error in the plugins. error plugins: \r\n%s',
|
||||||
emptyPlugins.join(', \r\n'),
|
emptyPlugins.join(', \r\n'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1313,7 +1313,7 @@ function getTargetField(obj) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 之所以不直接使用 form.reset() 是因为其无法将子表格重置为空
|
* 之所以不直接使用 form.reset() 是因为其无法将子表格重置为空
|
||||||
* 主要用于修复这个问题:https://nocobase.height.app/T-3106
|
* 主要用于修复这个问题:https://tachybase.height.app/T-3106
|
||||||
* @param form
|
* @param form
|
||||||
*/
|
*/
|
||||||
async function resetFormCorrectly(form: Form) {
|
async function resetFormCorrectly(form: Form) {
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
* 是需要从 recordData 还是 parentRecordData 中获取;解决方法是通过更改 schema,在不同类型的关系区块中
|
* 是需要从 recordData 还是 parentRecordData 中获取;解决方法是通过更改 schema,在不同类型的关系区块中
|
||||||
* (`通过点击关系字段按钮打开的弹窗中创建的非关系字段区块`和`关系字段区块`)使用不同的 hook。
|
* (`通过点击关系字段按钮打开的弹窗中创建的非关系字段区块`和`关系字段区块`)使用不同的 hook。
|
||||||
*
|
*
|
||||||
* 更新:上面所说的“需要更改 schema 才能解决的问题”已在这个任务中更改:https://nocobase.height.app/T-3848/description
|
* 更新:上面所说的“需要更改 schema 才能解决的问题”已在这个任务中更改:https://tachybase.height.app/T-3848/description
|
||||||
*
|
*
|
||||||
* @param param0
|
* @param param0
|
||||||
* @returns
|
* @returns
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { FC } from 'react';
|
import React from 'react';
|
||||||
import { observer } from '@tachybase/schema';
|
import { observer } from '@tachybase/schema';
|
||||||
import { getSubAppName } from '@tachybase/sdk';
|
import { getSubAppName } from '@tachybase/sdk';
|
||||||
|
|
||||||
@ -26,6 +26,11 @@ import { SystemSettingsPlugin } from '../system-settings';
|
|||||||
import { CurrentUserProvider, CurrentUserSettingsMenuProvider } from '../user';
|
import { CurrentUserProvider, CurrentUserSettingsMenuProvider } from '../user';
|
||||||
import { LocalePlugin } from './plugins/LocalePlugin';
|
import { LocalePlugin } from './plugins/LocalePlugin';
|
||||||
|
|
||||||
|
interface AppStatusProps {
|
||||||
|
error: Error;
|
||||||
|
app: Application;
|
||||||
|
}
|
||||||
|
|
||||||
const AppSpin = () => {
|
const AppSpin = () => {
|
||||||
return (
|
return (
|
||||||
<Spin style={{ position: 'fixed', top: '50%', left: '50%', fontSize: 72, transform: 'translate(-50%, -50%)' }} />
|
<Spin style={{ position: 'fixed', top: '50%', left: '50%', fontSize: 72, transform: 'translate(-50%, -50%)' }} />
|
||||||
@ -78,8 +83,8 @@ const useErrorProps = (app: Application, error: any) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const AppError: FC<{ error: Error; app: Application }> = observer(
|
const AppError = observer(
|
||||||
({ app, error }) => {
|
({ app, error }: AppStatusProps) => {
|
||||||
const props = useErrorProps(app, error);
|
const props = useErrorProps(app, error);
|
||||||
const { styles } = useStyles();
|
const { styles } = useStyles();
|
||||||
return (
|
return (
|
||||||
@ -207,8 +212,8 @@ const getProps = (app: Application) => {
|
|||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
const AppMaintaining: FC<{ app: Application; error: Error }> = observer(
|
const AppMaintaining = observer(
|
||||||
({ app }) => {
|
({ app }: AppStatusProps) => {
|
||||||
const { icon, status, title, subTitle } = getProps(app);
|
const { icon, status, title, subTitle } = getProps(app);
|
||||||
const { styles } = useStyles();
|
const { styles } = useStyles();
|
||||||
return (
|
return (
|
||||||
@ -231,8 +236,8 @@ const AppMaintaining: FC<{ app: Application; error: Error }> = observer(
|
|||||||
{ displayName: 'AppMaintaining' },
|
{ displayName: 'AppMaintaining' },
|
||||||
);
|
);
|
||||||
|
|
||||||
const AppMaintainingDialog: FC<{ app: Application; error: Error }> = observer(
|
const AppMaintainingDialog = observer(
|
||||||
({ app }) => {
|
({ app }: AppStatusProps) => {
|
||||||
const { icon, status, title, subTitle } = getProps(app);
|
const { icon, status, title, subTitle } = getProps(app);
|
||||||
return (
|
return (
|
||||||
<Modal open={true} footer={null} closable={false}>
|
<Modal open={true} footer={null} closable={false}>
|
||||||
@ -259,7 +264,7 @@ const AppNotFound = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export class NocoBaseBuildInPlugin extends Plugin {
|
export class BuildinPlugin extends Plugin {
|
||||||
async afterAdd() {
|
async afterAdd() {
|
||||||
this.app.addComponents({
|
this.app.addComponents({
|
||||||
AppSpin,
|
AppSpin,
|
@ -1,6 +1,8 @@
|
|||||||
import { setValidateLanguage } from '@tachybase/schema';
|
import { setValidateLanguage } from '@tachybase/schema';
|
||||||
|
|
||||||
import { App, ConfigProvider } from 'antd';
|
import { App, ConfigProvider } from 'antd';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { loadConstrueLocale } from '../../antd-config-provider/loadConstrueLocale';
|
import { loadConstrueLocale } from '../../antd-config-provider/loadConstrueLocale';
|
||||||
import { Plugin } from '../../application/Plugin';
|
import { Plugin } from '../../application/Plugin';
|
||||||
import { dayjsLocale } from '../../locale';
|
import { dayjsLocale } from '../../locale';
|
@ -1,10 +1,12 @@
|
|||||||
|
import { useCallback, useEffect, useMemo } from 'react';
|
||||||
import { useField, useForm } from '@tachybase/schema';
|
import { useField, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
import omit from 'lodash/omit';
|
import omit from 'lodash/omit';
|
||||||
import { useCallback, useEffect, useMemo } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useCollection_deprecated, useCollectionManager_deprecated } from '.';
|
import { useCollection_deprecated, useCollectionManager_deprecated } from '.';
|
||||||
import { useRequest } from '../api-client';
|
import { useRequest } from '../api-client';
|
||||||
import { useRecord } from '../record-provider';
|
import { useRecord } from '../record-provider';
|
||||||
@ -585,7 +587,7 @@ export const useFilterActionProps = () => {
|
|||||||
const options = useFilterFieldOptions(collection.fields);
|
const options = useFilterFieldOptions(collection.fields);
|
||||||
const service = useResourceActionContext();
|
const service = useResourceActionContext();
|
||||||
return useFilterFieldProps({
|
return useFilterFieldProps({
|
||||||
// 目前仅需要支持筛选 title 和 name,其它字段可能会报错。详见:https://nocobase.height.app/T-2745
|
// 目前仅需要支持筛选 title 和 name,其它字段可能会报错。详见:https://tachybase.height.app/T-2745
|
||||||
options: options.filter((option) => ['title', 'name'].includes(option.name)),
|
options: options.filter((option) => ['title', 'name'].includes(option.name)),
|
||||||
params: service.state?.params?.[0] || service.params,
|
params: service.state?.params?.[0] || service.params,
|
||||||
service,
|
service,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { TinyColor } from '@ctrl/tinycolor';
|
|
||||||
import { useEffect, useMemo } from 'react';
|
import { useEffect, useMemo } from 'react';
|
||||||
|
|
||||||
|
import { TinyColor } from '@ctrl/tinycolor';
|
||||||
|
|
||||||
import { defaultTheme } from '../global-theme';
|
import { defaultTheme } from '../global-theme';
|
||||||
import { useToken } from '../style';
|
import { useToken } from '../style';
|
||||||
|
|
||||||
@ -20,11 +22,11 @@ export const CSSVariableProvider = ({ children }) => {
|
|||||||
}, [token.colorBgElevated]);
|
}, [token.colorBgElevated]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.body.style.setProperty('--nb-spacing', `${token.marginLG}px`);
|
document.body.style.setProperty('--tb-spacing', `${token.marginLG}px`);
|
||||||
document.body.style.setProperty('--nb-designer-offset', `${token.marginXS}px`);
|
document.body.style.setProperty('--tb-designer-offset', `${token.marginXS}px`);
|
||||||
document.body.style.setProperty('--nb-header-height', `${token.sizeXXL - 2}px`);
|
document.body.style.setProperty('--tb-header-height', `${token.sizeXXL - 2}px`);
|
||||||
document.body.style.setProperty('--nb-box-bg', token.colorBgLayout);
|
document.body.style.setProperty('--tb-box-bg', token.colorBgLayout);
|
||||||
document.body.style.setProperty('--nb-box-bg', token.colorBgLayout);
|
document.body.style.setProperty('--tb-box-bg', token.colorBgLayout);
|
||||||
document.body.style.setProperty('--controlHeightLG', `${token.controlHeightLG}px`);
|
document.body.style.setProperty('--controlHeightLG', `${token.controlHeightLG}px`);
|
||||||
document.body.style.setProperty('--paddingContentVerticalSM', `${token.paddingContentVerticalSM}px`);
|
document.body.style.setProperty('--paddingContentVerticalSM', `${token.paddingContentVerticalSM}px`);
|
||||||
document.body.style.setProperty('--marginSM', `${token.marginSM}px`);
|
document.body.style.setProperty('--marginSM', `${token.marginSM}px`);
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import { useDeepCompareEffect, useUpdateEffect } from 'ahooks';
|
import React, { createContext, FC, useContext, useMemo } from 'react';
|
||||||
import React, { FC, createContext, useContext, useMemo } from 'react';
|
|
||||||
|
|
||||||
import { UseRequestResult, useAPIClient, useRequest } from '../../api-client';
|
import { useDeepCompareEffect, useUpdateEffect } from 'ahooks';
|
||||||
import { CollectionRecordProvider, CollectionRecord } from '../collection-record';
|
|
||||||
import { AllDataBlockProps, useDataBlockProps } from './DataBlockProvider';
|
import { useAPIClient, useRequest, UseRequestResult } from '../../api-client';
|
||||||
import { useDataBlockResource } from './DataBlockResourceProvider';
|
|
||||||
import { useDataSourceHeaders } from '../utils';
|
|
||||||
import { useDataLoadingMode } from '../../modules/blocks/data-blocks/details-multi/setDataLoadingModeSettingsItem';
|
import { useDataLoadingMode } from '../../modules/blocks/data-blocks/details-multi/setDataLoadingModeSettingsItem';
|
||||||
import { useSourceKey } from '../../modules/blocks/useSourceKey';
|
import { useSourceKey } from '../../modules/blocks/useSourceKey';
|
||||||
|
import { CollectionRecord, CollectionRecordProvider } from '../collection-record';
|
||||||
|
import { useDataSourceHeaders } from '../utils';
|
||||||
|
import { AllDataBlockProps, useDataBlockProps } from './DataBlockProvider';
|
||||||
|
import { useDataBlockResource } from './DataBlockResourceProvider';
|
||||||
|
|
||||||
export const BlockRequestContext = createContext<UseRequestResult<any>>(null);
|
export const BlockRequestContext = createContext<UseRequestResult<any>>(null);
|
||||||
BlockRequestContext.displayName = 'BlockRequestContext';
|
BlockRequestContext.displayName = 'BlockRequestContext';
|
||||||
@ -26,7 +27,7 @@ function useCurrentRequest<T>(options: Omit<AllDataBlockProps, 'type'>) {
|
|||||||
if (record) return Promise.resolve({ data: record });
|
if (record) return Promise.resolve({ data: record });
|
||||||
if (!action) {
|
if (!action) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`[nocobase]: The 'action' parameter is missing in the 'DataBlockRequestProvider' component`,
|
`[tachybase]: The 'action' parameter is missing in the 'DataBlockRequestProvider' component`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return resource[action]({ ...params, ...customParams }).then((res) => res.data);
|
return resource[action]({ ...params, ...customParams }).then((res) => res.data);
|
||||||
|
@ -9,7 +9,7 @@ group:
|
|||||||
## DocumentTitleProvider
|
## DocumentTitleProvider
|
||||||
|
|
||||||
```tsx | pure
|
```tsx | pure
|
||||||
<DocumentTitleProvider addonBefore={'!!'} addonAfter={'NocoBase'}>
|
<DocumentTitleProvider addonBefore={'!!'} addonAfter={'TachyBase'}>
|
||||||
</DocumentTitleProvider>
|
</DocumentTitleProvider>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export const useAdminSchemaUid = () => {
|
export const useAdminSchemaUid = () => {
|
||||||
return 'nocobase-admin-menu';
|
return 'default-admin-menu';
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import i18next, { TFuncKey, TOptions } from 'i18next';
|
import i18next, { TFuncKey, TOptions } from 'i18next';
|
||||||
import { initReactI18next } from 'react-i18next';
|
import { initReactI18next } from 'react-i18next';
|
||||||
|
|
||||||
import locale from '../locale';
|
import locale from '../locale';
|
||||||
|
|
||||||
export function tval(text: TFuncKey | TFuncKey[], options?: TOptions) {
|
export function tval(text: TFuncKey | TFuncKey[], options?: TOptions) {
|
||||||
@ -21,7 +22,7 @@ i18n
|
|||||||
// .use(Backend)
|
// .use(Backend)
|
||||||
.use(initReactI18next)
|
.use(initReactI18next)
|
||||||
.init({
|
.init({
|
||||||
lng: localStorage.getItem('NOCOBASE_LOCALE') || 'en-US',
|
lng: localStorage.getItem('TACHYBASE_LOCALE') || 'en-US',
|
||||||
// debug: true,
|
// debug: true,
|
||||||
defaultNS: 'client',
|
defaultNS: 'client',
|
||||||
// fallbackNS: 'client',
|
// fallbackNS: 'client',
|
||||||
@ -40,5 +41,5 @@ i18n
|
|||||||
});
|
});
|
||||||
|
|
||||||
i18n.on('languageChanged', (lng) => {
|
i18n.on('languageChanged', (lng) => {
|
||||||
localStorage.setItem('NOCOBASE_LOCALE', lng);
|
localStorage.setItem('TACHYBASE_LOCALE', lng);
|
||||||
});
|
});
|
||||||
|
@ -33,7 +33,7 @@ export * from './hooks';
|
|||||||
export * from './i18n';
|
export * from './i18n';
|
||||||
export * from './icon';
|
export * from './icon';
|
||||||
export { default as locale } from './locale';
|
export { default as locale } from './locale';
|
||||||
export * from './nocobase-buildin-plugin';
|
export * from './buildin-plugin';
|
||||||
export * from './plugin-manager';
|
export * from './plugin-manager';
|
||||||
export * from './pm';
|
export * from './pm';
|
||||||
export * from './powered-by-v2';
|
export * from './powered-by-v2';
|
||||||
|
@ -80,7 +80,7 @@ export const disassociatePage: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'b678n93qa6y',
|
'x-uid': 'b678n93qa6y',
|
||||||
@ -270,7 +270,7 @@ export const disassociatePage: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'oe1qrytmueq',
|
'x-uid': 'oe1qrytmueq',
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { test, expect } from '@tachybase/test/e2e';
|
import { expect, test } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
import { T3529 } from './templatesOfBug';
|
import { T3529 } from './templatesOfBug';
|
||||||
|
|
||||||
test.describe('association form block', () => {
|
test.describe('association form block', () => {
|
||||||
// https://nocobase.height.app/T-3529
|
// https://tachybase.height.app/T-3529
|
||||||
test('should be created instead of updated', async ({ page, mockPage, mockRecord }) => {
|
test('should be created instead of updated', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T3529).waitForInit();
|
const nocoPage = await mockPage(T3529).waitForInit();
|
||||||
await mockRecord('general');
|
await mockRecord('general');
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
oneTableSubtableWithMultiLevelAssociationFields,
|
oneTableSubtableWithMultiLevelAssociationFields,
|
||||||
test,
|
test,
|
||||||
} from '@tachybase/test/e2e';
|
} from '@tachybase/test/e2e';
|
||||||
|
|
||||||
import { T2200, T2614, T2615, T2845, T2993 } from './templatesOfBug';
|
import { T2200, T2614, T2615, T2845, T2993 } from './templatesOfBug';
|
||||||
|
|
||||||
test.describe('display association fields', () => {
|
test.describe('display association fields', () => {
|
||||||
@ -49,7 +50,7 @@ test.describe('display association fields', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2615
|
// https://tachybase.height.app/T-2615
|
||||||
test('should load association data', async ({ page, mockPage, mockRecord }) => {
|
test('should load association data', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T2615).waitForInit();
|
const nocoPage = await mockPage(T2615).waitForInit();
|
||||||
await mockRecord('T2615');
|
await mockRecord('T2615');
|
||||||
@ -87,7 +88,7 @@ test.describe('display association fields', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2845
|
// https://tachybase.height.app/T-2845
|
||||||
test('should load association data of subform', async ({ page, mockPage, mockRecord }) => {
|
test('should load association data of subform', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T2845).waitForInit();
|
const nocoPage = await mockPage(T2845).waitForInit();
|
||||||
// 和 T2615 使用一样的数据表结构
|
// 和 T2615 使用一样的数据表结构
|
||||||
@ -136,7 +137,7 @@ test.describe('display association fields', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2614
|
// https://tachybase.height.app/T-2614
|
||||||
test('should load association data in subform', async ({ page, mockPage, mockRecord }) => {
|
test('should load association data in subform', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T2614).waitForInit();
|
const nocoPage = await mockPage(T2614).waitForInit();
|
||||||
await mockRecord('T2614');
|
await mockRecord('T2614');
|
||||||
@ -164,7 +165,7 @@ test.describe('display association fields', () => {
|
|||||||
).toHaveText(`ID:1`);
|
).toHaveText(`ID:1`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2993
|
// https://tachybase.height.app/T-2993
|
||||||
test('should load association data of sub details', async ({ page, mockPage, mockRecord }) => {
|
test('should load association data of sub details', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T2993).waitForInit();
|
const nocoPage = await mockPage(T2993).waitForInit();
|
||||||
const record = await mockRecord('T2993');
|
const record = await mockRecord('T2993');
|
||||||
@ -264,7 +265,7 @@ test.describe('association fields', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-2200
|
// fix https://tachybase.height.app/T-2200
|
||||||
test('should be possible to change the value of the association field normally', async ({ page, mockPage }) => {
|
test('should be possible to change the value of the association field normally', async ({ page, mockPage }) => {
|
||||||
await mockPage(T2200).goto();
|
await mockPage(T2200).goto();
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ test.describe('variables with default value', () => {
|
|||||||
.getByRole('textbox'),
|
.getByRole('textbox'),
|
||||||
).toHaveValue('1');
|
).toHaveValue('1');
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2805 ----------------------------------------------------------------------
|
// https://tachybase.height.app/T-2805 ----------------------------------------------------------------------
|
||||||
await page
|
await page
|
||||||
.getByLabel('block-item-CollectionField-general-form-general.m2oField0-m2oField0')
|
.getByLabel('block-item-CollectionField-general-form-general.m2oField0-m2oField0')
|
||||||
.getByTestId('select-object-single')
|
.getByTestId('select-object-single')
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { createBlockInPage, expect, oneEmptyForm, test } from '@tachybase/test/e2e';
|
|
||||||
import { T3106, T3469 } from './templatesOfBug';
|
|
||||||
import { uid } from '@tachybase/schema';
|
import { uid } from '@tachybase/schema';
|
||||||
|
import { createBlockInPage, expect, oneEmptyForm, test } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
|
import { T3106, T3469 } from './templatesOfBug';
|
||||||
|
|
||||||
test.describe('where creation form block can be added', () => {
|
test.describe('where creation form block can be added', () => {
|
||||||
test('page', async ({ page, mockPage }) => {
|
test('page', async ({ page, mockPage }) => {
|
||||||
@ -80,7 +81,7 @@ test.describe('configure actions', () => {
|
|||||||
await expect(page.getByRole('button', { name: 'Submit' })).not.toBeVisible();
|
await expect(page.getByRole('button', { name: 'Submit' })).not.toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-3106
|
// https://tachybase.height.app/T-3106
|
||||||
test('subTable: should clear form value after submit', async ({ page, mockPage }) => {
|
test('subTable: should clear form value after submit', async ({ page, mockPage }) => {
|
||||||
await mockPage(T3106).goto();
|
await mockPage(T3106).goto();
|
||||||
|
|
||||||
@ -102,7 +103,7 @@ test.describe('configure actions', () => {
|
|||||||
).toHaveValue('test name');
|
).toHaveValue('test name');
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-3469
|
// https://tachybase.height.app/T-3469
|
||||||
test('default values for fields should not be cleared after submission', async ({ page, mockPage }) => {
|
test('default values for fields should not be cleared after submission', async ({ page, mockPage }) => {
|
||||||
await mockPage(T3469).goto();
|
await mockPage(T3469).goto();
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {
|
import {
|
||||||
Page,
|
|
||||||
expect,
|
expect,
|
||||||
expectSettingsMenu,
|
expectSettingsMenu,
|
||||||
oneEmptyForm,
|
oneEmptyForm,
|
||||||
@ -7,8 +6,10 @@ import {
|
|||||||
oneTableBlockWithActionsAndFormBlocks,
|
oneTableBlockWithActionsAndFormBlocks,
|
||||||
oneTableBlockWithAddNewAndViewAndEditAndAssociationFields,
|
oneTableBlockWithAddNewAndViewAndEditAndAssociationFields,
|
||||||
oneTableBlockWithAddNewAndViewAndEditAndBasicFields,
|
oneTableBlockWithAddNewAndViewAndEditAndBasicFields,
|
||||||
|
Page,
|
||||||
test,
|
test,
|
||||||
} from '@tachybase/test/e2e';
|
} from '@tachybase/test/e2e';
|
||||||
|
|
||||||
import { T2165, T2174, T3251, T3806 } from './templatesOfBug';
|
import { T2165, T2174, T3251, T3806 } from './templatesOfBug';
|
||||||
|
|
||||||
const clickOption = async (page: Page, optionName: string) => {
|
const clickOption = async (page: Page, optionName: string) => {
|
||||||
@ -211,7 +212,7 @@ test.describe('creation form block schema settings', () => {
|
|||||||
).toHaveValue('123');
|
).toHaveValue('123');
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2165
|
// https://tachybase.height.app/T-2165
|
||||||
test('variable labels should be displayed normally', async ({ page, mockPage }) => {
|
test('variable labels should be displayed normally', async ({ page, mockPage }) => {
|
||||||
await mockPage(T2165).goto();
|
await mockPage(T2165).goto();
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ test.describe('creation form block schema settings', () => {
|
|||||||
await expect(page.getByText('Current form / Phone')).toBeVisible();
|
await expect(page.getByText('Current form / Phone')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-3251
|
// https://tachybase.height.app/T-3251
|
||||||
test('nested conditions', async ({ page, mockPage }) => {
|
test('nested conditions', async ({ page, mockPage }) => {
|
||||||
await mockPage(T3251).goto();
|
await mockPage(T3251).goto();
|
||||||
|
|
||||||
@ -255,7 +256,7 @@ test.describe('creation form block schema settings', () => {
|
|||||||
).toBeEditable();
|
).toBeEditable();
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-3806
|
// https://tachybase.height.app/T-3806
|
||||||
test('after save as block template', async ({ page, mockPage }) => {
|
test('after save as block template', async ({ page, mockPage }) => {
|
||||||
await mockPage(T3806).goto();
|
await mockPage(T3806).goto();
|
||||||
|
|
||||||
@ -731,7 +732,7 @@ test.describe('creation form block schema settings', () => {
|
|||||||
).toHaveValue('new value');
|
).toHaveValue('new value');
|
||||||
});
|
});
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-2174
|
// fix https://tachybase.height.app/T-2174
|
||||||
test('should show default value option', async ({ page, mockPage, mockRecord }) => {
|
test('should show default value option', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T2174).waitForInit();
|
const nocoPage = await mockPage(T2174).waitForInit();
|
||||||
await mockRecord('test2174');
|
await mockRecord('test2174');
|
||||||
@ -964,7 +965,7 @@ test.describe('creation form block schema settings', () => {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PageConfig, generalWithM2oSingleSelect, generalWithMultiLevelM2mFields } from '@tachybase/test/e2e';
|
import { generalWithM2oSingleSelect, generalWithMultiLevelM2mFields, PageConfig } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
export const T2165 = {
|
export const T2165 = {
|
||||||
pageSchema: {
|
pageSchema: {
|
||||||
@ -339,7 +339,7 @@ export const T2174 = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-index': 1,
|
'x-index': 1,
|
||||||
@ -932,7 +932,7 @@ export const T2614: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'vq4vg5mpbxz',
|
'x-uid': 'vq4vg5mpbxz',
|
||||||
@ -1770,7 +1770,7 @@ export const T2993: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-index': 1,
|
'x-index': 1,
|
||||||
@ -2353,7 +2353,7 @@ export const T2615: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
@ -3259,7 +3259,7 @@ export const T2845: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-index': 1,
|
'x-index': 1,
|
||||||
@ -4735,7 +4735,7 @@ export const T2200 = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'farfrcvsydq',
|
'x-uid': 'farfrcvsydq',
|
||||||
@ -5696,7 +5696,7 @@ export const T3469: PageConfig = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://nocobase.height.app/T-3529
|
// https://tachybase.height.app/T-3529
|
||||||
export const T3529: PageConfig = {
|
export const T3529: PageConfig = {
|
||||||
collections: generalWithMultiLevelM2mFields,
|
collections: generalWithMultiLevelM2mFields,
|
||||||
pageSchema: {
|
pageSchema: {
|
||||||
@ -5756,7 +5756,7 @@ export const T3529: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'gcqzwfc98cz',
|
'x-uid': 'gcqzwfc98cz',
|
||||||
|
@ -20,7 +20,7 @@ describe('createGridCardBlockSchema', () => {
|
|||||||
"x-component": "ActionBar",
|
"x-component": "ActionBar",
|
||||||
"x-component-props": {
|
"x-component-props": {
|
||||||
"style": {
|
"style": {
|
||||||
"marginBottom": "var(--nb-spacing)",
|
"marginBottom": "var(--tb-spacing)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"x-initializer": "gridCard:configureActions",
|
"x-initializer": "gridCard:configureActions",
|
||||||
@ -96,7 +96,7 @@ describe('createGridCardBlockSchema', () => {
|
|||||||
"x-component": "ActionBar",
|
"x-component": "ActionBar",
|
||||||
"x-component-props": {
|
"x-component-props": {
|
||||||
"style": {
|
"style": {
|
||||||
"marginBottom": "var(--nb-spacing)",
|
"marginBottom": "var(--tb-spacing)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"x-initializer": "gridCard:configureActions",
|
"x-initializer": "gridCard:configureActions",
|
||||||
|
@ -45,7 +45,7 @@ export const createGridCardBlockUISchema = (options: {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -30,7 +30,7 @@ describe('createListBlockSchema', () => {
|
|||||||
"x-component": "ActionBar",
|
"x-component": "ActionBar",
|
||||||
"x-component-props": {
|
"x-component-props": {
|
||||||
"style": {
|
"style": {
|
||||||
"marginBottom": "var(--nb-spacing)",
|
"marginBottom": "var(--tb-spacing)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"x-initializer": "list:configureActions",
|
"x-initializer": "list:configureActions",
|
||||||
|
@ -37,7 +37,7 @@ export const createListBlockUISchema = (options: {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -76,7 +76,7 @@ export const tableSelectorDataScopeVariable: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'vdvzzbfp53e',
|
'x-uid': 'vdvzzbfp53e',
|
||||||
@ -341,7 +341,7 @@ export const tableSelectorDataScopeVariable: PageConfig = {
|
|||||||
{
|
{
|
||||||
style: {
|
style: {
|
||||||
marginBottom:
|
marginBottom:
|
||||||
'var(--nb-spacing)',
|
'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid':
|
'x-uid':
|
||||||
|
@ -22,7 +22,7 @@ describe('createTableSelectorSchema', () => {
|
|||||||
"x-component": "ActionBar",
|
"x-component": "ActionBar",
|
||||||
"x-component-props": {
|
"x-component-props": {
|
||||||
"style": {
|
"style": {
|
||||||
"marginBottom": "var(--nb-spacing)",
|
"marginBottom": "var(--tb-spacing)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"x-initializer": "table:configureActions",
|
"x-initializer": "table:configureActions",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
import { ISchema, uid } from '@tachybase/schema';
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
|
|
||||||
export const createTableSelectorUISchema = (options: {
|
export const createTableSelectorUISchema = (options: {
|
||||||
collectionName: string;
|
collectionName: string;
|
||||||
@ -36,7 +35,7 @@ export const createTableSelectorUISchema = (options: {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { expect, test } from '@tachybase/test/e2e';
|
import { expect, test } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
import { T2187 } from '../templatesOfBug';
|
import { T2187 } from '../templatesOfBug';
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-2187
|
// fix https://tachybase.height.app/T-2187
|
||||||
test('in the Duplicate mode, the Roles field should not have a value after clicking it because it is not selected', async ({
|
test('in the Duplicate mode, the Roles field should not have a value after clicking it because it is not selected', async ({
|
||||||
page,
|
page,
|
||||||
mockPage,
|
mockPage,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { expect, test } from '@tachybase/test/e2e';
|
import { expect, test } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
import { T2183, T2186 } from '../templatesOfBug';
|
import { T2183, T2186 } from '../templatesOfBug';
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-2183
|
// fix https://tachybase.height.app/T-2183
|
||||||
test('should save conditions', async ({ page, mockPage }) => {
|
test('should save conditions', async ({ page, mockPage }) => {
|
||||||
await mockPage(T2183).goto();
|
await mockPage(T2183).goto();
|
||||||
await page.getByLabel('action-Filter.Action-Filter-filter-users-table').click();
|
await page.getByLabel('action-Filter.Action-Filter-filter-users-table').click();
|
||||||
@ -18,7 +19,7 @@ test('should save conditions', async ({ page, mockPage }) => {
|
|||||||
await expect(page.getByTestId('select-filter-operator').getByText('is')).toBeVisible();
|
await expect(page.getByTestId('select-filter-operator').getByText('is')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-2186
|
// fix https://tachybase.height.app/T-2186
|
||||||
test('the input box displayed should correspond to the field type', async ({ page, mockPage }) => {
|
test('the input box displayed should correspond to the field type', async ({ page, mockPage }) => {
|
||||||
await mockPage(T2186).goto();
|
await mockPage(T2186).goto();
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export const T2183 = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
@ -215,7 +215,7 @@ export const T2186 = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
@ -374,7 +374,7 @@ export const T2187 = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 't2drja2eg9p',
|
'x-uid': 't2drja2eg9p',
|
||||||
@ -771,7 +771,7 @@ export const T3686: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': '42xfns3215b',
|
'x-uid': '42xfns3215b',
|
||||||
|
@ -20,7 +20,7 @@ describe('createTableBLockSchemaV2', () => {
|
|||||||
"x-component": "ActionBar",
|
"x-component": "ActionBar",
|
||||||
"x-component-props": {
|
"x-component-props": {
|
||||||
"style": {
|
"style": {
|
||||||
"marginBottom": "var(--nb-spacing)",
|
"marginBottom": "var(--tb-spacing)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"x-initializer": "table:configureActions",
|
"x-initializer": "table:configureActions",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
import { ISchema, uid } from '@tachybase/schema';
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
|
|
||||||
export const createTableBlockUISchema = (options: {
|
export const createTableBlockUISchema = (options: {
|
||||||
dataSource: string;
|
dataSource: string;
|
||||||
@ -41,7 +40,7 @@ export const createTableBlockUISchema = (options: {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {},
|
properties: {},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PageConfig, generalWithMultiLevelM2oFields } from '@tachybase/test/e2e';
|
import { generalWithMultiLevelM2oFields, PageConfig } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
export const T2797: PageConfig = {
|
export const T2797: PageConfig = {
|
||||||
pageSchema: {
|
pageSchema: {
|
||||||
@ -63,7 +63,7 @@ export const T2797: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-index': 1,
|
'x-index': 1,
|
||||||
@ -642,7 +642,7 @@ export const T2838: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-index': 1,
|
'x-index': 1,
|
||||||
@ -1531,7 +1531,7 @@ export const tableWithRoles: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'w07zcu825vu',
|
'x-uid': 'w07zcu825vu',
|
||||||
@ -1746,7 +1746,7 @@ export const tableWithUsers = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'e7ukdkylglc',
|
'x-uid': 'e7ukdkylglc',
|
||||||
@ -1992,7 +1992,7 @@ export const tableWithInherit = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': '6j0p8tmwey7',
|
'x-uid': '6j0p8tmwey7',
|
||||||
@ -2223,7 +2223,7 @@ export const tableWithInheritWithoutAssociation = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': '6j0p8tmwey7',
|
'x-uid': '6j0p8tmwey7',
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { expect, test } from '@tachybase/test/e2e';
|
import { expect, test } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
import { T2797, T2838 } from './templatesOfBug';
|
import { T2797, T2838 } from './templatesOfBug';
|
||||||
|
|
||||||
test.describe('z-index of dialog', () => {
|
test.describe('z-index of dialog', () => {
|
||||||
// https://nocobase.height.app/T-2797
|
// https://tachybase.height.app/T-2797
|
||||||
test('edit block title', async ({ page, mockPage }) => {
|
test('edit block title', async ({ page, mockPage }) => {
|
||||||
await mockPage(T2797).goto();
|
await mockPage(T2797).goto();
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ test.describe('z-index of dialog', () => {
|
|||||||
await expect(page.getByLabel('block-item-Input-users-Block')).not.toBeVisible();
|
await expect(page.getByLabel('block-item-Input-users-Block')).not.toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://nocobase.height.app/T-2838
|
// https://tachybase.height.app/T-2838
|
||||||
test('multilevel modal', async ({ page, mockPage, mockRecord }) => {
|
test('multilevel modal', async ({ page, mockPage, mockRecord }) => {
|
||||||
const nocoPage = await mockPage(T2838).waitForInit();
|
const nocoPage = await mockPage(T2838).waitForInit();
|
||||||
await mockRecord('general');
|
await mockRecord('general');
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { generalWithDatetime, PageConfig } from '@tachybase/test/e2e';
|
import { generalWithDatetime, PageConfig } from '@tachybase/test/e2e';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1. 一个 Table 区块
|
* 1. 一个 Table 区块
|
||||||
* 5. 所有字段都是 datetime 字段
|
* 5. 所有字段都是 datetime 字段
|
||||||
@ -62,7 +63,7 @@ export const oneTableBlockWithDatetimeFields: PageConfig = {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-uid': 'nd5jqapjy3w',
|
'x-uid': 'nd5jqapjy3w',
|
||||||
|
@ -47,8 +47,8 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
height: var(--nb-header-height);
|
height: var(--tb-header-height);
|
||||||
line-height: var(--nb-header-height);
|
line-height: var(--tb-header-height);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
background-color: ${token.colorBgHeader} !important;
|
background-color: ${token.colorBgHeader} !important;
|
||||||
@ -114,10 +114,10 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
background: rgba(0, 0, 0, 0);
|
background: rgba(0, 0, 0, 0);
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
.ant-layout-sider-children {
|
.ant-layout-sider-children {
|
||||||
top: var(--nb-header-height);
|
top: var(--tb-header-height);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: calc(100vh - var(--nb-header-height));
|
height: calc(100vh - var(--tb-header-height));
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
main: css`
|
main: css`
|
||||||
@ -141,8 +141,8 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
`,
|
`,
|
||||||
mainHeader: css`
|
mainHeader: css`
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
height: var(--nb-header-height);
|
height: var(--tb-header-height);
|
||||||
line-height: var(--nb-header-height);
|
line-height: var(--tb-header-height);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
`,
|
`,
|
||||||
|
@ -18,7 +18,7 @@ const useStyles = createStyles(({ css }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ant-modal-content {
|
.ant-modal-content {
|
||||||
background: var(--nb-box-bg);
|
background: var(--tb-box-bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { observer, RecursionField, useField, useFieldSchema, useForm } from '@tachybase/schema';
|
import { observer, RecursionField, useField, useFieldSchema, useForm } from '@tachybase/schema';
|
||||||
import { isPortalInBody } from '@tachybase/utils/client';
|
import { isPortalInBody } from '@tachybase/utils/client';
|
||||||
|
|
||||||
import { App, Button } from 'antd';
|
import { App, Button } from 'antd';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { default as lodash } from 'lodash';
|
import { default as lodash } from 'lodash';
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { StablePopover, useActionContext } from '../..';
|
import { StablePopover, useActionContext } from '../..';
|
||||||
import { useDesignable } from '../../';
|
import { useDesignable } from '../../';
|
||||||
import { useACLActionParamsContext } from '../../../acl';
|
import { useACLActionParamsContext } from '../../../acl';
|
||||||
|
import { withDynamicSchemaProps } from '../../../application/hoc/withDynamicSchemaProps';
|
||||||
import { Icon } from '../../../icon';
|
import { Icon } from '../../../icon';
|
||||||
import { RecordProvider, useRecord } from '../../../record-provider';
|
import { RecordProvider, useRecord } from '../../../record-provider';
|
||||||
import { useLocalVariables, useVariables } from '../../../variables';
|
import { useLocalVariables, useVariables } from '../../../variables';
|
||||||
@ -26,7 +29,6 @@ import { useA } from './hooks';
|
|||||||
import { useGetAriaLabelOfAction } from './hooks/useGetAriaLabelOfAction';
|
import { useGetAriaLabelOfAction } from './hooks/useGetAriaLabelOfAction';
|
||||||
import { ComposedAction } from './types';
|
import { ComposedAction } from './types';
|
||||||
import { linkageAction } from './utils';
|
import { linkageAction } from './utils';
|
||||||
import { withDynamicSchemaProps } from '../../../application/hoc/withDynamicSchemaProps';
|
|
||||||
|
|
||||||
export const Action: ComposedAction = withDynamicSchemaProps(
|
export const Action: ComposedAction = withDynamicSchemaProps(
|
||||||
observer((props: any) => {
|
observer((props: any) => {
|
||||||
@ -172,7 +174,7 @@ export const Action: ComposedAction = withDynamicSchemaProps(
|
|||||||
</ActionContextProvider>
|
</ActionContextProvider>
|
||||||
);
|
);
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-3235/description
|
// fix https://tachybase.height.app/T-3235/description
|
||||||
if (addChild) {
|
if (addChild) {
|
||||||
return wrapSSR(
|
return wrapSSR(
|
||||||
<RecordProvider record={null} parent={record}>
|
<RecordProvider record={null} parent={record}>
|
||||||
|
@ -45,7 +45,7 @@ group:
|
|||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
基于 antd 的 [DatePicker](https://ant.design/components/date-picker/#API),新增了以下扩展属性,用于支持 NocoBase 的日期字段设置。
|
基于 antd 的 [DatePicker](https://ant.design/components/date-picker/#API),新增了以下扩展属性,用于支持 TachyBase 的日期字段设置。
|
||||||
|
|
||||||
- `dateFormat` 设置日期格式
|
- `dateFormat` 设置日期格式
|
||||||
- `timeFormat` 设置时间格式
|
- `timeFormat` 设置时间格式
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { render, screen } from '@tachybase/test/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { render, screen } from '@tachybase/test/client';
|
||||||
|
|
||||||
import App1 from '../demos/demo1';
|
import App1 from '../demos/demo1';
|
||||||
|
|
||||||
describe('ErrorFallback', () => {
|
describe('ErrorFallback', () => {
|
||||||
@ -7,7 +8,7 @@ describe('ErrorFallback', () => {
|
|||||||
render(<App1 />);
|
render(<App1 />);
|
||||||
|
|
||||||
expect(screen.getByText(/render failed/i)).toBeInTheDocument();
|
expect(screen.getByText(/render failed/i)).toBeInTheDocument();
|
||||||
expect(screen.getByText(/this is likely a nocobase internals bug\. please open an issue at/i)).toBeInTheDocument();
|
expect(screen.getByText(/this is likely a tachybase internals bug\. please open an issue at/i)).toBeInTheDocument();
|
||||||
expect(screen.getByRole('link', { name: /feedback/i })).toBeInTheDocument();
|
expect(screen.getByRole('link', { name: /feedback/i })).toBeInTheDocument();
|
||||||
expect(screen.getByText(/try again/i)).toBeInTheDocument();
|
expect(screen.getByText(/try again/i)).toBeInTheDocument();
|
||||||
expect(screen.getByText(/error: error message/i)).toBeInTheDocument();
|
expect(screen.getByText(/error: error message/i)).toBeInTheDocument();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { render, screen, userEvent, waitFor, within } from '@tachybase/test/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { render, screen, userEvent, waitFor, within } from '@tachybase/test/client';
|
||||||
|
|
||||||
import App2 from '../demos/demo2';
|
import App2 from '../demos/demo2';
|
||||||
import App3 from '../demos/demo3';
|
import App3 from '../demos/demo3';
|
||||||
import App4 from '../demos/demo4';
|
import App4 from '../demos/demo4';
|
||||||
@ -30,7 +31,7 @@ describe('Filter', () => {
|
|||||||
expect(inputs[0]).toHaveValue('aa');
|
expect(inputs[0]).toHaveValue('aa');
|
||||||
expect(inputs[1]).toHaveValue('aaa');
|
expect(inputs[1]).toHaveValue('aaa');
|
||||||
|
|
||||||
// 点击下拉框中的选项,Popover 不应该关闭。详见:https://nocobase.height.app/T-1508
|
// 点击下拉框中的选项,Popover 不应该关闭。详见:https://tachybase.height.app/T-1508
|
||||||
await userEvent.click(screen.getByText(/any/i));
|
await userEvent.click(screen.getByText(/any/i));
|
||||||
await userEvent.click(screen.getByText(/all/i));
|
await userEvent.click(screen.getByText(/all/i));
|
||||||
expect(tooltip).toBeInTheDocument();
|
expect(tooltip).toBeInTheDocument();
|
||||||
@ -96,7 +97,7 @@ describe('Filter', () => {
|
|||||||
expect(inputs[0]).toHaveValue('');
|
expect(inputs[0]).toHaveValue('');
|
||||||
expect(inputs[1]).toHaveValue('aaa');
|
expect(inputs[1]).toHaveValue('aaa');
|
||||||
|
|
||||||
// 点击下拉框中的选项,Popover 不应该关闭。详见:https://nocobase.height.app/T-1508
|
// 点击下拉框中的选项,Popover 不应该关闭。详见:https://tachybase.height.app/T-1508
|
||||||
await userEvent.click(screen.getByText(/any/i));
|
await userEvent.click(screen.getByText(/any/i));
|
||||||
await userEvent.click(screen.getByText(/all/i));
|
await userEvent.click(screen.getByText(/all/i));
|
||||||
expect(tooltip).toBeInTheDocument();
|
expect(tooltip).toBeInTheDocument();
|
||||||
|
@ -1,12 +1,26 @@
|
|||||||
import { createForm, Form, IFormProps } from '@tachybase/schema';
|
|
||||||
import { FormProvider, Observer, observer, ReactFC } from '@tachybase/schema';
|
|
||||||
import { toJS } from '@tachybase/schema';
|
|
||||||
import { applyMiddleware, IMiddleware, isBool, isFn, isNum, isStr } from '@tachybase/schema';
|
|
||||||
import { Modal, ModalProps, ThemeConfig } from 'antd';
|
|
||||||
import React, { Fragment, useLayoutEffect, useRef, useState } from 'react';
|
import React, { Fragment, useLayoutEffect, useRef, useState } from 'react';
|
||||||
|
import {
|
||||||
|
applyMiddleware,
|
||||||
|
createForm,
|
||||||
|
Form,
|
||||||
|
FormProvider,
|
||||||
|
IFormProps,
|
||||||
|
IMiddleware,
|
||||||
|
isBool,
|
||||||
|
isFn,
|
||||||
|
isNum,
|
||||||
|
isStr,
|
||||||
|
Observer,
|
||||||
|
observer,
|
||||||
|
ReactFC,
|
||||||
|
toJS,
|
||||||
|
} from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { Modal, ModalProps, ThemeConfig } from 'antd';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { GlobalThemeProvider } from '../../../global-theme';
|
|
||||||
import { createPortalProvider, createPortalRoot, loading, usePrefixCls, useToken } from '../__builtins__';
|
import { createPortalProvider, createPortalRoot, loading, usePrefixCls, useToken } from '../__builtins__';
|
||||||
|
import { GlobalThemeProvider } from '../../../global-theme';
|
||||||
|
|
||||||
type FormDialogRenderer = React.ReactElement | ((form: Form) => React.ReactElement);
|
type FormDialogRenderer = React.ReactElement | ((form: Form) => React.ReactElement);
|
||||||
|
|
||||||
@ -96,8 +110,8 @@ export function FormDialog(title: any, id: any, renderer?: any, theme?: any): IF
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
// fix https://nocobase.height.app/T-2797
|
// fix https://tachybase.height.app/T-2797
|
||||||
// fix https://nocobase.height.app/T-2838
|
// fix https://tachybase.height.app/T-2838
|
||||||
zIndex={token.zIndexPopupBase + 1000}
|
zIndex={token.zIndexPopupBase + 1000}
|
||||||
{...modal}
|
{...modal}
|
||||||
open={open}
|
open={open}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { Field } from '@tachybase/schema';
|
|
||||||
import { useField, useFieldSchema, useForm } from '@tachybase/schema';
|
|
||||||
import { nextTick } from '@tachybase/utils/client';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import { useEffect, useMemo, useRef } from 'react';
|
import { useEffect, useMemo, useRef } from 'react';
|
||||||
|
import { Field, useField, useFieldSchema, useForm } from '@tachybase/schema';
|
||||||
|
import { nextTick } from '@tachybase/utils/client';
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
import { useAssociationNames } from '../../../../block-provider/hooks';
|
import { useAssociationNames } from '../../../../block-provider/hooks';
|
||||||
import { useCollectionManager_deprecated, useCollection_deprecated } from '../../../../collection-manager';
|
import { useCollection_deprecated, useCollectionManager_deprecated } from '../../../../collection-manager';
|
||||||
import { useCollectionRecordData } from '../../../../data-source/collection-record/CollectionRecordProvider';
|
import { useCollectionRecordData } from '../../../../data-source/collection-record/CollectionRecordProvider';
|
||||||
import { useFlag } from '../../../../flag-provider';
|
import { useFlag } from '../../../../flag-provider';
|
||||||
import { useVariables } from '../../../../variables';
|
import { useVariables } from '../../../../variables';
|
||||||
@ -86,7 +87,7 @@ const useLazyLoadDisplayAssociationFieldsOfForm = () => {
|
|||||||
.then((value) => {
|
.then((value) => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const result = transformVariableValue(value, { targetCollectionField: collectionFieldRef.current });
|
const result = transformVariableValue(value, { targetCollectionField: collectionFieldRef.current });
|
||||||
// fix https://nocobase.height.app/T-2608
|
// fix https://tachybase.height.app/T-2608
|
||||||
if (_.isEmpty(result) && !_.isNumber(result)) {
|
if (_.isEmpty(result) && !_.isNumber(result)) {
|
||||||
field.value = null;
|
field.value = null;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Field } from '@tachybase/schema';
|
|
||||||
import { useField, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import { reaction } from '@tachybase/schema';
|
|
||||||
import { getValuesByPath } from '@tachybase/utils/client';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import { useCallback, useEffect } from 'react';
|
import { useCallback, useEffect } from 'react';
|
||||||
|
import { Field, reaction, useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
import { getValuesByPath } from '@tachybase/utils/client';
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
import { useRecordIndex } from '../../../../../src/record-provider';
|
import { useRecordIndex } from '../../../../../src/record-provider';
|
||||||
import { useCollection_deprecated } from '../../../../collection-manager';
|
import { useCollection_deprecated } from '../../../../collection-manager';
|
||||||
import { useCollectionRecord } from '../../../../data-source/collection-record/CollectionRecordProvider';
|
import { useCollectionRecord } from '../../../../data-source/collection-record/CollectionRecordProvider';
|
||||||
@ -82,7 +82,7 @@ const useParseDefaultValue = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (value == null || value === '') {
|
if (value == null || value === '') {
|
||||||
// fix https://nocobase.height.app/T-2805
|
// fix https://tachybase.height.app/T-2805
|
||||||
field.setInitialValue(null);
|
field.setInitialValue(null);
|
||||||
await field.reset({ forceClear: true });
|
await field.reset({ forceClear: true });
|
||||||
} else if (isSpecialCase()) {
|
} else if (isSpecialCase()) {
|
||||||
@ -122,7 +122,7 @@ const useParseDefaultValue = () => {
|
|||||||
const obj = { [variableName]: variable?.ctx || {} };
|
const obj = { [variableName]: variable?.ctx || {} };
|
||||||
const path = getPath(fieldSchema.default);
|
const path = getPath(fieldSchema.default);
|
||||||
const value = getValuesByPath(obj, path);
|
const value = getValuesByPath(obj, path);
|
||||||
// fix https://nocobase.height.app/T-2212
|
// fix https://tachybase.height.app/T-2212
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
// 返回一个随机值,确保能触发 run 函数
|
// 返回一个随机值,确保能触发 run 函数
|
||||||
return Math.random();
|
return Math.random();
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
import { Field } from '@tachybase/schema';
|
|
||||||
import { Schema, useFieldSchema, useForm } from '@tachybase/schema';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import { useCallback, useEffect, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo } from 'react';
|
||||||
|
import { Field, Schema, useFieldSchema, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CollectionFieldOptions_deprecated,
|
CollectionFieldOptions_deprecated,
|
||||||
useCollection_deprecated,
|
useCollection_deprecated,
|
||||||
useCollectionManager_deprecated,
|
useCollectionManager_deprecated,
|
||||||
} from '../../../../collection-manager';
|
} from '../../../../collection-manager';
|
||||||
import { isSubMode } from '../../association-field/util';
|
|
||||||
import { markRecordAsNew } from '../../../../data-source/collection-record/isNewRecord';
|
import { markRecordAsNew } from '../../../../data-source/collection-record/isNewRecord';
|
||||||
|
import { isSubMode } from '../../association-field/util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* #### 处理 `子表单` 和 `子表格` 中的特殊情况
|
* #### 处理 `子表单` 和 `子表格` 中的特殊情况
|
||||||
@ -46,7 +47,7 @@ export const useSpecialCase = () => {
|
|||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
* 特殊情况指的是:当前字段是 `对一` 字段且存在于 `对多` 字段的 `子表格` 或 `子表单` 中
|
* 特殊情况指的是:当前字段是 `对一` 字段且存在于 `对多` 字段的 `子表格` 或 `子表单` 中
|
||||||
* 详细说明见:https://nocobase.feishu.cn/docx/EmNEdEBOnoQohUx2UmBcqIQ5nyh#CUdLdy6OpoPKjyx9DLPc3lqknVc
|
* 详细说明见:https://tachybase.feishu.cn/docx/EmNEdEBOnoQohUx2UmBcqIQ5nyh#CUdLdy6OpoPKjyx9DLPc3lqknVc
|
||||||
*/
|
*/
|
||||||
isSpecialCase,
|
isSpecialCase,
|
||||||
setDefaultValue,
|
setDefaultValue,
|
||||||
@ -71,7 +72,7 @@ export function getParentFieldSchema(fieldSchema: Schema) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 特殊情况指的是:当前字段是 `对一` 字段且存在于 `对多` 字段的 `子表格` 或 `子表单` 中
|
* 特殊情况指的是:当前字段是 `对一` 字段且存在于 `对多` 字段的 `子表格` 或 `子表单` 中
|
||||||
* 详细说明见:https://nocobase.feishu.cn/docx/EmNEdEBOnoQohUx2UmBcqIQ5nyh#CUdLdy6OpoPKjyx9DLPc3lqknVc
|
* 详细说明见:https://tachybase.feishu.cn/docx/EmNEdEBOnoQohUx2UmBcqIQ5nyh#CUdLdy6OpoPKjyx9DLPc3lqknVc
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function isSpecialCaseField({
|
export function isSpecialCaseField({
|
||||||
|
@ -332,7 +332,7 @@ function getFieldValuesInCondition({ linkageRules, formValues }) {
|
|||||||
|
|
||||||
return conditions
|
return conditions
|
||||||
.map((condition) => {
|
.map((condition) => {
|
||||||
// fix https://nocobase.height.app/T-3251
|
// fix https://tachybase.height.app/T-3251
|
||||||
if ('$and' in condition || '$or' in condition) {
|
if ('$and' in condition || '$or' in condition) {
|
||||||
return run(condition);
|
return run(condition);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { render, screen, sleep, userEvent, waitFor } from '@tachybase/test/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { render, screen, sleep, userEvent, waitFor } from '@tachybase/test/client';
|
||||||
|
|
||||||
import App1 from '../demos/demo1';
|
import App1 from '../demos/demo1';
|
||||||
import App2 from '../demos/demo2';
|
import App2 from '../demos/demo2';
|
||||||
import App3 from '../demos/demo3';
|
import App3 from '../demos/demo3';
|
||||||
@ -145,7 +146,7 @@ describe('Form', () => {
|
|||||||
const closeBtn = screen.getByText('Close');
|
const closeBtn = screen.getByText('Close');
|
||||||
|
|
||||||
expect(input).toBeInTheDocument();
|
expect(input).toBeInTheDocument();
|
||||||
expect(input).toHaveValue('hello nocobase');
|
expect(input).toHaveValue('hello tachybase');
|
||||||
expect(closeBtn).toBeInTheDocument();
|
expect(closeBtn).toBeInTheDocument();
|
||||||
expect(screen.getByText(/drawer title/i)).toBeInTheDocument();
|
expect(screen.getByText(/drawer title/i)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { FormItem } from '@tachybase/components';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { ISchema, observer } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
Action,
|
Action,
|
||||||
ActionContextProvider,
|
ActionContextProvider,
|
||||||
@ -11,8 +10,10 @@ import {
|
|||||||
useCloseAction,
|
useCloseAction,
|
||||||
useRequest,
|
useRequest,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { FormItem } from '@tachybase/components';
|
||||||
|
import { ISchema, observer } from '@tachybase/schema';
|
||||||
|
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
const useValues = (options) => {
|
const useValues = (options) => {
|
||||||
const { visible } = useActionContext();
|
const { visible } = useActionContext();
|
||||||
@ -21,7 +22,7 @@ const useValues = (options) => {
|
|||||||
Promise.resolve({
|
Promise.resolve({
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'hello nocobase',
|
name: 'hello tachybase',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
{ ...options, manual: true },
|
{ ...options, manual: true },
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { fireEvent, render, screen, userEvent, waitFor } from '@tachybase/test/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { fireEvent, render, screen, userEvent, waitFor } from '@tachybase/test/client';
|
||||||
|
|
||||||
import App1 from '../demos/input';
|
import App1 from '../demos/input';
|
||||||
import App4 from '../demos/json';
|
import App4 from '../demos/json';
|
||||||
import App2 from '../demos/textarea';
|
import App2 from '../demos/textarea';
|
||||||
@ -64,9 +65,9 @@ describe('Input.URL', () => {
|
|||||||
const { container } = render(<App3 />);
|
const { container } = render(<App3 />);
|
||||||
|
|
||||||
const input = container.querySelector('input') as HTMLInputElement;
|
const input = container.querySelector('input') as HTMLInputElement;
|
||||||
await userEvent.type(input, 'https://www.nocobase.com');
|
await userEvent.type(input, 'https://www.tachybase.com');
|
||||||
expect(input.value).toBe('https://www.nocobase.com');
|
expect(input.value).toBe('https://www.tachybase.com');
|
||||||
expect(screen.getByText('https://www.nocobase.com')).toBeInTheDocument();
|
expect(screen.getByText('https://www.tachybase.com')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display the error when the value is invalid', async () => {
|
it('should display the error when the value is invalid', async () => {
|
||||||
@ -98,15 +99,15 @@ describe('Input.JSON', () => {
|
|||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
const textarea = container.querySelector('textarea') as HTMLTextAreaElement;
|
const textarea = container.querySelector('textarea') as HTMLTextAreaElement;
|
||||||
const pre = container.querySelector('pre') as HTMLPreElement;
|
const pre = container.querySelector('pre') as HTMLPreElement;
|
||||||
fireEvent.change(textarea, { target: { value: '{"name":"nocobase"}' } });
|
fireEvent.change(textarea, { target: { value: '{"name":"tachybase"}' } });
|
||||||
fireEvent.blur(textarea, { target: { value: '{"name":"nocobase"}' } });
|
fireEvent.blur(textarea, { target: { value: '{"name":"tachybase"}' } });
|
||||||
expect(JSON.parse(textarea.value)).toEqual({ name: 'nocobase' });
|
expect(JSON.parse(textarea.value)).toEqual({ name: 'tachybase' });
|
||||||
expect(pre).toMatchInlineSnapshot(`
|
expect(pre).toMatchInlineSnapshot(`
|
||||||
<pre
|
<pre
|
||||||
class="ant-json css-4dta7v"
|
class="ant-json css-4dta7v"
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
"name": "nocobase"
|
"name": "tachybase"
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
`);
|
`);
|
||||||
@ -118,8 +119,8 @@ describe('Input.JSON', () => {
|
|||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
const textarea = container.querySelector('textarea') as HTMLTextAreaElement;
|
const textarea = container.querySelector('textarea') as HTMLTextAreaElement;
|
||||||
fireEvent.change(textarea, { target: { value: '{"name":nocobase}' } });
|
fireEvent.change(textarea, { target: { value: '{"name":tachybase}' } });
|
||||||
fireEvent.blur(textarea, { target: { value: '{"name":nocobase}' } });
|
fireEvent.blur(textarea, { target: { value: '{"name":tachybase}' } });
|
||||||
expect(screen.getByText(/Unexpected token/)).toBeInTheDocument();
|
expect(screen.getByText(/Unexpected token/)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -136,7 +136,7 @@ const SideMenu = ({
|
|||||||
const { Component, getMenuItems } = useMenuItem();
|
const { Component, getMenuItems } = useMenuItem();
|
||||||
const { styles } = useStyles();
|
const { styles } = useStyles();
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-3331/description
|
// fix https://tachybase.height.app/T-3331/description
|
||||||
// 使用 ref 用来防止闭包问题
|
// 使用 ref 用来防止闭包问题
|
||||||
const sideMenuSchemaRef = useRef(sideMenuSchema);
|
const sideMenuSchemaRef = useRef(sideMenuSchema);
|
||||||
sideMenuSchemaRef.current = sideMenuSchema;
|
sideMenuSchemaRef.current = sideMenuSchema;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { render, screen, waitFor } from '@tachybase/test/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { render, screen, waitFor } from '@tachybase/test/client';
|
||||||
|
|
||||||
import App1 from '../demos/demo1';
|
import App1 from '../demos/demo1';
|
||||||
|
|
||||||
describe('Page', () => {
|
describe('Page', () => {
|
||||||
@ -13,7 +14,7 @@ describe('Page', () => {
|
|||||||
expect(screen.getByText(/page content/i)).toBeInTheDocument();
|
expect(screen.getByText(/page content/i)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(document.title).toBe('Page Title - NocoBase');
|
expect(document.title).toBe('Page Title - TachyBase');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ISchema } from '@tachybase/schema';
|
|
||||||
import { DocumentTitleProvider, Page, SchemaComponent, SchemaComponentProvider, Application } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Application, DocumentTitleProvider, Page, SchemaComponent, SchemaComponentProvider } from '@tachybase/client';
|
||||||
|
import { ISchema } from '@tachybase/schema';
|
||||||
|
|
||||||
const schema: ISchema = {
|
const schema: ISchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
@ -23,7 +23,7 @@ const schema: ISchema = {
|
|||||||
const Root = () => {
|
const Root = () => {
|
||||||
return (
|
return (
|
||||||
<SchemaComponentProvider components={{ Page }}>
|
<SchemaComponentProvider components={{ Page }}>
|
||||||
<DocumentTitleProvider addonAfter={'NocoBase'}>
|
<DocumentTitleProvider addonAfter={'TachyBase'}>
|
||||||
<SchemaComponent schema={schema} />
|
<SchemaComponent schema={schema} />
|
||||||
</DocumentTitleProvider>
|
</DocumentTitleProvider>
|
||||||
</SchemaComponentProvider>
|
</SchemaComponentProvider>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { Popover as AntdPopover, PopoverProps } from 'antd';
|
|
||||||
import React, { useCallback, useRef } from 'react';
|
import React, { useCallback, useRef } from 'react';
|
||||||
|
|
||||||
|
import { Popover as AntdPopover, PopoverProps } from 'antd';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参见:https://github.com/ant-design/ant-design/issues/44119
|
* 参见:https://github.com/ant-design/ant-design/issues/44119
|
||||||
* fix https://nocobase.height.app/T-1508
|
* fix https://tachybase.height.app/T-1508
|
||||||
* @param props
|
* @param props
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* title: Preview
|
* title: Preview
|
||||||
*/
|
*/
|
||||||
import { FormItem } from '@tachybase/components';
|
|
||||||
import { SchemaComponent, SchemaComponentProvider } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { SchemaComponent, SchemaComponentProvider } from '@tachybase/client';
|
||||||
|
import { FormItem } from '@tachybase/components';
|
||||||
|
|
||||||
import Preview from '../Preview';
|
import Preview from '../Preview';
|
||||||
|
|
||||||
const defaultValue = [
|
const defaultValue = [
|
||||||
@ -19,7 +20,7 @@ const defaultValue = [
|
|||||||
meta: {},
|
meta: {},
|
||||||
status: 'uploading',
|
status: 'uploading',
|
||||||
percent: 60,
|
percent: 60,
|
||||||
url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/cd48dc833ab01aa3959ac39309fc39de.jpg',
|
url: 'https://tachybase.oss-cn-beijing.aliyuncs.com/cd48dc833ab01aa3959ac39309fc39de.jpg',
|
||||||
created_at: '2021-08-13T15:00:17.423Z',
|
created_at: '2021-08-13T15:00:17.423Z',
|
||||||
updated_at: '2021-08-13T15:00:17.423Z',
|
updated_at: '2021-08-13T15:00:17.423Z',
|
||||||
created_by_id: null,
|
created_by_id: null,
|
||||||
@ -35,7 +36,7 @@ const defaultValue = [
|
|||||||
mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
path: '',
|
path: '',
|
||||||
meta: {},
|
meta: {},
|
||||||
url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/d9f6ad6669902a9a8a1229d9f362235a.docx',
|
url: 'https://tachybase.oss-cn-beijing.aliyuncs.com/d9f6ad6669902a9a8a1229d9f362235a.docx',
|
||||||
created_at: '2021-09-12T01:22:06.229Z',
|
created_at: '2021-09-12T01:22:06.229Z',
|
||||||
updated_at: '2021-09-12T01:22:06.229Z',
|
updated_at: '2021-09-12T01:22:06.229Z',
|
||||||
created_by_id: null,
|
created_by_id: null,
|
||||||
|
@ -119,7 +119,7 @@ const useTableColumns = () => {
|
|||||||
const index = field.value?.indexOf(record);
|
const index = field.value?.indexOf(record);
|
||||||
return (
|
return (
|
||||||
<RecordIndexProvider index={index}>
|
<RecordIndexProvider index={index}>
|
||||||
{/* fix https://nocobase.height.app/T-3232/description */}
|
{/* fix https://tachybase.height.app/T-3232/description */}
|
||||||
{/* 如果作为关系表格区块,则 parentRecordData 应该有值;如果作为普通表格使用(如数据源管理页面的表格)则应该使用 recordData,且 parentRecordData 为空 */}
|
{/* 如果作为关系表格区块,则 parentRecordData 应该有值;如果作为普通表格使用(如数据源管理页面的表格)则应该使用 recordData,且 parentRecordData 为空 */}
|
||||||
<RecordProvider record={record} parent={parentRecordData || recordData}>
|
<RecordProvider record={record} parent={parentRecordData || recordData}>
|
||||||
<RecursionField schema={s} name={record.__index || index} onlyRenderProperties />
|
<RecursionField schema={s} name={record.__index || index} onlyRenderProperties />
|
||||||
|
@ -21,7 +21,7 @@ mockRequest.onPost('/attachments:create').reply(async (config) => {
|
|||||||
extname: '.docx',
|
extname: '.docx',
|
||||||
path: '',
|
path: '',
|
||||||
size: null,
|
size: null,
|
||||||
url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/7edb55e4e3145e5ac59ea3a44ca840e9.docx',
|
url: 'https://tachybase.oss-cn-beijing.aliyuncs.com/7edb55e4e3145e5ac59ea3a44ca840e9.docx',
|
||||||
mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
meta: {},
|
meta: {},
|
||||||
storage_id: 2,
|
storage_id: 2,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* title: Upload
|
* title: Upload
|
||||||
*/
|
*/
|
||||||
import { FormItem } from '@tachybase/components';
|
|
||||||
import { APIClientProvider, SchemaComponent, SchemaComponentProvider, Upload } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { APIClientProvider, SchemaComponent, SchemaComponentProvider, Upload } from '@tachybase/client';
|
||||||
|
import { FormItem } from '@tachybase/components';
|
||||||
|
|
||||||
import apiClient from './apiClient';
|
import apiClient from './apiClient';
|
||||||
|
|
||||||
const schema = {
|
const schema = {
|
||||||
@ -25,7 +26,7 @@ const schema = {
|
|||||||
meta: {},
|
meta: {},
|
||||||
status: 'uploading',
|
status: 'uploading',
|
||||||
percent: 60,
|
percent: 60,
|
||||||
url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/cd48dc833ab01aa3959ac39309fc39de.jpg',
|
url: 'https://tachybase.oss-cn-beijing.aliyuncs.com/cd48dc833ab01aa3959ac39309fc39de.jpg',
|
||||||
created_at: '2021-08-13T15:00:17.423Z',
|
created_at: '2021-08-13T15:00:17.423Z',
|
||||||
updated_at: '2021-08-13T15:00:17.423Z',
|
updated_at: '2021-08-13T15:00:17.423Z',
|
||||||
created_by_id: null,
|
created_by_id: null,
|
||||||
@ -41,7 +42,7 @@ const schema = {
|
|||||||
mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
path: '',
|
path: '',
|
||||||
meta: {},
|
meta: {},
|
||||||
url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/d9f6ad6669902a9a8a1229d9f362235a.docx',
|
url: 'https://tachybase.oss-cn-beijing.aliyuncs.com/d9f6ad6669902a9a8a1229d9f362235a.docx',
|
||||||
created_at: '2021-09-12T01:22:06.229Z',
|
created_at: '2021-09-12T01:22:06.229Z',
|
||||||
updated_at: '2021-09-12T01:22:06.229Z',
|
updated_at: '2021-09-12T01:22:06.229Z',
|
||||||
created_by_id: null,
|
created_by_id: null,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import _, { every, findIndex, some } from 'lodash';
|
import _, { every, findIndex, some } from 'lodash';
|
||||||
|
|
||||||
import { VariableOption, VariablesContextType } from '../../../variables/types';
|
import { VariableOption, VariablesContextType } from '../../../variables/types';
|
||||||
import { isVariable } from '../../../variables/utils/isVariable';
|
import { isVariable } from '../../../variables/utils/isVariable';
|
||||||
import { transformVariableValue } from '../../../variables/utils/transformVariableValue';
|
import { transformVariableValue } from '../../../variables/utils/transformVariableValue';
|
||||||
@ -78,7 +79,7 @@ export const conditionAnalyses = async ({
|
|||||||
const conditions = ruleGroup[type];
|
const conditions = ruleGroup[type];
|
||||||
|
|
||||||
let results = conditions.map(async (condition) => {
|
let results = conditions.map(async (condition) => {
|
||||||
// fix https://nocobase.height.app/T-3152
|
// fix https://tachybase.height.app/T-3152
|
||||||
if ('$and' in condition || '$or' in condition) {
|
if ('$and' in condition || '$or' in condition) {
|
||||||
return await conditionAnalyses({ ruleGroup: condition, variables, localVariables });
|
return await conditionAnalyses({ ruleGroup: condition, variables, localVariables });
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,21 @@
|
|||||||
import { GeneralField, Query } from '@tachybase/schema';
|
import React, { ComponentType, useCallback, useContext, useEffect, useMemo } from 'react';
|
||||||
import { ISchema, Schema, SchemaOptionsContext, useField, useFieldSchema } from '@tachybase/schema';
|
import {
|
||||||
import { uid } from '@tachybase/schema';
|
GeneralField,
|
||||||
|
ISchema,
|
||||||
|
Query,
|
||||||
|
Schema,
|
||||||
|
SchemaOptionsContext,
|
||||||
|
uid,
|
||||||
|
useField,
|
||||||
|
useFieldSchema,
|
||||||
|
} from '@tachybase/schema';
|
||||||
|
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
import set from 'lodash/set';
|
import set from 'lodash/set';
|
||||||
import React, { ComponentType, useCallback, useContext, useEffect, useMemo } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { APIClient, useAPIClient } from '../../api-client';
|
import { APIClient, useAPIClient } from '../../api-client';
|
||||||
import { SchemaComponentContext } from '../context';
|
import { SchemaComponentContext } from '../context';
|
||||||
|
|
||||||
@ -691,7 +700,7 @@ export function useFindComponent() {
|
|||||||
}
|
}
|
||||||
const res = get(components, component);
|
const res = get(components, component);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
console.error(`[nocobase]: Component "${component}" not found`);
|
console.error(`[tachybase]: Component "${component}" not found`);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import { ISchema, useField, useFieldSchema, useForm } from '@tachybase/schema';
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { SchemaComponent, useAPIClient, useActionContext, useDesignable, useProps, useRecord } from '../..';
|
import { ISchema, useField, useFieldSchema, useForm } from '@tachybase/schema';
|
||||||
import { SchemaInitializer } from '../../application/schema-initializer/SchemaInitializer';
|
|
||||||
import { useGetAriaLabelOfSchemaInitializer } from '../hooks/useGetAriaLabelOfSchemaInitializer';
|
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { saveAs } from 'file-saver';
|
import { saveAs } from 'file-saver';
|
||||||
|
|
||||||
|
import { SchemaComponent, useActionContext, useAPIClient, useDesignable, useProps, useRecord } from '../..';
|
||||||
|
import { SchemaInitializer } from '../../application/schema-initializer/SchemaInitializer';
|
||||||
|
import { useGetAriaLabelOfSchemaInitializer } from '../hooks/useGetAriaLabelOfSchemaInitializer';
|
||||||
|
|
||||||
export const TabPaneInitializers = (props?: any) => {
|
export const TabPaneInitializers = (props?: any) => {
|
||||||
const { designable, insertBeforeEnd } = useDesignable();
|
const { designable, insertBeforeEnd } = useDesignable();
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
@ -120,7 +122,7 @@ export const TabPaneInitializers = (props?: any) => {
|
|||||||
style: {
|
style: {
|
||||||
borderColor: 'var(--colorSettings)',
|
borderColor: 'var(--colorSettings)',
|
||||||
color: 'var(--colorSettings)',
|
color: 'var(--colorSettings)',
|
||||||
marginRight: 'var(--nb-spacing)',
|
marginRight: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
type: 'dashed',
|
type: 'dashed',
|
||||||
useAction: useDumpAction,
|
useAction: useDumpAction,
|
||||||
@ -136,7 +138,7 @@ export const TabPaneInitializers = (props?: any) => {
|
|||||||
style: {
|
style: {
|
||||||
borderColor: 'var(--colorSettings)',
|
borderColor: 'var(--colorSettings)',
|
||||||
color: 'var(--colorSettings)',
|
color: 'var(--colorSettings)',
|
||||||
marginRight: 'var(--nb-spacing)',
|
marginRight: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
type: 'dashed',
|
type: 'dashed',
|
||||||
'aria-label': getAriaLabel(),
|
'aria-label': getAriaLabel(),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Field } from '@tachybase/schema';
|
|
||||||
import { useField, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import { merge } from '@tachybase/schema';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import React, { useCallback, useEffect, useMemo } from 'react';
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
||||||
|
import { Field, merge, useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
import { useFormBlockContext } from '../../../block-provider';
|
import { useFormBlockContext } from '../../../block-provider';
|
||||||
import {
|
import {
|
||||||
useCollection_deprecated,
|
useCollection_deprecated,
|
||||||
@ -10,13 +10,13 @@ import {
|
|||||||
useCollectionFilterOptions,
|
useCollectionFilterOptions,
|
||||||
useCollectionManager_deprecated,
|
useCollectionManager_deprecated,
|
||||||
} from '../../../collection-manager';
|
} from '../../../collection-manager';
|
||||||
|
import { CollectionFieldProvider } from '../../../data-source';
|
||||||
import { useRecord } from '../../../record-provider';
|
import { useRecord } from '../../../record-provider';
|
||||||
import { useCompile, useComponent } from '../../../schema-component';
|
import { useCompile, useComponent } from '../../../schema-component';
|
||||||
import { VariableInput, getShouldChange } from '../../../schema-settings/VariableInput/VariableInput';
|
|
||||||
import { Option } from '../../../schema-settings/VariableInput/type';
|
import { Option } from '../../../schema-settings/VariableInput/type';
|
||||||
import { formatVariableScop } from '../../../schema-settings/VariableInput/utils/formatVariableScop';
|
import { formatVariableScop } from '../../../schema-settings/VariableInput/utils/formatVariableScop';
|
||||||
|
import { getShouldChange, VariableInput } from '../../../schema-settings/VariableInput/VariableInput';
|
||||||
import { useLocalVariables, useVariables } from '../../../variables';
|
import { useLocalVariables, useVariables } from '../../../variables';
|
||||||
import { CollectionFieldProvider } from '../../../data-source';
|
|
||||||
|
|
||||||
interface AssignedFieldProps {
|
interface AssignedFieldProps {
|
||||||
value: any;
|
value: any;
|
||||||
@ -116,7 +116,7 @@ export const AssignedField = (props: AssignedFieldProps) => {
|
|||||||
const currentForm = scope.find((item) => item.value === '$nForm');
|
const currentForm = scope.find((item) => item.value === '$nForm');
|
||||||
const fields = getCollectionFields(name);
|
const fields = getCollectionFields(name);
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-1355
|
// fix https://tachybase.height.app/T-1355
|
||||||
// 工作流人工节点的 `自定义表单` 区块,与其它表单区块不同,根据它的数据表名称,获取到的字段列表为空,所以需要在这里特殊处理一下
|
// 工作流人工节点的 `自定义表单` 区块,与其它表单区块不同,根据它的数据表名称,获取到的字段列表为空,所以需要在这里特殊处理一下
|
||||||
if (!fields?.length && currentForm) {
|
if (!fields?.length && currentForm) {
|
||||||
currentForm.children = formatVariableScop(currentFormFields);
|
currentForm.children = formatVariableScop(currentFormFields);
|
||||||
|
@ -46,7 +46,7 @@ group:
|
|||||||
|
|
||||||
### Built Type
|
### Built Type
|
||||||
|
|
||||||
NocoBase 提供了几个内置的组件,可以直接使用。
|
TachyBase 提供了几个内置的组件,可以直接使用。
|
||||||
|
|
||||||
<code src="./demos/build-type.tsx"></code>
|
<code src="./demos/build-type.tsx"></code>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Field, Form } from '@tachybase/schema';
|
|
||||||
import { ISchema, Schema, useFieldSchema, useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
import { Field, Form, ISchema, Schema, uid, useFieldSchema, useForm } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DataBlockInitializer,
|
DataBlockInitializer,
|
||||||
DataSource,
|
DataSource,
|
||||||
@ -14,7 +14,7 @@ import {
|
|||||||
useFormActiveFields,
|
useFormActiveFields,
|
||||||
useFormBlockContext,
|
useFormBlockContext,
|
||||||
} from '../';
|
} from '../';
|
||||||
import { FieldOptions, useCollectionManager_deprecated, useCollection_deprecated } from '../collection-manager';
|
import { FieldOptions, useCollection_deprecated, useCollectionManager_deprecated } from '../collection-manager';
|
||||||
import { Collection, CollectionFieldOptions } from '../data-source/collection/Collection';
|
import { Collection, CollectionFieldOptions } from '../data-source/collection/Collection';
|
||||||
import { useDataSourceManager } from '../data-source/data-source/DataSourceManagerProvider';
|
import { useDataSourceManager } from '../data-source/data-source/DataSourceManagerProvider';
|
||||||
import { isAssocField } from '../filter-provider/utils';
|
import { isAssocField } from '../filter-provider/utils';
|
||||||
@ -890,7 +890,7 @@ export const useCollectionDataSourceItems = ({
|
|||||||
getTemplatesByCollection,
|
getTemplatesByCollection,
|
||||||
t,
|
t,
|
||||||
}).sort((item) => {
|
}).sort((item) => {
|
||||||
// fix https://nocobase.height.app/T-3551
|
// fix https://tachybase.height.app/T-3551
|
||||||
const inherits = _.toArray(collection?.inherits || []);
|
const inherits = _.toArray(collection?.inherits || []);
|
||||||
if (item.name === collection?.name || inherits.some((inheritName) => inheritName === item.name)) return -1;
|
if (item.name === collection?.name || inherits.some((inheritName) => inheritName === item.name)) return -1;
|
||||||
}),
|
}),
|
||||||
@ -898,7 +898,7 @@ export const useCollectionDataSourceItems = ({
|
|||||||
}));
|
}));
|
||||||
}, [allCollections, collection?.inherits, collection?.name, componentName, getTemplatesByCollection, t]);
|
}, [allCollections, collection?.inherits, collection?.name, componentName, getTemplatesByCollection, t]);
|
||||||
|
|
||||||
// https://nocobase.height.app/T-3821
|
// https://tachybase.height.app/T-3821
|
||||||
// showAssociationFields 的值是固定不变的,所以在 if 语句里使用 hooks 是安全的
|
// showAssociationFields 的值是固定不变的,所以在 if 语句里使用 hooks 是安全的
|
||||||
if (showAssociationFields) {
|
if (showAssociationFields) {
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
@ -1178,7 +1178,7 @@ export const createFormBlockSchema = (options: {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: actions,
|
properties: actions,
|
||||||
@ -1313,7 +1313,7 @@ export const createTableBlockSchema = (options) => {
|
|||||||
'x-component': 'ActionBar',
|
'x-component': 'ActionBar',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: 'var(--nb-spacing)',
|
marginBottom: 'var(--tb-spacing)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {},
|
properties: {},
|
||||||
|
@ -81,7 +81,7 @@ export const SchemaSettingsDefaultValue = function DefaultValueConfigure(props:
|
|||||||
const currentForm = scope.find((item) => item.value === '$nForm');
|
const currentForm = scope.find((item) => item.value === '$nForm');
|
||||||
const fields = getCollectionFields(name);
|
const fields = getCollectionFields(name);
|
||||||
|
|
||||||
// fix https://nocobase.height.app/T-1355
|
// fix https://tachybase.height.app/T-1355
|
||||||
// 工作流人工节点的 `自定义表单` 区块,与其它表单区块不同,根据它的数据表名称,获取到的字段列表为空,所以需要在这里特殊处理一下
|
// 工作流人工节点的 `自定义表单` 区块,与其它表单区块不同,根据它的数据表名称,获取到的字段列表为空,所以需要在这里特殊处理一下
|
||||||
if (!fields?.length && currentForm) {
|
if (!fields?.length && currentForm) {
|
||||||
currentForm.children = formatVariableScop(getFields());
|
currentForm.children = formatVariableScop(getFields());
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { Form } from '@tachybase/schema';
|
|
||||||
// @ts-ignore
|
|
||||||
import { Schema } from '@tachybase/schema';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
// @ts-ignore
|
||||||
|
import { Form, Schema } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { CollectionFieldOptions_deprecated } from '../../collection-manager';
|
import { CollectionFieldOptions_deprecated } from '../../collection-manager';
|
||||||
import { Variable, useVariableScope } from '../../schema-component';
|
import { useVariableScope, Variable } from '../../schema-component';
|
||||||
import { useValues } from '../../schema-component/antd/filter/useValues';
|
import { useValues } from '../../schema-component/antd/filter/useValues';
|
||||||
import { VariableOption, VariablesContextType } from '../../variables/types';
|
import { VariableOption, VariablesContextType } from '../../variables/types';
|
||||||
import { isVariable } from '../../variables/utils/isVariable';
|
import { isVariable } from '../../variables/utils/isVariable';
|
||||||
@ -160,7 +161,7 @@ export const getShouldChange = ({
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// `json` 可以选择任意类型的变量,详见:https://nocobase.feishu.cn/docx/EmNEdEBOnoQohUx2UmBcqIQ5nyh#FPLfdSRDEoXR65xW0mBcdfL5n0c
|
// `json` 可以选择任意类型的变量,详见:https://tachybase.feishu.cn/docx/EmNEdEBOnoQohUx2UmBcqIQ5nyh#FPLfdSRDEoXR65xW0mBcdfL5n0c
|
||||||
if (collectionField.interface === 'json') {
|
if (collectionField.interface === 'json') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Form } from '@tachybase/schema';
|
import { Form, Schema } from '@tachybase/schema';
|
||||||
import { Schema } from '@tachybase/schema';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useFormBlockContext } from '../../../block-provider';
|
import { useFormBlockContext } from '../../../block-provider';
|
||||||
import { CollectionFieldOptions_deprecated } from '../../../collection-manager';
|
import { CollectionFieldOptions_deprecated } from '../../../collection-manager';
|
||||||
import { useBaseVariable } from './useBaseVariable';
|
import { useBaseVariable } from './useBaseVariable';
|
||||||
@ -36,7 +37,7 @@ export const useFormVariable = ({ collectionName, collectionField, schema, noDis
|
|||||||
collectionName: collectionName,
|
collectionName: collectionName,
|
||||||
noDisabled,
|
noDisabled,
|
||||||
returnFields: (fields, option) => {
|
returnFields: (fields, option) => {
|
||||||
// fix https://nocobase.height.app/T-2277
|
// fix https://tachybase.height.app/T-2277
|
||||||
return fields;
|
return fields;
|
||||||
// const activeFieldsName = getActiveFieldsName?.('form') || [];
|
// const activeFieldsName = getActiveFieldsName?.('form') || [];
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ export const useCurrentFormVariable = ({
|
|||||||
collectionName: collectionName,
|
collectionName: collectionName,
|
||||||
noDisabled,
|
noDisabled,
|
||||||
returnFields: (fields, option) => {
|
returnFields: (fields, option) => {
|
||||||
// fix https://nocobase.height.app/T-2277
|
// fix https://tachybase.height.app/T-2277
|
||||||
return fields;
|
return fields;
|
||||||
// const activeFieldsName = getActiveFieldsName?.('form') || [];
|
// const activeFieldsName = getActiveFieldsName?.('form') || [];
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user