Skip to content

Commit 9c758c8

Browse files
authored
Merge branch 'develop' into si/fixSSOMultipleProviders
2 parents c3bf98f + 26194d7 commit 9c758c8

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

src/chart/graph/component/GraphChartInspectModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export const NeoGraphChartInspectModal = (props: GraphChartVisualizationProps) =
1717
aria-labelledby='form-dialog-title'
1818
>
1919
<Dialog.Header id='form-dialog-title'>
20-
{props.interactivity.selectedEntity ? getEntityHeader(props.interactivity.selectedEntity) : ''}
20+
{props.interactivity.selectedEntity
21+
? getEntityHeader(props.interactivity.selectedEntity, props.engine.selection)
22+
: ''}
2123
</Dialog.Header>
2224
<Dialog.Content>
2325
<GraphEntityInspectionTable entity={props.interactivity.selectedEntity}></GraphEntityInspectionTable>

src/chart/graph/util/NodeUtils.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,26 @@ export const parseNodeIconConfig = (iconStyle) => {
2424
}
2525
};
2626

27-
export const getEntityHeader = (entity) => {
28-
return (entity.labels && entity.labels.join(', ')) || entity.type;
27+
const getSelectedNodeProperty = (entity: any, sourceOrTarget: string, propertySelections: any) => {
28+
const selection = propertySelections[entity[sourceOrTarget]?.mainLabel];
29+
switch (selection) {
30+
case '(label)':
31+
return entity[sourceOrTarget]?.mainLabel;
32+
case '(id)':
33+
return entity[sourceOrTarget]?.id;
34+
default:
35+
return entity[sourceOrTarget]?.properties[selection];
36+
}
37+
};
38+
39+
const getRelPatternString = (entity: any, selection: any) => {
40+
const sourceTitle = getSelectedNodeProperty(entity, 'source', selection);
41+
const targetTitle = getSelectedNodeProperty(entity, 'target', selection);
42+
return `(${sourceTitle ? sourceTitle : '[no value]'} --> ${targetTitle ? targetTitle : '[no value]'})`;
43+
};
44+
45+
export const getEntityHeader = (entity: any, selection: any) => {
46+
return entity.labels?.join(', ') || `${entity.type} ${getRelPatternString(entity, selection)}`;
2947
};
3048

3149
export const drawDataURIOnCanvas = (node, strDataURI, canvas, defaultNodeSize) => {

src/chart/table/TableChart.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,18 @@ export const NeoTableChart = (props: ChartProps) => {
276276
ColumnSortedAscendingIcon: () => <></>,
277277
}}
278278
getRowClassName={(params) => {
279-
return `rule${evaluateRulesOnDict(params.row, styleRules, ['row color', 'row text color'])}`;
279+
return ['row color', 'row text color']
280+
.map((e) => {
281+
return `rule${evaluateRulesOnDict(params.row, styleRules, [e])}`;
282+
})
283+
.join(' ');
280284
}}
281285
getCellClassName={(params) => {
282-
return `rule${evaluateRulesOnDict({ [params.field]: params.value }, styleRules, [
283-
'cell color',
284-
'cell text color',
285-
])}`;
286+
return ['cell color', 'cell text color']
287+
.map((e) => {
288+
return `rule${evaluateRulesOnDict({ [params.field]: params.value }, styleRules, [e])}`;
289+
})
290+
.join(' ');
286291
}}
287292
/>
288293
</div>

0 commit comments

Comments
 (0)