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

fea(design-core,mockServer): 引入图表物料组件 #815

Conversation

spongebody
Copy link

@spongebody spongebody commented Sep 25, 2024

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced new chart components: Pie Chart, Line Chart, Histogram, Bar Chart, Radar Chart, and Ring Chart.
    • Added a new navigation component: TinyNavMenu.
    • Organized chart components under a new "Charts" group for better accessibility.
  • Improvements

    • Updated package references for better performance and reliability.
    • Enhanced configuration options for chart components, including data binding and event handling.

Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The changes involve updates to the element-plus package references, modifying URLs for scripts and CSS. The isContainer property has been updated across multiple instances, and the group for ElTable has been changed. New chart components have been introduced, including pie, line, histogram, bar, radar, and ring charts, each with specific configurations. Additionally, a new "Charts" group has been created to organize these components.

Changes

File Path Change Summary
mockServer/src/services/appinfo.json Updated element-plus package URLs, modified isContainer property, changed ElTable group, added new chart components.
packages/design-core/public/mock/bundle.json Introduced new chart components (Pie, Line, Histogram, Bar, Radar, Ring) with properties and configuration options, created "Charts" group.

Possibly related PRs

Suggested labels

refactor-main

Suggested reviewers

  • hexqi

Poem

In fields of code, where rabbits play,
New charts hop in to brighten the day.
With colors and lines, they dance and twirl,
Bringing data to life in a vibrant whirl.
So let’s celebrate with a joyful cheer,
For every new feature that brings us near! 🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the ospp-2024 ospp-2024 label Sep 25, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Outside diff range and nitpick comments (1)
packages/design-core/public/mock/bundle.json (1)

Line range hint 4-4: Address TODO comment

There's a TODO comment to add tests for this function. It's important to implement these tests to ensure the function works as expected across various inputs.

Would you like me to generate some unit test cases for this function?

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7bcae54 and 3d14d5a.

Files selected for processing (2)
  • mockServer/src/services/appinfo.json (24 hunks)
  • packages/design-core/public/mock/bundle.json (2 hunks)
Additional comments not posted (24)
mockServer/src/services/appinfo.json (24)

16983-16984: Consistent CDN update for element-plus

This change is consistent with the previous update to the element-plus package URLs. It maintains the same version and uses the new CDN (npm.onmicrosoft.cn).


16994-16994: Component now marked as a container: Verify behavior changes

The isContainer property has been changed from false to true. This change may affect how the component interacts with child components or how it's treated in the layout.

Please verify that this change doesn't introduce any unexpected behavior in the component's rendering or interaction with child elements. You may want to check for any layout issues or unexpected nesting behavior.


17304-17305: Consistent CDN update for element-plus

This change aligns with the previous updates to the element-plus package URLs, maintaining consistency across the file.


17315-17315: Consistent container property update

The isContainer property has been changed from false to true, consistent with the previous similar change. This maintains consistency in how components are treated as containers.


17761-17762: Consistent CDN update for element-plus

This change maintains consistency with the previous updates to the element-plus package URLs.


17772-17772: Consistent container property update

The isContainer property has been changed from false to true, maintaining consistency with previous similar changes.


18111-18116: CDN update and component reclassification

  1. The element-plus package URLs have been updated consistently with previous changes.
  2. The component's group has been changed from "表单组件" (form component) to "数据展示" (data display).

Please verify that the reclassification of this component from a form component to a data display component is intentional and doesn't negatively impact its usage in the application. Ensure that any component filtering or categorization features are updated accordingly.


18488-18490: Widget configuration updated to expect a JavaScript function

The widget configuration has been updated to include a "props" object with "dataType" set to "JSFunction". This change suggests that the widget now expects a JavaScript function as input.

Please ensure that:

  1. The component's documentation is updated to reflect this new expectation of a JavaScript function input.
  2. Any existing usage of this widget is updated to provide a JavaScript function where required.
  3. The component handles cases where a function might not be provided or is of the wrong type.

18773-18776: MetaTableColumns component configuration enhancement

The MetaTableColumns component configuration has been updated with the following changes:

  1. Added "textField" property set to "label".
  2. Added "language" property set to "json".
  3. Updated "buttonText" and "title" properties.

Please ensure that:

  1. The component correctly uses the new "textField" property for displaying labels.
  2. The JSON language setting is properly handled in the component's logic.
  3. The updated button text and title are correctly displayed in the user interface.
  4. These changes are reflected in the component's documentation.
  5. Any existing usage of this component is compatible with these new configurations.

19349-19350: Consistent CDN update for element-plus

This change maintains consistency with the previous updates to the element-plus package URLs.


19879-19882: New schema structure and npm placeholder added

The following changes have been made:

  1. An empty "npm" object has been added.
  2. A new "schema" object with a "properties" array has been introduced.

Please clarify the following:

  1. The purpose of the empty "npm" object. Is it a placeholder for future npm-related configurations?
  2. The intended use of the new "schema" object. Is it for schema-based configuration or validation of the component?
  3. Ensure that these additions are properly documented and that they don't introduce any unintended side effects in the current implementation.

20822-20824: Component configured as a container

A "configure" object has been added with the "isContainer" property set to true, consistent with previous similar changes.

Please ensure that:

  1. The component's behavior as a container is intentional and properly implemented.
  2. Any layout or styling that depends on the container status of this component is updated accordingly.
  3. The change is reflected in the component's documentation.
  4. Test the component to verify that it correctly handles child components, if applicable.

21183-21185: Consistent container configuration

This change is consistent with the previous update, configuring the component as a container by setting "isContainer" to true.


22668-22671: Component configured as non-container with nesting rules

Unlike previous changes, this component is configured with "isContainer" set to false. Additionally, a "nestingRule" object has been added with a "childWhitelist" property.

Please ensure that:

  1. The decision to set "isContainer" to false is intentional and aligns with the component's intended behavior.
  2. The purpose and implementation of the "nestingRule" and "childWhitelist" are clearly defined and documented.
  3. The component correctly enforces these nesting rules in its implementation.
  4. Any potential impact on existing usage of this component due to these changes is assessed and communicated to the development team.

22688-22894: New component added: TinyNavMenu

A new component, TinyNavMenu, has been added with comprehensive configuration. This component appears to be a navigation menu with various customizable properties.

Key points:

  1. Detailed schema definition with properties like "data", "overflow", "fields", etc.
  2. Custom event handlers and data fetching capabilities.
  3. Configurable as a non-container component.

To ensure proper integration of this new component:

  1. Verify that the component is thoroughly documented, including usage examples and property descriptions.
  2. Ensure that all required properties ("data", "overflow", "fields", etc.) are properly handled in the component's implementation.
  3. Test the component with various configurations to ensure it behaves as expected, especially the "overflow" property with its different options.
  4. Verify that the "before-skip" and "fetch-menu-data" functions are properly implemented and documented.
  5. Check if any existing navigation components need to be updated or replaced with this new TinyNavMenu component.
  6. Consider adding unit and integration tests for this new component.

23291-23294: Consistent non-container configuration with nesting rules

This change is consistent with a previous update, configuring the component as a non-container ("isContainer": false) and adding nesting rules.


25080-25083: Consistent non-container configuration with nesting rules

This change maintains consistency with previous updates, configuring the component as a non-container and adding nesting rules.


25847-25849: Widget configuration updated to support JSON input

The widget configuration has been updated to include a "props" object with "language" set to "json". This change indicates that the widget now expects or supports JSON input.

Please ensure that:

  1. The component's logic correctly handles JSON input in this widget.
  2. The change is reflected in the component's documentation, clearly stating that JSON input is expected or supported.
  3. Any existing usage of this widget is updated to provide JSON input where required.
  4. The component includes proper error handling for cases where invalid JSON might be provided.

25895-25898: Non-container configuration with click capture disabled

This change configures the component as a non-container ("isContainer": false) and introduces a new "clickCapture" property set to false. It also includes nesting rules, consistent with previous updates.

Please ensure that:

  1. The purpose of the "clickCapture" property is clearly documented and understood by the development team.
  2. The component's event handling logic correctly implements the "clickCapture" behavior.
  3. Any potential impact on user interaction with this component due to disabled click capture is assessed and intentional.
  4. Test the component to verify that click events behave as expected with this configuration.

27811-27814: Increased number of items before collapse

The "number" property in the "collapse" object has been updated to 10. This change likely increases the number of items displayed before collapsing in a list or menu component.

Please ensure that:

  1. The increase in the number of items before collapse aligns with the design requirements and doesn't negatively impact the user interface.
  2. The component correctly implements this change, displaying 10 items before collapsing.
  3. The change is reflected in the component's documentation.
  4. Test the component with various numbers of items to ensure it behaves correctly in all scenarios (less than, equal to, and greater than 10 items).

27886-27907: New render-content property added for custom node rendering

A new "render-content" property has been added to the component configuration. This property appears to be a function for custom rendering of tree node content.

Key points:

  1. The property is optional (not required).
  2. The widget is configured as a disabled input field.
  3. The placeholder suggests using variable binding to provide the function.

Please ensure that:

  1. The component's logic correctly implements the custom rendering functionality using this "render-content" function.
  2. Clear documentation is provided on how to use this property, including examples of valid render functions.
  3. The component handles cases where no render function is provided, falling back to default rendering.
  4. Error handling is in place for cases where an invalid function might be provided.
  5. Consider adding type checking to ensure that only functions are accepted for this property.
  6. Test the component with various custom render functions to ensure it behaves correctly in all scenarios.

28455-28476: Consistent addition of render-content property

The "render-content" property has been added again, with configuration nearly identical to the previous instance. This suggests the property is being added to multiple components or is part of a shared configuration.

Please ensure that:

  1. The duplication of this property across multiple components is intentional and necessary.
  2. If this configuration is shared across multiple components, consider refactoring it into a shared schema or utility function to reduce code duplication and improve maintainability.
  3. The implementation of the "render-content" functionality is consistent across all components that use it.
  4. Documentation clearly states which components support this property and if there are any component-specific considerations for its usage.
  5. Test all components that implement this property to ensure consistent behavior.

29896-30717: New chart components added: Enhancing data visualization capabilities

Several new chart components have been added to the application:

  1. TinyChartPie
  2. TinyChartLine
  3. TinyChartHistogram
  4. TinyChartBar
  5. TinyChartRadar
  6. TinyChartRing

These components are based on the @opentiny/vue package and utilize eCharts for rendering. They share a consistent configuration structure, including properties for data, settings, dimensions, and events.

To ensure proper integration and usage of these new chart components:

  1. Verify that comprehensive documentation is provided for each chart type, including:
    • Usage examples
    • Detailed property descriptions
    • Data format requirements
    • Available customization options
  2. Ensure that the implementation of each chart type correctly utilizes the eCharts library and handles all specified properties.
  3. Test each chart type with various data sets to confirm proper rendering and behavior.
  4. Verify that the event handling (specified in the "events" property) is correctly implemented for each chart type.
  5. Check that the "extend" property correctly allows for additional eCharts configuration options.
  6. Ensure that the "loading" and "data-empty" states are properly implemented and visually appropriate for each chart type.
  7. Consider creating a suite of unit and integration tests for these chart components.
  8. Verify that the charts are responsive and render correctly on different screen sizes.
  9. Ensure accessibility features are implemented, such as proper aria labels and keyboard navigation where applicable.
  10. Consider adding TypeScript type definitions for the component props to improve developer experience and catch potential errors early.

16703-16704: CDN change for element-plus package: Verify new CDN reliability

The URLs for the element-plus package have been updated from unpkg.com to npm.onmicrosoft.cn. This change might improve load times or address network restrictions.

Please ensure that the new CDN (npm.onmicrosoft.cn) is reliable and accessible in all required environments. Run the following script to check the availability of the new URLs:

Verification successful

New CDN URLs are available

The new CDN URLs for the element-plus package have responded with HTTP 200 OK, confirming their availability.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check availability of new CDN URLs
curl -I https://npm.onmicrosoft.cn/element-plus@2.4.2/dist/index.full.mjs
curl -I https://npm.onmicrosoft.cn/element-plus@2.4.2/dist/index.css

Length of output: 3504

@hexqi hexqi merged commit 13676d9 into opentiny:ospp-2024/005-template Sep 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ospp-2024 ospp-2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants