valhalla-app icon indicating copy to clipboard operation
valhalla-app copied to clipboard

Adding Warnings (Height-Graph/ Draw Text)

Open hs7898753 opened this issue 1 year ago • 13 comments

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

hs7898753 avatar Apr 01 '23 06:04 hs7898753

Can I work on this issue?

Sheikh-JamirAlam avatar Apr 01 '23 13:04 Sheikh-JamirAlam

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

hs7898753 avatar Apr 01 '23 13:04 hs7898753

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

nilsnolde avatar Apr 01 '23 16:04 nilsnolde

@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.

Sheikh-JamirAlam avatar Apr 02 '23 16:04 Sheikh-JamirAlam

I think @nilsnolde can help you in better way.

hs7898753 avatar Apr 02 '23 17:04 hs7898753

@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

Sheikh-JamirAlam avatar Apr 02 '23 17:04 Sheikh-JamirAlam

Yah! This looks good👏

hs7898753 avatar Apr 02 '23 17:04 hs7898753

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

Sheikh-JamirAlam avatar Apr 03 '23 05:04 Sheikh-JamirAlam

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

hs7898753 avatar Apr 03 '23 05:04 hs7898753

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.

nilsnolde avatar Apr 03 '23 06:04 nilsnolde

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?

Sheikh-JamirAlam avatar Apr 03 '23 16:04 Sheikh-JamirAlam

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?

nilsnolde avatar Apr 03 '23 17:04 nilsnolde

Sure!

Sheikh-JamirAlam avatar Apr 03 '23 17:04 Sheikh-JamirAlam