-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix(getContent): fix handle un-indexed (usually private) content #345
Conversation
AFFECTS PACKAGES: @esri/hub-content ISSUES CLOSED: #341
// TODO: inspect error? | ||
// dataset is not in index (i.e. might be a private item) | ||
// try fetching from portal instead | ||
return getContentFromPortal(id, requestOptions); |
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 don't love the fact that we use portal
to refer both to enterprise sites and to the portal API in this flow. Maybe we could consider calling this function getContentFromPortalApi
or something. Anyway, your call.
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.
Fair point. I would suggest we also rename getContentFromHubApi
as well then.
Do we need a changelog entry? |
Thanks @drewctate, changelog will be generated ;) |
return getContentFromHub(id, requestOptions).catch(() => { | ||
// TODO: inspect error? | ||
// dataset is not in index (i.e. might be a private item) | ||
// try fetching from portal instead | ||
return getContentFromPortal(id, requestOptions); |
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.
is this supported for all item types? if somebody is selecting a feature layer dataset, a failed request would return a feature service item. is that acceptable?
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.
good point, but I think that is out of scope of this PR, b/c getContent()
doesn't yet support feature layer/service datasets.
We should address this as part of #322
Codecov Report
@@ Coverage Diff @@
## master #345 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 388
Lines ? 4516
Branches ? 603
==========================================
Hits ? 4516
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
AFFECTS PACKAGES:
@esri/hub-content
ISSUES CLOSED: #341