mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:45:18 +00:00
fix: autoGenId default value should be false when adding collection (#4942)
* fix: autoGenId default value should be false when adding collection * fix: test
This commit is contained in:
parent
bd5d4489fd
commit
47d2a0ee61
@ -169,7 +169,7 @@ export const PresetFields = observer(
|
|||||||
];
|
];
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const config = {
|
const config = {
|
||||||
autoGenId: true,
|
autoGenId: false,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
createdBy: true,
|
createdBy: true,
|
||||||
updatedAt: true,
|
updatedAt: true,
|
||||||
@ -209,7 +209,7 @@ export const PresetFields = observer(
|
|||||||
onChange: (_, selectedRows) => {
|
onChange: (_, selectedRows) => {
|
||||||
const fields = getDefaultCollectionFields(selectedRows, form.values);
|
const fields = getDefaultCollectionFields(selectedRows, form.values);
|
||||||
const config = {
|
const config = {
|
||||||
autoGenId: !!fields.find((v) => v.name === 'id'),
|
autoGenId: false,
|
||||||
createdAt: !!fields.find((v) => v.name === 'createdAt'),
|
createdAt: !!fields.find((v) => v.name === 'createdAt'),
|
||||||
createdBy: !!fields.find((v) => v.name === 'createdBy'),
|
createdBy: !!fields.find((v) => v.name === 'createdBy'),
|
||||||
updatedAt: !!fields.find((v) => v.name === 'updatedAt'),
|
updatedAt: !!fields.find((v) => v.name === 'updatedAt'),
|
||||||
|
@ -26,7 +26,7 @@ test.describe('create collection with preset fields', () => {
|
|||||||
const postData = request.postDataJSON();
|
const postData = request.postDataJSON();
|
||||||
//默认提交的数据符合预期
|
//默认提交的数据符合预期
|
||||||
expect(postData).toMatchObject({
|
expect(postData).toMatchObject({
|
||||||
autoGenId: true,
|
autoGenId: false,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
createdBy: true,
|
createdBy: true,
|
||||||
updatedAt: true,
|
updatedAt: true,
|
||||||
@ -78,7 +78,7 @@ test.describe('create collection with preset fields', () => {
|
|||||||
const postData = request.postDataJSON();
|
const postData = request.postDataJSON();
|
||||||
//提交的数据符合预期
|
//提交的数据符合预期
|
||||||
expect(postData).toMatchObject({
|
expect(postData).toMatchObject({
|
||||||
autoGenId: true,
|
autoGenId: false,
|
||||||
createdAt: false,
|
createdAt: false,
|
||||||
createdBy: false,
|
createdBy: false,
|
||||||
updatedAt: false,
|
updatedAt: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user