Skip to content

Commit eb75d62

Browse files
committed
Wrap info data for large texts
1 parent c05bdde commit eb75d62

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

redisinsight/ui/src/packages/ri-explain/src/Node.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ function Snippet({content}: {content: string}) {
2121
export function ExplainNode(props: INodeProps) {
2222
const propData: EntityInfo = (props as any).node.getData()
2323
const { id, type, data, snippet, subType } = propData
24+
25+
const infoData = data ? data : type
26+
2427
return (
2528
<div className="ExplainContainer" id={`node-${id}`}>
2629
<div className="Main">
2730
<div className="Info">
28-
<div>{data ? data : type}</div>
31+
<div className="InfoData">
32+
<EuiToolTip delay='long' content={infoData}><span>{infoData}</span></EuiToolTip>
33+
</div>
2934
{subType && [EntityType.GEO, EntityType.NUMERIC, EntityType.TEXT, EntityType.TAG].includes(subType) && <div className="Type">{subType}</div> }
3035
</div>
3136
</div>
@@ -99,10 +104,14 @@ export function ProfileNode(props: INodeProps) {
99104
}
100105

101106

107+
const infoData = data ? data : type
108+
102109
return (
103110
<div className="ProfileContainer" id={`node-${id}`} data-size={counter || size || recordsProduced}>
104111
<div className="Main">
105-
<div>{data ? data : type}</div>
112+
<div className="InfoData">
113+
<EuiToolTip delay='long' content={infoData}><span>{infoData}</span></EuiToolTip>
114+
</div>
106115
<div className="Type">{[EntityType.GEO, EntityType.NUMERIC, EntityType.TEXT, EntityType.TAG].includes(type) ? type : ''}</div>
107116
</div>
108117
{

redisinsight/ui/src/packages/ri-explain/src/styles/styles.less

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@
8585
display: unset !important;
8686
}
8787

88+
.InfoData {
89+
white-space: nowrap;
90+
overflow: hidden;
91+
text-overflow: ellipsis;
92+
93+
// Make text selectable
94+
-moz-user-select: text;
95+
-khtml-user-select: text;
96+
-webkit-user-select: text;
97+
-ms-user-select: text;
98+
user-select: text;
99+
}
100+
88101
.FooterCommon {
89102
white-space: nowrap;
90103
overflow: hidden;

0 commit comments

Comments
 (0)