gis-ops / valhalla-app

This is the demo web app running on https://valhalla.openstreetmap.de
https://valhalla.openstreetmap.de
MIT License
154 stars 87 forks source link

Adding Warnings (Height-Graph/ Draw Text) #166

Open hs7898753 opened 1 year ago

hs7898753 commented 1 year ago

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

Sheikh-JamirAlam commented 1 year ago

Can I work on this issue?

hs7898753 commented 1 year ago

Yah sure. Wait for mentors to assign you the issue.

nilsnolde commented 1 year ago

Sure, please go ahead. Getting rid of errors is always good.

Sheikh-JamirAlam commented 1 year ago

@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 : image

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.

hs7898753 commented 1 year ago

I think @nilsnolde can help you in better way.

Sheikh-JamirAlam commented 1 year ago

@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

hs7898753 commented 1 year ago

Yah! This looks good👏

Sheikh-JamirAlam commented 1 year ago

@hs7898753 Can you tell me what's the function of this method in line 640. Its being called from this line.

hs7898753 commented 1 year ago

I think this is just to update the longitude-latitudes when the edit, drag, remove is triggered

nilsnolde commented 1 year ago

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.

Sheikh-JamirAlam commented 1 year ago

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?

nilsnolde commented 1 year ago

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?

Sheikh-JamirAlam commented 1 year ago

Sure!