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

Display error messages #70

Merged
merged 3 commits into from
Oct 23, 2020
Merged

Display error messages #70

merged 3 commits into from
Oct 23, 2020

Conversation

petro97
Copy link
Contributor

@petro97 petro97 commented Oct 21, 2020

Description:

Linting:

  • No linting errors

Tests:

  • E2E tests
  • Manual tests
  • Accessibility tests (no new react-axe errors in console)

Documentation:

  • Requires documentation updates
  • Requires Storybook component updates

@petro97 petro97 requested a review from shaunmaharaj October 21, 2020 13:04
@petro97 petro97 self-assigned this Oct 21, 2020
@petro97 petro97 changed the title [WIP] Display error messages Display error messages Oct 22, 2020
return (
<div className="notification">
{!!error && error.length > 0 && error.map((el: IErrorMessage) => (
<div className="notification__body" key={`${el.detail}_${Math.random().toString(36)}`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I look forward to when we can get error message keys from the API to populate this 😄

src/App.tsx Outdated Show resolved Hide resolved
@@ -34,6 +36,7 @@ export const Promotion: React.FC<PromotionProps> = (props) => {
})
.catch(error => {
console.error(error);
addError(error.errors);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to call setErrors if we're displaying our own toast?

Copy link
Contributor Author

@petro97 petro97 Oct 23, 2020

Choose a reason for hiding this comment

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

@shaunmaharaj,
I think we should display only our own toast. I'll update it.
That's actually what I told before. Should we use the state of a component or our own toast for displaying messages (the same is in address form, login form, and registration form)?

import { getCustomer, getAddresses, getAllOrders, loadCategoryTree, getCartItems } from './service';
import * as service from './service';
import {
getCustomer,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for cleaning this up!

Copy link
Contributor

@shaunmaharaj shaunmaharaj left a comment

Choose a reason for hiding this comment

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

Thank you for this Petro! I left a couple comments to clarify. We can merge once resolved

@shaunmaharaj shaunmaharaj merged commit 4ec0315 into master Oct 23, 2020
@shaunmaharaj shaunmaharaj deleted the MT-4299-error-message branch October 23, 2020 12:32
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.

2 participants