fix: wrong composable usage and spelling#640
fix: wrong composable usage and spelling#640chilingling merged 4 commits intoopentiny:refactor/developfrom
Conversation
WalkthroughThe recent changes focus on refactoring the codebase to enhance the modularity and maintainability by utilizing hooks consistently across different files. This involves moving variable declarations inside functions, renaming constants for clarity, and restructuring function calls to improve encapsulation and separation of concerns. Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- packages/design-core/src/App.vue (1 hunks)
- packages/plugins/block/src/js/blockSetting.jsx (14 hunks)
- packages/plugins/datasource/src/DataSourceRecordForm.vue (5 hunks)
- packages/plugins/script/src/js/method.js (3 hunks)
- packages/settings/props/src/components/groups/TablePager.vue (1 hunks)
- packages/toolbars/save/src/js/index.js (6 hunks)
Files skipped from review due to trivial changes (1)
- packages/settings/props/src/components/groups/TablePager.vue
Additional comments not posted (24)
packages/design-core/src/App.vue (1)
24-24: Ensure proper usage ofuseModal()hook.The
messagevariable is now correctly scoped within thesetup()function using theuseModal()hook. This change improves encapsulation.packages/toolbars/save/src/js/index.js (5)
30-31: Ensure correct usage ofuseLayoutanduseBlockhooks.The
PLUGIN_NAMEandgetPluginApiare now correctly retrieved using theuseLayouthook, andgetCurrentBlockis retrieved using theuseBlockhook. This change improves consistency.
46-46: Ensure correct usage ofuseCanvashook.The
currentPageis now correctly retrieved using theuseCanvashook. This change maintains the functionality and improves consistency.
57-58: Ensure correct usage ofusePageanduseCanvashooks.The
pageSettingStateandisTemporaryPageare now correctly retrieved using theusePagehook, andisBlock,canvasApi, andpageStateare retrieved using theuseCanvashook. This restructuring improves code readability and maintainability.
86-86: Ensure correct usage ofuseCanvashook.The
isSavedandcanvasApiare now correctly retrieved using theuseCanvashook. This change maintains the functionality and improves consistency.
120-120: Ensure correct usage ofuseCanvasanduseLayouthooks.The commented-out code correctly shows the usage of
useCanvasanduseLayouthooks for retrieving plugin API and block/page information. Ensure this code is correctly utilized if uncommented in the future.packages/plugins/script/src/js/method.js (2)
83-83: Ensure correct usage ofuseModalformessage.The
messagefunction is now correctly localized within thesaveMethodsfunction using theuseModalhook. This change improves encapsulation.
127-127: Ensure correct usage ofuseModalforconfirm.The
confirmfunction is now correctly localized within theclosefunction using theuseModalhook. This change improves encapsulation.packages/plugins/datasource/src/DataSourceRecordForm.vue (4)
56-66: Correct spelling errors in constant names.The spelling errors in the constant names have been corrected. Ensure that these corrected names are used consistently throughout the file.
91-95: Correct spelling error in function name.The spelling error in the function name
inithas been corrected. Ensure that this corrected name is used consistently throughout the file.
146-148: Correct spelling errors in validation messages.The spelling errors in the validation messages have been corrected. Ensure that these corrected messages are used consistently throughout the file.
163-185: Correct spelling errors in format keys and validation messages.The spelling errors in the format keys and validation messages have been corrected. Ensure that these corrected keys and messages are used consistently throughout the file.
packages/plugins/block/src/js/blockSetting.jsx (12)
344-344: LGTM! Correct usage ofuseBlock().addBlockProperty.The change correctly uses the
useBlockhook to add a block property.
358-358: LGTM! Correct usage ofuseBlock().addBlockEvent.The change correctly uses the
useBlockhook to add a block event.
381-381: LGTM! Correct usage ofuseBlock().getCurrentBlock.The change correctly uses the
useBlockhook to get the current block.
415-416: LGTM! Correct usage ofuseBlock().getBlockListanduseModal().message.The change correctly uses the
useBlockanduseModalhooks to manage block deletion and display messages.
541-541: LGTM! Correct usage ofuseModal().message.The change correctly uses the
useModalhook to display messages.
560-560: LGTM! Correct usage ofuseModal().confirm.The change correctly uses the
useModalhook to display confirmation dialogs.
582-582: LGTM! Correct usage ofuseModal().message.The change correctly uses the
useModalhook to display messages.
591-591: LGTM! Correct usage ofuseBlock().setCategoryList.The change correctly uses the
useBlockhook to set the category list.
Line range hint
598-616:
LGTM! Correct usage ofuseModal().message,useTranslate().batchCreateI18n, anduseCanvas().setSaved.The change correctly uses the
useModal,useTranslate, anduseCanvashooks for message display, translation creation, and canvas state management.
666-669: LGTM! Correct usage ofuseCanvas().setSavedanduseModal().message.The change correctly uses the
useCanvasanduseModalhooks for canvas state management and message display.
690-690: LGTM! Correct usage ofuseMaterial().getMaterial.The change correctly uses the
useMaterialhook to get material information.
743-743: LGTM! Correct usage ofuseBlock().setBlockList.The change correctly uses the
useBlockhook to set the block list.
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/plugins/block/src/js/blockSetting.jsx (14 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/plugins/block/src/js/blockSetting.jsx
* fix: wrong composable usage and spelling
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?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Refactor
Bug Fixes
useModal()calls within specific functions.Chores
setupfunction in TablePager for better parameter handling.New Features