Skip to content

Commit

Permalink
fix map
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwiaGowor committed Sep 16, 2024
1 parent 86db476 commit 543e6e8
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/resources/CustomResourceDefinitions/CustomResources.details.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,20 @@ export default function CustomResource({ params }) {
: '';

const yamlPreview = resource => {
return Object.keys(resource || {}).map(key => {
if (typeof resource[key] === 'object' && key !== 'metadata') {
return (
<ReadonlyEditorPanel
title={key}
value={jsyaml.dump(resource[key])}
key={key + JSON.stringify(resource[key])}
/>
);
}
});
return Object.keys(resource || {})
?.map(key => {
if (typeof resource[key] === 'object' && key !== 'metadata') {
return (
<ReadonlyEditorPanel
title={key}
value={jsyaml.dump(resource[key])}
key={key + JSON.stringify(resource[key])}
/>
);
}
return null;
})
.filter(Boolean);
};

return (
Expand Down

0 comments on commit 543e6e8

Please sign in to comment.