From 905bbe9d3ff9e5b0e823650348a3d3ee725624e0 Mon Sep 17 00:00:00 2001 From: Trevor Nichols Date: Thu, 20 Aug 2020 00:49:17 +1000 Subject: [PATCH] Handle status values that contains an object (#693) Signed-off-by: Trevor Nichols Co-authored-by: Alex Andreev --- .../crd-resource-details.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/+custom-resources/crd-resource-details.tsx b/src/renderer/components/+custom-resources/crd-resource-details.tsx index 36874c3b7c..cda2f7d5be 100644 --- a/src/renderer/components/+custom-resources/crd-resource-details.tsx +++ b/src/renderer/components/+custom-resources/crd-resource-details.tsx @@ -13,11 +13,27 @@ import { apiManager } from "../../api/api-manager"; import { crdStore } from "./crd.store"; import { KubeObject } from "../../api/kube-object"; import { KubeObjectMeta } from "../kube-object/kube-object-meta"; +import { Input } from "../input"; // fixme: provide type-safe check for status interface Props extends KubeObjectDetailsProps { } +function CrdColumnValue({ value }: { value: any[] | {} | string }) { + if (Array.isArray(value)) { + return <>{value.map((item, index) => )} + } + if (typeof(value) === 'object') return ( + + ); + return {value}; +} @observer export class CrdResourceDetails extends React.Component { @computed get crd() { @@ -43,9 +59,10 @@ export class CrdResourceDetails extends React.Component { {extraColumns.map(column => { const { name } = column; + const value = jsonPath.query(object, column.JSONPath.slice(1)); return ( - {jsonPath.query(object, column.JSONPath.slice(1))} + ) })} @@ -66,4 +83,4 @@ export class CrdResourceDetails extends React.Component { ) } -} \ No newline at end of file +}