Skip to content
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

fix: display programs nav button only if it is configured #506

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

dcoa
Copy link
Contributor

@dcoa dcoa commented Nov 18, 2024

Description

This PR removes the link of programs from the Header if the service is not configured.

It aims to solve the following issue #372

How to test

  1. Create a instance with frontend-app-learner-dashobord mounted in the current branch.
  2. Launch the instance and open it in the browser.
  3. Access the learner dashboard.
  4. By default you should not see nav button.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 18, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Nov 18, 2024

Thanks for the pull request, @dcoa!

What's next?

Please work through the following steps to get your changes 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.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @2U-aperture. Tag them in a comment and let them know that your changes are ready for review.

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.

@dcoa dcoa changed the title fix: display programs tab only if it is configured fix: display programs nav button only if it is configured Nov 18, 2024
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (ce1848a) to head (89cae33).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #506   +/-   ##
=======================================
  Coverage   97.40%   97.40%           
=======================================
  Files         157      157           
  Lines        1387     1389    +2     
  Branches      230      231    +1     
=======================================
+ Hits         1351     1353    +2     
  Misses         34       34           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@dcoa dcoa marked this pull request as ready for review November 18, 2024 23:23
@dcoa dcoa requested a review from a team as a code owner November 18, 2024 23:23
@dcoa dcoa requested a review from arbrandes November 19, 2024 00:12
@deborahgu deborahgu self-assigned this Nov 19, 2024
@deborahgu deborahgu added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Nov 19, 2024
Copy link
Member

@deborahgu deborahgu left a comment

Choose a reason for hiding this comment

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

this looks good to me. If we weren't time constrained I would want to add the test for a unpermissioned user, just because that's what broke last time, but I doubt we have a great way to do that quickly, and this shouldn't remotely have a chance of running into that problem. Thanks for the quick turnaround on the fix!

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Just a couple of changes, if you don't mind.

@@ -19,6 +19,7 @@ const configuration = {
LOGO_URL: process.env.LOGO_URL,
ENABLE_EDX_PERSONAL_DASHBOARD: process.env.ENABLE_EDX_PERSONAL_DASHBOARD === 'true',
SEARCH_CATALOG_URL: process.env.SEARCH_CATALOG_URL || null,
ENABLE_PROGRAMS: !!process.env.ENABLE_PROGRAMS,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please check for the 'true' string explicitly, like in line 20 above? There's a reason for it: .env files only support strings, not booleans. (Yes, I know, there are some boolean checks that don't respect this - they're basically wrong.)

That leads me to a second request: can you please add ENABLE_PROPRAMS to the existing .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.

I addressed both comments :)

@arbrandes

@@ -39,4 +39,9 @@ describe('LearnerDashboardHeader', () => {
const wrapper = shallow(<LearnerDashboardHeader />);
expect(wrapper.instance.findByType(Header)[0].props.secondaryMenuItems.length).toBe(1);
});
test('should display Programs link if the service is configured in the backend', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we need to reword the test title, here.

Suggested change
test('should display Programs link if the service is configured in the backend', () => {
test('should display Programs link if it's enabled by configuration', () => {

Copy link
Contributor

@arbrandes arbrandes 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 @dcoa, looks great!

@deborahgu
Copy link
Member

for what it's worth I verified this again with your changes, and it still works great, so merge whenever you are ready.

@dcoa
Copy link
Contributor Author

dcoa commented Nov 21, 2024

Thank you!!
I don't have write access on this repo, could any of you help me with the merge @deborahgu , @arbrandes ?

@itsjeyd itsjeyd added core contributor PR author is a Core Contributor (who may or may not have write access to this repo). and removed waiting for eng review PR is ready for review. Review and merge it, or suggest changes. labels Nov 21, 2024
@deborahgu
Copy link
Member

I've got you, @dcoa! 😃

@deborahgu deborahgu merged commit a0e5f75 into openedx:master Nov 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants