Implement Expert hub landing page backend#15709
Implement Expert hub landing page backend#15709adalcima merged 16 commits intofeature/expert-gallery-hubfrom
Conversation
…nding-page-backend
…nding-page-backend
nancyt1
left a comment
There was a problem hiding this comment.
Works as expected for me! Can we rename issues to topics? So -> "Featured Issue Areas" -> "Featured Topics" And the items below are named Topic 1, Topic 2, Topic 3 etc. Just so we don't get confused with so many things labeled "featured". Same thing with "Featured Experts", can the items be "Expert 1", "Expert 2", etc.?
I will update the designs as well
|
1036369 to
249c8d1
Compare
…nding-page-backend
Hi @kevdmoz thanks for the feedback:
Please let me know if you have any further comments. Thank you 🙌 |
nancyt1
left a comment
There was a problem hiding this comment.
Looks great, thank you! If we can remove the "Featured Experts" heading from rendering that would be great, or maybe frontend can do that later.
danielfmiranda
left a comment
There was a problem hiding this comment.
Thanks @adalcima for taking on this work!
After reviewing the code and the review app, everything looks great. R+! 👍
A couple of small non-blocking notes:
- Do we need to add django-countries to requirements.txt?
- If we have the bandwidth, I think moving the expert hub related code to its own /
expert_hubdirectory would be a nice separation of concerns,especially if models in/profilesend up being used for other parts of the site down the road. That said, I know it's not urgent, so totally fine to revisit this later.
| from django.core.paginator import EmptyPage, Paginator | ||
| from django.db import models | ||
| from django.http import JsonResponse | ||
| from django_countries import countries |
There was a problem hiding this comment.
Cool! This package seems like it could be super useful 👍 just want to double check if we need to add it requirements.txt or anything?
|
|
||
|
|
||
| class ExpertDirectoryPageTestCase(WagtailPageTestCase): | ||
| def setUp(self): | ||
| self.hub = ExpertHubPageFactory() | ||
| self.directory = ExpertDirectoryPageFactory(parent=self.hub) | ||
|
|
||
| def test_parent_is_hub(self): | ||
| self.assertEqual(self.directory.get_parent().specific, self.hub) | ||
|
|
||
| def test_is_leaf_page(self): | ||
| self.assertEqual(self.directory.subpage_types, []) | ||
|
|
||
| def test_get_experts_returns_hub_children(self): | ||
| expert = ExpertProfilePageFactory(parent=self.hub) | ||
| experts = self.directory.get_experts() | ||
| self.assertIn(expert, experts) |
There was a problem hiding this comment.
Kudos Thank you for adding tests!
| ) | ||
|
|
||
|
|
||
| def generate(seed): |
There was a problem hiding this comment.
Kudos Thanks for adding a factory! This will be very helpful in the future
|
Thanks @nancyt1 @danielfmiranda for the review 💯
|


Description
This PR adds the backend for Expert Hub — a central directory where visitors can browse Mozilla's network of experts.
Related issue: TP1-3734
Review app: Landing page | Directory page
Main changes
ExpertHubPagehub/landing page with :ExpertDirectoryPagedirectory/index page with:/experts/with pagination (12 per page).External Linkupdated with title and description fields forExpert Profile.Basic html for landing page and directory, showing featured experts and featured topics. Section for "All experts" using filters and api endpoint.
* It will be necessary to make adjustments and modify the styles so that it displays correctly on the corresponding frontend ticket.Factory generates 15 experts profiles, 6 featured experts an 5 featured topics.
How to test
Images