Skip to content

Commit 5eebe57

Browse files
committed
Update Graph.tsx
1 parent 4271f16 commit 5eebe57

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Graphs/Graph.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ const Graph: React.FC = () => {
4444
const { nodes, edges, colorMap, loading, error } = useGraph(colorBy, handleYamlClick);
4545

4646
const yamlString = useMemo(
47+
() => (yamlResource ? stringify(removeManagedFieldsAndFilterData(yamlResource as unknown as Resource, true)) : ''),
48+
[yamlResource],
49+
);
50+
51+
const yamlStringToCopy = useMemo(
4752
() => (yamlResource ? stringify(removeManagedFieldsAndFilterData(yamlResource as unknown as Resource, false)) : ''),
4853
[yamlResource],
4954
);
@@ -134,7 +139,9 @@ const Graph: React.FC = () => {
134139
<YamlViewDialog
135140
isOpen={yamlDialogOpen}
136141
setIsOpen={setYamlDialogOpen}
137-
dialogContent={<YamlViewer yamlString={yamlString} yamlStringToCopy={yamlString} filename={yamlFilename} />}
142+
dialogContent={
143+
<YamlViewer yamlString={yamlString} yamlStringToCopy={yamlStringToCopy} filename={yamlFilename} />
144+
}
138145
/>
139146
</div>
140147
);

0 commit comments

Comments
 (0)