require scoped_hbs_pre_processor in i18nLinerHandlebars.js

fixes CNVS-28474

From what I could tell, none of the hbs templates were being passed the
`scope` value as part of the helper method `options.hash`, and that's
because we were not using the preprocesses that
PreProcessor.processStatement override via
frontend_build/i18nLinerHandelbars.js.

test plan:
- Load canvas using the Webpack build.
- Go into Calendar.
- Click on a day in the month and a Edit Event modal should pop up.
- Observe that the `Date:` labem is present, whereas it used to say
  [object Object].

Change-Id: I8e077261379b43f5be27ab6544d9d05a47e97625
Reviewed-on: https://gerrit.instructure.com/81558
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
This commit is contained in:
John Corrigan 2016-06-03 17:47:31 -05:00
parent 6a2ddf0e41
commit 17d44b8a03
2 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import ScopedHbsExtractor from './../gems/canvas_i18nliner/js/scoped_hbs_extract
import {allFingerprintsFor} from 'brandable_css/lib/main' import {allFingerprintsFor} from 'brandable_css/lib/main'
import _PreProcessor from './../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor' import _PreProcessor from './../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor'
const PreProcessor = _PreProcessor.default const PreProcessor = _PreProcessor.default
import "./../gems/canvas_i18nliner/js/scoped_hbs_pre_processor";
const compileHandlebars = (data) => { const compileHandlebars = (data) => {
const path = data.path const path = data.path

View File

@ -23,6 +23,7 @@ PreProcessor.processStatement = function(statement) {
} }
PreProcessor.injectScope = function(node) { PreProcessor.injectScope = function(node) {
var pairs;
if (!node.hash) if (!node.hash)
node.hash = node.sexpr.hash = new HashNode([]); node.hash = node.sexpr.hash = new HashNode([]);
pairs = node.hash.pairs; pairs = node.hash.pairs;