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: fix known issues with the form #4696

Merged
merged 3 commits into from
Oct 20, 2024
Merged

fix: fix known issues with the form #4696

merged 3 commits into from
Oct 20, 2024

Conversation

anncwb
Copy link
Collaborator

@anncwb anncwb commented Oct 20, 2024

Description

fixed #4498
fixed #4681

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

  • New Features

    • Enhanced validation for the confirmPassword field with clearer error messaging.
    • Simplified rendering of privacy policy and terms links for improved readability.
  • Bug Fixes

    • Improved error handling for empty password confirmation.
  • Style

    • Updated styling for links across various components to a unified vben-link class.
  • Documentation

    • No changes to documentation were made.
  • Chores

    • Streamlined code structure and rendering logic in multiple components for better maintainability.

@anncwb anncwb added the bug Something isn't working label Oct 20, 2024
@anncwb anncwb requested review from vince292007 and a team as code owners October 20, 2024 14:24
Copy link

changeset-bot bot commented Oct 20, 2024

⚠️ No Changeset found

Latest commit: ffbff6c

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 Oct 20, 2024

Caution

Review failed

The head commit changed during the review from c0694a3 to ffbff6c.

Walkthrough

The changes in this pull request primarily focus on enhancing the validation rules and rendering logic within various register.vue components across different applications. The confirmPassword field's validation now includes a specific required error message, improving error handling. Additionally, the rendering of links related to privacy policies and terms has been simplified for better readability. Styling adjustments have been made to align with a new design system, particularly through the introduction of the .vben-link class. These updates improve the overall user experience and maintain consistency across components.

Changes

File Path Change Summary
apps/web-antd/src/views/_core/authentication/register.vue Updated validation rules for confirmPassword to include a required error message. Simplified rendering of privacy policy and terms link. Modified link class for styling.
apps/web-ele/src/views/_core/authentication/register.vue Similar updates to validation rules for confirmPassword, including required error messages and simplified link rendering for privacy policy and terms. Changed link class for styling.
apps/web-naive/src/views/_core/authentication/register.vue Changes include updated validation rules for confirmPassword with required error messages and simplified rendering for links. Link class modified for styling purposes.
packages/@core/base/design/src/css/global.css Introduced a new CSS class .vben-link for link styling, including text color and hover effects.
packages/@core/ui-kit/form-ui/src/form-render/expandable.ts Adjusted useExpandable function to improve state management for visible form items. Added logic to reset isCalculated state when collapse button visibility changes.
packages/@core/ui-kit/form-ui/src/form-render/form-field.vue Enhanced type definitions for formFieldProps and updated function signatures to improve type safety. Minor adjustment to class binding for FormLabel.
packages/@core/ui-kit/form-ui/src/form-render/form-label.vue Modified class binding for FormLabel by removing the mb-1 class, altering layout slightly.
packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue Simplified class binding for the main <div> element and retained click event handler for toggling collapsed state.
packages/effects/common-ui/src/ui/about/about.vue Updated link rendering to use the new .vben-link class for styling.
packages/effects/common-ui/src/ui/authentication/login.vue Changed class attributes for "Forget Password" and "Create Account" links to .vben-link, aligning with new styling.
packages/effects/common-ui/src/ui/authentication/register.vue Updated class for the link triggering goToLogin function to .vben-link, focusing on styling changes without altering functionality.
playground/src/router/routes/modules/examples.ts Removed and re-added three route definitions (ModalExample, DrawerExample, EllipsisExample) under the Examples route with identical properties.
playground/src/views/_core/authentication/register.vue Similar updates to validation rules for confirmPassword, including required error messages and simplified rendering for checkbox links. General structure remains intact.

Possibly related PRs

Suggested reviewers

  • vince292007

🐰 In the meadow where bunnies play,
New links and rules come out to stay.
With colors bright and messages clear,
Our forms are ready, have no fear!
So hop along, let’s celebrate,
A joyful change, it’s truly great! 🌼


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 (16)
packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue (1)

Line range hint 20-20: Consider removing commented-out code

There's a commented-out span element in the template. If this code is no longer needed, it would be best to remove it for code cleanliness.

Consider removing this line:

-      <!-- <span>{{ isExpanded ? '收起' : '展开' }}</span> -->
packages/@core/ui-kit/form-ui/src/form-render/expandable.ts (1)

Line range hint 1-108: Consider adding comments and improving type safety

The changes made improve the functionality of the useExpandable function. However, to enhance maintainability and type safety, consider the following suggestions:

  1. Add comments explaining the purpose of the isCalculated ref and how it's used throughout the function.
  2. Consider using more specific types for the rowMapping ref instead of Record<number, number>. For example, you could define a custom type that better represents the structure of the row mapping.
  3. The calculateRowMapping function is quite complex. Consider breaking it down into smaller, more focused functions to improve readability and maintainability.

Would you like assistance in implementing any of these suggestions?

apps/web-naive/src/views/_core/authentication/register.vue (1)

70-73: Improved styling consistency and code readability.

The changes to the policy agreement checkbox rendering are beneficial:

  1. The use of the 'vben-link' class suggests a move towards a more standardized styling approach, improving consistency across the application.
  2. The simplification of the privacy policy and terms text rendering improves code readability.

These changes align with best practices for maintainability and consistency in UI components.

Consider separating the privacy policy and terms text into two distinct translated strings for better flexibility in internationalization. This would allow for different word orders in various languages. For example:

`${$t('authentication.privacyPolicy')} ${$t('authentication.and')} ${$t('authentication.terms')}`

This approach would require adding a new translation key for 'and', but it would provide more flexibility for translations in different languages.

apps/web-antd/src/views/_core/authentication/register.vue (1)

70-70: Consistent styling update for link

The update to use the vben-link class aligns with the new design system and improves consistency across components. This change simplifies the code and centralizes styling definitions.

Consider adding a comment explaining the vben-link class's purpose for better maintainability:

class="vben-link ml-1" <!-- vben-link applies cursor-pointer, text-primary, and hover styles -->
apps/web-ele/src/views/_core/authentication/register.vue (3)

Line range hint 49-53: Improved validation for confirmPassword field.

The updated validation rule enhances error handling by providing a specific required error message and a minimum length check. This change improves the user experience by offering more precise feedback.

Consider extracting the error message to a constant or a separate localization file for better maintainability:

const PASSWORD_TIP = $t('authentication.passwordTip');

// Then use it in the validation rule
z.string({ required_error: PASSWORD_TIP })
  .min(1, { message: PASSWORD_TIP })

70-73: Improved styling and readability for policy agreement link.

The updated class name 'vben-link ml-1' aligns the styling with what appears to be a new design system. The simplified rendering of the link content improves code readability.

Consider adding an aria-label to the link for better accessibility:

h(
  'a',
  {
    class: 'vben-link ml-1',
    href: '',
    'aria-label': $t('authentication.policyLinkAriaLabel'),
  },
  `${$t('authentication.privacyPolicy')} & ${$t('authentication.terms')}`,
)

Also, ensure that the 'href' attribute is populated with the correct URL for the privacy policy and terms page.


Missing Unit Tests for Register Component

The register.vue component in apps/web-ele/src/views/_core/authentication/register.vue does not have corresponding unit tests to cover the new validation logic. Adding unit tests will ensure that the validation changes work as expected and help prevent future regressions.

  • Implement unit tests for register.vue to cover the updated validation rules and form behaviors.
🔗 Analysis chain

Line range hint 1-95: Overall improvements to form validation and styling.

The changes in this file successfully address the PR objectives by enhancing form validation and improving styling consistency. The updates to the confirmPassword validation and the policy agreement link rendering contribute to a better user experience.

To ensure these changes are effective and don't introduce any regressions:

  1. Verify that the new validation messages are displayed correctly:

  2. Check for consistent usage of the 'vben-link' class across the project:

  3. Ensure that unit tests for this component are updated to cover the new validation logic:

Please review the results of these checks and update tests if necessary.


Please run the following corrected scripts to gather the necessary information:

[/run_scripts]

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of authentication.passwordTip translation key
rg "authentication.passwordTip" --type vue

Length of output: 70


Script:

#!/bin/bash
# Search for usage of 'vben-link' class
rg "class.*vben-link" --type vue

Length of output: 62


Script:

#!/bin/bash
# Search for test files related to register component
fd "register.spec" --type file

Length of output: 30


Script:

#!/bin/bash
# Search for usage of authentication.passwordTip translation key in .vue files
rg "authentication.passwordTip" -g "*.vue"

Length of output: 2288


Script:

#!/bin/bash
# Search for usage of 'vben-link' class in .vue files
rg "class.*vben-link" -g "*.vue"

Length of output: 1150


Script:

#!/bin/bash
# Search for test files related to the register component with common test file extensions
fd "register.spec" -e js -e ts -e jsx -e tsx

Length of output: 44

playground/src/views/_core/authentication/register.vue (2)

49-49: Improved validation rule for confirmPassword

The addition of a specific required error message enhances the user experience by providing clearer feedback. This change is consistent with best practices in form validation.

Consider adding a comment explaining the purpose of this specific validation rule to improve code maintainability.


70-70: Simplified link styling

The use of the vben-link class aligns with the new styling approach and improves consistency across components.

Remove the trailing space in the class string:

-                class: 'vben-link ml-1 ',
+                class: 'vben-link ml-1',
packages/@core/base/design/src/css/global.css (1)

145-147: Approve the addition of .vben-link class with a minor suggestion.

The new .vben-link class is a great addition that provides consistent styling for links across the project. It aligns well with the design system approach by using color variables and ensures visual interactivity.

To further improve accessibility, consider adding a focus state to the class:

 .vben-link {
-  @apply text-primary hover:text-primary-hover active:text-primary-active cursor-pointer;
+  @apply text-primary hover:text-primary-hover active:text-primary-active focus:outline-none focus:ring-2 focus:ring-primary-focus cursor-pointer;
 }

This addition will enhance keyboard navigation and meet WCAG 2.1 success criterion 2.4.7 (Focus Visible).

packages/effects/common-ui/src/ui/authentication/login.vue (2)

172-172: Approve consistent styling approach.

The class attribute change for the "Create Account" link mirrors the earlier modification, demonstrating a consistent approach to link styling throughout the component. This change enhances the overall maintainability of the codebase.

Consider documenting the vben-link class in your style guide or component library to ensure consistent usage across the project.


Line range hint 1-180: Summary of changes and suggestion for broader refactoring.

The changes in this file focus on simplifying and standardizing the styling of links by introducing the vben-link class. This approach improves code readability and maintainability without altering the component's functionality.

Consider applying this styling approach consistently across other components in the project. This could be achieved through a systematic refactoring process:

  1. Identify all instances of link styling similar to the old pattern.
  2. Replace them with the new vben-link class.
  3. Update any related documentation or style guides.

Would you like assistance in creating a script to identify potential refactoring targets across the project?

packages/effects/common-ui/src/ui/about/about.vue (1)

Line range hint 1-174: Summary: Styling updates improve consistency

The changes in this file are part of a broader styling update across the project. The introduction of the 'vben-link' class for links improves consistency in the UI. These changes are minimal and do not affect the logic or functionality of the component.

Consider documenting the new 'vben-link' class in your project's style guide or component library documentation to ensure consistent usage across the project.

playground/src/router/routes/modules/examples.ts (1)

204-230: LGTM! Consider minor adjustment for consistency.

The new routes for ModalExample, DrawerExample, and EllipsisExample are well-structured and consistent with the existing routes in the file. They follow good practices such as:

  • Using dynamic imports for components
  • Providing localized titles with the $t function
  • Including appropriate icons in the meta information

For complete consistency with other multi-route sections (like FormExample and VxeTableExample), consider wrapping these new routes in a parent route object with its own meta information. This would allow for better organization if more related routes are added in the future. Here's an example structure:

{
  name: 'MiscExamples',
  path: '/examples/misc',
  meta: {
    icon: 'some-icon',
    title: $t('examples.misc.title'),
  },
  children: [
    // ModalExample, DrawerExample, and EllipsisExample routes here
  ],
},

This is a minor suggestion and not necessary for the current implementation to work correctly.

packages/@core/ui-kit/form-ui/src/form-render/form-field.vue (2)

196-196: LGTM: Updated formFieldProps type

The change from Record<string, any> to Recordable<any> for formFieldProps is consistent with the new import and likely part of a type standardization effort.

Consider using a more specific type than any if possible, to improve type safety. For example, if you know the shape of the props, you could use an interface or type alias instead.


Line range hint 200-221: LGTM: Updated fieldBindEvent function signature and inner types

The change from Record<string, any> to Recordable<any> for the slotProps parameter is consistent with previous changes. The same update for the e parameter in the onChange handler is also appropriate.

Consider using more specific types for slotProps and the onChange event object if their structures are known. This could improve type safety and developer experience.

Also applies to: 227-227

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 860fc15 and 074067e.

📒 Files selected for processing (13)
  • apps/web-antd/src/views/_core/authentication/register.vue (2 hunks)
  • apps/web-ele/src/views/_core/authentication/register.vue (2 hunks)
  • apps/web-naive/src/views/_core/authentication/register.vue (2 hunks)
  • packages/@core/base/design/src/css/global.css (1 hunks)
  • packages/@core/ui-kit/form-ui/src/form-render/expandable.ts (2 hunks)
  • packages/@core/ui-kit/form-ui/src/form-render/form-field.vue (5 hunks)
  • packages/@core/ui-kit/form-ui/src/form-render/form-label.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue (1 hunks)
  • packages/effects/common-ui/src/ui/about/about.vue (2 hunks)
  • packages/effects/common-ui/src/ui/authentication/login.vue (2 hunks)
  • packages/effects/common-ui/src/ui/authentication/register.vue (1 hunks)
  • playground/src/router/routes/modules/examples.ts (1 hunks)
  • playground/src/views/_core/authentication/register.vue (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/effects/common-ui/src/ui/authentication/register.vue
🧰 Additional context used
🔇 Additional comments (19)
packages/@core/ui-kit/form-ui/src/form-render/form-label.vue (1)

15-15: Confirm the intention behind removing the bottom margin.

The 'mb-1' class has been removed from the FormLabel component, which eliminates the bottom margin of the label. While this could be part of the styling adjustments mentioned in the PR summary, it's important to ensure this change doesn't negatively impact the spacing between labels and form fields.

Could you please clarify the reasoning behind this change? Is it part of a broader update to the spacing system?

It would be beneficial to verify the visual impact of this change across different form layouts to ensure consistent and appropriate spacing. Consider running the following script to find all usages of this component:

This will help identify all instances where this component is used, allowing for a comprehensive review of the spacing impact.

packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue (3)

Line range hint 1-33: Component logic looks good

The overall component logic is well-implemented:

  • The use of defineModel for the collapsed state is a modern and efficient approach in Vue 3.
  • The click handler effectively toggles the collapsed state.
  • The slot usage provides flexibility for the parent component to control the content based on the expanded state.
  • The transition effect for the arrow rotation is smoothly implemented.

Good job on creating a reusable and flexible component!


Line range hint 1-33: Overall assessment: Good improvements with minor suggestions

The changes made to this component, particularly the adoption of the 'vben-link' class, align well with the project's updated styling approach. The component logic is well-implemented, providing good flexibility through slot usage and efficient state management.

A few minor suggestions:

  1. Ensure that the 'vben-link' class provides all necessary styles previously included in the removed classes.
  2. Consider removing the commented-out code for improved cleanliness.

Great job on maintaining and improving this component!


15-15: Class binding updated to use 'vben-link'

The class binding has been simplified and now uses the 'vben-link' class. This change aligns with the project's recent updates to link classes across various components, as mentioned in the AI summary.

However, we should verify if this change maintains all the necessary styles for the component.

Let's check if the 'vben-link' class is defined and includes the necessary styles:

packages/@core/ui-kit/form-ui/src/form-render/expandable.ts (2)

25-25: Approve: Ensure at least one form item is always visible

This change improves the robustness of the keepFormItemIndex computed property. By returning maxItem - 1 || 1, it guarantees that at least one form item will always be visible, even in edge cases where the calculation might result in zero items. This prevents potential issues with an empty form display.


39-39: Approve: Reset calculation state on relevant changes

This addition ensures that the isCalculated state is reset to false whenever the collapse button visibility, active breakpoint, or schema length changes. This is a good practice as it forces a fresh recalculation of the row mapping when any of these critical properties change, ensuring that the form layout always reflects the current state accurately.

apps/web-naive/src/views/_core/authentication/register.vue (1)

49-49: Improved error handling for empty confirm password field.

The updated validation rule now explicitly sets a required error message using z.string({ required_error: ... }). This change enhances the user experience by providing a specific error message when the confirm password field is left empty, while still maintaining the minimum length check.

apps/web-antd/src/views/_core/authentication/register.vue (3)

49-49: Improved error handling for confirmPassword field

The addition of the required_error property enhances the validation by providing a specific error message when the field is empty. This improvement aligns with best practices in form validation and contributes to a better user experience.


73-73: Improved readability for privacy policy and terms link

The use of a template literal to concatenate the privacy policy and terms text improves code readability and maintainability. This change aligns with modern JavaScript best practices and reduces the potential for errors in string concatenation.


Line range hint 49-73: Overall improvements to form validation and styling

The changes in this file effectively address the PR objectives by enhancing form validation, maintaining styling consistency, and improving code readability. The modifications to the confirmPassword field validation, link styling, and text rendering contribute to a better user experience and more maintainable code. These updates align well with modern best practices and the project's design system.

playground/src/views/_core/authentication/register.vue (2)

73-73: Improved content rendering for checkbox

The streamlined approach using a template string enhances code readability while maintaining proper localization. This change simplifies the component and makes it easier to maintain.


Line range hint 1-95: Overall assessment: Improvements to form validation and rendering

The changes in this file enhance the registration form by:

  1. Improving validation rules with more specific error messages.
  2. Aligning styling with the new vben-link class for consistency.
  3. Simplifying content rendering for better readability and maintainability.

These modifications contribute to a better user experience and more maintainable code. The changes are well-aligned with the project's localization strategy and styling approach.

packages/effects/common-ui/src/ui/authentication/login.vue (1)

123-123: Approve styling change and suggest verification.

The simplification of the class attribute for the "Forget Password" link improves code readability and maintainability. The new vben-link class likely encapsulates the previously explicit styling, including hover and active states.

To ensure consistency, please verify the implementation of the vben-link class:

packages/effects/common-ui/src/ui/about/about.vue (2)

117-117: LGTM! Consistent styling applied.

The update of the GitHub link's class to 'vben-link' is consistent with the earlier change in the renderLink function. This ensures uniform styling for all links in the component.


47-47: LGTM! Verify the new link styling.

The change from 'text-primary hover:text-primary-hover' to 'vben-link' aligns with the project-wide styling updates. This should lead to more consistent link styling across the application.

To ensure the new styling is applied correctly, please run the following script to check the definition of the vben-link class:

✅ Verification successful

Verified: New link styling is correctly defined.

The vben-link class is properly defined in packages/@core/base/design/src/css/global.css, ensuring consistent styling across the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the definition of the 'vben-link' class

# Test: Search for the 'vben-link' class definition
rg -g '*.{css,scss,less,styl}' '\.vben-link'

Length of output: 107

packages/@core/ui-kit/form-ui/src/form-render/form-field.vue (4)

2-2: LGTM: Import of Recordable type

The addition of the Recordable type import from '@vben-core/typings' is a good practice. It enhances type safety and clarity in the rest of the file.


235-235: LGTM: Updated createComponentProps function signature

The change from Record<string, any> to Recordable<any> for the slotProps parameter is consistent with previous changes and maintains type consistency throughout the file.


283-283: LGTM: Updated FormLabel class binding

The addition of 'mb-1' class when isVertical is true is a good styling adjustment. It adds a margin-bottom to the FormLabel in vertical layout, which should improve the visual spacing.


Line range hint 1-353: Overall assessment: Approved with minor suggestions

The changes in this file consistently improve type safety by using the Recordable type and make a minor styling adjustment. The modifications are well-aligned with each other and likely part of a larger effort to standardize types across the project.

While the changes are approved, consider the suggestions for using more specific types where possible to further enhance type safety and developer experience.

@anncwb anncwb merged commit d262b7b into main Oct 20, 2024
13 checks passed
@anncwb anncwb deleted the bugfix/4498 branch October 20, 2024 14:34
GavinLucky pushed a commit to GavinLucky/vue-vben-admin that referenced this pull request Oct 23, 2024
* fix: fix known issues with the form

* chore: typo

* chore: typo
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: 表单的label没有居中对齐 Bug: Form组件的展开收起重置窗口后不起作用
1 participant