Commit 60fab86f by Andy Armstrong Committed by Renzo Lucioni

Reconcile double reverts

Resolves conflicts between reverts of pattern library test pages and multi-site comprehensive theming, and the re-introduction of pattern library test pages. Fixes a pipeline rendering test which relied on other tests updating assets. The test now ensures that static assets are available before running.
parent affee692
// ------------------------------ // ------------------------------
// Studio: Shared Build Compile // Studio: Shared Build Compile
// Version 1 styling (pre-Pattern Library)
// About: Sass compile for Studio that are shared between LTR and RTL UI. Configuration and vendor specific imports happen before this shared set of imports are compiled in the studio-main-*.scss files. // About: Sass compile for Studio that are shared between LTR and RTL UI. Configuration and vendor specific imports happen before this shared set of imports are compiled in the studio-main-*.scss files.
......
// ------------------------------
// Studio: Shared Build Compile
// Version 2 - introduces the Pattern Library
// Configuration
@import 'config';
// Extensions
// ------------------------------
// Studio configuration settings
// ------------------------------
// #VARIABLES
// ------------------------------
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
@import 'bourbon/bourbon'; // lib - bourbon @import 'bourbon/bourbon'; // lib - bourbon
@import 'vendor/bi-app/bi-app-rtl'; // set the layout for right to left languages @import 'vendor/bi-app/bi-app-rtl'; // set the layout for right to left languages
@import 'build'; // shared app style assets/rendering @import 'build-v1'; // shared app style assets/rendering
// studio - css architecture // Studio - css architecture
// Version 1 styling (pre-Pattern Library)
// ==================== // ====================
// Table of Contents // Table of Contents
...@@ -17,4 +18,4 @@ ...@@ -17,4 +18,4 @@
@import 'bourbon/bourbon'; // lib - bourbon @import 'bourbon/bourbon'; // lib - bourbon
@import 'vendor/bi-app/bi-app-ltr'; // set the layout for left to right languages @import 'vendor/bi-app/bi-app-ltr'; // set the layout for left to right languages
@import 'build'; // shared app style assets/rendering @import 'build-v1'; // shared app style assets/rendering
// ------------------------------
// Studio main styling
// Version 2 - introduces the Pattern Library
// NOTE: This is the right-to-left (RTL) configured style compile.
// It should mirror main-ltr w/ the exception of bi-app references.
// Load the RTL version of the edX Pattern Library
$pattern-library-path: '../edx-pattern-library' !default;
@import 'edx-pattern-library/pattern-library/sass/edx-pattern-library-rtl';
// Load the shared build
@import 'build-v2';
// ------------------------------
// Studio main styling
// Version 2 - introduces the Pattern Library
// NOTE: This is the left-to-right (LTR) configured style compile.
// It should mirror main-rtl w/ the exception of bi-app references.
// Load the LTR version of the edX Pattern Library
$pattern-library-path: '../edx-pattern-library' !default;
@import 'edx-pattern-library/pattern-library/sass/edx-pattern-library-ltr';
// Load the shared build
@import 'build-v2';
...@@ -13,6 +13,7 @@ from openedx.core.djangolib.js_utils import ( ...@@ -13,6 +13,7 @@ from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string dump_js_escaped_json, js_escaped_string
) )
%> %>
<%page expression_filter="h"/> <%page expression_filter="h"/>
<!doctype html> <!doctype html>
<!--[if lte IE 9]><html class="ie9 lte9" lang="${LANGUAGE_CODE}"><![endif]--> <!--[if lte IE 9]><html class="ie9 lte9" lang="${LANGUAGE_CODE}"><![endif]-->
...@@ -42,7 +43,8 @@ from openedx.core.djangolib.js_utils import ( ...@@ -42,7 +43,8 @@ from openedx.core.djangolib.js_utils import (
<%static:css group='style-vendor'/> <%static:css group='style-vendor'/>
<%static:css group='style-vendor-tinymce-content'/> <%static:css group='style-vendor-tinymce-content'/>
<%static:css group='style-vendor-tinymce-skin'/> <%static:css group='style-vendor-tinymce-skin'/>
<%static:css group='style-main'/>
<%static:css group='${self.attr.main_css}'/>
<%include file="widgets/segment-io.html" /> <%include file="widgets/segment-io.html" />
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<ul> <ul>
<li><a href="container.html">Container page</a></li> <li><a href="container.html">Container page</a></li>
<li><a href="unit.html">Unit page</a></li> <li><a href="unit.html">Unit page</a></li>
<li><a href="pattern-library-test.html">Pattern Library test page</a></li>
</ul> </ul>
</section> </section>
</li> </li>
......
...@@ -5,6 +5,7 @@ from unittest import skipUnless ...@@ -5,6 +5,7 @@ from unittest import skipUnless
from django.conf import settings from django.conf import settings
from django.test import TestCase from django.test import TestCase
from paver.easy import call_task
from pipeline_mako import render_require_js_path_overrides, compressed_css, compressed_js from pipeline_mako import render_require_js_path_overrides, compressed_css, compressed_js
...@@ -42,6 +43,14 @@ class RequireJSPathOverridesTest(TestCase): ...@@ -42,6 +43,14 @@ class RequireJSPathOverridesTest(TestCase):
class PipelineRenderTest(TestCase): class PipelineRenderTest(TestCase):
"""Test individual pipeline rendering functions. """ """Test individual pipeline rendering functions. """
@classmethod
def setUpClass(cls):
"""
Create static assets once for all pipeline render tests.
"""
super(PipelineRenderTest, cls).setUpClass()
call_task('pavelib.assets.update_assets', args=('lms', '--settings=test'))
@skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in LMS') @skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in LMS')
@ddt.data( @ddt.data(
(True,), (True,),
......
// ------------------------------ // ------------------------------
// Open edX Certificates: Shared Build Compile // Open edX Certificates: Shared Build Compile
// About: Sass compile for Open edX Certificates elements that are shared between LTR and RTL UI. Configuration and vendor specific imports happen before this shared set of imports are compiled in the main-*.scss files. // About: Sass compile for Open edX Certificates elements that are shared between LTR and RTL UI.
// Configuration and vendor specific imports happen before this shared set of imports are compiled
// in the main-*.scss files.
// ------------------------------ // Configuration
// #CONFIG + LIB
// ------------------------------
@import 'lib';
@import 'config'; @import 'config';
@import '../../../../node_modules/edx-pattern-library/pattern-library/sass/edx-pattern-library';
// ------------------------------ // Extensions
// #EXTENSIONS
// ------------------------------
@import 'utilities'; @import 'utilities';
@import 'base'; @import 'base';
@import 'components'; @import 'components';
......
// ------------------------------ // ------------------------------
// Open edX Certificates: Config // Open edX Certificates: Config
// About: variable and configuration overrides
// #VARIABLES
// ------------------------------ // ------------------------------
// #VARIABLES // #VARIABLES
// ------------------------------ // ------------------------------
$pattern-library-path: '../../edx-pattern-library' !default;
// certificate characteristics // certificate characteristics
$cert-base-color: palette(grayscale-cool, dark); $cert-base-color: palette(grayscale-cool, dark);
......
// ------------------------------
// Open edX Certificates: Main Style Compile
// About: third party libraries and dependencies import
@import '../../../../node_modules/edx-pattern-library/node_modules/bourbon/app/assets/stylesheets/bourbon';
@import '../../../../node_modules/edx-pattern-library/node_modules/susy/sass/susy';
@import '../../../../node_modules/edx-pattern-library/node_modules/breakpoint-sass/stylesheets/breakpoint';
// ------------------------------
// Open edX Certificates: Main Style Compile
// About: Sass partial for defining settings and utilities for LTR-centric layouts.
// #SETTINGS
// #LIB
// ----------------------------
// #SETTINGS
// ----------------------------
$layout-direction: ltr;
// currently needed since platform Sass won't obey https://github.com/edx/ux-pattern-library/blob/master/pattern-library/sass/patterns/_grid.scss#L23
$grid-direction-default: ltr;
$grid-direction-reversed: ltr;
// ----------------------------
// #LIB
// ----------------------------
@import '../../../../node_modules/edx-pattern-library/node_modules/bi-app-sass/bi-app/bi-app-ltr';
// ------------------------------
// Open edX Certificates: Main Style Compile
// About: Sass partial for defining settings and utilities for LTR-centric layouts.
// #SETTINGS
// #LIB
// ----------------------------
// #SETTINGS
// ----------------------------
$layout-direction: rtl;
// currently needed since platform Sass won't obey https://github.com/edx/ux-pattern-library/blob/master/pattern-library/sass/patterns/_grid.scss#L23
$grid-direction-default: rtl;
$grid-direction-reversed: ltr;
// ----------------------------
// #LIB
// ----------------------------
@import '../../../../node_modules/edx-pattern-library/node_modules/bi-app-sass/bi-app/bi-app-rtl';
...@@ -3,16 +3,13 @@ ...@@ -3,16 +3,13 @@
// About: Sass compile for the Open edX Certificates Elements. // About: Sass compile for the Open edX Certificates Elements.
// NOTE: This is the left to right (LTR) configured style compile. It should mirror main-rtl w/ the exception of bi-app references. // NOTE: This is the left to right (LTR) configured style compile.
// It should mirror main-rtl w/ the exception of bi-app references.
// ------------------------------ // Load the LTR version of the edX Pattern Library
// #CONFIG - layout direction $pattern-library-path: '../../edx-pattern-library' !default;
// ------------------------------ @import 'edx-pattern-library/pattern-library/sass/edx-pattern-library-ltr';
@import 'ltr'; // LTR-specifc settings and utilities
// ------------------------------ // Load the shared build
// #BUILD @import 'build';
// ------------------------------
@import 'build'; // shared compile/build order for both LTR and RTL UI
...@@ -3,16 +3,13 @@ ...@@ -3,16 +3,13 @@
// About: Sass compile for the Open edX Certificates Elements. // About: Sass compile for the Open edX Certificates Elements.
// NOTE: This is the right to left (RTL) configured style compile. It should mirror main-ltr w/ the exception of bi-app references. // NOTE: This is the right to left (RTL) configured style compile.
// It should mirror main-ltr w/ the exception of bi-app references.
// ------------------------------ // Load the RTL version of the edX Pattern Library
// #CONFIG - layout direction $pattern-library-path: '../../edx-pattern-library' !default;
// ------------------------------ @import 'edx-pattern-library/pattern-library/sass/edx-pattern-library-rtl';
@import 'rtl'; // RTL-specifc settings and utilities
// ------------------------------ // Load the shared build
// #BUILD @import 'build';
// ------------------------------
@import 'build'; // shared compile/build order for both LTR and RTL UI
// ------------------------------
// LMS: Shared Build Compile
// Version 2 - introduces the Pattern Library
// Configuration
@import 'config';
// Extensions
// ------------------------------
// LMS configuration settings
// ------------------------------
// #VARIABLES
// ------------------------------
// lms - css application architecture // LMS - CSS application architecture
// Version 1 styling (pre-Pattern Library)
// ==================== // ====================
// libs and resets *do not edit* // libs and resets *do not edit*
...@@ -18,4 +19,4 @@ ...@@ -18,4 +19,4 @@
// theme, for old-style deprecated theming. // theme, for old-style deprecated theming.
//<THEME-OVERRIDE> //<THEME-OVERRIDE>
@import 'build-lms'; // shared app style assets/rendering @import 'build-lms-v1'; // shared app style assets/rendering
// lms - css application architecture // LMS - CSS application architecture
// Version 1 styling (pre-Pattern Library)
// ==================== // ====================
// libs and resets *do not edit* // libs and resets *do not edit*
...@@ -17,4 +18,4 @@ ...@@ -17,4 +18,4 @@
// theme, for old-style deprecated theming. // theme, for old-style deprecated theming.
//<THEME-OVERRIDE> //<THEME-OVERRIDE>
@import 'build-lms'; // shared app style assets/rendering @import 'build-lms-v1'; // shared app style assets/rendering
// ------------------------------
// LMS main styling
// Version 2 - introduces the Pattern Library
// NOTE: This is the right-to-left (RTL) configured style compile.
// It should mirror lms-main-v2 w/ the exception of bi-app references.
// Load the RTL version of the edX Pattern Library
$pattern-library-path: '../edx-pattern-library' !default;
@import 'edx-pattern-library/pattern-library/sass/edx-pattern-library-rtl';
// Load the shared build
@import 'build-lms-v2';
// ------------------------------
// LMS main styling
// Version 2 - introduces the Pattern Library
// NOTE: This is the left-to-right (LTR) configured style compile.
// It should mirror lms-main-v2-rtl w/ the exception of bi-app references.
// Load the RTL version of the edX Pattern Library
$pattern-library-path: '../edx-pattern-library' !default;
@import 'edx-pattern-library/pattern-library/sass/edx-pattern-library-ltr';
// Load the shared build
@import 'build-lms-v2';
...@@ -60,17 +60,7 @@ from pipeline_mako import render_require_js_path_overrides ...@@ -60,17 +60,7 @@ from pipeline_mako import render_require_js_path_overrides
<link rel="icon" type="image/x-icon" href="${static.url(static.get_value('favicon_path', settings.FAVICON_PATH))}" /> <link rel="icon" type="image/x-icon" href="${static.url(static.get_value('favicon_path', settings.FAVICON_PATH))}" />
<%static:css group='style-vendor'/> <%static:css group='style-vendor'/>
## We could do <%static:css group='style-main'/>, but that's only useful <%static:css group='${self.attr.main_css}'/>
## if the group contains multiple files, and the 'style-main' group doesn't.
## Instead, we'll construct this <link> element manually, to improve clarity.
## When nothing in the system is referencing the 'style-main' group, it can
## be removed from the environment file.
<%
application_css_path = "css/lms-main{rtl}.css".format(
rtl="-rtl" if get_language_bidi() else "",
)
%>
<link rel="stylesheet" href="${static.url(application_css_path)}" type="text/css" media="all" />
% if disable_courseware_js: % if disable_courseware_js:
<%static:js group='base_vendor'/> <%static:js group='base_vendor'/>
......
<%page expression_filter="h"/>
<%inherit file="/main.html" />
<%namespace name='static' file='/static_content.html'/>
<%block name="pagetitle">UX Reference</%block>
<%block name="nav_skip">#content</%block>
<%block name="bodyclass">view-ux-reference</%block>
<%block name="content">
<div class="main-wrapper">
<div class="inner-wrapper">
<div class="main-column">
<article class="window unit-body">
<h1>UX Style Reference</h1>
<section class="xblock xblock-student_view xmodule_display xmodule_HtmlModule">
<h2>Page Types</h2>
<ul>
<li><a href="pattern-library-test.html">Pattern Library test page</a></li>
</ul>
</section>
</article>
</div>
</div>
</div>
</%block>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"coffee-script": "1.6.1", "coffee-script": "1.6.1",
"edx-pattern-library": "0.10.4", "edx-pattern-library": "~0.12.1",
"edx-ui-toolkit": "0.9.0", "edx-ui-toolkit": "~0.9.1",
"requirejs": "~2.1.22", "requirejs": "~2.1.22",
"uglify-js": "2.4.24", "uglify-js": "2.4.24",
"underscore": "~1.8.3", "underscore": "~1.8.3",
......
...@@ -35,7 +35,12 @@ CMS_SASS_DIRECTORIES = [ ...@@ -35,7 +35,12 @@ CMS_SASS_DIRECTORIES = [
path("cms/static/sass"), path("cms/static/sass"),
] ]
THEME_SASS_DIRECTORIES = [] THEME_SASS_DIRECTORIES = []
SASS_LOAD_PATHS = ['common/static', 'common/static/sass'] SASS_LOAD_PATHS = [
'common/static',
'common/static/sass',
'node_modules',
'node_modules/edx-pattern-library/node_modules',
]
# A list of NPM installed libraries that should be copied into the common # A list of NPM installed libraries that should be copied into the common
# static directory. # static directory.
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import ddt import ddt
from paver.easy import call_task from paver.easy import call_task
from mock import patch from mock import patch
from unittest import TestCase
from watchdog.observers.polling import PollingObserver from watchdog.observers.polling import PollingObserver
from .utils import PaverTestCase from .utils import PaverTestCase
...@@ -59,31 +58,3 @@ class TestPaverAssetTasks(PaverTestCase): ...@@ -59,31 +58,3 @@ class TestPaverAssetTasks(PaverTestCase):
expected_messages.append("rm -rf cms/static/css/*.css") expected_messages.append("rm -rf cms/static/css/*.css")
expected_messages.append("libsass cms/static/sass") expected_messages.append("libsass cms/static/sass")
self.assertEquals(self.task_messages, expected_messages) self.assertEquals(self.task_messages, expected_messages)
class TestPaverWatchAssetTasks(TestCase):
"""
Test the Paver watch asset tasks.
"""
def setUp(self):
super(TestPaverWatchAssetTasks, self).setUp()
def tearDown(self):
self.expected_sass_directories = []
super(TestPaverWatchAssetTasks, self).tearDown()
def test_watch_assets(self):
"""
Test the "compile_sass" task.
"""
with patch('pavelib.assets.SassWatcher.register') as mock_register:
with patch('pavelib.assets.PollingObserver.start'):
call_task(
'pavelib.assets.watch_assets',
options={"background": True},
)
self.assertEqual(mock_register.call_count, 2)
sass_watcher_args = mock_register.call_args_list[0][0]
self.assertIsInstance(sass_watcher_args[0], PollingObserver)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment