-
Notifications
You must be signed in to change notification settings - Fork 0
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
Convert class based to functional components #100
Convert class based to functional components #100
Conversation
@Vismayak could you take a first pass review of this PR? Since your keycloak PR might need this. Thank you so much! |
@Rashmil-1999 I get an error when I first go the DFR3Viewer, then to any other Viewer(Data, Hazard or Semantic Viewer) and back to the DFR3FViewer. This is the console error messages I am getting. Are you also getting the same error? |
So it seems like a side effect of using async await. if you wait like 5 seconds before jumping to other component, everything works fine otherwise it basically mutates a state even though the component was unmounted... classbased didn't cause such issues but using hooks you've got to be more careful it seems :( anyways good catch! let me see how to fix this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for putting so much effort in refactoring this to hooks!
All the functionality works, just some minor comments.
Do we have task for refactoring SemanticViewer, Profile, and hazardViewer? If not could you help create separate task so in the future we could distribute the work looking at your example.
@@ -0,0 +1,196 @@ | |||
import React from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do I test this page? This is */playbook url right?
@Rashmil-1999 I briefly checked the code but I am not very good at react. So if you let me know what to checked in terms of functionality, I can perform that. I have deployed this to dev and checked some viewers and it looks okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
A few thing I noticed:
- Search seems weird. E.g. When search an item doesn't exist; I clear the search box then search again, the search action is actually never fired leaving the page stuck on empty results.
- 3D fragility is not searchable and not showing up properly. e.g. search 6303c9e2cef2881193f226bd
- certain fragility breaks. e.g. 6489ba3355647c1f4968bbb8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything works well. Approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality of the updated components seems to be working as expected and matches the behavior of the latest on production so I have approved this change, but I have two general comments/questions:
-
There are a lot of warnings/errors about style in the console, should these be addressed at some point or the style/linting updated?
-
When selecting filters (e.g. in the DFR3 viewer), should they stay selected when doing a search? Production clears them out as well when entering text and hitting search so just asking what the better behavior is since I would think filters would stay and it would search the filtered results.
|
This PR converts the Data Viewer and DFR3 Viewer components to Functional components from Class-based.