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

FeaturePanel: Arrow for direction tag #592

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

Dlurak
Copy link
Collaborator

@Dlurak Dlurak commented Sep 24, 2024

Description

Add a arrow for the direction tag. This fixes #590

image

### examples:

Copy link

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Sep 24, 2024 3:29pm

Copy link

sentry-io bot commented Sep 24, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/components/FeaturePanel/Properties/renderValue.tsx

Function Unhandled Issue
renderValue TypeError: t is undefined /[[...all]]
Event Count: 97 Affected Users: 6
renderValue TypeError: undefined is not an object (evaluating 't.match') ...
Event Count: 84 Affected Users: 4
renderValue TypeError: Cannot read properties of undefined (reading 'match') ...
Event Count: 11 Affected Users: 1
renderValue TypeError: Cannot read properties of undefined (reading 'replace') ...
Event Count: 10 Affected Users: 1
renderValue TypeError: undefined is not an object (evaluating 't.replace') ...
Event Count: 3 Affected Users: 1

Did you find this useful? React with a 👍 or 👎

@Dlurak Dlurak merged commit 8227c24 into zbycz:master Sep 24, 2024
2 checks passed
case 'W':
return 270;
default:
throw new Error('Invalid');
Copy link
Owner

Choose a reason for hiding this comment

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

I would suggest returning a null here, because value in OSM can be very creative. Let's don't stop entire application, but just hide the direction indicator.

In general - exceptions are meant for app states we really don't expect. User input usually shouldn't throw an exception.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Often there are directions that aren't cardinal e.g. on road signs backward and forward is used.
This will throw here and will be catched in DirectionValue a few lines lower.
In my opinion this is the easiest way to cancel the arrow rendering.

Copy link
Owner

Choose a reason for hiding this comment

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

Please, can you add examples of features with direction in the PR description? also with the range? thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Understandable direction tag
2 participants