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
@@ -1,7 +1,6 @@
|
||||
import * as ts from "typescript";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import * as program from "commander";
|
||||
|
||||
import * as heading from "mdast-util-heading-range";
|
||||
import * as remark from "remark";
|
||||
@@ -9,6 +8,10 @@ import * as remark from "remark";
|
||||
import * as unist from "../unistHelpers";
|
||||
import { JsxEmit, isClassDeclaration, PropertyDeclaration } from "typescript";
|
||||
|
||||
|
||||
// Max number of characters in the text for the default value column.
|
||||
const maxDefaultTextLength = 20;
|
||||
|
||||
export function initPhase(aggData) {
|
||||
}
|
||||
|
||||
@@ -397,7 +400,6 @@ function buildPropsTable(props: PropData[], includeInitializer: boolean = true)
|
||||
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) {
|
||||
@@ -406,10 +408,16 @@ function buildPropsTable(props: PropData[], includeInitializer: boolean = true)
|
||||
|
||||
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