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

feat: replace hardcoded edx string with site_name from configs #425

Conversation

ihor-romaniuk
Copy link
Contributor

Description:

This PR replace the hardcoded edx string in the page head with the SITE_NAME value from the configuration.

Related PRs:

PR to the olive brunch - #424

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 5, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @ihor-romaniuk! 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 as you can:

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

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Jan 6, 2023
@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Jan 12, 2023
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 🎉

Comparison is base (1344c28) 74.48% compared to head (3dbcf5f) 74.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #425      +/-   ##
==========================================
+ Coverage   74.48%   74.53%   +0.04%     
==========================================
  Files         106      108       +2     
  Lines        2085     2089       +4     
  Branches      514      514              
==========================================
+ Hits         1553     1557       +4     
  Misses        504      504              
  Partials       28       28              
Impacted Files Coverage Δ
src/index.jsx 0.00% <ø> (ø)
src/head/Head.jsx 100.00% <100.00%> (ø)
src/head/messages.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en-us">
<head>
<title>Course Authoring | edX</title>
<title>Course Authoring | <%= process.env.SITE_NAME %></title>
Copy link
Member

Choose a reason for hiding this comment

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

@arbrandes This uses static configuration (process.env.SITE_NAME) instead of runtime configuration (getConfig().SITE_NAME). Am I right in presuming that runtime config isn't available in this file?

Copy link
Contributor Author

@ihor-romaniuk ihor-romaniuk Jan 22, 2023

Choose a reason for hiding this comment

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

Yes, you are right, just a static configuration. Also, this approach is used by all MFEs.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ihor-romaniuk, right. However, Kyle's point is relevant: in order to truly fix the problem, we'll have to introduce a way to get the SITE_NAME dynamically.

We can use frontend-app-account as a template. See the <Head /> component that was introduced there for this very purpose. It makes use of the <Helmet /> component to modify the page title with the dynamically-obtained site name.

Do you mind doing that here as well? Otherwise, the change is not very useful to current users.

@mphilbrick211
Copy link

Hi @KristinAoki! Flagging this for your review.

@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en-us">
<head>
<title>Course Authoring | edX</title>
<title>Course Authoring | <%= process.env.SITE_NAME %></title>
Copy link
Contributor

Choose a reason for hiding this comment

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

@ihor-romaniuk, right. However, Kyle's point is relevant: in order to truly fix the problem, we'll have to introduce a way to get the SITE_NAME dynamically.

We can use frontend-app-account as a template. See the <Head /> component that was introduced there for this very purpose. It makes use of the <Helmet /> component to modify the page title with the dynamically-obtained site name.

Do you mind doing that here as well? Otherwise, the change is not very useful to current users.

@mphilbrick211 mphilbrick211 added changes requested waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Jan 27, 2023
@mphilbrick211
Copy link

Hi @ihor-romaniuk! Just checking to see if the requested changes were made and/or that this pull request is ready for review. Thanks!

@mphilbrick211
Copy link

Hi @ihor-romaniuk! Friendly check-in on this :)

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/feat/replace-hardcoded-edx-string branch from 119bbe3 to 820f556 Compare March 2, 2023 16:42
@ihor-romaniuk
Copy link
Contributor Author

ihor-romaniuk commented Mar 2, 2023

Hi @arbrandes, @kdmccormick
We are definitely right. I added ability to obtain site name dynamically as you suggested.
Also, It required localization of overriding ReactDOM.createPortal for allowing portals in jest.

Everything was updated and it's ready for review.

PR #424 was also updated.

@mphilbrick211
Copy link

@arbrandes @kdmccormick @jristau1984 would you mind taking a look at this? Thanks!

@mphilbrick211 mphilbrick211 removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Mar 3, 2023
@jristau1984
Copy link
Contributor

Tests failed. It may have been a flaky run, so I have kicked them off again.

@jristau1984
Copy link
Contributor

@arbrandes @ihor-romaniuk CI is still failing due to changes requested.

@ihor-romaniuk
Copy link
Contributor Author

Hi @jristau1984. All checkers are green.

@kdmccormick kdmccormick removed their request for review March 6, 2023 14:21
@mphilbrick211
Copy link

@ihor-romaniuk @arbrandes - are the changes on this all set? Can @jristau1984 merge?

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.

Awesome, thanks for the changes, @ihor-romaniuk!

@jristau1984 jristau1984 merged commit 5c0ca7b into openedx:master Mar 9, 2023
@openedx-webhooks
Copy link

@ihor-romaniuk 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@ihor-romaniuk ihor-romaniuk deleted the romaniuk/feat/replace-hardcoded-edx-string branch March 13, 2023 15:28
bradenmacdonald pushed a commit to open-craft/frontend-app-authoring that referenced this pull request Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Status: Closed
Development

Successfully merging this pull request may close these issues.

7 participants