Skip to content

Commit

Permalink
Merge pull request openedx#18341 from edx/revert-18290-switch-contain…
Browse files Browse the repository at this point in the history
…er-factory-to-webpack

Revert "Switch container factory to webpack"
  • Loading branch information
cpennington authored Jun 7, 2018
2 parents 6d8aebe + 18d93b0 commit 947d827
Show file tree
Hide file tree
Showing 158 changed files with 6,598 additions and 7,161 deletions.
31 changes: 11 additions & 20 deletions cms/djangoapps/contentstore/features/advanced_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,17 @@
@step('I select the Advanced Settings$')
def i_select_advanced_settings(step):

world.wait_for_js_to_load() # pylint: disable=no-member
world.wait_for_js_variable_truthy('window.studioNavMenuActive') # pylint: disable=no-member

for _ in range(5):
world.click_course_settings() # pylint: disable=no-member

# The click handlers are set up so that if you click <body>
# the menu disappears. This means that if we're even a *little*
# bit off on the last item ('Advanced Settings'), the menu
# will close and the test will fail.
# For this reason, we retrieve the link and visit it directly
# This is what the browser *should* be doing, since it's just a native
# link with no JavaScript involved.
link_css = 'li.nav-course-settings-advanced a'
try:
world.wait_for_visible(link_css) # pylint: disable=no-member
break
except AssertionError:
continue

world.click_course_settings()

# The click handlers are set up so that if you click <body>
# the menu disappears. This means that if we're even a *little*
# bit off on the last item ('Advanced Settings'), the menu
# will close and the test will fail.
# For this reason, we retrieve the link and visit it directly
# This is what the browser *should* be doing, since it's just a native
# link with no JavaScript involved.
link_css = 'li.nav-course-settings-advanced a'
world.wait_for_visible(link_css)
link = world.css_find(link_css).first['href']
world.visit(link)

Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/features/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def create_unit_from_course_outline():
world.css_click(selector)

world.wait_for_mathjax()
world.wait_for_xmodule()
world.wait_for_loading()

assert world.is_css_present('ul.new-component-type')
Expand Down
5 changes: 5 additions & 0 deletions cms/djangoapps/contentstore/features/html-editor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Feature: CMS.HTML Editor
Then I can modify the display name
And my display name change is persisted on save

Scenario: Edit High Level source is available for LaTeX html
Given I have created an E-text Written in LaTeX
When I edit and select Settings
Then Edit High Level Source is visible

Scenario: TinyMCE image plugin sets urls correctly
Given I have created a Blank HTML Page
When I edit the page
Expand Down
15 changes: 15 additions & 0 deletions cms/djangoapps/contentstore/features/problem-editor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,22 @@ Feature: CMS.Problem Editor
And I can modify the display name
Then If I press Cancel my changes are not persisted

Scenario: Edit High Level source is available for LaTeX problem
Given I have created a LaTeX Problem
When I edit and select Settings
Then Edit High Level Source is visible

Scenario: Cheat sheet visible on toggle
Given I have created a Blank Common Problem
And I can edit the problem
Then I can see cheatsheet

Scenario: Reply on Annotation and Return to Annotation link works for Annotation problem
Given I have created a unit with advanced module "annotatable"
And I have created an advanced component "Annotation" of type "annotatable"
And I have created an advanced problem of type "Blank Advanced Problem"
And I edit first blank advanced problem for annotation response
When I mouseover on "annotatable-span"
Then I can see Reply to Annotation link
And I see that page has scrolled "down" when I click on "annotatable-reply" link
And I see that page has scrolled "up" when I click on "annotation-return" link
60 changes: 0 additions & 60 deletions cms/djangoapps/pipeline_js/js/xmodule.js

This file was deleted.

45 changes: 45 additions & 0 deletions cms/djangoapps/pipeline_js/templates/xmodule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## This file is designed to load all the XModule Javascript files in one wad
## using requirejs. It is passed through the Mako template system, which
## populates the `urls` variable with a list of paths to XModule JS files.
## These files assume that several libraries are available and bound to
## variables in the global context, so we load those libraries with requirejs
## and attach them to the global context manually.
define(["jquery", "underscore", "codemirror", "tinymce",
"jquery.tinymce", "jquery.qtip", "jquery.scrollTo", "jquery.flot",
"jquery.cookie",
"utility"],
function($, _, CodeMirror, tinymce) {
window.$ = $;
window._ = _;
require(['mathjax']);
window.CodeMirror = CodeMirror;
window.RequireJS = {
'requirejs': requirejs,
'require': require,
'define': define
};
/**
* Loads all modules one-by-one in exact order.
* The module should be used until we'll use RequireJS for XModules.
* @param {Array} modules A list of urls.
* @return {jQuery Promise}
**/
var requireQueue = function(modules) {
var deferred = $.Deferred();
var loadScript = function (queue) {
// Loads the next script if queue is not empty.
if (queue.length) {
require([queue.shift()], function() {
loadScript(queue);
});
} else {
deferred.resolve();
}
};

loadScript(modules.concat());
return deferred.promise();
};

return requireQueue(${urls});
});
10 changes: 10 additions & 0 deletions cms/djangoapps/pipeline_js/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
URL patterns for Javascript files used to load all of the XModule JS in one wad.
"""
from django.conf.urls import url
from pipeline_js.views import xmodule_js_files, requirejs_xmodule

urlpatterns = [
url(r'^files\.json$', xmodule_js_files, name='xmodule_js_files'),
url(r'^xmodule\.js$', requirejs_xmodule, name='requirejs_xmodule'),
]
18 changes: 0 additions & 18 deletions cms/djangoapps/pipeline_js/utils.py

This file was deleted.

44 changes: 44 additions & 0 deletions cms/djangoapps/pipeline_js/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""
Views for returning XModule JS (used by requirejs)
"""

import json

from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.http import HttpResponse

from edxmako.shortcuts import render_to_response


def get_xmodule_urls():
"""
Returns a list of the URLs to hit to grab all the XModule JS
"""
pipeline_js_settings = settings.PIPELINE_JS["module-js"]
if settings.DEBUG:
paths = [path.replace(".coffee", ".js") for path in pipeline_js_settings["source_filenames"]]
else:
paths = [pipeline_js_settings["output_filename"]]
return [staticfiles_storage.url(path) for path in paths]


def xmodule_js_files(request): # pylint: disable=unused-argument
"""
View function that returns XModule URLs as a JSON list; meant to be used
as an API
"""
urls = get_xmodule_urls()
return HttpResponse(json.dumps(urls), content_type="application/json")


def requirejs_xmodule(request): # pylint: disable=unused-argument
"""
View function that returns a requirejs-wrapped Javascript file that
loads all the XModule URLs; meant to be loaded via requireJS
"""
return render_to_response(
"xmodule.js",
{"urls": get_xmodule_urls()},
content_type="text/javascript",
)
4 changes: 4 additions & 0 deletions cms/envs/acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def seed():
# We do not yet understand why this occurs. Setting this to true is a stopgap measure
USE_I18N = True

# Override the test stub webpack_loader that is installed in test.py.
INSTALLED_APPS = [app for app in INSTALLED_APPS if app != 'openedx.tests.util.webpack_loader']
INSTALLED_APPS.append('webpack_loader')

# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
# django.contrib.staticfiles used to be loaded by lettuce, now we must add it ourselves
# django.contrib.staticfiles is not added to lms as there is a ^/static$ route built in to the app
Expand Down
3 changes: 0 additions & 3 deletions cms/envs/bok_choy.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
# Needed to enable licensing on video modules
XBLOCK_SETTINGS.update({'VideoDescriptor': {'licensing_enabled': True}})

# Capture the console log via template includes, until webdriver supports log capture again
CAPTURE_CONSOLE_LOG = True

############################ STATIC FILES #############################

# Enable debug so that static assets are served by Django
Expand Down
6 changes: 0 additions & 6 deletions cms/envs/bok_choy_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@
}

LOGGING['loggers']['tracking']['handlers'] = ['console']

# Point the URL used to test YouTube availability to our stub YouTube server
BOK_CHOY_HOST = os.environ['BOK_CHOY_HOSTNAME']
YOUTUBE['API'] = "http://{}:{}/get_youtube_api/".format(BOK_CHOY_HOST, YOUTUBE_PORT)
YOUTUBE['METADATA_URL'] = "http://{}:{}/test_youtube/".format(BOK_CHOY_HOST, YOUTUBE_PORT)
YOUTUBE['TEXT_API']['url'] = "{}:{}/test_transcripts_youtube/".format(BOK_CHOY_HOST, YOUTUBE_PORT)
2 changes: 2 additions & 0 deletions cms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

# Want static files in the same dir for running on jenkins.
STATIC_ROOT = TEST_ROOT / "staticfiles"
INSTALLED_APPS = [app for app in INSTALLED_APPS if app != 'webpack_loader']
INSTALLED_APPS.append('openedx.tests.util.webpack_loader')
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"

GITHUB_REPO_ROOT = TEST_ROOT / "data"
Expand Down
7 changes: 6 additions & 1 deletion cms/static/cms/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@
modules: getModulesList([
'js/factories/asset_index',
'js/factories/base',
'js/factories/container',
'js/factories/course_create_rerun',
'js/factories/course_info',
'js/factories/edit_tabs',
'js/factories/export',
'js/factories/group_configurations',
'js/certificates/factories/certificates_page_factory',
'js/factories/index',
'js/factories/library',
'js/factories/manage_users',
'js/factories/outline',
'js/factories/register',
'js/factories/settings',
'js/factories/settings_advanced',
'js/factories/settings_graders',
'js/factories/videos_index'
'js/factories/textbooks',
'js/factories/videos_index',
'js/factories/xblock_validation'
]),
/**
* By default all the configuration for optimization happens from the command
Expand Down
Loading

0 comments on commit 947d827

Please sign in to comment.