feat: filter courses by user language by default#33647
feat: filter courses by user language by default#33647pomegranited merged 1 commit intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @navinkarkera! 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:
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. |
0adc71b to
c86d908
Compare
|
Sandbox deploy request received. Deployment will start soon. |
|
Sandbox deployment started. |
c86d908 to
6c71c68
Compare
|
Sandbox update request received. Deployment will start soon. |
|
Sandbox deployment successful. Sandbox LMS is available at pr-33647-139931.staging.do.opencraft.hosting |
|
Sandbox deployment started. |
|
Sandbox deployment successful. Sandbox LMS is available at pr-33647-139931.staging.do.opencraft.hosting |
6c71c68 to
4f23108
Compare
NOTE:
|
20597e2 to
af1d124
Compare
|
|
Sandbox update request received. Deployment will start soon. |
|
Hi @navinkarkera! Is this ready for review? |
|
@mphilbrick211 Thanks for checking. Yes it is ready. |
81335fa to
eca9398
Compare
|
Sandbox deployment successful. Sandbox LMS is available at pr-33647-139931.staging.do.opencraft.hosting Instance config : https://grove-stage-build-logs.nyc3.digitaloceanspaces.com/34602668-5639873435-config.yml |
eca9398 to
13ad42f
Compare
|
Hi @mphilbrick211 @navinkarkera may I review/merge this as CC? |
13ad42f to
9a2f9da
Compare
|
@pomegranited That would be super helpful. Thanks! |
|
Sure thing @navinkarkera , could you direct me to the ticket? |
|
@pomegranited BB-8091. Added the ticket info to description as well. |
pomegranited
left a comment
There was a problem hiding this comment.
@navinkarkera This code is working exactly as described, thank you for such great testing instructions!
But I have some questions about the feature flag, and a request for a better test. Please let me know if you have any questions or concerns.
There was a problem hiding this comment.
Since there's only ever one course in the returned list, this test doesn't actually verify that the filter was applied.
Could you add another course that uses a different language so we can see that this filter actually applies?
There was a problem hiding this comment.
I noticed that when my preferred language doesn't match any of my course's languages that I see header text like this:
We couldn't find any results for ""
which I think students may find confusing, because the text is confusing, and because the student didn't actually perform an explicit search.
An easy way around this would be to avoid showing that header if there's no search text.
There was a problem hiding this comment.
Since there's only ever one course in the returned list, this test doesn't actually verify that the filter was applied.
Could you add another course that uses a different language so we can see that this filter actually applies?
@pomegranited Actually the test should not be about checking API response as it is mocked above by AjaxHelpers.respondWithJson(requests, JSON_RESPONSE);. So I modified to check the request body as it should include language filter automatically when default filter is enabled.
An easy way around this would be to avoid showing that header if there's no search text.
Makes sense. Done 👍
There was a problem hiding this comment.
Is there an implementation reason why you chose to add a new settings.FEATURES flag instead of one of the toggles available from edx-toggles like SettingToggle or WaffleFlag?
It's my understanding from Feature Flags and Settings on edx-platform and OEP-17 that we should be using these edx-toggles now, and that FEATURES flags are deprecated.
There was a problem hiding this comment.
@pomegranited No specific reason for using feature flags, except for maybe the relationship with ENABLE_COURSE_DISCOVERY feature flag. After reading the the OEP, I think we can using WaffleSwitch here.
9a2f9da to
ed3664a
Compare
pomegranited
left a comment
There was a problem hiding this comment.
👍 Thank you for addressing my comments @navinkarkera :) I'll merge this tomorrow if there are no objections.
Could you update the PR description to reflect the use of a Waffle Switch instead of a feature flag to enable this feature? And will need an update to openedx-unsupported/edx-documentation#2210 too.
- I tested this on my devstack using the excellent testing instructions in the PR.
- I read through the code
- I checked for accessibility issues by using my keyboard to navigate the Courses list
- Includes documentation on the new switch
-
User-facing strings are extracted for translationN/A
1ef9b38 to
c3eb382
Compare
|
@pomegranited We probably don't need openedx-unsupported/edx-documentation#2210 as it will be automatically documented here. |
Adds a feature flag to filter courses by users preferred language by default test: add test
c3eb382 to
f1d79ca
Compare
|
@navinkarkera Perfect, thank you for fixing that nit and updating your PR description.
Sweet! Feel free to close that then. Merging this now :) |
|
@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
Adds a waffle switch to filter courses by selected site language by default
Useful information to include:
Private-ref: BB-8091Testing instructions
lms/envs/private.pyStart lms and cms using
make {lms,cms}-upAdd
courseware.discovery_default_language_filterwaffle switch in django admin.Add a new course or update language of any existing course to some other language.
Go to http://localhost:18000/courses
If you have never set your language via account settings, you should see all the courses without any filters applied.
Now change your language by going to Account page.

Englishoption is available in theLanguagefield.