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: added error handler prop to components #277

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

charmi-v
Copy link
Contributor

@charmi-v charmi-v commented Aug 21, 2024

Description

Shared component containing error handlers with console.log

  • Icon
  • Image

Why

  • Added an onError prop to the shared component to handle errors from the parent component when the issue originates within the component.
  • This ensures that errors are communicated effectively to the user, rather than being overlooked, as might happen with a console log.

Issue

#148

Checklist

Please delete options that are not relevant.

  • I have followed the contributing guidelines
  • I have performed a self-review of my own code
  • I have successfully tested my changes locally
  • I have commented my code, particularly in hard-to-understand areas

Copy link
Contributor

@oyo oyo left a comment

Choose a reason for hiding this comment

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

@charmi-v we already have a snackbar management logic in the portal-frontend where the snackbars are managed in Redux:

https://github.com/eclipse-tractusx/portal-frontend/blob/main/src/features/control/notify.ts
https://github.com/eclipse-tractusx/portal-frontend/blob/main/src/services/NotifyService.ts
https://github.com/eclipse-tractusx/portal-frontend/blob/main/src/components/pages/Test/index.notify.tsx

I think a better solution is to pass a error or success handler function to the according shared components as props - this could be NotifyService.(error|success)

@charmi-v
Copy link
Contributor Author

charmi-v commented Aug 22, 2024

@charmi-v we already have a snackbar management logic in the portal-frontend where the snackbars are managed in Redux:

https://github.com/eclipse-tractusx/portal-frontend/blob/main/src/features/control/notify.ts https://github.com/eclipse-tractusx/portal-frontend/blob/main/src/services/NotifyService.ts https://github.com/eclipse-tractusx/portal-frontend/blob/main/src/components/pages/Test/index.notify.tsx

I think a better solution is to pass a error or success handler function to the according shared components as props - this could be NotifyService.(error|success)

@oyo Thank you for highlighting that! I appreciate the context regarding the existing snackbar management in the portal-frontend.

  • Updated the existing components prop that might require on error handler

@charmi-v charmi-v marked this pull request as draft August 29, 2024 06:23
Copy link

@charmi-v charmi-v changed the title fix: add custom hook for error logging fix: added error handler prop to components Aug 29, 2024
@charmi-v charmi-v marked this pull request as ready for review August 29, 2024 07:37
@charmi-v charmi-v requested a review from oyo August 29, 2024 07:37
@MaximilianHauer MaximilianHauer added this to the Release 24.12 milestone Sep 13, 2024
@evegufy evegufy modified the milestones: Release 24.12, Release 25.03 Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: IN PROGRESS
Development

Successfully merging this pull request may close these issues.

4 participants