-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
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 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. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by 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 ReportAll modified and coverable lines are covered by tests ✅
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. 🚨 Try these New Features:
|
dcc9c94
to
94e1483
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.
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!
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.
Thanks for doing this! Just a couple of changes, if you don't mind.
src/config/index.js
Outdated
@@ -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, |
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.
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?
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.
I addressed both comments :)
@@ -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', () => { |
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.
Looks like we need to reword the test title, here.
test('should display Programs link if the service is configured in the backend', () => { | |
test('should display Programs link if it's enabled by configuration', () => { |
f4d65f5
to
89cae33
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.
Thank you @dcoa, looks great!
for what it's worth I verified this again with your changes, and it still works great, so merge whenever you are ready. |
Thank you!! |
I've got you, @dcoa! 😃 |
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