Skip to content

Implement a shareable url of a skills profile that can be viewed when not logged in#746

Open
sbland wants to merge 3 commits into
mainfrom
742-profile-skills-exportimport-buttons/create-url-link
Open

Implement a shareable url of a skills profile that can be viewed when not logged in#746
sbland wants to merge 3 commits into
mainfrom
742-profile-skills-exportimport-buttons/create-url-link

Conversation

@sbland

@sbland sbland commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

This implements a "Get shareable link" button next to the export as csv button on a users skill wheel page.
Following the url takes you to a publicly accessible anonymous view of the exported skill wheel data.

Screenshot of public view:
image

It needs the following before being merged:

  • The json data from the query string should be sanitized
  • Needs some tests for the new view

Part of #742 (issue)

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 Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
main/views/page_views.py 71.42% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sbland

sbland commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@AdrianDAlessandro if you get chance this one is ready for review. Thanks!

@sbland sbland requested a review from AdrianDAlessandro June 13, 2026 20:37
@sbland sbland marked this pull request as ready for review June 13, 2026 20:41

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

This looks good and behaves as expected!

I've left some comments on some changes I'd like to see, but have approved so I don't delay it further.

Comment on lines +29 to +30
<button class="export-skill-profile-link btn btn-secondary mt-4">Generate shareable link</button>
{% include "main/snippets/create_user_skill_profile_link.html" %}

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.

I think I would prefer if this button just opens the link in a new tab, instead of copying it to the clipboard. Then, if someone want to copy the link, they can just right-click > copy url or copy the url from the new tab.

Comment thread main/views/page_views.py
Comment on lines +330 to +333
except json.JSONDecodeError:
logger.error("Invalid JSON in query parameters")
context["chart_data"] = []
context["skill_levels"] = []

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.

I think in this case we should show a warning message on the page, or even just make it a 400 error.

return reverse("licensing")


class TestViewSkillProfilePageView(TemplateOkMixin):

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.

It'd be good to include a test_provides_required_context method on this. There are a few example of these already in the files. Let me know if you have an issues with providing the query parameters to the test client

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I also tried to include a beautiful soup test to match the one on TestUserSkillProfile but adding query parameters to the _get_url method is a bit tricky when it's used in a fixture. I'll take another look later.

@sbland sbland force-pushed the 742-profile-skills-exportimport-buttons/create-url-link branch from 0273649 to a603f00 Compare June 18, 2026 07:51
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