Skip to content
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

b/3573 fix access urls for downloadable distros #22

Merged
merged 4 commits into from
Apr 11, 2022

Conversation

drspacemanphd
Copy link
Contributor

3573 -> CSV, GeoJSON, Shapefile and KML distros now use correct V3 API url for downloadable urls.

Copy link
Collaborator

@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.

Just the one comment! Good work!

@@ -18,6 +18,7 @@ export function formatDcatDataset (hubDataset: HubDatasetAttributes, siteUrl: st
} as DatasetResource);
const { relative: relativePath } = getContentSiteUrls(content, siteModel);
const landingPage = siteUrl.startsWith('https://') ? siteUrl + relativePath : `https://${siteUrl}${relativePath}`;
const downloadLink = siteUrl.startsWith('https://') ? `${siteUrl}/datasets/${hubDataset.slug}` : `https://${siteUrl}/datasets/${hubDataset.slug}`;
Copy link
Collaborator

@sonofflynn89 sonofflynn89 Apr 11, 2022

Choose a reason for hiding this comment

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

Change this to use content.identifier. It returns the slug if available and the hubId on the off chance the slug doesn't exist. It's a little more robust and will never be undefined 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done thanks for the heads up

@drspacemanphd drspacemanphd merged commit 685f28a into main Apr 11, 2022
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.

2 participants