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

EZP-27563: Handle a non responding server and JSON parsing error in Hybrid Platform UI #27

Merged
merged 3 commits into from Jul 11, 2017

Conversation

dpobel
Copy link
Contributor

@dpobel dpobel commented Jul 6, 2017

JIRA: https://jira.ez.no/browse/EZP-27563
Requires ezsystems/hybrid-platform-ui#60 (for links in notification to be readable)

Description

This PR changes <ez-platform-ui-app> so that it correctly handles connection error and JSON parsing error and so that it notifies the user about that.

For JSON parsing error, the notification also carries some details that can be copied and if the server is in dev mode, it contains a link to open the Symfony Profiler (thanks @bdunogier for the suggestion).

Also, while working on that part, I took the time to refactor it as suggested by @bdunogier a while back.

Screencast

Tests

manual test + unit test

const {response, text} = updateInfo;
let debugLink = '';

if ( response.headers.has('X-Debug-Token-Link') ) {

Choose a reason for hiding this comment

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

Very smart!
👍

@dpobel dpobel merged commit 58a4c7b into master Jul 11, 2017
@dpobel dpobel deleted the ezp-27563_network_error branch July 11, 2017 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants