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

Refactor the getErrorMessage function #190

Merged
merged 22 commits into from Oct 15, 2021

Conversation

borodovisin
Copy link
Contributor

In this PR the repeated function getErrorMessage per component was removed.
Now it is a generic function in the utils.ts file.

The pure function will receive all the needed information to generate and return an error message.

Each component calls the function with specific information, to make a readable message to show to the final user in the UI.

@borodovisin borodovisin requested a review from a team as a code owner October 8, 2021 17:57
@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #190 (8a753e3) into main (b4086ab) will increase coverage by 2.65%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
+ Coverage   88.16%   90.82%   +2.65%     
==========================================
  Files          18       18              
  Lines         355      338      -17     
  Branches      111      100      -11     
==========================================
- Hits          313      307       -6     
+ Misses         42       31      -11     
Impacted Files Coverage Δ
...rc/components/braintree/BraintreePayPalButtons.tsx 100.00% <ø> (ø)
src/components/PayPalMessages.tsx 6.66% <33.33%> (+4.16%) ⬆️
src/components/PayPalButtons.tsx 98.33% <100.00%> (-0.18%) ⬇️
src/components/PayPalMarks.tsx 100.00% <100.00%> (ø)
...onents/hostedFields/PayPalHostedFieldsProvider.tsx 100.00% <100.00%> (ø)
src/components/hostedFields/utils.ts 100.00% <100.00%> (ø)
src/utils.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4086ab...8a753e3. Read the comment docs.

src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
@gregjopa gregjopa merged commit 5871016 into paypal:main Oct 15, 2021
@borodovisin borodovisin deleted the DTPPSDK-388/generateErrorMessage branch October 15, 2021 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants