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

feat:弹窗&树选择框上下文优化 #7486

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

hsm-lv
Copy link
Collaborator

@hsm-lv hsm-lv commented Jul 17, 2023

What

🤖 Generated by Copilot at a7c7d63

This pull request enhances the data binding capabilities of the amis-editor package by adding new methods and props to the editor and some plugins. It allows the dialog, input tree, and tree select components to generate and use data schemas based on their configuration and the host node data. It also improves the option resolution function in util.ts.

🤖 Generated by Copilot at a7c7d63

We bind the data to the dialog
We generate the schema from the node
We find the tree and resolve the option
We unleash the power of the editor mode

Why

How

🤖 Generated by Copilot at a7c7d63

  • Add a new optional property getHostNodeDataSchema to the EditorProps and SubEditorProps interfaces to allow the editor and sub-editor to access the data schema of the host node (link, link)
  • Pass the getHostNodeDataSchema prop from the sub-editor props to the editor component in the SubEditor class (link)
  • Remove the hard-coded pageParams variable from the variables array in the SubEditor class to avoid duplicating the page variables from the editor config (link)
  • Add a new method buildDataSchemas to the DialogPlugin, InputTreePlugin and TreeSelectPlugin classes to generate the data schema for the dialog, input tree and tree select nodes based on their schema and data or options properties (link, link, link)
  • Import EditorNodeType from amis-editor-core to use the type for the buildDataSchemas method in the Dialog.tsx, InputTree.tsx and TreeSelect.tsx files (link, link, link)
  • Modify the resolveOptionType function in the util.ts file to use the findTree function from amis to find the first valid option and handle the empty or undefined options cases (link)
  • Import resolveOptionType from util.ts to use the function for the buildDataSchemas method in the InputTree.tsx and TreeSelect.tsx files (link, link)
  • Import findTree from amis to use the function for the resolveOptionType function in the util.ts file (link)

@github-actions github-actions bot added the feat label Jul 17, 2023
@github-actions
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@hsm-lv hsm-lv changed the title feat:t弹窗上下文优化 feat:弹窗&树选择框上下文优化 Jul 17, 2023
@hsm-lv hsm-lv merged commit 62aa19a into baidu:master Jul 17, 2023
3 checks passed
@hsm-lv hsm-lv deleted the feat-dialog-dataschema branch July 18, 2023 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants