From 17d44b8a03f3118de3177cf755888dfa02e36b70 Mon Sep 17 00:00:00 2001 From: John Corrigan Date: Fri, 3 Jun 2016 17:47:31 -0500 Subject: [PATCH] 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 Tested-by: Jenkins QA-Review: Pedro Fajardo Product-Review: Simon Williams --- frontend_build/i18nLinerHandlebars.js | 1 + gems/canvas_i18nliner/js/scoped_hbs_pre_processor.js | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend_build/i18nLinerHandlebars.js b/frontend_build/i18nLinerHandlebars.js index 220b176387d..ab36d5b1f5c 100644 --- a/frontend_build/i18nLinerHandlebars.js +++ b/frontend_build/i18nLinerHandlebars.js @@ -10,6 +10,7 @@ import ScopedHbsExtractor from './../gems/canvas_i18nliner/js/scoped_hbs_extract import {allFingerprintsFor} from 'brandable_css/lib/main' import _PreProcessor from './../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor' const PreProcessor = _PreProcessor.default +import "./../gems/canvas_i18nliner/js/scoped_hbs_pre_processor"; const compileHandlebars = (data) => { const path = data.path diff --git a/gems/canvas_i18nliner/js/scoped_hbs_pre_processor.js b/gems/canvas_i18nliner/js/scoped_hbs_pre_processor.js index da80bf7a537..9520cbd84dd 100644 --- a/gems/canvas_i18nliner/js/scoped_hbs_pre_processor.js +++ b/gems/canvas_i18nliner/js/scoped_hbs_pre_processor.js @@ -23,6 +23,7 @@ PreProcessor.processStatement = function(statement) { } PreProcessor.injectScope = function(node) { + var pairs; if (!node.hash) node.hash = node.sexpr.hash = new HashNode([]); pairs = node.hash.pairs;