-
Notifications
You must be signed in to change notification settings - Fork 17
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
Issue 257: Configurable default player ID #262
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #262 +/- ##
=========================================
+ Coverage 85.76% 85.8% +0.04%
=========================================
Files 41 41
Lines 2578 2593 +15
Branches 26 26
=========================================
+ Hits 2211 2225 +14
- Misses 364 365 +1
Partials 3 3
Continue to review full report at Codecov.
|
bd5022d
to
b86561f
Compare
1a4ad5d
to
102417d
Compare
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.
Looks good.
Couple things need to be addressed before the merge.
submit_data.setdefault(key, value) | ||
# if key is present in submit data but set to empty value: | ||
if key in submit_data and not submit_data[key]: | ||
submit_data[key] = value |
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 looks like this entire for-loop can be simplified down to:
submit_data.update(self.settings)
return submit_data
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.
dict.update()
overrides existed values but wanna to set only those which are empty or are absent.
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.
Ah, ok. Good point.
video_xblock/utils.py
Outdated
@@ -133,3 +133,17 @@ def normalize_transcripts(transcripts): | |||
Transcript = namedtuple('Transcript', [ | |||
'id', 'label', 'lang', 'lang_id', 'content', 'format', 'video_id', 'source', 'url' | |||
]) | |||
|
|||
|
|||
def get_current_site_name(): |
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.
Move this method to SettingsMixin
, it belongs there.
video_xblock/mixins.py
Outdated
@@ -530,22 +530,37 @@ class SettingsMixin(XBlock): | |||
|
|||
Sample default settings in /edx/app/edxapp/cms.env.json: | |||
"XBLOCK_SETTINGS": { | |||
"video_xblock": { | |||
"domain.com": { |
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.
Here and everywhere, use example.com
instead of example.com
.
Example.com is established to be used for illustrative examples in documents.
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.
Didn't know that!
…ongang/xblock-video into 257-configurable-player-id
* Reimplement population fields with default values * Cover with unittest 3PlayMedia get_3pm_transcripts_list API failure case * Cover with unittests subdomain fatching utility * Refactor XBLOCK_SETTINGS format * Merge branch 'dev' of https://github.com/raccoongang/xblock-video into 257-configurable-player-id * Fix code review complaints
Customer requested the ability to set the initial default value to "player_id" xblock field.
Now we check if the DEFAULT_PLAYER_ID is set, we use it and settings falls back to 'default' if it's not.
This feature implementation includes per-microsite default settings ability.