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

Improve handling of undefined visitor data for Somaliland region #3054

Closed
eremannisto opened this issue Nov 17, 2024 · 4 comments
Closed

Improve handling of undefined visitor data for Somaliland region #3054

eremannisto opened this issue Nov 17, 2024 · 4 comments
Labels
enhancement New feature or request fixed in dev Fixed in the dev branch

Comments

@eremannisto
Copy link
Contributor

eremannisto commented Nov 17, 2024

Describe the Bug

Description:
When viewing the visitor map, hovering over the Somaliland region displays "undefined: X visitors" which appears to be a raw JavaScript undefined value being rendered. While Somaliland's status as an unrecognized state may explain the lack of data, the current display looks like a technical error rather than an intentional handling of this edge case.

Suggested Solution:
Replace the "undefined" text with a more user-friendly message such as:

  • "Unknown region: X visitors"
  • "Unrecognized region: X visitors"
  • "No data available: X visitors"

This would make it clearer that the lack of data is handled intentionally rather than showing what appears to be a JavaScript error to end users.

map

Database

PostgreSQL

Relevant log output

No response

Which Umami version are you using? (if relevant)

v2.13.2

Which browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

Docker

@mikecao mikecao added the enhancement New feature or request label Nov 18, 2024
@mikecao
Copy link
Collaborator

mikecao commented Nov 18, 2024

That makes sense. A PR would be welcome.

@eremannisto
Copy link
Contributor Author

eremannisto commented Nov 19, 2024

We should handle this with i18n in mind. We could either add new translations for all languages, or simply reuse the existing label.unknown from the locale JSON. With label.unknown it would be simpler since we wouldn't need to create new translations. I already have the necessary code changes ready for this.

Example image:

image

@eremannisto
Copy link
Contributor Author

PR made 3060

@mikecao mikecao added the fixed in dev Fixed in the dev branch label Nov 20, 2024
@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2024

Fixed in v2.14.0.

@mikecao mikecao closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in dev Fixed in the dev branch
Projects
None yet
Development

No branches or pull requests

2 participants