Skip to content

Commit 735400b

Browse files
committed
fixes
1 parent 14cd6e1 commit 735400b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/components/Projects/ProjectsList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default function ProjectsList() {
2525
data?.map((projectName) => {
2626
return {
2727
projectName: projectName,
28+
yaml: projectName,
2829
nameSpace: projectnameToNamespace(projectName),
2930
};
3031
}) ?? [],

src/components/Yaml/YamlViewButton.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type YamlViewButtonProps = {
1717
export const YamlViewButton: FC<YamlViewButtonProps> = ({ resourceObject }) => {
1818
const [isOpen, setIsOpen] = useState(false);
1919
const { t } = useTranslation();
20+
const resource = resourceObject as Resource;
2021
return (
2122
<span>
2223
<Dialog
@@ -38,10 +39,8 @@ export const YamlViewButton: FC<YamlViewButtonProps> = ({ resourceObject }) => {
3839
>
3940
{isOpen && (
4041
<YamlViewer
41-
yamlString={stringify(
42-
removeManagedFieldsProperty(resourceObject as Resource),
43-
)}
44-
filename={`filename_here`}
42+
yamlString={stringify(removeManagedFieldsProperty(resource))}
43+
filename={`${resource.kind ?? ''}${resource.metadata.name ? '_' : ''}${resource.metadata.name ?? ''}`}
4544
/>
4645
)}
4746
</Dialog>

src/utils/removeManagedFieldsProperty.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ export type Resource = {
22
kind: string;
33
items?: {
44
metadata: {
5+
name: string;
56
managedFields?: unknown;
67
};
78
}[];
89
metadata: {
10+
name: string;
911
managedFields?: unknown;
1012
};
1113
};

0 commit comments

Comments
 (0)