Skip to content

Conversation

PKulkoRaccoonGang
Copy link
Contributor

@PKulkoRaccoonGang PKulkoRaccoonGang commented Sep 16, 2025

Description

This PR extends the frontend-component-header settings for the Index, Course Catalog, and Course About pages.

Useful information

Initial setup

  1. Clone and install the tutor-mfe plugin from the draft PR that adds support for Catalog MFE.
  2. The edx-platform should have changes from these PRs feat [FC-86]: update course_about & catalog link generation edx-platform#37342 and feat [FC-86]: add redirects to mfe for catalog-related legacy pages edx-platform#37341. Alternatively, for testing, you can switch to the rg-tick/develop testing branch, which already contains these commits.

How Has This Been Tested?

Header for unauthenticated users

The header must include the following links:

  • Logo
    • /learner-dashboard - link for Home, Course about and Catalog pages. If the user is not authenticated, redirect to the login page.
  • Explore courses (/courses) - visible only if ENABLE_COURSE_DISCOVERY is enabled (Django Site Configuration)
  • Help - visible only if SUPPORT_URL is configured (Django Site Configuration)
  • Sign Up button
  • Login button

Header for authenticated users

The header must include the following links:

  • Logo
    • /learner-dashboard - Home page, Course About and Catalog pages
  • Courses (/learner-dashboard)
  • Programs (/dashboard/programs) - visible only if ENABLE_PROGRAMS is enabled (Django Site Configuration)
  • Discover new (/courses) - visible only if NON_BROWSABLE_COURSES is enabled (Django Site Configuration)
  • Help - visible only if SUPPORT_URL is configured (Django Site Configuration)

Acceptance Criteria

  1. Depending on the value of ENABLE_COURSE_DISCOVERY, legacy links should redirect to the corresponding new MFE pages.
  2. The header links must match the list provided above for both authenticated and unauthenticated users.
  3. On mobile devices, the logic should be identical to the desktop functionality.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Sep 16, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Sep 16, 2025

Thanks for the pull request, @PKulkoRaccoonGang!

This repository is currently maintained by @openedx/committers-frontend.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Sep 16, 2025
@PKulkoRaccoonGang PKulkoRaccoonGang self-assigned this Sep 16, 2025
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Sep 16, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Sep 16, 2025
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.96%. Comparing base (1cf6194) to head (95ec797).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/header/hooks/useMenuItems.ts 96.15% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

@PKulkoRaccoonGang PKulkoRaccoonGang marked this pull request as ready for review September 24, 2025 11:51
@PKulkoRaccoonGang PKulkoRaccoonGang changed the title DRAFT: [FC-86] Updated Header links feat: [FC-86] Updated Header links Sep 24, 2025
HOMEPAGE_PROMO_VIDEO_YOUTUBE_ID='test-youtube-id'
ENABLE_COURSE_DISCOVERY=true
ENABLE_PROGRAMS=true
SUPPORT_URL='https://support.example.com'

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 19 to 21
}
return getConfig().LMS_BASE_URL;
};

Choose a reason for hiding this comment

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

Suggested change
}
return getConfig().LMS_BASE_URL;
};
}
return getConfig().LMS_BASE_URL;
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a 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!

@PKulkoRaccoonGang
Copy link
Contributor Author

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

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a 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!

Comment on lines 18 to 27
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>
)),
}));
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@sarina
Copy link

sarina commented Oct 1, 2025

Can this be re-reviewed now that the edx-platform changes have merged?

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a 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.

@brian-smith-tcril
Copy link
Contributor

brian-smith-tcril commented Oct 2, 2025

Local testing looks good overall, I do have a question though:

Note

Based on the Slack conversation we can proceed without changes to frontend-component-header (no need to make a follow up issue).

I don't know of a scenario before this MFE that leads to seeing the header while logged out. The log in buttons differ from what appears on the legacy page.

image

vs

image

Specifically:

  • Wording changed
    • "Sign in" -> "Login"
    • "Register for free" -> "Sign Up"
  • Ordering changed
    • Legacy has:
      • "Sign in" as primary? brand? to the right
      • "Register for free" as outline-primary? outline-brand? to the left
    • MFE header has:
      • "Sign up" as outline-primary to the right
      • "Login" as link to the left

This is coming from LoggedOutItems in frontend-component-header, so it's not something that should block this PR, but I wanted to flag it here.

@PKulkoRaccoonGang
Copy link
Contributor Author

PKulkoRaccoonGang commented Oct 3, 2025

This is coming from LoggedOutItems in frontend-component-header, so it's not something that should block this PR, but I wanted to flag it here.

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.

image

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.

@brian-smith-tcril
Copy link
Contributor

@PKulkoRaccoonGang re: links in the LearningHeader

Thanks for doing that discovery! I don't think trying to reuse LearningHeader within frontend-component-header is something we should focus on with frontend-base work underway.

I do, however, think having consistency in our "Register"/"Sign Up"/"Login"/"Sign in" links for all the headers provided by frontend-component-header is worth making an issue on frontend-component-header for.

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

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a 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!

@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the Peter_Kulko/header-links branch from 44158dc to 95ec797 Compare October 3, 2025 13:39
@brian-smith-tcril brian-smith-tcril merged commit 8953eb6 into openedx:master Oct 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants