Skip to content

Commit 0bcac8b

Browse files
authored
Fix filtering highlighted columns in "manage-table-columns" (#1000)
1 parent d2a7222 commit 0bcac8b

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

aim/web/ui/src/components/ChartPanel/PopoverContent/PopoverContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const PopoverContent = React.forwardRef(function PopoverContent(
8787
{isSystemMetric(metric)
8888
? formatSystemMetricName(metric)
8989
: metric ?? '--'}
90-
</strong>
90+
</strong>{' '}
9191
{context || null}
9292
</div>
9393
<div className='PopoverContent__value'>

aim/web/ui/src/pages/Metrics/components/Table/ManageColumnsPopover/ManageColumnsPopover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function ManageColumnsPopover({
133133
if (!!midPane) {
134134
if (searchKey && searchKey.trim() !== '') {
135135
const firstHighlightedCol: any = midPane.querySelector(
136-
'.ColumnItem__container.highlighted',
136+
'.ColumnItem.highlighted',
137137
);
138138
if (!!firstHighlightedCol) {
139139
midPane.scrollTop =

aim/web/ui/src/types/services/models/metrics/metricsAppModel.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export interface IChartTooltip {
189189
}
190190

191191
export interface IAlignmentConfig {
192-
metric: string;
192+
metric?: string;
193193
type: AlignmentOptionsEnum;
194194
}
195195

aim/web/ui/src/utils/d3/drawAxes.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ function drawAxes(props: IDrawAxesProps): void {
3737
let xAlignmentText = '';
3838
const [first, last] = attributesRef.current.xScale.domain();
3939

40+
const alignmentKey = _.capitalize(getKeyByAlignment(alignmentConfig));
41+
4042
switch (alignmentConfig?.type) {
4143
case AlignmentOptionsEnum.EPOCH:
4244
{
43-
xAlignmentText =
44-
_.capitalize(getKeyByAlignment(alignmentConfig)) + 's';
45+
xAlignmentText = alignmentKey ? alignmentKey + 's' : '';
4546

4647
let ticksCount = Math.floor(plotBoxRef.current.width / 50);
4748
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
@@ -52,7 +53,7 @@ function drawAxes(props: IDrawAxesProps): void {
5253
break;
5354
case AlignmentOptionsEnum.RELATIVE_TIME:
5455
{
55-
xAlignmentText = _.capitalize(getKeyByAlignment(alignmentConfig));
56+
xAlignmentText = alignmentKey || '';
5657

5758
let ticksCount = Math.floor(plotBoxRef.current.width / 85);
5859
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
@@ -119,7 +120,7 @@ function drawAxes(props: IDrawAxesProps): void {
119120
break;
120121
case AlignmentOptionsEnum.ABSOLUTE_TIME:
121122
{
122-
xAlignmentText = _.capitalize(getKeyByAlignment(alignmentConfig));
123+
xAlignmentText = alignmentKey || '';
123124

124125
let ticksCount = Math.floor(plotBoxRef.current.width / 120);
125126
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
@@ -144,15 +145,15 @@ function drawAxes(props: IDrawAxesProps): void {
144145
break;
145146
case AlignmentOptionsEnum.CUSTOM_METRIC:
146147
{
147-
xAlignmentText = alignmentConfig?.metric;
148+
xAlignmentText = alignmentConfig?.metric || '';
148149

149150
let ticksCount = Math.floor(plotBoxRef.current.width / 120);
150151
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
151152
xAxis.ticks(ticksCount);
152153
}
153154
break;
154155
default: {
155-
xAlignmentText = _.capitalize(getKeyByAlignment(alignmentConfig)) + 's';
156+
xAlignmentText = alignmentKey ? alignmentKey + 's' : 'Steps';
156157

157158
let ticksCount = Math.floor(plotBoxRef.current.width / 90);
158159
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;

aim/web/ui/src/utils/formatByAlignment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getKeyByAlignment(alignmentConfig?: IAlignmentConfig): string {
4444
case AlignmentOptionsEnum.RELATIVE_TIME:
4545
return AlignmentKeysEnum.RELATIVE_TIME.replace('_', ' ');
4646
case AlignmentOptionsEnum.CUSTOM_METRIC:
47-
return alignmentConfig.metric;
47+
return alignmentConfig?.metric || '';
4848
default:
4949
return '';
5050
}

0 commit comments

Comments
 (0)