Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): fix undefined context #4719

Merged
merged 1 commit into from
Jun 20, 2024
Merged

fix(client): fix undefined context #4719

merged 1 commit into from
Jun 20, 2024

Conversation

mytharcher
Copy link
Contributor

@mytharcher mytharcher commented Jun 20, 2024

Description

While using sub-table component to represent one-to-many field in manual node block or assign field values in create/update node, error thrown.

Steps to reproduce

  1. Manual node:
    1. Add a data block with an one-to-many field in manual UI configuration.
    2. Switch the component of the field from title to sub-table.
  2. Create/update node:
    1. Add a create/update node.
    2. Add an one-to-many field into assign value block.
    3. Switch the component of the field from select to sub-table.

Expected behavior

Showing sub-table.

Actual behavior

Error thrown:

TypeError: Cannot read properties of null (reading 'data')
useTableHeight
.nocobase/packages/core/client/src/schema-component/hooks/useBlockSize.ts:94:10

  91 | const schema = useFieldSchema();
  92 | const heightProps = tableHeightProps || blockHeightProps;
  93 | const pageFullScreenHeight = useFullScreenHeight(heightProps);
> 94 | const { data } = useDataBlockRequest();
     |        ^  95 | const { name } = useCollection();
  96 | const { count, pageSize } = (data as any)?.meta || ({} as any);
  97 | const hasPagination = count > pageSize;

Related issues

#4692.

Reason

No DataBlockRequest context in workflow nodes.

Solution

Adapt undefined value.

Copy link

height bot commented Jun 20, 2024

This pull request has been linked to 1 task:

  • T-4602 工作流人工节点,显示触发器节点数据,对多关系字段设置子表格报错 (unlink task)

💡Tip: Add "Close T-4602" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.

This comment has been minimized.

Copy link

Tests results for "E2E"

10 flaky ⚠️ [chromium] › plugins/@nocobase/plugin-action-bulk-edit/src/client/__e2e__/schemaInitailizer.test.ts:14:7 › TableActionInitializers & GanttActionInitializers & MapActionInitializers should add bulk edit action › bulk edit in TableActionInitializers
⚠️ [chromium] › plugins/@nocobase/plugin-auth/src/client/__e2e__/auth.test.ts:21:7 › auth › register
⚠️ [chromium] › plugins/@nocobase/plugin-gantt/src/client/__e2e__/schemaInitailizer.test.ts:13:5 › BlockInitializers should add gantt block
⚠️ [chromium] › plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/time/schemaSettings.test.ts:79:7 › form item & create form › pattern
⚠️ [chromium] › plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoFormulaEngine.test.ts:936:5 › Collection event add data trigger, determine the trigger node integer variable is not equal to the query node not equal integer variable, pass.
⚠️ [chromium] › plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/belongsTo/schemaInitializer.test.ts:36:7 › form item & edit form › configure fields
⚠️ [chromium] › plugins/@nocobase/plugin-acl/src/client/__e2e__/configure.test.ts:13:5 › allows to configure interface
⚠️ [chromium] › plugins/@nocobase/plugin-action-bulk-edit/src/client/__e2e__/schemaSettings.test.ts:14:7 › bulk edit action setting › data will be updated && edit form configure
⚠️ [chromium] › core/client/src/modules/blocks/data-blocks/grid-card/__e2e__/schemaInitializer.test.ts:30:7 › where grid card block can be added › popup
⚠️ [chromium] › plugins/@nocobase/plugin-file-manager/src/client/__e2e__/block.test.ts:53:7 › file collection block › correctly size

985 passed, 30 skipped
✔️✔️✔️

Full HTML report. Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant