Financial-Times / n-syndication

clientside library for making content on FT.com syndicatable
0 stars 2 forks source link

Fail more gracefully #25

Open leggsimon opened 6 years ago

leggsimon commented 6 years ago

Currently if we have a problem receiving user data from next-syndication-api we can't properly render the syndication icons because we don't know what they should be for the user.

~In some cases the old, smaller icons are rendered which link to http://ftsyndication.com, the now deprecated syndication platform~ (These were completely removed in #28 ) screenshot 2018-06-06 11 34 22

We should probably render something like we do when syndication is in maintenance mode where they all are red crosses and say there's been an issue or something like that.

Example screenshot 2018-06-06 11 40 44

leggsimon commented 6 years ago

In order to show a red cross and a "something’s gone wrong" modal I think we should replicate what we do with maintenance mode.

getUserStatus()’s catch should return a custom object like this https://github.com/Financial-Times/n-syndication/blob/22bb8925743e903397b75e336fd56119c5f66f7c/src/js/get-user-status.js#L25-L30

And then replicate this https://github.com/Financial-Times/n-syndication/blob/22bb8925743e903397b75e336fd56119c5f66f7c/src/js/data-store.js#L42-L57 and https://github.com/Financial-Times/n-syndication/blob/22bb8925743e903397b75e336fd56119c5f66f7c/src/js/modal-download.js#L171-L176

with a new custom message defined in config.js