fix building WFE Handlebars

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
pull/15526/head
Arthur Schiwon 2019-05-14 11:51:01 +07:00
parent c41aa7a209
commit 738ca9f849
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
6 changed files with 22 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -22,22 +22,6 @@ import OperationTemplate from './templates/operation.handlebars';
import OperationsTemplate from './templates/operations.handlebars';
(function() {
Handlebars.registerHelper('selectItem', function(currentValue, itemValue) {
if (currentValue === itemValue) {
return 'selected="selected"';
}
return "";
});
Handlebars.registerHelper('getOperators', function(classname) {
var check = OCA.WorkflowEngine.getCheckByClass(classname);
if (!_.isUndefined(check)) {
return check['operators'];
}
return [];
});
OCA.WorkflowEngine = _.extend(OCA.WorkflowEngine || {}, {
availablePlugins: [],
availableChecks: [],

@ -0,0 +1,7 @@
module.exports = function(classname) {
var check = OCA.WorkflowEngine.getCheckByClass(classname);
if (!_.isUndefined(check)) {
return check['operators'];
}
return [];
}

@ -0,0 +1,7 @@
module.exports = function(currentValue, itemValue) {
if (currentValue === itemValue) {
return 'selected="selected"';
}
return "";
}

@ -31,11 +31,14 @@ module.exports = {
},
{
test: /\.handlebars$/,
loader: "handlebars-loader"
}
loader: "handlebars-loader",
options: {
helperDirs: path.join(__dirname, 'src/hbs_helpers'),
}
},
]
},
resolve: {
extensions: ['*', '.js']
extensions: ['*', '.js', '.handlebars']
}
};