Skip to content

Commit

Permalink
Fix filtering highlighted columns in "manage-table-columns" (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaroMourad authored Nov 12, 2021
1 parent d2a7222 commit 0bcac8b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const PopoverContent = React.forwardRef(function PopoverContent(
{isSystemMetric(metric)
? formatSystemMetricName(metric)
: metric ?? '--'}
</strong>
</strong>{' '}
{context || null}
</div>
<div className='PopoverContent__value'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function ManageColumnsPopover({
if (!!midPane) {
if (searchKey && searchKey.trim() !== '') {
const firstHighlightedCol: any = midPane.querySelector(
'.ColumnItem__container.highlighted',
'.ColumnItem.highlighted',
);
if (!!firstHighlightedCol) {
midPane.scrollTop =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export interface IChartTooltip {
}

export interface IAlignmentConfig {
metric: string;
metric?: string;
type: AlignmentOptionsEnum;
}

Expand Down
13 changes: 7 additions & 6 deletions aim/web/ui/src/utils/d3/drawAxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ function drawAxes(props: IDrawAxesProps): void {
let xAlignmentText = '';
const [first, last] = attributesRef.current.xScale.domain();

const alignmentKey = _.capitalize(getKeyByAlignment(alignmentConfig));

switch (alignmentConfig?.type) {
case AlignmentOptionsEnum.EPOCH:
{
xAlignmentText =
_.capitalize(getKeyByAlignment(alignmentConfig)) + 's';
xAlignmentText = alignmentKey ? alignmentKey + 's' : '';

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

let ticksCount = Math.floor(plotBoxRef.current.width / 85);
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
Expand Down Expand Up @@ -119,7 +120,7 @@ function drawAxes(props: IDrawAxesProps): void {
break;
case AlignmentOptionsEnum.ABSOLUTE_TIME:
{
xAlignmentText = _.capitalize(getKeyByAlignment(alignmentConfig));
xAlignmentText = alignmentKey || '';

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

let ticksCount = Math.floor(plotBoxRef.current.width / 120);
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
xAxis.ticks(ticksCount);
}
break;
default: {
xAlignmentText = _.capitalize(getKeyByAlignment(alignmentConfig)) + 's';
xAlignmentText = alignmentKey ? alignmentKey + 's' : 'Steps';

let ticksCount = Math.floor(plotBoxRef.current.width / 90);
ticksCount = ticksCount > 1 ? ticksCount - 1 : 1;
Expand Down
2 changes: 1 addition & 1 deletion aim/web/ui/src/utils/formatByAlignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function getKeyByAlignment(alignmentConfig?: IAlignmentConfig): string {
case AlignmentOptionsEnum.RELATIVE_TIME:
return AlignmentKeysEnum.RELATIVE_TIME.replace('_', ' ');
case AlignmentOptionsEnum.CUSTOM_METRIC:
return alignmentConfig.metric;
return alignmentConfig?.metric || '';
default:
return '';
}
Expand Down

0 comments on commit 0bcac8b

Please sign in to comment.