-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: added organization dropdown in studio #30975
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: added organization dropdown in studio #30975
Conversation
|
Thanks for the pull request, @Ian2012! 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. |
|
@Ian2012 Thank you for the contribution. Is this ready for our review? |
|
@natabene I was waiting for feedback from the community. Do you know someone that maybe interested or has knowledge of the CourseCreator permission? |
|
@Ian2012 I am not aware. |
|
Hello @natabene! |
|
Hi, Jon here from the UX team. I'm unable to test, but based on the screenshot this looks like a nice improvement. |
|
Hi @jfay1, thanks for the reply Would you mind explaining why you were unable to test it? Are you facing some error? |
|
Hi @Ian2012, no errors but I'm wondering if I need to test on a certain site? Sometimes I'm sent a test link on stage etc. I'm not sure how to get to the screen in step 2 but I do have permission to create courses in studio. When I create a new course I see the old field, but that's what I would expect. |
|
Hey @jmakowski1123 what do you think of this feature. |
|
@Ian2012 I think this is a good improvement; you should try to fix the test to have a proper review. |
5bd8267 to
5fe5ab7
Compare
|
Hello. I can review this one if we're clear from the product side. |
578bd57 to
cabea10
Compare
@santiagosuarezedunext It seems to be a useful feature in terms of fixing a known pain point. What does the behavior look like if there are multiple organizations listed in the dropdown? Do they display alphabetically? Is a user able to scroll through the full list of enabled organizations, as well as start typing an organization and be offered a dropdown of selections based on what he/she typed? |
|
Hi @jmakowski1123, What does the behavior look like if there are multiple organizations listed in the dropdown? The organizations will be sorted by id (creation date). Is a user able to scroll through the full list of enabled organizations, as well as start typing an organization and be offered a dropdown of selections based on what he/she typed? No, the dropdown was added because it worked like that before (with the option to type in) but users don't really know which organizations they have access. Staff users and users with permission to create organizations still have the old input (type and get suggestions) |
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.
| if user.count() == 0: | |
| return [] | |
| elif user[0].all_organizations: | |
| # User is defined to be unique, can assume a single entry. | |
| return Organization.objects.all().values_list('short_name', flat=True) | |
| else: | |
| return user[0].organizations.all().values_list('short_name', flat=True) | |
| if not user: | |
| organizations = [] | |
| elif user[0].all_organizations: | |
| organizations = Organization.objects.all().values_list('short_name', flat=True) | |
| else: | |
| organizations = user[0].organizations.all().values_list('short_name', flat=True) | |
| return organizations |
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.
Also, I believe some testing would be beneficial. You could add tests to test_organizations, extend the existing ones or create a new test suite.
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.
The test related to CourseCreators have been modified because this is the main functionality that is affected by those changes
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 I see is that you're only testing get_allowed_organizations
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.
More test have been added to can_create_courses. This permission is only validation on the frontend, because this permission is checked once a request is made to create a course or library in the backend
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.
is new-library-org missing here?
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.
In fact, I need to verify if this change is applied correctly but I don't know how to compile those SCSS files. Do you know who can give me a hand with the styles?
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.
If you're using tutor you could try this from the docs and then inspect the browser. You could do a before and after and post it under this comment
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.
837feff to
4ce0fab
Compare
|
I've tested the following in my local environment:
Technically, this is working like a charm—also, thanks @Ian2012, for considering my suggestions. Given this is under product review, I won't leave my approval yet. |
|
@mariajgrimaldi Is there anything that we can do to push this forward? |
|
@Ian2012: we need to wait for the product review. Is there anything we could do in the meantime? @jmakowski1123 |
4ce0fab to
7c32305
Compare
@mariajgrimaldi - we're planning to leave those labels on just in case for some reason we need to go back to this PR (or any PR that was marked for Product review. Thank you for checking! |
|
@mphilbrick211 good! -just checking- this can be merged, right -from the product view-? |
@mariajgrimaldi Looks like it per @cablaa77's comment above! |
|
@mariajgrimaldi just checking in to see if this can be merged? |
|
@mphilbrick211: the branch is still out-of-date, once @Ian2012 updates it, I'll merge this :) |
mariajgrimaldi
left a comment
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'll be merging this tomorrow :)
Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>
8c0253b to
c8efb16
Compare
|
@Ian2012 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
Hi @Ian2012 @mariajgrimaldi our authors on edx.org are running into a 500 error attempting to load the v1 library page as: File "/edx/app/edxapp/edx-platform/cms/djangoapps/contentstore/views/course.py", line 622, in library_listing return render_to_response('index.html', data) The course home page is loading fine, so I presume this has to do with the fact that library_listing_return does not specify an Can you confirm this behavior with V1 libraries is working as expected, and is a peculiarity of our deployment? It might be, as |
|
@connorhaugh I'll check this right away. BTW, you tagged the wrong Maria 😅 |
|
@Ian2012 can you give us a hand, please? thanks |
|
Hi @connorhaugh, The issue is caused because in the context of the 'allowed_organizations': get_allowed_organizations(request.user),
'can_create_organizations': user_can_create_organizations(request.user),@connorhaugh can you revert the commit or should I open a new PR with the fix? Also, this issue is triggered only when this waffle flag is enabled: ### contentstore.split_library_on_studio_dashboard
SPLIT_LIBRARY_ON_DASHBOARD = WaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.split_library_on_studio_dashboard',
__name__,
CONTENTSTORE_LOG_PREFIX,
) |
|
@connorhaugh Temporarily, you can disable this waffle flag: |
|
Thank you, Cristhian. @connorhaugh: that flag is turned off by default, so it wasn't included as one of our test cases. Please, let us know how to proceed. |
|
Based on what I have heard from our support team, a fix forward is acceptable. Thanks so much your prompt response @Ian2012 @mariajgrimaldi, and all of your help. Let me know if there is anything I can do to help! Seems like the fix is rather straightforward. We have that waffle flag (split_library_on_studio_dashboard) on on our production env, but not our staging env. |
|
I will review #31752 promptly. |
|
thank you! @connorhaugh @Ian2012 |


Description
This PR adds a dropdown to select the organization. The dropdown will only be activated for users with CourseCreator permission to specific organizations in Studio.
Use cases:
When
FEATURES['ENABLE_CREATOR_GROUP'] = Trueand the user has CourseCreator permission granted, a dropdown will appear with all specific organizations allowed. In case ofall_organizationssetting is enabled, all organizations will appear in the dropdown.In case the user is staff, he can create organizations it will work as before:
Testing instructions
Result:
