Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

f/2840 add durable download linlk #45

Merged
merged 2 commits into from
Jun 9, 2023
Merged

Conversation

sansth1010
Copy link
Collaborator

This PR adds durable download link for different file types ('CSV', 'GeoJSON', 'Shapefile')

Related: https://devtopia.esri.com/dc/hub/issues/2840

@sansth1010 sansth1010 requested a review from drspacemanphd June 9, 2023 20:50
@@ -79,10 +79,13 @@ export function enrichDataset(dataset: HubDataset, hubsite: HubSite): Feature {

if (isLayer(dataset)) {
additionalFields.accessUrlGeoJSON = downloadLinkFor('geojson');
additionalFields.durableUrlGeoJSON = generateDurableDownloadUrl(dataset.id, siteUrl, 'geojson');
Copy link
Contributor

@sonofflynn89 sonofflynn89 Jun 9, 2023

Choose a reason for hiding this comment

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

Wait, do we want to even keep the old links then if we are planning on introducing these durable ones?

Copy link
Collaborator Author

@sansth1010 sansth1010 Jun 9, 2023

Choose a reason for hiding this comment

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

For now yes. Durable links will stay experimental until we finalize the new download service which hasn't been released to production yet and these durable links will only be used for testing hub feeds on DEV and QA as required by the issue 2840. Production hub feeds will be using old links for now.

Once, download service gets released to production, these old links will be removed from the provider.

@sansth1010 sansth1010 requested a review from sonofflynn89 June 9, 2023 21:49
Copy link
Contributor

@sonofflynn89 sonofflynn89 left a comment

Choose a reason for hiding this comment

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

Looks great! Just one more question

@@ -70,7 +70,10 @@ describe('enrichDataset function', () => {
provenance: '',
hubLandingPage: 'https://arcgis.com/maps/CALFIRE::DCAT_Test',
downloadLink: 'https://arcgis.com/datasets/CALFIRE::DCAT_Test',
agoLandingPage: 'portal.arcgis.com/home/item.html?id=0&sublayer=0',
durableUrlCSV: 'https://arcgis.com/api/download/v1/item/123a/csv?layers=0',
Copy link
Contributor

@sonofflynn89 sonofflynn89 Jun 9, 2023

Choose a reason for hiding this comment

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

I totally get that you were just copying what existed, but I got really tripped up by the fact that these urls use arcgis.com instead of hub.arcgis.com (or my-hub-site.com, etc.). This is mainly because the download APIs are provided by us, not ArcGIS Online. Would you mind updating for consistency?

@sansth1010 sansth1010 merged commit 721b2c0 into main Jun 9, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants