Skip to content

Commit 1227c5e

Browse files
Merge pull request #61 from digma-ai/fix/header-styles
Update Trace header styles
2 parents 777b780 + ffc9500 commit 1227c5e

File tree

6 files changed

+55
-27
lines changed

6 files changed

+55
-27
lines changed

.github/workflows/digma/push.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Lint & test & build
22

33
on:
44
push:
5-
branches: ['digma']
5+
branches:
6+
- 'digma'
67
# Github Actions don't support YAML anchors yet, so we have to repeat
78
# the paths-ignore in both push and pull_request events.
89
# More info: https://github.com/actions/runner/issues/1182
@@ -14,7 +15,8 @@ on:
1415
- 'DCO'
1516
- 'LICENSE'
1617
pull_request:
17-
branches: ['digma']
18+
branches:
19+
- 'digma'
1820
paths-ignore:
1921
- '.vscode/**'
2022
- '.prettierignore'

packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageHeader.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ limitations under the License.
5858
color: var(--tx-color-title);
5959
display: flex;
6060
flex: 1;
61+
min-width: 120px;
62+
overflow: hidden;
6163
}
6264

6365
.TracePageHeader--titleLink:hover * {
@@ -85,6 +87,9 @@ limitations under the License.
8587
line-height: 1em;
8688
margin: 0 0 0 0.5em;
8789
padding: 0.5em 0;
90+
white-space: nowrap;
91+
overflow: hidden;
92+
text-overflow: ellipsis;
8893
}
8994

9095
.TracePageHeader--title.is-collapsible {
@@ -110,5 +115,6 @@ limitations under the License.
110115
}
111116

112117
.TracePageHeader--zoomControls {
118+
flex-shrink: 0;
113119
margin-left: 0.5em;
114120
}

packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageHeader.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ export function TracePageHeaderFn(props: TracePageHeaderEmbedProps & { forwarded
151151
return { ...rest, value: renderer(trace) };
152152
});
153153

154+
const traceName = getTraceName(trace.spans);
155+
154156
const title = (
155157
<h1 className={`TracePageHeader--title ${canCollapse ? 'is-collapsible' : ''}`}>
156-
<TraceName traceName={getTraceName(trace.spans)} />{' '}
158+
<TraceName traceName={traceName} breakable={false} />{' '}
157159
<small className="u-tx-muted">{trace.traceID.slice(0, 7)}</small>
158160
</h1>
159161
);

packages/jaeger-ui/src/components/common/TraceName.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ limitations under the License.
1717
.TraceName.is-error {
1818
color: #c00;
1919
}
20+
21+
.TraceName .TraceName--name {
22+
display: block;
23+
padding-bottom: 0.2em;
24+
text-overflow: ellipsis;
25+
overflow: hidden;
26+
}

packages/jaeger-ui/src/components/common/TraceName.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
import * as React from 'react';
16+
import { Tooltip } from 'antd';
1617

1718
import BreakableText from './BreakableText';
1819
import LoadingIndicator from './LoadingIndicator';
@@ -23,15 +24,32 @@ import { ApiError } from '../../types/api-error';
2324

2425
import './TraceName.css';
2526

27+
type TitleProps = {
28+
text: string;
29+
breakable: boolean;
30+
};
31+
2632
type Props = {
2733
className?: string;
2834
error?: ApiError | TNil;
2935
state?: FetchedState | TNil;
3036
traceName?: string | TNil;
37+
breakable?: boolean;
38+
};
39+
40+
const Title = (props: TitleProps) => {
41+
const { text, breakable } = props;
42+
return breakable ? (
43+
<BreakableText text={text} />
44+
) : (
45+
<Tooltip title={text} placement="bottom">
46+
<span className="TraceName--name">{text}</span>
47+
</Tooltip>
48+
);
3149
};
3250

3351
export default function TraceName(props: Props) {
34-
const { className, error, state, traceName } = props;
52+
const { className, error, state, traceName, breakable = true } = props;
3553
const isErred = state === fetchedState.ERROR;
3654
let title: string | React.ReactNode = traceName || FALLBACK_TRACE_NAME;
3755
let errorCssClass = '';
@@ -45,12 +63,12 @@ export default function TraceName(props: Props) {
4563
titleStr = 'Error: Unknown error';
4664
}
4765
title = titleStr;
48-
title = <BreakableText text={titleStr} />;
66+
title = <Title text={titleStr} breakable={breakable} />;
4967
} else if (state === fetchedState.LOADING) {
5068
title = <LoadingIndicator small />;
5169
} else {
5270
const text: string = String(traceName || FALLBACK_TRACE_NAME);
53-
title = <BreakableText text={text} />;
71+
title = <Title text={text} breakable={breakable} />;
5472
}
5573
return <span className={`TraceName ${errorCssClass} ${className || ''}`}>{title}</span>;
5674
}

packages/jaeger-ui/src/components/common/__snapshots__/TraceName.test.js.snap

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ exports[`<TraceName> renders empty string error in error state 1`] = `
44
<span
55
className="TraceName is-error "
66
>
7-
<BreakableText
8-
className="BreakableText"
7+
<Title
8+
breakable={true}
99
text="Error: Unknown error"
10-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
1110
/>
1211
</span>
1312
`;
@@ -16,10 +15,9 @@ exports[`<TraceName> renders error object in error state 1`] = `
1615
<span
1716
className="TraceName is-error "
1817
>
19-
<BreakableText
20-
className="BreakableText"
18+
<Title
19+
breakable={true}
2120
text="ERROR-OBJECT-MESSAGE"
22-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
2321
/>
2422
</span>
2523
`;
@@ -28,10 +26,9 @@ exports[`<TraceName> renders error object with empty message in error state 1`]
2826
<span
2927
className="TraceName is-error "
3028
>
31-
<BreakableText
32-
className="BreakableText"
29+
<Title
30+
breakable={true}
3331
text="Error"
34-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
3532
/>
3633
</span>
3734
`;
@@ -40,10 +37,9 @@ exports[`<TraceName> renders in error state 1`] = `
4037
<span
4138
className="TraceName is-error "
4239
>
43-
<BreakableText
44-
className="BreakableText"
40+
<Title
41+
breakable={true}
4542
text="TEST-ERROR-MESSAGE"
46-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
4743
/>
4844
</span>
4945
`;
@@ -63,10 +59,9 @@ exports[`<TraceName> renders with className 1`] = `
6359
<span
6460
className="TraceName TEST-CLASS-NAME"
6561
>
66-
<BreakableText
67-
className="BreakableText"
62+
<Title
63+
breakable={true}
6864
text="<trace-without-root-span>"
69-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
7065
/>
7166
</span>
7267
`;
@@ -75,10 +70,9 @@ exports[`<TraceName> renders with default props 1`] = `
7570
<span
7671
className="TraceName "
7772
>
78-
<BreakableText
79-
className="BreakableText"
73+
<Title
74+
breakable={true}
8075
text="<trace-without-root-span>"
81-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
8276
/>
8377
</span>
8478
`;
@@ -87,10 +81,9 @@ exports[`<TraceName> renders with traceName 1`] = `
8781
<span
8882
className="TraceName "
8983
>
90-
<BreakableText
91-
className="BreakableText"
84+
<Title
85+
breakable={true}
9286
text="TEST-TRACE-NAME"
93-
wordRegexp={/\\\\W\\*\\\\w\\+\\\\W\\*/g}
9487
/>
9588
</span>
9689
`;

0 commit comments

Comments
 (0)