valhalla-app
valhalla-app copied to clipboard
Adding Warnings (Height-Graph/ Draw Text)
Description
What is the problem you are facing
currently, height-graph feature is displaying an error message when it is used without a selected route. Even some sort of compilation error comes when we use Draw Text.
What is your suggested solution
It should not display an compilation error message. Instead, it should display a warning message to select a route first.
Screenshots
https://user-images.githubusercontent.com/112114562/229269293-0931e323-16eb-4d75-831b-2ba9b796df33.mp4
Can I work on this issue?
Yah sure. Wait for mentors to assign you the issue.
Sure, please go ahead. Getting rid of errors is always good.
@hs7898753 I modifyed the code to make sure we don't see the error when user tries to open the height graph without mentioning the Waypoints. I used the react-semantic-toasts
package to display the warning message, but I am facing this warning in the console and semantic-toast seems buggy.
https://user-images.githubusercontent.com/48979376/229364652-8ea1e4c6-83c1-483c-965a-4975554d07d1.mp4
Console warning :
Do you know any solution to this? Else I can use the Message
element from semantic-ui-react
package but that will not have the animations like this one.
I think @nilsnolde can help you in better way.
@hs7898753 I used react-toastify and this is the output I got. I think it looks cool, do let me know about the warning message. react-toastify
is better than react-semantic-toasts
as it is not being maintained anymore. Do you think we should remove react-semantic-toasts
comepletely and use react-toastify
?
https://user-images.githubusercontent.com/48979376/229368210-06b3ef0a-8cbc-4f4a-a674-03bf0d640904.mp4
Yah! This looks good👏
@hs7898753 Can you tell me what's the function of this method in line 640. Its being called from this line.
I think this is just to update the longitude-latitudes when the edit, drag, remove is triggered
Do you think we should remove react-semantic-toasts comepletely and use react-toastify ?
Jep, I agree, it's better to move to the package that's maintained.
Can you tell me what's the function of this method in line 640. Its being called from this line.
On the right button panel you can draw polygons on the map which should be avoided by the route/isochrone. That's the function updating that polygon.
Jep, I agree, it's better to move to the package that's maintained.
Should I change the welcome toast and use react-toastify? And uninstall the react-semantic-toasts package?
That'd be great!
In case you wanna do that, I'd suggest to raise another PR to do that first, as it's mostly a refactoring. Then we can merge it here and focus on the functional changes. How does that sound?
Sure!