Add json download button#756
Open
sbland wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AdrianDAlessandro
requested changes
Jul 17, 2026
AdrianDAlessandro
left a comment
Collaborator
There was a problem hiding this comment.
As it stands, the download button does nothing. I've suggested a change to fix that, but the json that gets downloaded is not what I expected...
Comment on lines
+50
to
+52
| const jsonContent = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(jsonData, null, 2)); | ||
| const link = document.createElement("a"); | ||
| link.setAttribute("href", encodedUri); |
Collaborator
There was a problem hiding this comment.
This encodedUri variable isn't defined in this function. Should it be?
Suggested change
| const jsonContent = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(jsonData, null, 2)); | |
| const link = document.createElement("a"); | |
| link.setAttribute("href", encodedUri); | |
| const jsonContent = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(jsonData, null, 2)); | |
| const encodedUri = encodeURI(jsonContent); | |
| const link = document.createElement("a"); | |
| link.setAttribute("href", encodedUri); |
Note: I made this change and it fixed the issue about it not downloading anything. But the resultant file is not a JSON file. It is equivalent to the URL query. So, I got:
%5B%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Communication%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Community%20and%20outreach%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Community%20governance%20and%20management%22%2C%0A%20%20%20%20%22level%22%3A%203%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Communication%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Community%20and%20outreach%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Open%20project%20culture%2C%20structure%20and%20practices%20%22%2C%0A%20%20%20%20%22level%22%3A%202%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Communication%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Verbal%20and%20written%20communication%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Multimedia%20and%20social%20content%20production%22%2C%0A%20%20%20%20%22level%22%3A%202%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Communication%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Verbal%20and%20written%20communication%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Providing%20positive%20and%20constructive%20feedback%22%2C%0A%20%20%20%20%22level%22%3A%202%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Computing%20infrastructures%20and%20systems%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Cloud%20infrastructure%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Serverless%20computing%22%2C%0A%20%20%20%20%22level%22%3A%202%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Computing%20infrastructures%20and%20systems%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22General%20systems%20infrastructure%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Network%20communication%20protocols%22%2C%0A%20%20%20%20%22level%22%3A%201%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Computing%20infrastructures%20and%20systems%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22General%20systems%20infrastructure%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Storage%20systems%22%2C%0A%20%20%20%20%22level%22%3A%203%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Computing%20infrastructures%20and%20systems%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22General%20systems%20infrastructure%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Systems%20architecture%20and%20infrastructure%20design%22%2C%0A%20%20%20%20%22level%22%3A%203%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Communication%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Community%20and%20outreach%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Networking%20and%20relationship%20building%22%2C%0A%20%20%20%20%22level%22%3A%200%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Domain%20expertise%20and%20research%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Research%20skills%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Ethical%20responsibility%22%2C%0A%20%20%20%20%22level%22%3A%201%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Domain%20expertise%20and%20research%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Research%20skills%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Legal%20and%20regulatory%20responsibility%22%2C%0A%20%20%20%20%22level%22%3A%202%0A%20%20%7D%2C%0A%20%20%7B%0A%20%20%20%20%22category%22%3A%20%22Domain%20expertise%20and%20research%22%2C%0A%20%20%20%20%22subcategory%22%3A%20%22Research%20skills%22%2C%0A%20%20%20%20%22skill%22%3A%20%22Research%20methodologies%22%2C%0A%20%20%20%20%22level%22%3A%203%0A%20%20%7D%0A%5D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements a json download link in addition to the csv download link added previously.
Also improved the share button docs
Fixes #742
Type of change
Key checklist
python -m pytest)mkdocs serve)pre-commit run --all-files)Further checks