fix: resolve some interaction issues#1102
Conversation
WalkthroughThis pull request introduces several modifications across multiple modules. The npm utility import process has been enhanced with a preliminary validation step and improved error handling. Vue components have been updated: one now uses a simplified tiny-radio component with added reactivity, another modifies its method for counting selected rows, and a page preview function has been enriched with additional contextual information. Additionally, a new query parameter has been incorporated into the available blocks API call in the materials module. Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
packages/plugins/i18n/src/Main.vue (1)
274-274: Consider updating batchDelete to use getAllSelection for consistency.The batchDelete function still uses
getSelectRecords()while the selection count usesgetAllSelection(). This inconsistency could lead to mismatches between the number of items shown as selected and the number of items actually deleted.Apply this change for consistency:
- const i18nData = i18nTable.value.getSelectRecords() + const i18nData = i18nTable.value.getAllSelection()
🧹 Nitpick comments (2)
packages/canvas/render/src/application-function/utils.ts (2)
57-67: Consider handling invalid or missing CDN links more robustly.
While the filter ensures that only items with a "cdnLink" are processed, you may want to validate the link format or handle potential edge cases (e.g., an empty string). This can help avoid silent failures and facilitate better user feedback.
68-83: Ensure all rejected imports are consistently handled or retried if needed.
This block gracefully handles rejected imports by notifying the user. However, keep in mind that some rejections might be transient or caused by temporary network issues. Depending on your requirements, you may want to give the user an option to retry loading the utilities or provide additional support instructions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/canvas/render/src/application-function/utils.ts(1 hunks)packages/plugins/datasource/src/DataSourceType.vue(2 hunks)packages/plugins/i18n/src/Main.vue(1 hunks)packages/plugins/materials/src/meta/block/src/http.js(1 hunks)packages/plugins/page/src/PageHistory.vue(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (5)
packages/plugins/page/src/PageHistory.vue (1)
61-65: Great inclusion of contextual data for page previews.
Passing the platform ID, page name, and item as ancestors ensures a richer preview. Consider validating that "item.name" is defined to avoid potential undefined references in scenarios where the backup item might lack a name property.packages/plugins/datasource/src/DataSourceType.vue (2)
6-12: Good simplification of the radio button rendering.
Using a single with v-for reduces duplication and improves readability. The dynamic :key, :text, and :label bindings correctly leverage the "item" object.
55-60: Sync child state with parent prop changes.
This watcher ensures that updates to "modelValue" flow down to "dataSourceType." Combine it with appropriate validation or defensive checks if "modelValue" can be undefined or hold unexpected values.packages/plugins/materials/src/meta/block/src/http.js (1)
124-124: LGTM! This change fixes the keyword search functionality.The addition of
name_cn_containsparameter enables searching blocks by their Chinese names, resolving the issue with keyword searches in material grouping.packages/plugins/i18n/src/Main.vue (1)
192-192: LGTM! This change fixes the delete button functionality.Switching from
getSelectRecords()togetAllSelection()correctly tracks selected rows, enabling proper deletion of single entries in internationalization resources.Let's verify that the delete button is properly enabled/disabled based on selections:
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Check for other usages of getSelectRecords to ensure consistent selection handling # Search for other instances of getSelectRecords rg "getSelectRecords" -A 5Length of output: 1922
LGTM! The change correctly fixes the delete button behavior in the i18n module.
- The computed property now uses getAllSelection(), ensuring the delete button is enabled/disabled based on the actual count of selected rows.
- The remaining instances of getSelectRecords in Main.vue and other files appear in contexts unrelated to the deletion functionality and do not affect the fix.
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?
1、【国际化资源】首次删除单个词条时,删除按钮置灰无法删除
2、【资源管理】检验资源 CDN 链接失败时,提示信息中:工具类名称 和 CDN 链接不匹配,且 链接显示为 undefined.
3、【物料】分组增加区块时,关键字检索不匹配
4、【数据源】设置数据源类型时、数据源类型样式异常。查看已保存数据源时,数据源类型不切换
5、【页面】历史备份预览界面时,页面名称不显示、页面一直显示 页面加载中 ...
Issue Number: N/A
What is the new behavior?
1、【国际化资源】删除按钮正常显示,可以删除单个词条
2、【资源管理】检验资源 CDN 链接失败时,提示信息的工具类名称 和 CDN 链接匹配,链接正常显示
3、【物料】分组增加区块时,关键字搜索可以根据 区块名称 或 区块 ID 正常检索
4、【数据源】数据源类型样式正常。查看已保存数据源时,数据源类型正常切换
5、【页面】历史备份预览界面时,正常预览页面
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Refactor