Skip to content

Add json download button#756

Open
sbland wants to merge 2 commits into
mainfrom
742-profile-skills-exportimport-buttons/create-json-download-button
Open

Add json download button#756
sbland wants to merge 2 commits into
mainfrom
742-profile-skills-exportimport-buttons/create-json-download-button

Conversation

@sbland

@sbland sbland commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Technical work (non-breaking, change which is work as part of a new feature)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • The documentation builds and looks OK (eg. mkdocs serve)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future. (Indicate issue here: # (issue))

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AdrianDAlessandro AdrianDAlessandro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

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.

Profile & skills export/import buttons

2 participants