From 1fa4d48869d1c8c35188badfc1474851f5e35682 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Thu, 18 Jan 2024 19:10:44 +0800 Subject: [PATCH 1/3] fix: attachment deletion and re upload do not display (#3405) --- packages/core/client/src/schema-component/antd/upload/Upload.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/client/src/schema-component/antd/upload/Upload.tsx b/packages/core/client/src/schema-component/antd/upload/Upload.tsx index c156a29292..8975c536b8 100644 --- a/packages/core/client/src/schema-component/antd/upload/Upload.tsx +++ b/packages/core/client/src/schema-component/antd/upload/Upload.tsx @@ -167,6 +167,7 @@ Upload.Attachment = connect((props: UploadProps) => { if (info.file.status === 'done') { onChange?.(toValue(list)); } + onChange?.(toValue(list)); setFileList(list.map(toItem)); setSync(true); } else { From 1260934d2bba8b22bb6c041a52fcd773c87003e6 Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 20 Jan 2024 14:48:17 +0800 Subject: [PATCH 2/3] fix(client): cannot read properties of null (reading 'removeEventListener') at http://localhost:13000/p. index.f739617tasyncis:118:3551 --- .../schema-settings/GeneralSchemaDesigner.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-settings/GeneralSchemaDesigner.tsx b/packages/core/client/src/schema-settings/GeneralSchemaDesigner.tsx index d00c37685f..0128321a8f 100644 --- a/packages/core/client/src/schema-settings/GeneralSchemaDesigner.tsx +++ b/packages/core/client/src/schema-settings/GeneralSchemaDesigner.tsx @@ -5,11 +5,11 @@ import { Space } from 'antd'; import classNames from 'classnames'; import React, { FC, useEffect, useMemo, useRef } from 'react'; import { useTranslation } from 'react-i18next'; +import { SchemaToolbarProvider, useSchemaInitializerRender, useSchemaSettingsRender } from '../application'; import { DragHandler, useCompile, useDesignable, useGridContext, useGridRowContext } from '../schema-component'; import { gridRowColWrap } from '../schema-initializer/utils'; import { SchemaSettingsDropdown } from './SchemaSettings'; import { useGetAriaLabelOfDesigner } from './hooks/useGetAriaLabelOfDesigner'; -import { SchemaToolbarProvider, useSchemaInitializerRender, useSchemaSettingsRender } from '../application'; import { useStyles } from './styles'; const titleCss = css` @@ -160,7 +160,7 @@ export interface SchemaToolbarProps { showBackground?: boolean; } -export const SchemaToolbar: FC = (props) => { +const InternalSchemaToolbar: FC = (props) => { const { title, initializer, settings, showBackground, showBorder = true, draggable = true } = props; const { designable } = useDesignable(); const fieldSchema = useFieldSchema(); @@ -242,13 +242,13 @@ export const SchemaToolbar: FC = (props) => { } } - if (toolbarElement) { + if (toolbarElement?.parentElement) { toolbarElement.parentElement.addEventListener('mouseenter', show); toolbarElement.parentElement.addEventListener('mouseleave', hide); } return () => { - if (toolbarElement) { + if (toolbarElement?.parentElement) { toolbarElement.parentElement.removeEventListener('mouseenter', show); toolbarElement.parentElement.removeEventListener('mouseleave', hide); } @@ -286,3 +286,13 @@ export const SchemaToolbar: FC = (props) => { ); }; + +export const SchemaToolbar: FC = (props) => { + const { designable } = useDesignable(); + + if (!designable) { + return null; + } + + return ; +}; From 3b60ba2cf8feb2c8b90299ae5abd9a312fff0b86 Mon Sep 17 00:00:00 2001 From: Junyi Date: Sat, 20 Jan 2024 20:59:49 +0800 Subject: [PATCH 3/3] test: mysql version bug (#3412) * test(plugin-workflow): limit mysql version to pass test * fix(plugin-workflow-delay): fix test case * fix(plugin-workflow-delay): fix test case --- .github/workflows/nocobase-test-backend.yml | 2 +- .../src/server/__tests__/instruction.test.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nocobase-test-backend.yml b/.github/workflows/nocobase-test-backend.yml index 34e97e4e35..3df4a9d9bc 100644 --- a/.github/workflows/nocobase-test-backend.yml +++ b/.github/workflows/nocobase-test-backend.yml @@ -136,7 +136,7 @@ jobs: container: node:${{ matrix.node_version }} services: mysql: - image: mysql:8 + image: mysql:8.2 # >= 8.3 will meet unsolved error: https://github.com/nocobase/nocobase/actions/runs/7581141593/job/20653828990?pr=3383 env: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: nocobase diff --git a/packages/plugins/@nocobase/plugin-workflow-delay/src/server/__tests__/instruction.test.ts b/packages/plugins/@nocobase/plugin-workflow-delay/src/server/__tests__/instruction.test.ts index b35eab1e0b..1197183749 100644 --- a/packages/plugins/@nocobase/plugin-workflow-delay/src/server/__tests__/instruction.test.ts +++ b/packages/plugins/@nocobase/plugin-workflow-delay/src/server/__tests__/instruction.test.ts @@ -86,7 +86,7 @@ describe('workflow > instructions > delay', () => { expect(j2.status).toBe(JOB_STATUS.FAILED); }); - it('delay to resolve and rollback in downstream node', async () => { + it('delay to resolve and downstream node error', async () => { const n1 = await workflow.createNode({ type: 'delay', config: { @@ -97,11 +97,9 @@ describe('workflow > instructions > delay', () => { const n2 = await workflow.createNode({ type: 'create', config: { - collection: 'comment', + collection: 'notExistsTable', params: { - values: { - status: 'should be number but use string to raise an error', - }, + values: {}, }, }, upstreamId: n1.id,