1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Stringify children only if value is object or array

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-12-18 13:32:15 +02:00
parent ed2703c424
commit 97135666af

View File

@ -92,10 +92,18 @@ export class CrdResources extends React.Component<Props> {
renderTableContents={(crdInstance: KubeObject) => [ renderTableContents={(crdInstance: KubeObject) => [
crdInstance.getName(), crdInstance.getName(),
isNamespaced && crdInstance.getNs(), isNamespaced && crdInstance.getNs(),
...extraColumns.map(column => ({ ...extraColumns.map((column) => {
renderBoolean: true, let value = jsonPath.value(crdInstance, parseJsonPath(column.jsonPath.slice(1)));
children: JSON.stringify(jsonPath.value(crdInstance, parseJsonPath(column.jsonPath.slice(1)))),
})), if (Array.isArray(value) || typeof value === "object") {
value = JSON.stringify(value);
}
return {
renderBoolean: true,
children: value,
};
}),
crdInstance.getAge(), crdInstance.getAge(),
]} ]}
/> />