-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add loading state and error message to Deployment map #705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@willemarcel I think this is looking good, but I'm seeing the error message on every campaign that doesn't have flight data. If I understand the code correctly, this should only appear if there is flight data, but it errors - is that correct? Should there be a geojson?.features?.length
check combined with the geojsonError
check?
EDIT
I attempted this, and then intentionally malformed the geojson for a campaign, but now I simply don't see the deployment map and there's no error message:
I also thought the loader should come first.
Actually, the only error that can happen is that we don't have a geojson for the campaign. Should we modify the text to state more clearly that it wasn't an error, but the map data for that campaign is not available? When running locally, you need to enable throttling in your network console to see the loading map component. |
@willemarcel looking again at this, I understand my confusion and think there needs to be some slight refactoring. The Instead, I would suggest the following:
|
I like
What we can do instead is check the status code of the request. If it's 404, the geojson file of that campaign was not found. |
Refactor deployments and events section
Resolves #703
@LanesGood feel free to modify the style or text.