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

chore:数组类组件当前行上下文优化 #7553

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

hsm-lv
Copy link
Collaborator

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

What

🤖 Generated by Copilot at f6d2adf

This pull request improves the data schema management and generation in the editor core and plugins, and fixes some issues and typos in the documentation and UI. It uses the JSONPipeOut function, the parent parameter, and the expression property to simplify and enhance the schema logic and output. It also modifies the data schema tag format in the Wrapper component.

🤖 Generated by Copilot at f6d2adf

Editor evolves
Data schemas more precise
Autumn leaves fall fast

Why

How

🤖 Generated by Copilot at f6d2adf

  • Simplify the button toolbar and action in the example code of switching between input and display modes in docs/zh-CN/components/form/index.md (link, link, link, link)
  • Modify the tag of the data schema in the Wrapper component of the editor core to use a colon instead of brackets in packages/amis-editor-core/src/component/factory.tsx (link)
  • Add a loop to remove the current row scopes from the data schema in the EditorManager class of the editor core to avoid stale scopes in packages/amis-editor-core/src/manager.ts (link)
  • Add a node parameter to the buildDataSchemas method of the node plugin in the EditorManager class of the editor core and the PluginInterface interface in the editor core to allow plugins to access the parent scope or schema in packages/amis-editor-core/src/manager.ts and packages/amis-editor-core/src/plugin.ts (link, link, link)
  • Add a default implementation of the buildDataSchemas method to the BasePlugin class in the editor core to provide a fallback schema for plugins that do not override this method in packages/amis-editor-core/src/plugin.ts (link)
  • Modify the logic of building the data schemas for the table rows and the selected rows in the CRUDPlugin class in the editor to create and switch to the current row scope and call the buildDataSchemas method of the column child plugin with the node parameter in packages/amis-editor/src/plugin/CRUD.tsx (link, link, link, link)
  • Modify the logic of creating and switching to the current row scope and building the data schemas for the combo items in the ComboControlPlugin class in the editor to handle the case where the current node is a combo column and call the buildDataSchemas method of the item child plugin with the node parameter in packages/amis-editor/src/plugin/Form/Combo.tsx (link, link, link, link)
  • Use the JSONPipeOut function to process the JSON data of the form node and remove some internal properties before converting it to JSON schema and remove the special handling of the combo and input-table types in the Form plugin in the editor in packages/amis-editor/src/plugin/Form/Form.tsx (link, link)
  • Remove an unused import of the getTreeAncestors function from the amis-core package in the InputTable plugin in the editor and modify the logic of building the data schemas for the input table rows in the TableControlPlugin class in the editor to call the buildDataSchemas method of the cell child plugin with the node parameter in packages/amis-editor/src/plugin/Form/InputTable.tsx (link, link, link, link)
  • Use the JSONPipeOut function to process the JSON data of the page node and remove some internal properties before converting it to JSON schema and remove the logic of creating a separate scope for the page data in the Page plugin in the editor in packages/amis-editor/src/plugin/Page.tsx (link, link)
  • Use the JSONPipeOut function to process the JSON data of the service node and remove some internal properties before converting it to JSON schema and add an implementation of the buildDataSchemas method to the ServicePlugin class in the editor in packages/amis-editor/src/plugin/Service.tsx (link, link)
  • Modify the logic of creating and switching to the current row scope and building the data schemas for the table rows in the TablePlugin class in the editor to handle the case where the current node is a table column and call the buildDataSchemas method of the cell child plugin with the node parameter in packages/amis-editor/src/plugin/Table.tsx (link, link, link, link)
  • Remove an unused import of the getTreeAncestors function from the amis-core package in the VariableList component in the UI and modify the logic of rendering the variable list items to avoid showing the member operations for nested array members in packages/amis-ui/src/components/formula/VariableList.tsx (link, link)

@github-actions github-actions bot added the chore label Jul 23, 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 requested a review from 2betop July 23, 2023 04:34
@hsm-lv hsm-lv force-pushed the chore-formulaeditor-dataschema branch from f6d2adf to a6bf83f Compare July 24, 2023 06:05
@hsm-lv hsm-lv force-pushed the chore-formulaeditor-dataschema branch from a6bf83f to 8cb9904 Compare July 24, 2023 06:55
@hsm-lv hsm-lv merged commit 84557da into baidu:master Jul 24, 2023
3 checks passed
@hsm-lv hsm-lv deleted the chore-formulaeditor-dataschema branch August 17, 2023 05:40
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