@W-18910688 - refactored error utils#2781
Merged
kzheng-sfdc merged 3 commits intofeature/chakra-ui-upgrade-v3from Jul 10, 2025
Merged
@W-18910688 - refactored error utils#2781kzheng-sfdc merged 3 commits intofeature/chakra-ui-upgrade-v3from
kzheng-sfdc merged 3 commits intofeature/chakra-ui-upgrade-v3from
Conversation
Collaborator
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
kzheng-sfdc
commented
Jul 10, 2025
| const showError = !isProductASet && !isProductABundle && !hasValidSelection | ||
| const scrollToError = showError && scrollErrorIntoView | ||
| const hasError = !isProductASet && !isProductABundle && !hasValidSelection | ||
| const scrollToError = hasError && scrollErrorIntoView |
Contributor
Author
There was a problem hiding this comment.
rename the local scoped "showError" to "hasError" to avoid confusion.
alexvuong
reviewed
Jul 10, 2025
| * @returns {Function} showError function | ||
| */ | ||
| export const useCartErrorHandler = () => { | ||
| export const useErrorHandler = () => { |
Contributor
There was a problem hiding this comment.
This should be in hooks folder. Utils is for generic function that is not React related.
kevinxh
approved these changes
Jul 10, 2025
Contributor
kevinxh
left a comment
There was a problem hiding this comment.
thanks for shipping small diffs to make the codebase better!
alexvuong
approved these changes
Jul 10, 2025
alexvuong
pushed a commit
that referenced
this pull request
Jul 16, 2025
…0688/refactored-error-utils @W-18910688 - refactored error utils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Types of Changes
Changes
Renamed generic cart/utils/cart-utils -> utils/error-utils, then consolidated 6 duplicate code occurrences to use the util.
How to Test-Drive This PR
Run all jest tests.
Generate a new app and verify all the modified pages are working as expected.
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization