Skip to content

[bugfix][xs] Text view when resource is missing fixed #189

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gavram
Copy link
Member

@gavram gavram commented Nov 20, 2020

@EvgeniiaVak Please, can you review this?

This fixes a bug in text view when the resource is missing. In that case, the page which contains a text view can not be loaded.

You can test this with this resource on ODDK https://www.opendata.dk/viborg-kommune/naturfaciliteter-viborg

Thanks

@gavram gavram requested a review from EvgeniiaVak November 20, 2020 10:31
Copy link
Member

@anuveyatsu anuveyatsu left a comment

Choose a reason for hiding this comment

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

LGTM 👍

item.resource.views[index].content = await fetchTextContent(item.resource.path)
}
} catch(error) {
item.resource.views[index].content = 'There is no data for this view type'
Copy link
Contributor

Choose a reason for hiding this comment

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

@gavram Maybe instead of content, sending it as errorMessage or failReason and then displaying it somehow different from a usual text view, so that it would be obvious to the user that this string is not the actual content, but an error warning?

Also, it's not certain here that there is no data, maybe there is data, but there was some other error that prevented from showing / fetching it. Maybe replacing it with something like 'Could not get data for this view'?

Copy link
Member

Choose a reason for hiding this comment

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

@gavram I think saying "Could not get data for this view" is better as @EvgeniiaVak suggested. Could you change the message and we can get this PR merged?

@anuveyatsu
Copy link
Member

@gavram is this going to be merged or can we close it?

@anuveyatsu anuveyatsu self-requested a review January 6, 2021 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants