RippleOSI / Ripple-Showcase-Stack-Project

repo for Showcase Stack (PulseTile+ QEWDjs + EtherCIS) - Project issues
Apache License 2.0
0 stars 0 forks source link

Images - error viewing #2

Open BogdanScherban opened 5 years ago

BogdanScherban commented 5 years ago

Error occurs when Images page is loaded.

images

BogdanScherban commented 5 years ago

@tony-shannon

Tony, I have updates about this issue.

1) I fixed the problem with images list not loading images

2) I found a reason why the message "Something is wrong" occurs images_2

Program tries to find token inside response, but token is absent there: images_3


So, I have a question:

We have two ways to prevent error "Something is wrong" in Images: 1) remove token check from code (I can do this); 2) add token to response at the server path (as I can't do this, we should ask Rob about it).

What should we do?

tony-shannon commented 5 years ago

thanks @BogdanScherban

Do you understand why "Program tries to find token inside response", but token is absent there:?

I think this one will have to wait so that Rob has time for it, can be paused for now

BogdanScherban commented 5 years ago

@tony-shannon

Yes, of course. This is a condition in plugin code (row 27): https://github.com/PulseTile-Plugins/PulseTile-React-Carbon-Plugins/blob/master/Images/ducks/fetch-all-series.duck.js

It calls the function (row 163), which works with response array and tries to find token: https://github.com/PulseTile/PulseTile-React-Core/blob/develop/src/utils/plugin-helpers.utils.js

This function is used in a lot of plugins. But in Images it works incorrectly because response in function initial data isn't a array.

If we remove this checking, Images will work correctly.

BogdanScherban commented 5 years ago

Suggest to remove token checking from Images-plugin.

Because we can see on showcase.ripple.foundation, that response structure is the same in comparison with dev.ripple.foundation. It means, that showcase.ripple.foundation doesn't try to search a token when display the image:

images____1