-
Notifications
You must be signed in to change notification settings - Fork 0
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
PADV-1191: Add DeepLinkingForm to DeepLinkingView. #35
Conversation
@@ -0,0 +1,8 @@ | |||
"""learning_sequences module backend (olive v1).""" |
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.
@kuipumu Why is this olive v1?
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.
@anfbermudezme This is following the same formula from previously defined edx_wrapper backends, which was also done following the structure from course_operations. I'm not sure what could be done to improve this but the (olive v1) comment is just to make clear that the o_v1 suffix on the module name refers to Olive and that this is the v1 of such 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.
@kuipumu Understood I thought that was the last stable version of olive https://github.com/openedx/edx-platform/tree/open-release/olive.4.
@patch.object(DeepLinkingForm, '__init__', return_value=None) | ||
def test_get_deep_link_resources( | ||
self, | ||
deep_linking_form_init: MagicMock, # pylint: disable=W0613 |
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.
@kuipumu Please use the explicit pylint title.
deep_linking_form_init: MagicMock, # pylint: disable=W0613 | |
deep_linking_form_init: MagicMock, # pylint: disable=unused-argument |
@patch.object(DeepLinkingForm, '__init__', return_value=None) | ||
def test_get_content_items_choice( | ||
self, | ||
deep_linking_form_init: MagicMock, # pylint: disable=W0613 |
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.
@kuipumu Please use the explicit pylint title.
@patch.object(DeepLinkingForm, '__init__', return_value=None) | ||
def test_get_content_items_choices( | ||
self, | ||
deep_linking_form_init: MagicMock, # pylint: disable=W0613 |
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.
@kuipumu Please use the explicit pylint title.
List of DeepLinkResource objects or an empty list | ||
|
||
""" | ||
return [ |
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.
@kuipumu It is necessary to use a list, what would happen if a set were used?
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.
@anfbermudezme It will work the same, the return just needs to be iterable, I will change it to a set since avoids having multiple occurrences and we don't care about order in this case, however both a list or a set will work in this case
""" | ||
return [ | ||
self.get_content_items_choice(course, request) | ||
for course in course_context().objects.all() |
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.
This query can become pretty big, do you think it is worth to implement a more robust field? One that has a search option and progressive loading? or maybe only retrieve the courses which are specified in a site 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.
@alexjmpb Right now there is this other PR that will separate the queryset into another method of this form: #36
I do think we need to come up with a more robust way to handle this form since there seems to be the future requirement to filter per institutions, licenses or even select unit or components, I'm thinking on using a more dynamic form using a JSONField and a custom form template, I'm still not sure of what will be the UI requirements so for now I think is OK to handle it has we are doing on #36.
What do you think?, do you have any resources that could be useful to create a more dynamic form?.
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.
No I was worried of not applying a filter on this since it would query all the courses in prod. But #36 does the job, maybe it's worth discussing later if a select field with a search bar can be implemented.
Ticket
https://agile-jira.pearson.com/browse/PADV-1191
Description
This PR add the DeepLinkingForm to the DeepLinkingFormView that was created on the PR for PADV-1190. This PR handles the second and third step on the Deep Linking UI process.
Type of Change
deep_linking/forms.py
module.learning_sequences
edxapp_wrapper backend.DeepLinkingForm
Django form.DeepLinkingForm
toDeepLinkingFormView
Django view logic.Testing:
make dev.up.lms
.openedx_lti_tool_plugin
on the LMS.ngrok http 18000