Open BogdanScherban opened 5 years ago
@tony-shannon
Tony, I have updates about this issue.
1) I fixed the problem with images list not loading
2) I found a reason why the message "Something is wrong" occurs
Program tries to find token inside response, but token is absent there:
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?
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
@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.
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:
Error occurs when Images page is loaded.