Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metrics] Minor Changes to Metrics Sidebar #1237

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dashboards-observability/public/components/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export const Home = ({ http, chrome, parentBreadcrumb, renderProps, pplService }
'col-md-12': isSidebarClosed,
});

const sidebarClassName = classNames({
closed: isSidebarClosed,
});

return (
<>
<Route
Expand Down Expand Up @@ -135,7 +139,9 @@ export const Home = ({ http, chrome, parentBreadcrumb, renderProps, pplService }
resolutionSelectId={resolutionSelectId}
/>
<div className="dscAppContainer">
<div className="col-md-3 dscSidebar__container dscCollapsibleSidebar">
<div
className={`col-md-3 dscSidebar__container dscCollapsibleSidebar ${sidebarClassName}`}
>
<div className="">
{!isSidebarClosed && <Sidebar http={http} pplService={pplService} />}
<EuiButtonIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,13 @@
}

.metricsList {
overflow-x:auto;
line-height:normal;
margin-top:10px;
}

.metricName {
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
margin-bottom:10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ export const Sidebar = (props: ISidebarProps) => {
>
<ul className="metricsList">
{recentlyCreatedMetrics.map((metric: any) => (
<li key={metric.id}>
<EuiLink onClick={() => handleAddMetric(metric)}>{metric.name}</EuiLink>
<li className="metricName" key={metric.id}>
<EuiLink
className="metricName eui-textTruncate"
title={metric.name}
onClick={() => handleAddMetric(metric)}
>
{metric.name}
</EuiLink>
</li>
))}
</ul>
Expand All @@ -80,7 +86,13 @@ export const Sidebar = (props: ISidebarProps) => {
<ul className="metricsList">
{selectedMetrics.map((metric: any) => (
<li key={metric.id}>
<EuiLink onClick={() => handleRemoveMetric(metric)}>{metric.name}</EuiLink>
<EuiLink
className="metricName eui-textTruncate"
title={metric.name}
onClick={() => handleRemoveMetric(metric)}
>
{metric.name}
</EuiLink>
</li>
))}
</ul>
Expand All @@ -99,7 +111,13 @@ export const Sidebar = (props: ISidebarProps) => {
<ul className="metricsList">
{availableMetrics.slice(0, 100).map((metric: any) => (
<li key={metric.id}>
<EuiLink onClick={() => handleAddMetric(metric)}>{metric.name}</EuiLink>
<EuiLink
className="metricName eui-textTruncate"
title={metric.name}
onClick={() => handleAddMetric(metric)}
>
{metric.name}
</EuiLink>
</li>
))}
</ul>
Expand Down