fix: replaced space for + char to render the filter correctly in the UI#140
Conversation
|
Thanks for the pull request, @jesusbalderramawgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are 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. DetailsWhere 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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #140 +/- ##
==========================================
+ Coverage 97.34% 97.64% +0.30%
==========================================
Files 89 68 -21
Lines 2106 1572 -534
Branches 457 368 -89
==========================================
- Hits 2050 1535 -515
+ Misses 53 37 -16
+ Partials 3 0 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| const intl = useIntl(); | ||
| const [searchParams] = useSearchParams(); | ||
| const presetScope = searchParams.get('scope') || undefined; | ||
| const presetScope = searchParams.get('scope')?.replace(/\s/g, '+') || undefined; |
There was a problem hiding this comment.
This works here because course and library key parts (org, run, number), don't accept spaces or special characters. Otherwise, this would potentially break keys with spaces (which is not the case).
However the root cause of this issue is that we are not url-encoding the query params on the links generated in frontend-app-authoring.
If we did that, the course key would be encoded as "course-v1%3AOpenedX%2BDemoX%2BDemoCourse", and on decode, it will come back correctly here as + instead of spaces.
We can keep this change as a fallback, but I think we should fix the root cause in frontend-app-authoring
There was a problem hiding this comment.
thanks @rodmgwgu , I checked first on authoring and I saw the URL correctly there, but let me double check.
agreed that we should use encodeURI on authoring repo.
There was a problem hiding this comment.
@rodmgwgu you were right, I've added the change to this PR
openedx/frontend-app-authoring#3023
and it works correct, thanks!
rodmgwgu
left a comment
There was a problem hiding this comment.
This works, but let's fix the root cause in frontend-app-authoring
|
Is this pr still needed after the encoding added in openedx/frontend-app-authoring#3023? |
I think we don't need it, but it Rodrigo mentioned that we could leave this as fallback. |
If we are keeping it, I think we should add a comment explaining it. Also I would like to hear @dcoa opinion on this. |
|
I think having this as a fallback is good idea, usually the urls in learning or authoring has the In the future we can have a scope resolver if we need to cover other cases besides the |
rodmgwgu
left a comment
There was a problem hiding this comment.
@jesusbalderramawgu Let's add the explanation comment and we are good to go, thanks!
|
Thank you, this has been updated |
Issue
Description
The filter is showing spaces instead of "+" chars.
for example after the redirection to admin console this string
course-v1:TestOrg+101+2025_T1
is received as
course-v1:TestOrg 101 2025_T1
Fix
NOTE: after debugging I saw that we send the correct data
UI
