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: Hard-coded link in Header component changed by LMS_BASE_URL env var #186

Merged
merged 4 commits into from Jun 14, 2021

Conversation

ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented May 25, 2021

index.jsx file of Header component updated with change the hard-coded link of https://www.edx.org with a component property.
index.jsx file of root project updated. Added the environment variable LMS_BASE_URL to the parameters of the Header component

Issue: openedx/wg-build-test-release#55

What changed?

  • This updates the index.jsx file of the Header component with change the hard-coded link with the component property logoDestination.
  • This updates the index.jsx file of root project with add the LMS_BASE_URL env var as logoDestination in Header component.

Developer Checklist

  • Test suites passing
  • Documentation and test plan updated, if applicable
  • Received code-owner approving review
  • Bumped version number package.json

Testing Instructions

If you start your local development server for gradebook and you load a course, when you click in the header logo, then it should redirect to the LMS dashboard.

Reviewer Checklist

Collectively, these should be completed by reviewers of this PR:

  • I've done a visual code review
  • I've tested the new functionality

FYI: @edx/masters-devs-gta

On index.js file of the Header component, currenly there is a hard-coded link of "https://www.edx.org". I added a new enviroment variable LOGO_DESTINATION to use it in this Header.
I have also added a mechanism to use the LMS_BASE_URL environment variable if the LOGO_DESTINATION environment variable is not found or is null.
@openedx-webhooks
Copy link

openedx-webhooks commented May 25, 2021

Thanks for the pull request, @ChrisChV! I've created OSPR-5806 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@ChrisChV ChrisChV changed the title feat: LOGO_DESTINATION env var added for use it on Header component feat: LOGO_DESTINATION env var added for use in Header component May 25, 2021
@sarina
Copy link
Contributor

sarina commented May 26, 2021

@davidjoy didn't you fix this already?

@natabene
Copy link

@ChrisChV Thank you for the contribution! Once you have signed our Contributor Agreement and it has been processed, you will receive a confirmation via email from our Legal team. We then will be able to review this and all your future code contributions.

@essiocolom
Copy link

@natabene we already signed the Entity Contributor Agreement and sent it to legal as we are going to be contributing as Bitmaker and @ChrisChV is part of the organization 👍 By the way, we are still waiting for them to confirm everything is okay

@natabene
Copy link

@ChrisChV Thank you for an update! They will process and get back to you soon.

@ChrisChV
Copy link
Contributor Author

Hi @natabene. We have already been authorized as a bitmaker to contribute

@davidjoy
Copy link
Contributor

Looking around at the shared MFE header, I think we should set the logo destination to point at the dashboard for consistency:

${config.LMS_BASE_URL}/dashboard

In which case we don't need to add a new environment variable specific to gradebook.

See shared header implementation here: https://github.com/edx/frontend-component-header/blob/3726792df260e72bcf9be6cd3bc921b880255604/src/Header.jsx#L82

@ChrisChV
Copy link
Contributor Author

Looking around at the shared MFE header, I think we should set the logo destination to point at the dashboard for consistency:

${config.LMS_BASE_URL}/dashboard

In which case we don't need to add a new environment variable specific to gradebook.

See shared header implementation here: https://github.com/edx/frontend-component-header/blob/3726792df260e72bcf9be6cd3bc921b880255604/src/Header.jsx#L82

@davidjoy In this case it is better to place the logo destination value in the Header as I have done now? Or pass that value through the Header props from the index file, as being done in the link you shared?

@natabene
Copy link

@ChrisChV Thank you for joining the Open edX community! We have added your user to our records and can now review your code going forward. @davidjoy Would you like to review?

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed community manager review labels May 27, 2021
@natabene
Copy link

@mattcarter FYI this PR coming.

`index.jsx` file of Header component updated with change the hard-coded link of https://www.edx.org with a component property.
`index.jsx` file of root project updated. Added the environment variable LMS BASE_URL to the parameters of the Header Component
@ChrisChV ChrisChV changed the title feat: LOGO_DESTINATION env var added for use in Header component fix: Hard-coded link in Header component changed by a env var May 28, 2021
@ChrisChV ChrisChV changed the title fix: Hard-coded link in Header component changed by a env var fix: Hard-coded link in Header component changed by LMS_BASE_URL env var May 28, 2021
@ChrisChV
Copy link
Contributor Author

@davidjoy Please review the new changes, I added a new logic to solve this using what you commented and without creating a new env var

@openedx-webhooks openedx-webhooks added engineering review and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels May 28, 2021
@natabene
Copy link

@mattcarter Do you want to have a look now?

@jansenk
Copy link
Contributor

jansenk commented May 28, 2021

@mattcarter @natabene I've got some spare cycles, I can review this if you'd like

@mattcarter
Copy link
Contributor

@jansenk, that would be great. Please review and engage with @davidjoy

@ChrisChV ChrisChV marked this pull request as ready for review May 31, 2021 22:54
Copy link
Contributor

@jansenk jansenk left a comment

Choose a reason for hiding this comment

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

Looks good! Small style suggestion

return (
<div className="mb-3">
<header className="d-flex justify-content-center align-items-center p-3 border-bottom-blue">
<Hyperlink destination="https://www.edx.org">
<Hyperlink {...logoProps}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the variable declarations seem unnecessary, you could just have this be <Hyperlink destination={this.props.logoDestination}>

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this line should just read:

<Hyperlink destination={`${getConfig().LMS_BASE_URL}/dashboard`}>

It's not really a configurable thing/there doesn't seem to be much value in passing it down from above.

Copy link
Contributor

@davidjoy davidjoy left a comment

Choose a reason for hiding this comment

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

I think we can simplify this and just put the URL in the hyperlink. The index.jsx file doesn't really need to know about the URL/this code isn't reused with different URLs.

return (
<div className="mb-3">
<header className="d-flex justify-content-center align-items-center p-3 border-bottom-blue">
<Hyperlink destination="https://www.edx.org">
<Hyperlink {...logoProps}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this line should just read:

<Hyperlink destination={`${getConfig().LMS_BASE_URL}/dashboard`}>

It's not really a configurable thing/there doesn't seem to be much value in passing it down from above.

@ChrisChV
Copy link
Contributor Author

ChrisChV commented Jun 5, 2021

@davidjoy It's done

@natabene
Copy link

@davidjoy @jansenk If this is good to merge, let's merge.

@mattcarter mattcarter merged commit 02c154e into openedx:master Jun 14, 2021
@openedx-webhooks
Copy link

@ChrisChV 🎉 Your pull request was merged!

Please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged open-source-contribution PR author is not from Axim or 2U
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants