-
Notifications
You must be signed in to change notification settings - Fork 6
feat: [FC-86] Updated Header links #24
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
feat: [FC-86] Updated Header links #24
Conversation
|
Thanks for the pull request, @PKulkoRaccoonGang! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 96.90% 96.96% +0.05%
==========================================
Files 42 46 +4
Lines 323 362 +39
Branches 51 60 +9
==========================================
+ Hits 313 351 +38
- Misses 10 11 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5d4be3a to
da5875c
Compare
2b4a7a3 to
2a18e95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform]: Moved from frontend-app-learner-dashboard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying this in here seems like a good short term solution, but if this is a common pattern we're using across MFEs it likely makes sense to add it to frontend-platform. It'd be good to make a follow-up issue on frontend-platform linking to the implementation here and in frontend-app-learner-dashboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created new issue: openedx/frontend-platform#835
2a18e95 to
4074ae4
Compare
| HOMEPAGE_PROMO_VIDEO_YOUTUBE_ID='test-youtube-id' | ||
| ENABLE_COURSE_DISCOVERY=true | ||
| ENABLE_PROGRAMS=true | ||
| SUPPORT_URL='https://support.example.com' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] Let's add an empty SUPPORT_URL to prod and dev env files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/header/utils.ts
Outdated
| } | ||
| return getConfig().LMS_BASE_URL; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| return getConfig().LMS_BASE_URL; | |
| }; | |
| } | |
| return getConfig().LMS_BASE_URL; | |
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
This is just a first pass.
I noticed isNotHomePage and was a bit confused about it, which led to a bigger "how should the logo link behave" question.
Any thoughts would be great!
|
@brian-smith-tcril thanks! I’ve added more context about the logo link on the home page in this comment. It would be great to hear your thoughts on it 💯 |
2fb6bf8 to
624f186
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks really good!
I left a couple comments with questions in there, but nothing super major.
Thanks again for your work on this!
src/header/CatalogHeader.test.tsx
Outdated
| jest.mock('@edx/frontend-component-header', () => ({ | ||
| __esModule: true, | ||
| default: jest.fn(({ mainMenuItems, logoDestination, secondaryMenuItems }) => ( | ||
| <div data-testid="header"> | ||
| <div data-testid="main-menu">{JSON.stringify(mainMenuItems)}</div> | ||
| <div data-testid="logo-destination">{logoDestination}</div> | ||
| <div data-testid="secondary-menu">{JSON.stringify(secondaryMenuItems)}</div> | ||
| </div> | ||
| )), | ||
| })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be mocked for this to be testable?
My worry here is that by mocking this the tests won't catch any issues stemming from updates to frontend-component-header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be mocked for this to be testable?
Not necessarily. I think you’re right 💯
It would be better to add tests that directly cover the header component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying this in here seems like a good short term solution, but if this is a common pattern we're using across MFEs it likely makes sense to add it to frontend-platform. It'd be good to make a follow-up issue on frontend-platform linking to the implementation here and in frontend-app-learner-dashboard.
|
Can this be re-reviewed now that the edx-platform changes have merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good!
I left a couple comments with questions about some of the tests. I'm also going to pull this down and verify it works against latest master of edx-platform.
I noticed that in the Learning MFE, the header displayed for unauthenticated users looks very similar to what we currently have in the legacy version.
The Register and Sign in buttons are rendered by the AnonymousUserMenu component, which is included within the LearningHeader. In other words, this is technically the header version used for the Learning MFE. I think it might be a good idea to reuse the LearningHeader and make some of its elements more generic, so they could serve as the basis for a universal header for the LMS part of the platform. However, these changes would introduce breaking changes, and I’m not sure we want to take that on in this iteration. If this makes sense to you, I’d be happy to create an issue for it. |
|
@PKulkoRaccoonGang re: links in the Thanks for doing that discovery! I don't think trying to reuse I do, however, think having consistency in our "Register"/"Sign Up"/"Login"/"Sign in" links for all the headers provided by Any work on that definitely falls outside the scope of this FC, especially considering the outcome of yesterday's slack conversation about this being "they are fine as-is." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
After a rebase this will be ready to merge!
44158dc to
95ec797
Compare



Note
Dependencies:
Note
Related PR:
Description
This PR extends the frontend-component-header settings for the Index, Course Catalog, and Course About pages.
Useful information
Initial setup
tutor-mfeplugin from the draft PR that adds support for Catalog MFE.How Has This Been Tested?
Header for unauthenticated users
The header must include the following links:
/learner-dashboard- link for Home, Course about and Catalog pages. If the user is not authenticated, redirect to the login page./courses) - visible only ifENABLE_COURSE_DISCOVERYis enabled (Django Site Configuration)SUPPORT_URLis configured (Django Site Configuration)Header for authenticated users
The header must include the following links:
/learner-dashboard- Home page, Course About and Catalog pages/learner-dashboard)/dashboard/programs) - visible only ifENABLE_PROGRAMSis enabled (Django Site Configuration)/courses) - visible only ifNON_BROWSABLE_COURSESis enabled (Django Site Configuration)SUPPORT_URLis configured (Django Site Configuration)Acceptance Criteria
ENABLE_COURSE_DISCOVERY, legacy links should redirect to the corresponding new MFE pages.