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(amis-editor-core): 调整editor默认值公式编辑器中获取amis对应渲染器上下文的方法 #6746

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

wibetter
Copy link
Collaborator

@wibetter wibetter commented Apr 27, 2023

What

🤖 Generated by Copilot at 121b3c3

This pull request removes some unused or redundant code from the EditorManager, IFramePreview, and Preview components, and fixes a bug in the FormulaControl component that affected the data context for the formula editor. These changes improve the code quality and the preview functionality of the amis-editor.

🤖 Generated by Copilot at 121b3c3

No more amisStore, no more data bugs
We rip out the code that was useless and old
We fix the formula logic, we make it clear and bold
We are the masters of the editor, we control the preview mode

Why

How

🤖 Generated by Copilot at 121b3c3

  • Remove the code that updates the editor's amisStore with the props.store.data from both IFramePreview.tsx and Preview.tsx components to fix a bug that causes the preview to render incorrectly when the data changes (link, link)
  • Remove the amisStore property and the updateAMISContext method from the EditorManager class to clean up the unused code and avoid confusion (link, link)
  • Modify the getContextData method in the FormulaControl.tsx component to improve the logic of getting the current data context for the formula editor, using the node.getComponent().props.data path as a fallback when the props.data.__super.props.data path is not available (link)
  • Add an empty line to the FormulaControl.tsx component to improve the code readability and formatting (link)

@wibetter wibetter requested a review from 2betop April 27, 2023 02:58
@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.

@github-actions github-actions bot added the fix label Apr 27, 2023
@igrowp igrowp merged commit 9633458 into baidu:master Apr 27, 2023
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

3 participants