Skip to content

Commit be00846

Browse files
committed
Rename node description property
1 parent 42c87dd commit be00846

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

calm-hub-ui/src/visualizer/components/cytoscape-renderer/CytoscapeRenderer.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ function getEdgeStyle(showDescription: boolean): cytoscape.Css.Edge {
5353
function getNodeStyle(showDescription: boolean): cytoscape.Css.Node {
5454
return {
5555
label: showDescription
56-
? 'data(_displayPlaceholderWithDesc)'
57-
: 'data(_displayPlaceholderWithoutDesc)',
56+
? 'data(labelWithDescription)'
57+
: 'data(labelWithoutDescription)',
5858
'text-valign': 'center',
5959
'text-halign': 'center',
6060
'text-wrap': 'wrap',
@@ -92,24 +92,24 @@ export function CytoscapeRenderer({
9292
container,
9393
elements: [...nodes, ...edges],
9494
style: [
95-
{
96-
selector: 'edge',
97-
style: getEdgeStyle(isRelationshipDescActive),
98-
},
99-
{
100-
selector: 'node',
101-
style: getNodeStyle(isNodeDescActive),
102-
},
103-
{
104-
selector: ':parent',
105-
style: {
106-
label: 'data(label)',
107-
"background-color": 'white',
108-
"border-style": 'dashed',
109-
"border-width": 2,
110-
"border-dash-pattern": [8, 10], // [dash length, gap length]
95+
{
96+
selector: 'edge',
97+
style: getEdgeStyle(isRelationshipDescActive),
98+
},
99+
{
100+
selector: 'node',
101+
style: getNodeStyle(isNodeDescActive),
102+
},
103+
{
104+
selector: ':parent',
105+
style: {
106+
label: 'data(label)',
107+
"background-color": 'white',
108+
"border-style": 'dashed',
109+
"border-width": 2,
110+
"border-dash-pattern": [8, 10], // [dash length, gap length]
111+
},
111112
},
112-
},
113113
],
114114
layout: breadthFirstLayout,
115115
boxSelectionEnabled: true,

calm-hub-ui/src/visualizer/components/drawer/Drawer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ export function Drawer({ calmInstance, title, isConDescActive, isNodeDescActive
117117
description: node.description,
118118
type: node['node-type'],
119119
id: node['unique-id'],
120-
_displayPlaceholderWithDesc: `${generateDisplayPlaceHolderWithoutDesc(node)}\n\n${node.description}\n`,
121-
_displayPlaceholderWithoutDesc: `${generateDisplayPlaceHolderWithoutDesc(node)}`,
120+
labelWithDescription: `${generateDisplayPlaceHolderWithoutDesc(node)}\n\n${node.description}\n`,
121+
labelWithoutDescription: `${generateDisplayPlaceHolderWithoutDesc(node)}`,
122122
},
123123
};
124124

calm-hub-ui/src/visualizer/components/visualizer-container/VisualizerContainer.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ describe('VisualizerContainer', () => {
8181
type: '',
8282
label: 'node1',
8383
id: 'node1',
84-
_displayPlaceholderWithDesc: '',
85-
_displayPlaceholderWithoutDesc: '',
84+
labelWithDescription: '',
85+
labelWithoutDescription: '',
8686
parent: undefined,
8787
interfaces: undefined,
8888
controls: undefined,

calm-hub-ui/src/visualizer/contracts/contracts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export type CalmNode = {
1919
type: string;
2020
label: string;
2121
id: string;
22-
_displayPlaceholderWithDesc: string;
23-
_displayPlaceholderWithoutDesc: string;
22+
labelWithDescription: string;
23+
labelWithoutDescription: string;
2424
parent?: string;
2525
interfaces?: (
2626
| CalmInterfaceTypeSchema

0 commit comments

Comments
 (0)