mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2456] Fixed property table formatting (#3051)
This commit is contained in:
committed by
Eugenio Romano
parent
8a70e026cd
commit
606009cac2
@@ -6,6 +6,8 @@ var heading = require("mdast-util-heading-range");
|
||||
var remark = require("remark");
|
||||
var unist = require("../unistHelpers");
|
||||
var typescript_1 = require("typescript");
|
||||
// Max number of characters in the text for the default value column.
|
||||
var maxDefaultTextLength = 20;
|
||||
function initPhase(aggData) {
|
||||
}
|
||||
exports.initPhase = initPhase;
|
||||
@@ -284,15 +286,20 @@ function buildPropsTable(props, includeInitializer) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var pName = props[i].name;
|
||||
var pType = props[i].type;
|
||||
var pDefault = props[i].initializer || "";
|
||||
var pDesc = props[i].docText || "";
|
||||
if (pDesc) {
|
||||
pDesc = pDesc.replace(/[\n\r]+/, " ");
|
||||
}
|
||||
var descCellContent = remark().parse(pDesc).children;
|
||||
var pDefault = props[i].initializer || "";
|
||||
var defaultCellContent;
|
||||
if (pDefault) {
|
||||
defaultCellContent = unist.makeInlineCode(pDefault);
|
||||
if (pDefault.length > maxDefaultTextLength) {
|
||||
defaultCellContent = unist.makeText("See description");
|
||||
console.log("Warning: property \"" + pName + "\" default value substituted (> " + maxDefaultTextLength + " chars)");
|
||||
}
|
||||
else
|
||||
defaultCellContent = unist.makeInlineCode(pDefault);
|
||||
}
|
||||
else {
|
||||
defaultCellContent = unist.makeText("");
|
||||
|
Reference in New Issue
Block a user