-
Notifications
You must be signed in to change notification settings - Fork 61
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: post sharing URL #455
Merged
asadazam93
merged 1 commit into
openedx:open-release/olive.master
from
raccoongang:olive/fix-post-sharing-link
Mar 28, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We use BASE_URL in discussions MFE. PUBLIC_PATH is not valid in configuration.
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 didn't get it, can you explain in detail?
The
PUBLIC_PATH
has a default value set to'/'
(source). It is used for subdomain-based deployments.In the case of the subdirectory-based deployments, it will be set for each MFE individually. In my case, its value is
'/discussions/'
.The
BASE_URL
var has a form of the"{{ MFE_BASE_SCHEMA }}://{{ MFE_BASE }}"
where theMFE_BASE
will bethe same value (
"mfe.{{ EDXAPP_LMS_BASE }}"
) for all MFEs in case of using subdirectory-based deployment (from the README for the MFE deployer)Why is the PUBLIC_PATH not valid?
How can I use the BASE_URL in case of subdirectory-based deployments?
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.
PUBLIC_PATH is actually used in the discussions MFE
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.
here is the example.
BASE_URL='http://localhost:2002'
${getConfig().BASE_URL}/${courseId}/topics/${post.topicId}
}`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.
Yes that's understandable
But the issue I'm trying to fix - is that the PUBLIC_PATH is NOT processed now. And in the case of using the URL construction like
${getConfig().BASE_URL}/${courseId}/topics/${post.topicId}}
you'll get an invalid results if you're using the subdirectory-based deployment (your URL actually should be${getConfig().BASE_URL}${getConfig().PUBLIC_PATH}${courseId}/topics/${post.topicId}}
)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.
what if I use
${getConfig().PUBLIC_PATH || '/'}
instead?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.
But I still don't understand why you're saying your instances are lacking the default for the PUBLIC_PATH (which is
'/'
) defined in both configuration and frontend-build repositoriesThere 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.
@asadazam93 and @muhammadadeeltajamul, any Open edX MFE must support path-based deployments, regardless of what your production deployment looks like. That's the whole point of the configuration variable: to allow users to deploy it in different ways.
With that in mind, it looks to me like @dyudyunov's fix is correct.
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.
We will need to fix the deployment path before we can merge this PR
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.
@asadazam93 can you test it on the sandbox instance? I think you don't need to change your env because the default value (
'/'
) should work well for you