Skip to content

Commit e51326b

Browse files
authored
Merge pull request #4124 from relative-ci/sort-by-actual-not-absolute-value-rltv-894
fix(ui): MetricsTable - sort by actual value
2 parents 688f358 + 92cd233 commit e51326b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/ui/src/components/metrics-table/metrics-table.i18n.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export const BASELINE_TITLE = 'Baseline';
22
export const CURRENT_TITLE = 'Current';
33

4-
export const SORT_ABSOLUTE_VALUE = 'absolute value';
5-
export const SORT_ABSOLUTE_CHANGE = 'absolute change';
6-
export const SORT_PERCENTUAL_CHANGE = 'absolute percentual change';
4+
export const SORT_VALUE = 'value';
5+
export const SORT_CHANGE = 'change';
6+
export const SORT_PERCENTUAL_CHANGE = 'percentual change';
77

88
export const EMPTY_MESSAGE = 'No items found.';
99
export const SHOW_ALL = 'Show all';

packages/ui/src/components/metrics-table/metrics-table.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const SumColumn = ({ rows, isBaseline, runIndex, updateSort, sort }: ColumnSumPr
9292
<SortButton
9393
fieldPath={fieldPath}
9494
fieldName="value"
95-
label="absolute value"
95+
label={I18N.SORT_VALUE}
9696
updateSort={updateSort}
9797
sort={sort}
9898
>
@@ -105,7 +105,7 @@ const SumColumn = ({ rows, isBaseline, runIndex, updateSort, sort }: ColumnSumPr
105105
<SortButton
106106
fieldPath={fieldPath}
107107
fieldName="delta"
108-
label="absolute change"
108+
label={I18N.SORT_CHANGE}
109109
updateSort={updateSort}
110110
sort={sort}
111111
>
@@ -118,7 +118,7 @@ const SumColumn = ({ rows, isBaseline, runIndex, updateSort, sort }: ColumnSumPr
118118
<SortButton
119119
fieldPath={fieldPath}
120120
fieldName="deltaPercentage"
121-
label="absolute percentual change"
121+
label={I18N.SORT_PERCENTUAL_CHANGE}
122122
updateSort={updateSort}
123123
sort={sort}
124124
>

packages/ui/src/hooks/rows-sort.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const getSortFn =
1818
return getCustomSort(item);
1919
}
2020

21-
return Math.abs(get(item, fieldPath) || 0);
21+
return get(item, fieldPath) || 0;
2222
};
2323

2424
export const useRowsSort = ({

0 commit comments

Comments
 (0)