-
Notifications
You must be signed in to change notification settings - Fork 32
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
Datahub: OGC API fixes #872
Conversation
this can happen on app load as there is no ngIf which would bother the animation when opening the form
…sts do not succeed this prevent download list with WFS links from breaking
Affected libs:
|
📷 Screenshots are here! |
} | ||
) | ||
} catch (error) { | ||
return Promise.resolve([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the error can be caught much later, this is already the case for WFS for instance. The errors are caught here:
geonetwork-ui/apps/datahub/src/app/record/record-downloads/record-downloads.component.ts
Line 78 in 3371b67
catchError((e) => { |
What's happening is maybe that
1/ even if an error is caught it is not shown (could be shown using an overlay for instance?)
2/ when an error is caught, it is assumed that the error comes from wfs; ut now, it can come from somewhere else, so the logic has to be adjusted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the problem that the WFS links don't show up anymore when there is an error with the OGC API links, is that both are in downloadLinks
at the error handling where you point to above. Maybe we'll have to split up the two and not do a combineLatest
here!? I'll have a look...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added 62c6e68 to catch the error later, but I still needed some additional error catching and resolving the Promise
to allow displaying the WFS links. Also, converting the Promise
to an Observable
with from
did not prevent the need of resolving the Promise
. Do you think it makes more sense this way?
Indeed, the error messages still need to be adapted as well and eventually displayed to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks better now, we could probably have a common handleError
callback which assigns the error and returns of([])
and use that both for WFS and OGC API. I'm not sure using a Promise is needed here anyway? But yes to have the equivalent of of
you probably need to do from(Promise.resolve(...))
, that makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, I was not able to refactor this further with a common handleError
function. Any attempt I did to try to catch the error once the Promise
has been transformed into en Obervable
broke the download list, so I needed to keep catching it within the Promise
.
I've added a separate translation key for the OGC API error. If I saw right, ogc-client
does not provide more info on the error as for WFS
, so there is just one generic message so far. It is displayed in the preview components like the map, but I decided to not also add it to the download list to not "pollute" the UI when there might be many links already displayed from working sources.
also add fixture to test that erroneous OGC API does not break download list and seperate generic OGC API error message from WFS messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! not tested but it looks really good 👍
Description
This PR applies a couple of fixes for the OGC API integration into the datahub:
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label => I think the bug fixes are for features introduced after the latest release (besides the recovered message)This work is sponsored by MEL.