Merge pull request #15526 from nextcloud/fix/noid/building-wfe-handlebars

fix building WFE Handlebars
This commit is contained in:
Roeland Jago Douma 2019-05-15 20:11:43 +02:00 committed by GitHub
commit 3ad1a6f1df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

View File

@ -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: [],

View File

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

View File

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

View File

@ -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']
}
};