Mercurial > hg > ng2-query-ismi
view src/app/result-type.js @ 61:6adf95d9a190 webpack
fix missing resultInfo. add column template for WITNESS.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 24 Apr 2017 19:39:25 +0200 |
parents | 3b4046e0cc02 |
children |
line wrap: on
line source
"use strict"; var result_column_1 = require('./result-column'); var ResultType = (function () { function ResultType(name, idAttribute, allowedAttributes, deniedAttributes) { if (allowedAttributes === void 0) { allowedAttributes = []; } if (deniedAttributes === void 0) { deniedAttributes = []; } this.name = name; this.idAttribute = idAttribute; this.allowedAttributes = allowedAttributes; this.deniedAttributes = deniedAttributes; } /** * Return columns for the given list of attributes. */ ResultType.prototype.getColumns = function (attributes, allAttributes) { var _this = this; if (allAttributes === void 0) { allAttributes = true; } var atts = attributes.slice(); var cols = []; // allowed attributes this.allowedAttributes.forEach(function (att) { var idx = atts.indexOf(att); if (idx > -1) { cols.push(new result_column_1.ResultColumn(att, att, '', true)); atts[idx] = null; } }); // then other attributes if (allAttributes) { atts.forEach(function (att) { if (att != null && att[0] != '_' && _this.deniedAttributes.indexOf(att) < 0) { cols.push(new result_column_1.ResultColumn(att, att, '', false)); } }); } return cols; }; return ResultType; }()); exports.ResultType = ResultType; function getResultType(name, resultTypes) { var rt = resultTypes[name]; if (rt == null) { rt = resultTypes['*']; } return rt; } exports.getResultType = getResultType; //# sourceMappingURL=result-type.js.map