Merge pull request #15526 from nextcloud/fix/noid/building-wfe-handlebars
fix building WFE Handlebars
This commit is contained in:
commit
3ad1a6f1df
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';
|
import OperationsTemplate from './templates/operations.handlebars';
|
||||||
|
|
||||||
(function() {
|
(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 || {}, {
|
OCA.WorkflowEngine = _.extend(OCA.WorkflowEngine || {}, {
|
||||||
availablePlugins: [],
|
availablePlugins: [],
|
||||||
availableChecks: [],
|
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$/,
|
test: /\.handlebars$/,
|
||||||
loader: "handlebars-loader"
|
loader: "handlebars-loader",
|
||||||
}
|
options: {
|
||||||
|
helperDirs: path.join(__dirname, 'src/hbs_helpers'),
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['*', '.js']
|
extensions: ['*', '.js', '.handlebars']
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue