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

Integrate form validation #96

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Conversation

jordanjones243
Copy link
Contributor

@jordanjones243 jordanjones243 commented Dec 5, 2024

Alaska Airlines Pull Request

Before Submitting this pull request:

  • Link all tickets in this repository related to this PR in the Development section
    note: all pull requests require at least one linked ticket
  • If this PR is Ready For Review, all ticket's linked under Development must have their status changed to Ready For Review as well

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

Integrate a new shared validation package for form components, replacing the existing '@aurodesignsystem/auro-formvalidation' dependency with '@auro-formkit/validation' across various components. This change centralizes form validation logic and improves maintainability.

New Features:

  • Introduce a new shared validation package for form components in the auro-formkit monorepo.

Enhancements:

  • Replace the dependency on '@aurodesignsystem/auro-formvalidation' with the new '@auro-formkit/validation' package across multiple components.

Copy link

sourcery-ai bot commented Dec 5, 2024

Reviewer's Guide by Sourcery

This PR introduces a new shared validation module for form components in the auro-formkit monorepo. The implementation involves migrating from the existing @aurodesignsystem/auro-formvalidation package to a new internal @auro-formkit/validation package, which provides consistent validation logic across all form components.

Class diagram for AuroFormValidation

classDiagram
    class AuroFormValidation {
        +AuroLibraryRuntimeUtils runtimeUtils
        +validateAttributes(elem)
        +validateType(elem)
        +validate(elem, force)
        +getInputElements(elem)
        +getAuroInputs(elem)
        +getErrorMessage(elem)
    }
    class AuroLibraryRuntimeUtils
    AuroFormValidation --> AuroLibraryRuntimeUtils
Loading

File-Level Changes

Change Details Files
Created a new validation package with shared form validation logic
  • Implemented a new AuroFormValidation class with comprehensive validation methods
  • Added support for various input types including email, credit-card, number, and date formats
  • Implemented attribute-based validation (pattern, minLength, maxLength)
  • Added custom event dispatching for validation state changes
packages/validation/src/validation.js
packages/validation/package.json
packages/validation/tsconfig.json
Updated form component dependencies to use the new validation package
  • Removed @aurodesignsystem/auro-formvalidation dependency
  • Added @auro-formkit/validation as a devDependency
components/checkbox/package.json
components/combobox/package.json
components/datepicker/package.json
components/form/package.json
components/input/package.json
components/radio/package.json
components/select/package.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jordanjones243 jordanjones243 force-pushed the jjones/integrateFormValidtion/#44 branch from c73b947 to 0259807 Compare December 5, 2024 21:23
@jordanjones243 jordanjones243 self-assigned this Dec 5, 2024
@jordanjones243 jordanjones243 linked an issue Dec 5, 2024 that may be closed by this pull request
@jordanjones243 jordanjones243 marked this pull request as ready for review December 5, 2024 21:24
@jordanjones243 jordanjones243 requested a review from a team as a code owner December 5, 2024 21:24
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jordanjones243 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider removing the console.log statement from the AuroFormValidation constructor as it appears to be debug code
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

packages/validation/src/validation.js Outdated Show resolved Hide resolved
packages/validation/src/validation.js Outdated Show resolved Hide resolved
packages/validation/src/validation.js Outdated Show resolved Hide resolved
packages/validation/src/validation.js Outdated Show resolved Hide resolved
@jordanjones243 jordanjones243 force-pushed the jjones/integrateFormValidtion/#44 branch from 0259807 to c16aec6 Compare December 5, 2024 21:27
@jordanjones243 jordanjones243 marked this pull request as draft December 5, 2024 21:29
@jordanjones243 jordanjones243 force-pushed the jjones/integrateFormValidtion/#44 branch 2 times, most recently from b452549 to 33dfcbf Compare December 5, 2024 21:45
@jordanjones243 jordanjones243 marked this pull request as ready for review December 5, 2024 21:46
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jordanjones243 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

packages/validation/src/validation.js Outdated Show resolved Hide resolved
packages/validation/src/validation.js Outdated Show resolved Hide resolved
packages/validation/src/validation.js Outdated Show resolved Hide resolved
@jordanjones243 jordanjones243 force-pushed the jjones/integrateFormValidtion/#44 branch 3 times, most recently from 4a51d50 to c3359dc Compare December 5, 2024 23:09
Copy link
Contributor

@sun-mota sun-mota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisfalaska might know better, but I think, since all other components are using form-validation, @auro-formkit/typescript/base.json should be added to dependsOn in build config in turbo.json

components/checkbox/package.json Outdated Show resolved Hide resolved
components/checkbox/src/auro-checkbox-group.js Outdated Show resolved Hide resolved
components/combobox/package.json Outdated Show resolved Hide resolved
components/combobox/src/auro-combobox.js Outdated Show resolved Hide resolved
components/datepicker/package.json Outdated Show resolved Hide resolved
components/radio/src/auro-radio-group.js Outdated Show resolved Hide resolved
components/select/package.json Outdated Show resolved Hide resolved
components/select/src/auro-select.js Outdated Show resolved Hide resolved
packages/form-validation/package.json Outdated Show resolved Hide resolved
packages/form-validation/package.json Outdated Show resolved Hide resolved
@jordanjones243 jordanjones243 force-pushed the jjones/integrateFormValidtion/#44 branch 2 times, most recently from bdb7f7f to 7088ca6 Compare December 9, 2024 20:44
@jordanjones243 jordanjones243 force-pushed the jjones/integrateFormValidtion/#44 branch from 7088ca6 to 7c75a8d Compare December 9, 2024 21:26
Copy link
Contributor

@chrisfalaska chrisfalaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚀

@jordanjones243 jordanjones243 merged commit 63eb5be into main Dec 9, 2024
4 of 6 checks passed
@jordanjones243 jordanjones243 deleted the jjones/integrateFormValidtion/#44 branch December 9, 2024 22:03
@rmenner
Copy link
Contributor

rmenner commented Dec 16, 2024

🎉 This PR is included in version 1.6.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate auro-formvalidation
4 participants