Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwiaGowor committed Sep 16, 2024
1 parent 7f101cc commit 86db476
Showing 1 changed file with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ export default function CustomResource({ params }) {
const yamlPreview = resource => {
return Object.keys(resource || {}).map(key => {
if (typeof resource[key] === 'object' && key !== 'metadata') {
//&& key !== 'metadata'
return (
<ReadonlyEditorPanel
title={key} //key[0].toLocaleUpperCase() + key.substring(1)
title={key}
value={jsyaml.dump(resource[key])}
key={key + JSON.stringify(resource[key])}
/>
Expand All @@ -67,29 +66,6 @@ export default function CustomResource({ params }) {
});
};

const yamlSinglePropsPreview = resource => {
const singleProps = {};
Object.keys(resource || {}).forEach(key => {
if (typeof resource[key] !== 'object' && key !== 'metadata') {
singleProps[key] = resource[key];
}
});
if (Object.keys(singleProps).length > 0) {
return (
<ReadonlyEditorPanel
title="props"
value={jsyaml.dump(singleProps)}
key="single-props"
/>
);
}
<ReadonlyEditorPanel
key="editor"
title="YAML"
value={jsyaml.dump(resource)}
/>;
};

return (
<ResourceDetails
layoutNumber={params.layoutNumber ?? 'EndColumn'}
Expand Down

0 comments on commit 86db476

Please sign in to comment.