-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Studio Support for Content Libraries (SOL-1, SOL-2, & SOL-3) #6046
Studio Support for Content Libraries (SOL-1, SOL-2, & SOL-3) #6046
Conversation
Thanks for the pull request, @bradenmacdonald! I've created OSPR-231 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here. |
Thanks @bradenmacdonald - looping in @smagoun too. |
/** | ||
* Provides utilities for validating libraries during creation. | ||
*/ | ||
define(["jquery", "underscore", "gettext", "js/views/utils/view_utils"], |
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.
Please write Jasmine tests for this file.
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.
It's covered (mostly) by index_spec.js
.
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.
Just make sure that the logic is actually being tested. You can get "coverage" if the file is simply loaded, but that doesn't mean you are actually testing the code.
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.
@cahrens made sure that coverage report is due to actual testing.
@bradenmacdonald I am working to get a T&L review of this code underway. We typically require 2 code reviewers for any non-trivial PRs. Can you please get a 2nd code reviewer from the Solutions team? It is also a good way for the Solutions team to become more familiar with the code. |
<li class="field text required" id="field-library-number"> | ||
<label for="new-library-number">${_("Library Code/Number")}</label> | ||
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" placeholder="${_('e.g. CSPROB')}" /> | ||
<span class="tip">${_("The unique code that identifies this library.")} <strong>${_("Note: This is part of your library URL, so no spaces or special characters are allowed and it cannot be changed.")}</strong></span> |
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 there a reason why the "Note" string is different here than at L141? For ease of translating it would be great if you could reuse the same string(s) in the two places.
I did an i18n review of all marked strings and found some unmarked ones as well. |
@bradenmacdonald Please take a look at the bok choy test that failed. If you think it is unrelated to your PR, get in touch with testeng to let them know that there is a sporadic. Here is the current code coverage report: I asked Steve to help you get a sandbox created so we can try out the feature (I'm having trouble finding his github username). @andy-armstrong will be doing the T&L review of the front-end code, and I will be doing the T&L review of the Python code in this PR. |
modulestore().has_changes(modulestore().get_course(xblock.location.course_key, depth=None)) | ||
# Except library blocks which don't use draft/publish | ||
if not isinstance(xblock.location, LibraryUsageLocator): | ||
modulestore().has_changes(modulestore().get_courselike(xblock.location.course_key, depth=None)) |
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.
Why is it necessary to get "get_courselike" (FYI, that name is not helpful) given you have already verified that xblock.location is not a LibraryUsageLocator?
@@ -406,15 +430,21 @@ def format_in_process_course_view(uca): | |||
|
|||
in_process_course_actions = [format_in_process_course_view(uca) for uca in in_process_course_actions] | |||
|
|||
# Translators: Appears on studio home "Here are all of the {enabled_types} you currently have access to in Studio:" | |||
enabled_types = _('courses and libraries') if LIBRARIES_ENABLED else _('courses') |
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.
Nit: it seems odd to have the translation of the different string parts occur different places. Perhaps just pass the complete translated string to the template here. For example (psuedo-code),
// Translator comment.
enabled_types = _('courses and libraries') if LIBRARIES_ENABLED else _('courses')
listing_description = _('Here are all the {enabled_types} you...'.format(enabled_types))
Pass listing_description to template.
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.
Would it be the worst thing in the world to just have two complete strings that you switch between? Eg,
if LIBRARIES_ENABLED:
listing_description = _('Here are all the courses and libraries you...'.)
else:
listing_description = _('Here are all the courses you...'.)
I'm relatively 😑 either way, but this way is easier to understand re: translations.
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, there may be languages where substituting the translation for 'courses' and for 'courses and libraries' into the same spot isn't correct.
The following things need to be followed up on, but otherwise I am 👍
Otherwise, it's looking great! |
176f864
to
b04f64c
Compare
@cahrens @andy-armstrong there's a problem regarding ORA problem :) In two words, before saving itself it checks if there are published version, than shows message/asks confirmation if it is already published. The check is essentially "are there such xblock in There are various ways to solve this, e.g. allowing libraries to have published and non-published versions, etc. The most straightforward and logical though (at least in my opinion) is to always consider all libraries as non-published. So this is the approach I used to fix that issue with ORA in library. Anyway, I believe this question deserves some thinking as some architectural decisions must be made. |
@andy-armstrong I couldn't reproduce "Numerical Input" problem issue. According to error message, server run out of memory, which correlates to the fact that sandbox was down yesterday. So most likely that was temporary issue having nothing to do with this PR. |
45146e8
to
2d86c2b
Compare
Squashed commits so that PR can be merged as soon as #6033 is merged (might require rebasing though) |
I double checked and the numerical input problem issue has indeed gone away. The way you solved the ORA editing issue also makes sense to me, at least for the short term. 👍 - awesome work guys! Before checking in, could you amend your commit to include your JIRA ticket number. We use this for tracking purposes. Generally the first line of the commit message is a short summary followed by a blank line, and then the third line is the JIRA ticket number. For example: |
@e-kolpakov You are only merging this to a feature branch, not master. Therefore I think this PR can be merged to the feature branch before #6033 merges to master. You will then need to rebase the feature branch on master once #6033 has merged. |
SOL-1, SOL-2, SOL-3
2d86c2b
to
4cc7b75
Compare
@andy-armstrong Thanks for noticing this - I think @e-kolpakov is out for the day now (it's pretty late for him) so I went ahead and added the stories to the commit message. @cahrens Yup, sounds good, that's also what I had in mind for #6033. Are we all good to merge? : ) Thank you for the thorough review btw, the quality of the PR improved a lot because of it! |
Just chatted with @andy-armstrong , we need two thumbs up - so I think this should be good, I'm merging. If there is any objection let me know - this goes to a feature branch so we can easily correct it there if needed. |
…ib-support Studio Support for Content Libraries (SOL-1, SOL-2, & SOL-3)
@antoviaque @explorerleslie @cahrens
Background: This is the UI code to enable creation and editing of Content Libraries. Together with #6033, it implements SOL-1, SOL-2, and SOL-3. Once #6033 has been merged to master, this branch is to be merged to
content-libraries
, which will become the new feature branch for library support.Discussion: Architecture discussed extensively on the wiki and in meetings, then the revised proposal was presented to the Arch Council on Oct. 21 and given thumbs up.
Partner information: 3rd party-hosted open edX instance, for an edX solutions client.
Merge deadline: ASAP - several other PRs are ready and blocking on this.
Dependencies: Requires #6033.