Open gene9831 opened 2 days ago
The changes in this pull request introduce enhancements to the block management system within the application. A new property, options
, is added to the default export object in index.js
, allowing for the configuration of category and group management. Several components, including BlockConfig.vue
, CategoryEdit.vue
, and Main.vue
, are updated to utilize dynamic labeling based on the new shouldReplaceCategoryWithGroup
method. Additionally, new functions for managing groups are added in http.js
, facilitating operations like fetching, creating, updating, and deleting groups.
File Path | Change Summary |
---|---|
packages/plugins/block/index.js |
Added new property options with mergeCategoriesAndGroups: false to the default export object. |
packages/plugins/block/src/BlockConfig.vue |
Updated template and script for dynamic binding of category/group labels and placeholders. |
packages/plugins/block/src/CategoryEdit.vue |
Enhanced dynamic behavior of form fields based on category or group context; updated validation logic. |
packages/plugins/block/src/Main.vue |
Modified UI elements and logic for category/group management; introduced dynamic labels for UI prompts. |
packages/plugins/block/src/SaveNewBlock.vue |
Updated category selection label to be context-sensitive; enhanced component interactivity. |
packages/plugins/block/src/composable/useBlock.js |
Added shouldReplaceCategoryWithGroup function to determine category/group management logic. |
packages/plugins/block/src/js/blockSetting.jsx |
Introduced new functions for group management; updated existing functions to handle categories/groups. |
packages/plugins/block/src/js/http.js |
Added functions: fetchGroups , createGroup , updateGroup , and deleteGroup for group management. |
index.js
, related to the addition of the options
property.options
section in meta.js
, relevant to the new options
property.ospp-2024
🐇 In the meadow, blocks do play,
Merging groups in a bright array.
With labels that dance and shift,
Our plugin's spirit gets a lift!
So let us cheer, both near and far,
For a block's new journey, like a shooting star! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
区块管理的区块分类接口与物料的区块分组接口响应基本一致,支持将分类接口和分组接口,合并成区块分组接口,实际上是将分类接口替换成分组接口
What is the current behavior?
What is the new behavior?
区块插件增加了
options.mergeCategoriesAndGroups
配置项,来决定是否合并分类和分组接口。mergeCategoriesAndGroups
为false
(默认值),保持原来的逻辑不变,即分类和分组接口都会调用mergeCategoriesAndGroups
为true
,将分类接口替换成分组接口。并且将区块管理页面的分类
文本全部替换成了分组
文本注册表示例:
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation