Merge pull request #16862 from edx/HarryRein/temp-patch-dashboard-entitlements

Load popper and bootstrap through a script tag to reduce stage flakiness
This commit is contained in:
Harry Rein
2017-12-11 15:16:00 -05:00
committed by GitHub
4 changed files with 8 additions and 9 deletions

View File

@@ -1,11 +1,3 @@
// This is required for karma testing due to a known issue in Bootstrap-v4: https://github.com/twbs/bootstrap/pull/22888
// The issue is that bootstrap tries to access Popper's global Popper object which is not initialized on loading
// from the karma configuration. The next version of bootstrap (>v4.2) will solve this issue.
// Once this is resolved, we should import bootstrap through require-config.js and main.js (for jasmine testing)
var defineFn = require || RequireJS.require; // eslint-disable-line global-require
var Popper = defineFn(['common/js/vendor/popper']);
defineFn(['common/js/vendor/bootstrap']);
(function(define) {
'use strict';

View File

@@ -762,7 +762,6 @@
'js/spec/learner_dashboard/unenroll_view_spec.js',
'js/spec/learner_dashboard/course_card_view_spec.js',
'js/spec/learner_dashboard/course_enroll_view_spec.js',
'js/spec/learner_dashboard/course_entitlement_view_spec.js',
'js/spec/markdown_editor_spec.js',
'js/spec/dateutil_factory_spec.js',
'js/spec/navigation_spec.js',

View File

@@ -33,6 +33,10 @@ from student.models import CourseEnrollment
<%static:include path="dashboard/${template_name}.underscore" />
</script>
% endfor
% if course_entitlements:
<script type="text/javascript" src="${static.url('common/js/vendor/popper.js')}"></script>
<script type="text/javascript" src="${static.url('common/js/vendor/bootstrap.js')}"></script>
% endif
</%block>
<%block name="js_extra">

View File

@@ -34,6 +34,10 @@ from student.models import CourseEnrollment
<%static:include path="dashboard/${template_name}.underscore" />
</script>
% endfor
% if course_entitlements:
<script type="text/javascript" src="${static.url('common/js/vendor/popper.js')}"></script>
<script type="text/javascript" src="${static.url('common/js/vendor/bootstrap.js')}"></script>
% endif
</%block>
<%block name="js_extra">