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

fix: supplement datepicker component #4943

Merged
merged 2 commits into from
Nov 24, 2024
Merged

fix: supplement datepicker component #4943

merged 2 commits into from
Nov 24, 2024

Conversation

anncwb
Copy link
Collaborator

@anncwb anncwb commented Nov 24, 2024

Description

fixed #4936

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced the ElDatePicker component, enhancing the component library with date selection functionality.
  • Bug Fixes

    • Updated type definitions for various modules to ensure accurate referencing.
  • Chores

    • Updated the package manager version to pnpm@9.14.2.
    • Removed unused dependencies to streamline the project.
    • Incremented versions for numerous package dependencies to improve stability and performance.

@anncwb anncwb added the bug Something isn't working label Nov 24, 2024
@anncwb anncwb requested review from vince292007 and a team as code owners November 24, 2024 13:45
Copy link

changeset-bot bot commented Nov 24, 2024

⚠️ No Changeset found

Latest commit: 68181fa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Nov 24, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces several modifications across multiple files, primarily focusing on the addition of the ElDatePicker component to the component library, updates to type definitions, and dependency version upgrades. The index.ts file is updated to include the new date picker, enhancing the component registration process. Additionally, the package.json files for various packages reflect changes in dependencies and type definitions, while the workspace configuration file updates multiple package versions to their latest releases.

Changes

File Path Change Summary
apps/web-ele/src/adapter/component/index.ts Added ElDatePicker to imports; updated ComponentType to include DatePicker; modified initComponentAdapter to register DatePicker.
package.json Updated packageManager from pnpm@9.13.2 to pnpm@9.14.2.
packages/@core/base/shared/package.json Removed @types/lodash.get and lodash.get from dependencies; updated type definitions in exports for several modules.
pnpm-workspace.yaml Updated multiple package versions, including @changesets/cli, @playwright/test, and others.

Assessment against linked issues

Objective Addressed Explanation
Register DatePicker component in the adapter file (4936)

Possibly related PRs

Suggested reviewers

  • vince292007

🐇 In the garden where the flowers sway,
A new DatePicker joins the play.
With components bright, we hop and cheer,
Enhancing forms, spreading joy, oh dear!
So let us dance, with code so neat,
A world of features, oh what a treat! 🌼


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.

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)
apps/web-ele/src/adapter/component/index.ts (1)

83-83: Consider enhancing DatePicker registration to handle edge cases

While the basic registration addresses the component availability, consider wrapping the DatePicker to handle the reported issues with datetimerange type and name attribute warnings. You might want to add validation or transformation logic similar to how Input and Select components use withDefaultPlaceholder.

Example enhancement:

-    DatePicker: ElDatePicker,
+    DatePicker: (props, { attrs, slots }) => {
+      // Handle datetimerange type
+      if (props?.type === 'datetimerange' && typeof props.name === 'string') {
+        // Convert string name to array for datetimerange
+        attrs = { ...attrs, name: [props.name + '_start', props.name + '_end'] };
+      }
+      return h(ElDatePicker, { ...props, ...attrs }, slots);
+    },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between dbcb713 and 3c4d66d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • apps/web-ele/src/adapter/component/index.ts (2 hunks)
  • package.json (1 hunks)
  • packages/@core/base/shared/package.json (0 hunks)
  • pnpm-workspace.yaml (6 hunks)
💤 Files with no reviewable changes (1)
  • packages/@core/base/shared/package.json
✅ Files skipped from review due to trivial changes (1)
  • package.json
🔇 Additional comments (6)
apps/web-ele/src/adapter/component/index.ts (3)

18-18: LGTM: ElDatePicker import added correctly

The ElDatePicker component is properly imported from element-plus, which is necessary for the component registration.


Line range hint 44-58: LGTM: DatePicker type properly added to ComponentType

The DatePicker component type is correctly added to the ComponentType union, ensuring proper type checking when using the datepicker in forms.


Line range hint 89-90: Verify component registration in related files

The DatePicker is now registered in the global shared state. Let's verify if there are any other files that need updates to properly use this component.

✅ Verification successful

Component registration appears to be self-contained

The component registration in the global shared state is part of the Element Plus UI framework adapter initialization. Since:

  1. No direct DatePicker configurations were found in the form adapters
  2. The component registration follows the same pattern across different UI framework adapters (web-ele, web-antd, web-naive)
  3. The setComponents call is part of the framework's initialization process

This suggests the registration is a standard setup step that doesn't require additional file updates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for DatePicker usage in form configurations and related files
echo "Searching for DatePicker usage patterns..."
rg -l "type.*['\"]DatePicker['\"]" --type ts

echo "Checking for potential form adapter configurations..."
rg -l "FormComponentType.*DatePicker" --type ts

echo "Looking for existing datepicker implementations that might need updates..."
rg -l "ElDatePicker" --type vue

Length of output: 531


Script:

#!/bin/bash
# Search for DatePicker usage with broader patterns and file types
echo "Searching for DatePicker usage patterns..."
rg -l "DatePicker" --type-add 'frontend:*.{ts,tsx,js,jsx,vue}'  --type frontend

echo "Checking component registration patterns..."
rg -l "setComponents.*components" --type-add 'frontend:*.{ts,tsx,js,jsx,vue}' --type frontend

echo "Looking for form configuration files..."
fd -e ts -e js "form" --type f

Length of output: 1728


Script:

#!/bin/bash
# Check the content of form adapter files to understand DatePicker integration
echo "Checking form adapter implementations..."
rg -A 5 "DatePicker" apps/web-ele/src/adapter/form.ts

echo "Checking other UI framework adapters for DatePicker..."
rg -A 5 "DatePicker" apps/web-antd/src/adapter/form.ts apps/web-naive/src/adapter/form.ts

echo "Examining component registration pattern in web-ele..."
rg -A 10 "setComponents" apps/web-ele/src/adapter/component/index.ts

Length of output: 828

pnpm-workspace.yaml (3)

18-22: Verify tooling updates compatibility.

Several development tools have received updates:

  • Build tools (turbo, rollup)
  • Linters (eslint plugins, stylelint)
  • Testing frameworks (playwright)
  • Code formatting (prettier)

While these are mostly patch version updates, please ensure your CI/CD pipeline passes with these changes.

Also applies to: 26-26, 33-34, 46-46, 51-52, 87-87, 90-90, 92-93, 98-98, 109-109, 124-124, 129-129, 132-132, 135-135, 138-138, 141-141, 150-150, 155-155


39-39: Verify Vue ecosystem updates compatibility.

Several Vue-related packages have been updated:

  • @tanstack/vue-query: ^5.60.5 → ^5.61.3
  • @vueuse/core: ^11.2.0 → ^11.3.0
  • @vueuse/integrations: ^11.2.0 → ^11.3.0

While these are minor version bumps, please ensure they don't introduce any breaking changes that could affect the datepicker component.

Also applies to: 60-61

✅ Verification successful

Vue ecosystem updates are safe to proceed

Based on the changelogs:

  • @tanstack/vue-query v5.61.x changes are primarily bug fixes and improvements to other packages in the monorepo, with no breaking changes affecting Vue Query
  • @vueuse/core and @vueuse/integrations v11.3.0 includes only new features and bug fixes, with no breaking changes

The updates are safe and won't impact the datepicker component functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in the updated Vue packages

# Check changelogs for breaking changes
gh api repos/TanStack/query/releases | jq -r '.[] | select(.tag_name | contains("v5.61")) | .body'
gh api repos/vueuse/vueuse/releases | jq -r '.[] | select(.tag_name | contains("v11.3")) | .body'

Length of output: 5130


175-176: Review UI component library version jumps.

Significant version updates in UI libraries:

  • vxe-pc-ui: ^4.2.55 → ^4.3.4
  • vxe-table: ^4.8.14 → ^4.9.5

These updates include minor version bumps which could potentially affect component behavior.

@anncwb anncwb merged commit 3587ec5 into main Nov 24, 2024
8 of 10 checks passed
@anncwb anncwb deleted the bugfix/4936 branch November 24, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: web-ele的适配文件中少注册了datapicker组件
1 participant