Skip to content

Commit 7f0375b

Browse files
authored
Remove branding related code from video xblock. (#37491)
* chore: remove branding related code from video_block class as it is stop being used, we have plan to remove the specialized VIDEO_CDN_URL in the next phase as after removing URL nothing will reference the branding code so we're removing it first.
1 parent 7cd4170 commit 7f0375b

4 files changed

Lines changed: 5 additions & 42 deletions

File tree

lms/djangoapps/courseware/tests/test_video_mongo.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ def test_video_constructor(self):
8888

8989
expected_context = {
9090
'autoadvance_enabled': False,
91-
'branding_info': None,
9291
'license': None,
9392
'bumper_metadata': 'null',
9493
'block_id': str(self.block.location),
@@ -177,7 +176,6 @@ def test_video_constructor(self):
177176

178177
expected_context = {
179178
'autoadvance_enabled': False,
180-
'branding_info': None,
181179
'license': None,
182180
'bumper_metadata': 'null',
183181
'block_id': str(self.block.location),
@@ -454,7 +452,6 @@ def test_get_html_track(self):
454452

455453
expected_context = {
456454
'autoadvance_enabled': False,
457-
'branding_info': None,
458455
'license': None,
459456
'bumper_metadata': 'null',
460457
'block_id': str(self.block.location),
@@ -587,7 +584,6 @@ def test_get_html_source(self):
587584

588585
initial_context = {
589586
'autoadvance_enabled': False,
590-
'branding_info': None,
591587
'license': None,
592588
'bumper_metadata': 'null',
593589
'block_id': str(self.block.location),
@@ -726,7 +722,6 @@ def test_get_html_with_mocked_edx_video_id(self):
726722

727723
initial_context = {
728724
'autoadvance_enabled': False,
729-
'branding_info': None,
730725
'license': None,
731726
'bumper_metadata': 'null',
732727
'block_id': str(self.block.location),
@@ -914,7 +909,6 @@ def helper_get_html_with_edx_video_id(self, data):
914909

915910
initial_context = {
916911
'autoadvance_enabled': False,
917-
'branding_info': None,
918912
'license': None,
919913
'bumper_metadata': 'null',
920914
'block_id': str(self.block.location),
@@ -971,21 +965,12 @@ def helper_get_html_with_edx_video_id(self, data):
971965
return context, expected_context
972966

973967
# pylint: disable=invalid-name
974-
@patch('xmodule.video_block.video_block.BrandingInfoConfig')
975968
@patch('xmodule.video_block.video_block.rewrite_video_url')
976-
def test_get_html_cdn_source(self, mocked_get_video, mock_BrandingInfoConfig):
969+
def test_get_html_cdn_source(self, mocked_get_video):
977970
"""
978971
Test if sources got from CDN
979972
"""
980973

981-
mock_BrandingInfoConfig.get_config.return_value = {
982-
"CN": {
983-
'url': 'http://www.xuetangx.com',
984-
'logo_src': 'http://www.xuetangx.com/static/images/logo.png',
985-
'logo_tag': 'Video hosted by XuetangX.com'
986-
}
987-
}
988-
989974
def side_effect(*args, **kwargs): # lint-amnesty, pylint: disable=unused-argument
990975
cdn = {
991976
'http://example.com/example.mp4': 'http://cdn-example.com/example.mp4',
@@ -1031,11 +1016,6 @@ def side_effect(*args, **kwargs): # lint-amnesty, pylint: disable=unused-argume
10311016

10321017
initial_context = {
10331018
'autoadvance_enabled': False,
1034-
'branding_info': {
1035-
'logo_src': 'http://www.xuetangx.com/static/images/logo.png',
1036-
'logo_tag': 'Video hosted by XuetangX.com',
1037-
'url': 'http://www.xuetangx.com'
1038-
},
10391019
'license': None,
10401020
'bumper_metadata': 'null',
10411021
'block_id': str(self.block.location),
@@ -1138,7 +1118,6 @@ def test_get_html_cdn_source_external_video(self):
11381118

11391119
initial_context = {
11401120
'autoadvance_enabled': False,
1141-
'branding_info': None,
11421121
'license': None,
11431122
'bumper_metadata': 'null',
11441123
'cdn_eval': False,
@@ -2380,7 +2359,6 @@ def test_bumper_metadata(self, get_url_for_profiles, get_bumper_settings, is_bum
23802359

23812360
expected_context = {
23822361
'autoadvance_enabled': False,
2383-
'branding_info': None,
23842362
'license': None,
23852363
'bumper_metadata': json.dumps(OrderedDict({
23862364
'saveStateUrl': self.block.ajax_url + '/save_user_state',
@@ -2480,7 +2458,6 @@ def prepare_expected_context(self, autoadvanceenabled_flag, autoadvance_flag):
24802458

24812459
context = {
24822460
'autoadvance_enabled': autoadvanceenabled_flag,
2483-
'branding_info': None,
24842461
'block_id': str(self.block.location),
24852462
'course_id': str(self.block.location.course_key),
24862463
'license': None,

lms/templates/video.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ <h4 class="hd hd-5">${_('Handouts')}</h4>
140140
<a class="btn-link" href="${handout}">${_('Download Handout')}</a>
141141
</div>
142142
% endif
143-
% if branding_info:
144-
<div class="branding">
145-
<span class="host-tag">${branding_info['logo_tag']}</span>
146-
<a href="${branding_info['url']}"><img class="brand-logo" src="${branding_info['logo_src']}" alt="${branding_info['logo_tag']}" /></a>
147-
</div>
148-
% endif
149143
</div>
150144
% endif
151145
% if transcript_feedback_enabled and video_id:

xmodule/static/css-builtin-blocks/VideoBlockDisplay.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
.xmodule_display.xmodule_VideoBlock .video .wrapper-video-bottom-section .wrapper-download-video,
7979
.xmodule_display.xmodule_VideoBlock .video .wrapper-video-bottom-section .wrapper-download-transcripts,
8080
.xmodule_display.xmodule_VideoBlock .video .wrapper-video-bottom-section .wrapper-handouts,
81-
.xmodule_display.xmodule_VideoBlock .video .wrapper-video-bottom-section .branding,
81+
.xmodule_display.xmodule_VideoBlock .video .wrapper-video-bottom-section ,
8282
.xmodule_display.xmodule_VideoBlock .video .wrapper-video-bottom-section .wrapper-transcript-feedback {
8383
margin-top: var(--baseline, 20px);
8484
padding-right: var(--baseline, 20px);
@@ -118,19 +118,19 @@
118118
padding-left: 4px;
119119
}
120120

121-
.xmodule_display.xmodule_VideoBlock .video .wrapper-downloads .branding {
121+
.xmodule_display.xmodule_VideoBlock .video .wrapper-downloads {
122122
padding-right: 0;
123123
}
124124

125-
.xmodule_display.xmodule_VideoBlock .video .wrapper-downloads .branding .host-tag {
125+
.xmodule_display.xmodule_VideoBlock .video .wrapper-downloads .host-tag {
126126
position: absolute;
127127
left: -9999em;
128128
display: inline-block;
129129
vertical-align: middle;
130130
color: var(--body-color, #313131);
131131
}
132132

133-
.xmodule_display.xmodule_VideoBlock .video .wrapper-downloads .branding .brand-logo {
133+
.xmodule_display.xmodule_VideoBlock .video .wrapper-downloads .brand-logo {
134134
display: inline-block;
135135
max-width: 100%;
136136
max-height: calc((var(--baseline, 20px) * 2));

xmodule/video_block/video_block.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@
103103
except ImportError:
104104
edxval_api = None
105105

106-
try:
107-
from lms.djangoapps.branding.models import BrandingInfoConfig
108-
except ImportError:
109-
BrandingInfoConfig = None
110-
111106
log = logging.getLogger(__name__)
112107

113108
# Make '_' a no-op so we can scrape strings. Using lambda instead of
@@ -294,7 +289,6 @@ def get_html(self, view=STUDENT_VIEW, context=None): # lint-amnesty, pylint: di
294289
sources = [source for source in self.html5_sources if source]
295290

296291
download_video_link = None
297-
branding_info = None
298292
youtube_streams = ""
299293
video_duration = None
300294
video_status = None
@@ -358,7 +352,6 @@ def get_html(self, view=STUDENT_VIEW, context=None): # lint-amnesty, pylint: di
358352
# Video caching is disabled for Studio. User_location is always None in Studio.
359353
# CountryMiddleware disabled for Studio.
360354
if getattr(self, 'video_speed_optimizations', True) and cdn_url:
361-
branding_info = BrandingInfoConfig.get_config().get(user_location)
362355

363356
if self.edx_video_id and edxval_api and video_status != 'external':
364357
for index, source_url in enumerate(sources):
@@ -477,7 +470,6 @@ def get_html(self, view=STUDENT_VIEW, context=None): # lint-amnesty, pylint: di
477470

478471
template_context = {
479472
'autoadvance_enabled': autoadvance_enabled,
480-
'branding_info': branding_info,
481473
'bumper_metadata': json.dumps(self.bumper['metadata']), # pylint: disable=E1101
482474
'cdn_eval': cdn_eval,
483475
'cdn_exp_group': cdn_exp_group,

0 commit comments

Comments
 (0)