mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix jsonPath calls by removing \ characters and using $..[] notation
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
ed036d1f99
commit
9cc342f82e
@ -46,7 +46,7 @@ export class CrdResourceDetails extends React.Component<Props> {
|
|||||||
renderAdditionalColumns(crd: CustomResourceDefinition, columns: AdditionalPrinterColumnsV1[]) {
|
renderAdditionalColumns(crd: CustomResourceDefinition, columns: AdditionalPrinterColumnsV1[]) {
|
||||||
return columns.map(({ name, jsonPath: jp }) => (
|
return columns.map(({ name, jsonPath: jp }) => (
|
||||||
<DrawerItem key={name} name={name} renderBoolean>
|
<DrawerItem key={name} name={name} renderBoolean>
|
||||||
{convertSpecValue(jsonPath.value(crd, jp.slice(1)))}
|
{convertSpecValue(jsonPath.value(crd, `$..["${jp.slice(1).replace(/\\/g, "")}"]`))}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ export class CrdResources extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extraColumns.forEach(column => {
|
extraColumns.forEach(column => {
|
||||||
sortingCallbacks[column.name] = (item: KubeObject) => jsonPath.value(item, column.jsonPath.slice(1));
|
sortingCallbacks[column.name] = (item: KubeObject) => jsonPath.value(item, `$..["${column.jsonPath.slice(1).replace(/\\/g, "")}"]`);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -93,7 +93,7 @@ export class CrdResources extends React.Component<Props> {
|
|||||||
isNamespaced && crdInstance.getNs(),
|
isNamespaced && crdInstance.getNs(),
|
||||||
...extraColumns.map(column => ({
|
...extraColumns.map(column => ({
|
||||||
renderBoolean: true,
|
renderBoolean: true,
|
||||||
children: jsonPath.value(crdInstance, column.jsonPath.slice(1)),
|
children: jsonPath.value(crdInstance, `$..["${column.jsonPath.slice(1).replace(/\\/g, "")}"]`),
|
||||||
})),
|
})),
|
||||||
crdInstance.getAge(),
|
crdInstance.getAge(),
|
||||||
]}
|
]}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user