-
Notifications
You must be signed in to change notification settings - Fork 453
feat(configurator): migrate configurator #546
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
feat(configurator): migrate configurator #546
Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 25 files out of 94 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the WalkthroughThe changes primarily involve renaming various components across multiple files and updating their references to improve consistency and maintainability. Configurator components have been standardized with new naming conventions, replacing the old "Meta" prefix with "Configurator." Additionally, there are updates to import/export structures and dependencies to align with these changes. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
Outside diff range and nitpick comments (5)
packages/configurator/src/slider-configurator/SliderConfigurator.vue (1)
[!TIP]
Codebase VerificationThe script output indicates that there are multiple references to
NumberConfiguratoracross various files, including JSON configuration files and JavaScript files. These references need to be reviewed and updated if necessary to ensure consistency across the codebase.
mockServer/src/services/appinfo.jsonmockServer/assets/json/bundle.jsonpackages/configurator/src/index.jspackages/settings/design/src/schema/carousel.jsonpackages/settings/design/src/schemas/time-line.jsonpackages/settings/design/src/schemas/select.jsonpackages/settings/design/src/schemas/popeditor.jsonpackages/settings/design/src/schemas/pager.jsonpackages/settings/design/src/schemas/input.jsonpackages/settings/design/src/schemas/button.jsonpackages/design-core/public/mock/bundle.jsonpackages/common/index.jsPlease review and update these references to ensure they align with the renaming strategy.
Analysis chain
Line range hint
4-18: RenamingMetaNumbertoNumberConfiguratorand updating its usage aligns with the PR's renaming strategy.Also applies to: 24-28
The script confirms that the
NumberConfiguratoris referenced inSliderConfigurator.vue. However, to ensure comprehensive verification, we should check for any other potential references across the entire codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `NumberConfigurator` are updated. rg --type vue 'NumberConfigurator' -lLength of output: 65
Script:
#!/bin/bash # Description: Verify all references to `NumberConfigurator` are updated. rg 'NumberConfigurator' --glob '*.vue'Length of output: 278
Script:
#!/bin/bash # Description: Verify all references to `NumberConfigurator` are updated across the entire codebase. rg 'NumberConfigurator'Length of output: 14713
packages/common/index.js (1)
111-111: Consider addressing the TODO comment about code import practices to improve modularity and maintainability.packages/plugins/block/src/js/blockSetting.jsx (3)
Line range hint
492-494: Optimize array iteration by replacingforEachwithfor...of.- children.forEach((child) => { + for (const child of children) { const component = getMaterial(child.componentName); if (!component) continue; const { npm, component: componentName } = component; if (npm) { const { package: pkg, exportName, css, version, script } = npm; const currentPkg = deps.scripts.find((item) => item.package === pkg); if (currentPkg) { currentPkg.components[componentName] = exportName; } else { deps.scripts.push({ package: pkg, version, script, css, components: { [componentName]: exportName } }); } if (css) { deps.styles.add(css); } } // 递归查找子区块或子组件 if (child.children) { generateBlockDeps(child.children, deps); } + }
Line range hint
532-536: ReplaceforEachwithfor...ofto improve performance in array iteration.- data.sort((a, b) => new Date(b.updated_at) - new Date(a.updated_at)).forEach((block) => { + for (const block of data.sort((a, b) => new Date(b.updated_at) - new Date(a.updated_at))) { setBlockList(blockListDescByUpdateAt); + }
Line range hint
737-775: Consider usingfor...ofinstead offorEachfor better performance in array operations.- state.arrayConfig.map?.(({ property, type, component, defaultValue, description, props }) => ({ + for (const { property, type, component, defaultValue, description, props } of state.arrayConfig) { property, type, defaultValue, label: { text: { zh_CN: description } }, widget: { component, props } + })
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (56)
- designer-demo/src/configurators.js (1 hunks)
- mockServer/assets/json/bundle.json (200 hunks)
- packages/builtinComponent/src/meta/CanvasCol.json (3 hunks)
- packages/canvas/src/components/builtin/builtin.json (2 hunks)
- packages/canvas/test/form.json (2 hunks)
- packages/common/component/ConfigItem.vue (2 hunks)
- packages/common/index.js (6 hunks)
- packages/common/package.json (1 hunks)
- packages/configurator/src/button-group-configurator/ButtonGroupConfigurator.vue (1 hunks)
- packages/configurator/src/cascader-configurator/CascaderConfigurator.vue (1 hunks)
- packages/configurator/src/checkbox-group-configurator/CheckboxGroupConfigurator.vue (1 hunks)
- packages/configurator/src/form-configurator/FormConfigurator.vue (1 hunks)
- packages/configurator/src/html-text-configurator/HtmlTextConfigurator.vue (1 hunks)
- packages/configurator/src/index.js (1 hunks)
- packages/configurator/src/ip-section-configurator/IpSectionConfigurator.vue (1 hunks)
- packages/configurator/src/radio-configurator/RadioConfigurator.vue (1 hunks)
- packages/configurator/src/radio-group-configurator/RadioGroupConfigurator.vue (1 hunks)
- packages/configurator/src/slider-configurator/SliderConfigurator.vue (2 hunks)
- packages/design-core/public/mock/bundle.json (162 hunks)
- packages/design-core/src/registerConfigurators.js (1 hunks)
- packages/plugins/block/src/js/blockSetting.jsx (3 hunks)
- packages/settings/design/package.json (1 hunks)
- packages/settings/design/src/assets/materials/ng-bundle.json (97 hunks)
- packages/settings/design/src/assets/materials/ng-components/accordion.json (3 hunks)
- packages/settings/design/src/assets/materials/ng-components/alert.json (3 hunks)
- packages/settings/design/src/assets/materials/ng-components/button.json (2 hunks)
- packages/settings/design/src/assets/materials/ng-components/checkbox.json (6 hunks)
- packages/settings/design/src/assets/materials/ng-components/container.json (3 hunks)
- packages/settings/design/src/assets/materials/ng-components/date.json (8 hunks)
- packages/settings/design/src/assets/materials/ng-components/daterange.json (6 hunks)
- packages/settings/design/src/assets/materials/ng-components/form.json (4 hunks)
- packages/settings/design/src/assets/materials/ng-components/formfield.json (9 hunks)
- packages/settings/design/src/assets/materials/ng-components/halfmodal.json (4 hunks)
- packages/settings/design/src/assets/materials/ng-components/image.json (4 hunks)
- packages/settings/design/src/assets/materials/ng-components/input.json (3 hunks)
- packages/settings/design/src/assets/materials/ng-components/radio.json (2 hunks)
- packages/settings/design/src/assets/materials/ng-components/select.json (3 hunks)
- packages/settings/design/src/assets/materials/ng-components/swiper.json (5 hunks)
- packages/settings/design/src/assets/materials/ng-components/switch.json (5 hunks)
- packages/settings/design/src/assets/materials/ng-components/tab.json (3 hunks)
- packages/settings/design/src/assets/materials/ng-components/table.json (12 hunks)
- packages/settings/design/src/assets/materials/ng-components/tablefilter.json (6 hunks)
- packages/settings/design/src/assets/materials/ng-components/tag.json (5 hunks)
- packages/settings/design/src/components/ArrayConfigItemForm.vue (2 hunks)
- packages/settings/design/src/components/widgets/index.js (2 hunks)
- packages/settings/design/src/convertToSchema.js (2 hunks)
- packages/settings/design/src/schema/carousel-item.json (2 hunks)
- packages/settings/design/src/schema/carousel.json (10 hunks)
- packages/settings/design/src/schemas/button.json (7 hunks)
- packages/settings/design/src/schemas/checkbox.json (7 hunks)
- packages/settings/design/src/schemas/checkboxbutton.json (4 hunks)
- packages/settings/design/src/schemas/checkboxgroup.json (2 hunks)
- packages/settings/design/src/schemas/collapse.json (1 hunks)
- packages/settings/design/src/schemas/collapseitem.json (2 hunks)
- packages/settings/design/src/schemas/dialogbox.json (7 hunks)
- packages/settings/design/src/schemas/form.json (5 hunks)
Files not processed due to max files limit (21)
- packages/settings/design/src/schemas/formitem.json
- packages/settings/design/src/schemas/grid.json
- packages/settings/design/src/schemas/gridcolumn.json
- packages/settings/design/src/schemas/input.json
- packages/settings/design/src/schemas/pager.json
- packages/settings/design/src/schemas/popeditor.json
- packages/settings/design/src/schemas/popover.json
- packages/settings/design/src/schemas/radio.json
- packages/settings/design/src/schemas/search.json
- packages/settings/design/src/schemas/select.json
- packages/settings/design/src/schemas/switch.json
- packages/settings/design/src/schemas/tabitem.json
- packages/settings/design/src/schemas/tabs.json
- packages/settings/design/src/schemas/time-line.json
- packages/settings/design/src/schemas/tooltip.json
- packages/settings/design/src/schemas/tree.json
- packages/settings/design/src/store/index.js
- packages/settings/events/src/components/AdvanceConfig.vue
- packages/settings/props/src/components/inputs/DraggableOptions.vue
- packages/vue-generator/test/testcases/full/case1_normal/input/blocks.schema.json
- packages/vue-generator/test/testcases/sfc/case01/blocks.schema.json
Files not summarized due to errors (1)
- mockServer/assets/json/bundle.json: Error: Message exceeds token limit
Files skipped from review due to trivial changes (22)
- packages/canvas/test/form.json
- packages/common/package.json
- packages/configurator/src/button-group-configurator/ButtonGroupConfigurator.vue
- packages/configurator/src/cascader-configurator/CascaderConfigurator.vue
- packages/configurator/src/index.js
- packages/configurator/src/ip-section-configurator/IpSectionConfigurator.vue
- packages/settings/design/package.json
- packages/settings/design/src/assets/materials/ng-components/checkbox.json
- packages/settings/design/src/assets/materials/ng-components/date.json
- packages/settings/design/src/assets/materials/ng-components/daterange.json
- packages/settings/design/src/assets/materials/ng-components/form.json
- packages/settings/design/src/assets/materials/ng-components/halfmodal.json
- packages/settings/design/src/assets/materials/ng-components/image.json
- packages/settings/design/src/assets/materials/ng-components/select.json
- packages/settings/design/src/assets/materials/ng-components/swiper.json
- packages/settings/design/src/assets/materials/ng-components/switch.json
- packages/settings/design/src/assets/materials/ng-components/tablefilter.json
- packages/settings/design/src/assets/materials/ng-components/tag.json
- packages/settings/design/src/schemas/button.json
- packages/settings/design/src/schemas/collapseitem.json
- packages/settings/design/src/schemas/dialogbox.json
- packages/settings/design/src/schemas/form.json
Additional context used
Biome
packages/settings/design/src/components/widgets/index.js
[error] 18-24: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
[error] 24-28: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
packages/settings/design/src/convertToSchema.js
[error] 81-103: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
packages/common/index.js
[error] 105-107: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
packages/plugins/block/src/js/blockSetting.jsx
[error] 492-494: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
[error] 532-536: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
[error] 737-775: Prefer for...of instead of forEach. (lint/complexity/noForEach)
forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
Additional comments not posted (64)
designer-demo/src/configurators.js (1)
1-7: The restructuring and export of configurators are well-implemented.packages/design-core/src/registerConfigurators.js (1)
10-10: The addition of user-specified configurators is correctly implemented.packages/settings/design/src/schema/carousel-item.json (1)
15-15: Correct update of component names in the JSON schema.Also applies to: 25-25
packages/configurator/src/checkbox-group-configurator/CheckboxGroupConfigurator.vue (1)
16-16: The component renaming and setup are correctly implemented.packages/configurator/src/radio-group-configurator/RadioGroupConfigurator.vue (1)
27-27: The component renaming and setup are correctly implemented.packages/settings/design/src/schemas/collapse.json (1)
35-35: The update to useInputConfiguratoraligns with the new naming convention. Good job on maintaining consistency.packages/settings/design/src/assets/materials/ng-components/alert.json (3)
39-39: The update toSwitchConfiguratoris consistent with the renaming strategy. Well done.
57-57: The update toInputConfiguratoris consistent with the renaming strategy. Well done.
81-81: The update toInputConfiguratoris consistent with the renaming strategy. Well done.packages/settings/design/src/assets/materials/ng-components/accordion.json (3)
39-39: The update toSwitchConfiguratoris consistent with the renaming strategy. Well done.
63-63: The update toInputConfiguratoris consistent with the renaming strategy. Well done.
83-83: The update toSwitchConfiguratoris consistent with the renaming strategy. Well done.packages/settings/design/src/assets/materials/ng-components/input.json (3)
39-39: The update toSwitchConfiguratoris consistent with the renaming strategy. Well done.
58-58: The update toInputConfiguratoris consistent with the renaming strategy. Well done.
83-83: The update toInputConfiguratoris consistent with the renaming strategy. Well done.packages/settings/design/src/assets/materials/ng-components/tab.json (3)
39-39: Change toSwitchConfiguratoraligns with the new naming convention.
58-58: Change toInputConfiguratoraligns with the new naming convention.
89-89: Change toInputConfiguratoraligns with the new naming convention.packages/settings/design/src/assets/materials/ng-components/radio.json (2)
39-39: Change toSwitchConfiguratoraligns with the new naming convention.
87-87: Change toInputConfiguratoraligns with the new naming convention.packages/settings/design/src/assets/materials/ng-components/container.json (3)
39-39: Change toSwitchConfiguratoraligns with the new naming convention.
59-59: Change toInputConfiguratoraligns with the new naming convention.
78-78: Change toInputConfiguratoraligns with the new naming convention.packages/configurator/src/html-text-configurator/HtmlTextConfigurator.vue (3)
13-13: Usage ofinput-configuratorin the template aligns with the new naming convention.
19-19: Updated import statement forInputConfiguratoraligns with the new naming convention.
24-24: Component registration forInputConfiguratoraligns with the new naming convention.packages/settings/design/src/convertToSchema.js (1)
49-49: Updated widget mapping for boolean types toSwitchConfiguratoraligns with the new naming convention.packages/settings/design/src/schemas/checkboxbutton.json (4)
35-35: Change toInputConfiguratoraligns with the new naming convention.
55-55: Change toSwitchConfiguratoraligns with the new naming convention.
74-74: Change toSwitchConfiguratoraligns with the new naming convention.
94-94: Change toInputConfiguratoraligns with the new naming convention.packages/settings/design/src/assets/materials/ng-components/button.json (1)
39-39: RenamingMetaSwitchtoSwitchConfiguratoraligns with the PR's renaming strategy.Verification successful
To ensure the renaming from
MetaSwitchtoSwitchConfiguratoris consistent across the codebase, we need to verify that no references toMetaSwitchremain.
The renaming from
MetaSwitchtoSwitchConfiguratorhas been applied consistently across the codebase, as no references toMetaSwitchremain in the JSON files.
- packages/settings/design/src/assets/materials/ng-components/button.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `SwitchConfigurator` are updated. rg --type json 'SwitchConfigurator' -lLength of output: 2949
Script:
#!/bin/bash # Description: Verify no references to `MetaSwitch` remain in the codebase. rg --type json 'MetaSwitch' -lLength of output: 30
packages/settings/design/src/schemas/checkboxgroup.json (2)
35-35: RenamingMetaInputtoInputConfiguratoraligns with the PR's renaming strategy.
55-55: RenamingMetaSwitchtoSwitchConfiguratoraligns with the PR's renaming strategy.Verification successful
Renaming
MetaSwitchtoSwitchConfiguratoraligns with the PR's renaming strategy. Thergcommand output shows multiple files referencingSwitchConfigurator. We need to ensure that all these references are correct and consistent with the renaming strategy.
Renaming
MetaSwitchtoSwitchConfiguratoraligns with the PR's renaming strategy. All references toSwitchConfiguratorhave been correctly updated across the codebase.
- Verified references in multiple files, including:
packages/design-core/public/mock/bundle.jsonpackages/vue-generator/test/testcases/sfc/case01/blocks.schema.jsonpackages/settings/design/src/schemas/checkboxgroup.json- And many others.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `SwitchConfigurator` are updated. rg --type json 'SwitchConfigurator' -lLength of output: 2949
Script:
#!/bin/bash # Description: Check the content of files referencing `SwitchConfigurator` to confirm the references are correct. files=( "packages/design-core/public/mock/bundle.json" "packages/vue-generator/test/testcases/sfc/case01/blocks.schema.json" "packages/vue-generator/test/testcases/full/case1_normal/input/blocks.schema.json" "packages/settings/design/src/schema/carousel.json" "packages/settings/design/src/schemas/formitem.json" "packages/settings/design/src/schemas/checkboxgroup.json" "packages/settings/design/src/schemas/input.json" "packages/settings/design/src/schemas/popeditor.json" "packages/settings/design/src/schemas/select.json" "packages/settings/design/src/schemas/tree.json" "packages/settings/design/src/schemas/time-line.json" "packages/settings/design/src/schemas/tabs.json" "packages/settings/design/src/schemas/radio.json" "packages/settings/design/src/schemas/popover.json" "packages/settings/design/src/schemas/gridcolumn.json" "packages/settings/design/src/schemas/grid.json" "packages/settings/design/src/schemas/search.json" "packages/settings/design/src/schemas/form.json" "packages/settings/design/src/schemas/dialogbox.json" "packages/settings/design/src/schemas/checkboxbutton.json" "packages/settings/design/src/schemas/checkbox.json" "packages/settings/design/src/schemas/button.json" "packages/settings/design/src/schemas/switch.json" "packages/settings/design/src/assets/materials/ng-bundle.json" "packages/settings/design/src/assets/materials/ng-components/button.json" "packages/settings/design/src/assets/materials/ng-components/alert.json" "packages/settings/design/src/assets/materials/ng-components/switch.json" "packages/settings/design/src/assets/materials/ng-components/tag.json" "packages/settings/design/src/assets/materials/ng-components/tablefilter.json" "packages/settings/design/src/assets/materials/ng-components/tab.json" "packages/settings/design/src/assets/materials/ng-components/table.json" "packages/settings/design/src/assets/materials/ng-components/swiper.json" "packages/settings/design/src/assets/materials/ng-components/select.json" "packages/settings/design/src/assets/materials/ng-components/input.json" "packages/settings/design/src/assets/materials/ng-components/image.json" "packages/settings/design/src/assets/materials/ng-components/radio.json" "packages/settings/design/src/assets/materials/ng-components/formfield.json" "packages/settings/design/src/assets/materials/ng-components/form.json" "packages/settings/design/src/assets/materials/ng-components/daterange.json" "packages/settings/design/src/assets/materials/ng-components/date.json" "packages/settings/design/src/assets/materials/ng-components/container.json" "packages/settings/design/src/assets/materials/ng-components/accordion.json" "packages/settings/design/src/assets/materials/ng-components/halfmodal.json" "packages/settings/design/src/assets/materials/ng-components/checkbox.json" "packages/builtinComponent/src/meta/CanvasCol.json" "packages/canvas/test/form.json" "mockServer/src/services/appinfo.json" "packages/canvas/src/components/builtin/builtin.json" "mockServer/assets/json/bundle.json" ) for file in "${files[@]}"; do echo "File: $file" cat "$file" | rg 'SwitchConfigurator' doneLength of output: 44880
packages/settings/design/src/schema/carousel.json (1)
16-16: RenamingMetaInput,MetaSwitch, andMetaNumbertoInputConfigurator,SwitchConfigurator, andNumberConfiguratoraligns with the PR's renaming strategy.Also applies to: 34-34, 44-44, 55-55, 72-72, 82-82, 92-92, 102-102, 113-113, 131-131
packages/builtinComponent/src/meta/CanvasCol.json (1)
37-37: RenamingMetaRadioGroup,MetaSwitch, and others toRadioGroupConfigurator,SwitchConfigurator, and so on aligns with the PR's renaming strategy.Also applies to: 156-156, 172-172
packages/settings/design/src/components/ArrayConfigItemForm.vue (2)
157-160: The dynamic component resolution logic is clear and well-implemented. Good use of computed properties for reactive updates.
55-56: Ensure that all imported components are used within the file to avoid unnecessary imports.Verification successful
The script results indicate that all imported components (
ConfigItem,MetaCodeEditor,MetaNumber,SwitchConfigurator, andInputConfigurator) are used within theArrayConfigItemForm.vuefile. Therefore, there are no unnecessary imports.
ConfigItemis used.MetaCodeEditoris used.MetaNumberis used.SwitchConfiguratoris used.InputConfiguratoris used.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for unused imports in ArrayConfigItemForm.vue ast-grep --lang vue --pattern 'import $_ from $_' packages/settings/design/src/components/ArrayConfigItemForm.vueLength of output: 222
Script:
#!/bin/bash # Description: Check for usage of each imported component in ArrayConfigItemForm.vue # Define the components to check components=("ConfigItem" "MetaCodeEditor" "MetaNumber" "SwitchConfigurator" "InputConfigurator") # Loop through each component and search for its usage in the file for component in "${components[@]}"; do echo "Searching for usage of $component:" rg "$component" packages/settings/design/src/components/ArrayConfigItemForm.vue echo doneLength of output: 1777
packages/settings/design/src/assets/materials/ng-components/formfield.json (1)
39-39: The updates to the component names in the widget configurations align with the new naming conventions. Ensure that these new components are properly defined and exported in their respective modules.Also applies to: 58-58, 78-78, 98-98, 118-118, 138-138, 158-158, 178-178, 229-229
Verification successful
The components
SwitchConfiguratorandInputConfiguratorare properly defined and exported in their respective modules.
SwitchConfiguratoris exported frompackages/configurator/src/switch-configurator/SwitchConfigurator.vue.InputConfiguratoris exported frompackages/configurator/src/input-configurator/InputConfigurator.vue.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and export of new component names in their respective modules. rg --type json --files-with-matches 'SwitchConfigurator|InputConfigurator' packages/configurator/src/**/*.vueLength of output: 1607
Script:
#!/bin/bash # Description: Verify the export of SwitchConfigurator and InputConfigurator components in their respective modules. rg 'export default' packages/configurator/src/switch-configurator/SwitchConfigurator.vue packages/configurator/src/input-configurator/InputConfigurator.vueLength of output: 327
packages/common/index.js (2)
13-33: The import statements for the configurator components are correctly updated to reflect the new naming conventions. This ensures consistency across the project.
111-111: ReplaceforEachwithfor...offor better performance and readability, especially if dealing with large arrays.- Object.entries(globalComponents).forEach(([name, component]) => { + for (const [name, component] of Object.entries(globalComponents)) { app.component(name, component) - }); + }Likely invalid or redundant comment.
packages/settings/design/src/assets/materials/ng-components/table.json (1)
39-39: The updates to the component names in the widget configurations are consistent with the new naming conventions. Ensure that these components are properly defined and exported in their respective modules.Also applies to: 105-105, 125-125, 145-145, 181-181, 217-217, 237-237, 257-257, 284-284, 303-303, 322-322, 346-346
Verification successful
The components
SwitchConfiguratorandInputConfiguratorexist in their respective modules. Now, let's verify if these components are properly exported from their modules.
The components
SwitchConfiguratorandInputConfiguratorare properly defined and exported in their respective modules.
SwitchConfiguratoris exported frompackages/configurator/src/switch-configurator/SwitchConfigurator.vue.InputConfiguratoris exported frompackages/configurator/src/input-configurator/InputConfigurator.vue.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and export of new component names in their respective modules. rg --type json --files-with-matches 'SwitchConfigurator|InputConfigurator' packages/configurator/src/**/*.vueLength of output: 1607
Script:
#!/bin/bash # Description: Verify the export of SwitchConfigurator and InputConfigurator components in their respective modules. rg 'export default' packages/configurator/src/switch-configurator/SwitchConfigurator.vue rg 'export default' packages/configurator/src/input-configurator/InputConfigurator.vueLength of output: 213
packages/canvas/src/components/builtin/builtin.json (1)
173-173: The updates to the component names in the widget configurations are consistent with the new naming conventions. Ensure that these components are properly defined and exported in their respective modules.Also applies to: 332-332
packages/plugins/block/src/js/blockSetting.jsx (3)
104-104: Update toSwitchConfiguratoraligns with the renaming strategy across the project.
113-113: Correctly updated the component list to includeSwitchConfiguratorfor boolean types.
242-242: The default editor for boolean types has been updated toSwitchConfigurator, ensuring consistency with other changes.packages/settings/design/src/assets/materials/ng-bundle.json (4)
44-44: Updated component name to 'SwitchConfigurator' aligns with the PR's renaming strategy.
64-64: Renaming 'MetaInput' to 'InputConfigurator' in widget components is consistent with the overall migration strategy.Also applies to: 83-83
152-152: Switch to 'SwitchConfigurator' for boolean properties is correctly implemented across various components.Also applies to: 196-196, 250-250, 346-346, 393-393, 487-487, 599-599, 737-737, 835-835, 937-937, 1063-1063, 1218-1218, 1348-1348, 1478-1478, 1582-1582, 1769-1769, 1941-1941, 2052-2052, 2163-2163, 2549-2549, 2812-2812
176-176: All instances of 'InputConfigurator' are correctly updated in line with the renaming strategy.Also applies to: 268-268, 292-292, 373-373, 413-413, 507-507, 526-526, 545-545, 624-624, 756-756, 781-781, 883-883, 982-982, 1009-1009, 1082-1082, 1101-1101, 1126-1126, 1237-1237, 1256-1256, 1275-1275, 1367-1367, 1386-1386, 1497-1497, 1528-1528, 1601-1601, 1620-1620, 1639-1639, 1677-1677, 1696-1696, 1715-1715, 1789-1789, 1812-1812, 1832-1832, 1852-1852, 1872-1872, 1960-1960, 1979-1979, 1998-1998, 2071-2071, 2090-2090, 2109-2109, 2205-2205, 2225-2225, 2245-2245, 2265-2265, 2301-2301, 2337-2337, 2357-2357, 2377-2377, 2404-2404, 2423-2423, 2442-2442, 2466-2466, 2569-2569, 2589-2589, 2613-2613, 2637-2637, 2701-2701, 2831-2831, 2851-2851, 2871-2871, 2891-2891, 2911-2911, 2931-2931, 3002-3002
mockServer/assets/json/bundle.json (10)
55-55: The component nameInputConfiguratoris consistent with the renaming strategy outlined in the PR. Ensure that all references to the old component name are updated across the project.
74-74: The component nameInputConfiguratoris correctly updated here as well. Double-check for any missed references or incorrect imports that might still be using the old name.
93-93: TheSelectConfiguratorcomponent is correctly named according to the new naming conventions. Verify that the options provided are correctly migrated from the old component.
223-223: TheSwitchConfiguratorcomponent is correctly updated. Ensure that all properties and behaviors are correctly migrated from the oldMetaSwitchcomponent.
313-313: TheNumberConfiguratorcomponent is correctly named. Verify that all numerical properties (like min, max) are correctly set if they were part of the old component's configuration.
513-513: TheHtmlTextConfiguratorcomponent is introduced correctly. Ensure that all HTML-related properties are correctly configured and that the component behaves as expected in the UI.
582-582: TheHtmlAttributesConfiguratorcomponent is correctly named. Verify that all HTML attribute configurations are correctly migrated from any previous component setups.
663-663: TheHtmlTextConfiguratorcomponent withshowRadioButtonproperty is a specific configuration. Ensure this property is handled correctly in the component logic.
685-685: Another instance ofHtmlAttributesConfigurator. As with other configurators, ensure all necessary attributes are correctly migrated and functional.
189-189: TheInputConfiguratorcomponent appears multiple times. Ensure that this is intentional and not a copy-paste error, especially if the configuration is identical across different sections.Verification successful
Let's correct the script to properly search for the
InputConfiguratorcomponent and check for duplicates.
The script output indicates that the
InputConfiguratorcomponent appears multiple times in thebundle.jsonfile, with 54 and 11 occurrences respectively. This suggests that there might be duplicate entries, but we need to verify if these entries have identical configurations.To ensure thorough verification, we should check if these occurrences have identical configurations.
The previous script did not produce any output, which suggests that there might not be exact duplicate configurations for the
InputConfiguratorcomponent. However, to be thorough, we should verify the configurations more precisely.Let's refine our approach to extract and compare the full configurations of the
InputConfiguratorcomponent.
The extracted configurations show that the
InputConfiguratorcomponent appears multiple times with varying configurations. Some instances have emptypropswhile others have specific options or properties set.This indicates that the multiple occurrences of
InputConfiguratorare intentional and not a result of a copy-paste error, as they serve different purposes with different configurations.
- : The multiple occurrences of the
InputConfiguratorcomponent inbundle.jsonare intentional and have different configurations.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for duplicate entries of InputConfigurator with identical configurations. # Test: Search for duplicate JSON blocks. Expect: No exact duplicates. rg --type json --json $'{ "component": "InputConfigurator", "props": {} }' mockServer/assets/json/bundle.json | uniq -c | grep -v ' 1 'Length of output: 436
Script:
#!/bin/bash # Description: Check for duplicate entries of InputConfigurator with identical configurations. # Test: Search for duplicate JSON blocks containing "component": "InputConfigurator". rg --type json '"component": "InputConfigurator"' mockServer/assets/json/bundle.json | uniq -c | grep -v ' 1 'Length of output: 240
Script:
#!/bin/bash # Description: Check for duplicate entries of InputConfigurator with identical configurations. # Extract all JSON blocks containing "component": "InputConfigurator" and count unique occurrences. rg --type json -A 5 '"component": "InputConfigurator"' mockServer/assets/json/bundle.json | uniq -c | grep -v ' 1 'Length of output: 117
Script:
#!/bin/bash # Description: Extract and compare configurations of InputConfigurator components. # Extract all JSON blocks containing "component": "InputConfigurator" and their configurations. rg --type json -A 10 '"component": "InputConfigurator"' mockServer/assets/json/bundle.jsonLength of output: 24463
packages/design-core/public/mock/bundle.json (4)
206-206: Consistent component renaming to 'SwitchConfigurator'.Also applies to: 420-420, 442-442, 464-464, 486-486, 508-508, 530-530, 552-552, 575-575, 729-729, 831-831, 886-886, 908-908, 930-930, 952-952, 1011-1011, 1034-1034, 1203-1203, 1268-1268, 1289-1289, 2167-2167, 2189-2189, 2248-2248, 2270-2270, 2292-2292, 2432-2432, 2454-2454, 2937-2937, 3065-3065, 3084-3084, 3911-3911, 3930-3930, 5779-5779, 5854-5854, 5874-5874, 5933-5933, 5953-5953, 10742-10742, 10762-10762, 10941-10941, 11032-11032, 11100-11100, 11288-11288, 11316-11316, 11599-11599, 11615-11615, 11710-11710, 11859-11859, 11878-11878, 11954-11954, 12049-12049, 12274-12274, 12294-12294, 12313-12313, 12394-12394, 12651-12651, 12671-12671, 12724-12724, 151-151, 152-152, 153-153, 155-155, 156-156, 157-157, 158-158, 161-161, 162-162
1638-1638: Consistent component renaming to 'NumberConfigurator'.Also applies to: 1657-1657, 2122-2122, 3228-3228, 3297-3297, 3378-3378, 3400-3400, 3481-3481, 3501-3501, 3703-3703, 3949-3949, 4046-4046, 4109-4109, 4228-4228, 4306-4306, 4325-4325, 4344-4344, 4863-4863, 4946-4946, 4985-4985, 5004-5004, 5339-5339, 5476-5476, 5498-5498, 5519-5519, 5541-5541, 5563-5563, 5585-5585, 5607-5607, 5629-5629, 5894-5894, 5913-5913, 5933-5933, 5953-5953, 6102-6102, 6140-6140, 6160-6160, 6221-6221, 6241-6241, 6527-6527, 6556-6556, 6750-6750, 6770-6770, 6790-6790, 6831-6831, 6859-6859, 6899-6899, 7118-7118, 7197-7197, 7340-7340, 7380-7380, 7400-7400, 7428-7428, 7448-7448, 7619-7619, 7638-7638, 7686-7686, 7878-7878, 7897-7897, 8071-8071, 8280-8280, 8320-8320, 8339-8339, 8379-8379, 8399-8399, 8540-8540, 8602-8602, 8622-8622, 9481-9481, 9495-9495, 9579-9579, 9785-9785, 9908-9908, 9944-9944, 9964-9964, 9984-9984, 10004-10004, 10024-10024, 10338-10338, 10358-10358, 10397-10397, 10615-10615, 10635-10635, 10662-10662, 10742-10742, 10762-10762, 10941-10941, 11032-11032, 11100-11100, 11288-11288, 11316-11316, 11599-11599, 11615-11615, 11710-11710, 11859-11859, 11878-11878, 11954-11954, 12049-12049, 12274-12274, 12294-12294, 12313-12313, 12394-12394, 12651-12651, 12671-12671, 12724-12724
1706-1706: Consistent component renaming to 'SwitchConfigurator'.Also applies to: 1787-1787, 1829-1829, 1979-1979, 2040-2040, 1706-1706, 1787-1787, 1829-1829, 1979-1979, 2040-2040
2167-2167: Consistent component renaming to 'SwitchConfigurator'.Also applies to: 2189-2189, 2248-2248, 2270-2270, 2292-2292, 2432-2432, 2454-2454, 2937-2937, 3065-3065, 3084-3084, 3911-3911, 3930-3930, 5779-5779, 5854-5854, 5874-5874, 5933-5933, 5953-5953, 10742-10742, 10762-10762, 10941-10941, 11032-11032, 11100-11100, 11288-11288, 11316-11316, 11599-11599, 11615-11615, 11710-11710, 11859-11859, 11878-11878, 11954-11954, 12049-12049, 12274-12274, 12294-12294, 12313-12313, 12394-12394, 12651-12651, 12671-12671, 12724-12724, 151-151, 152-152, 153-153, 155-155, 156-156, 157-157, 158-158, 161-161, 162-162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- mockServer/src/services/blocks.json (2 hunks)
- packages/canvas/test/form.json (3 hunks)
- packages/design-core/public/mock/bundle.json (162 hunks)
- packages/vue-generator/test/testcases/full/case1_normal/input/blocks.schema.json (3 hunks)
- packages/vue-generator/test/testcases/full/case2_prop-accessor/input/blocks.schema.json (1 hunks)
- packages/vue-generator/test/testcases/full/case3_state-accessor/input/blocks.schema.json (2 hunks)
- packages/vue-generator/test/testcases/sfc/case01/blocks.schema.json (3 hunks)
- packages/vue-generator/test/testcases/sfc/case02/blocks.schema.json (1 hunks)
- packages/vue-generator/test/testcases/sfc/case03/blocks.schema.json (2 hunks)
Files skipped from review due to trivial changes (4)
- mockServer/src/services/blocks.json
- packages/vue-generator/test/testcases/full/case2_prop-accessor/input/blocks.schema.json
- packages/vue-generator/test/testcases/sfc/case02/blocks.schema.json
- packages/vue-generator/test/testcases/sfc/case03/blocks.schema.json
Files skipped from review as they are similar to previous changes (2)
- packages/canvas/test/form.json
- packages/design-core/public/mock/bundle.json
Additional comments not posted (8)
packages/vue-generator/test/testcases/full/case3_state-accessor/input/blocks.schema.json (2)
114-114: EnsureInputConfiguratoris fully compatible with the previous component.
134-134: Confirm thatInputConfiguratorsupports all required props.packages/vue-generator/test/testcases/sfc/case01/blocks.schema.json (3)
131-131: EnsureInputConfiguratoris fully compatible with the previous component.
153-153: Confirm thatInputConfiguratorsupports all required props.
175-175: Verify thatSwitchConfiguratorcorrectly handles boolean values.packages/vue-generator/test/testcases/full/case1_normal/input/blocks.schema.json (3)
134-134: EnsureInputConfiguratoris fully compatible with the previous component.
156-156: Confirm thatInputConfiguratorsupports all required props.
178-178: Verify thatSwitchConfiguratorcorrectly handles boolean values.
06002e9 to
c8499ab
Compare
* feat(configurator): migrate configurator * fix: fix NumberConfiguratoric to NumberConfigurator * feat: register all configurator by default
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
New Features
FormConfiguratorcomponent for customizable form configurations.Dependencies
@opentiny/tiny-engine-configuratordependency to the project.These changes enhance the maintainability and consistency of component configurations across the application.