|
@@ -10,6 +10,7 @@ import GridEditable, {
|
|
|
import Link from 'sentry/components/links/link';
|
|
|
import Pagination, {CursorHandler} from 'sentry/components/pagination';
|
|
|
import {Organization} from 'sentry/types';
|
|
|
+import {defined} from 'sentry/utils';
|
|
|
import {EventsMetaType} from 'sentry/utils/discover/eventView';
|
|
|
import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
|
|
|
import type {Sort} from 'sentry/utils/discover/fields';
|
|
@@ -37,6 +38,7 @@ type Row = {
|
|
|
'sps()': number;
|
|
|
'sps_percent_change()': number;
|
|
|
'time_spent_percentage()': number;
|
|
|
+ 'time_spent_percentage(local)': number;
|
|
|
};
|
|
|
|
|
|
type Column = GridColumnHeader<keyof Row>;
|
|
@@ -63,6 +65,7 @@ export const SORTABLE_FIELDS = new Set([
|
|
|
'sps()',
|
|
|
'sps_percent_change()',
|
|
|
'time_spent_percentage()',
|
|
|
+ 'time_spent_percentage(local)',
|
|
|
'http_error_count()',
|
|
|
'http_error_count_percent_change()',
|
|
|
]);
|
|
@@ -112,7 +115,7 @@ export default function SpansTable({
|
|
|
<GridEditable
|
|
|
isLoading={isLoading}
|
|
|
data={data as Row[]}
|
|
|
- columnOrder={columnOrder ?? getColumns(moduleName)}
|
|
|
+ columnOrder={columnOrder ?? getColumns(moduleName, endpoint)}
|
|
|
columnSortBy={[
|
|
|
{
|
|
|
key: sort.field,
|
|
@@ -198,7 +201,7 @@ function getDescriptionHeader(moduleName: ModuleName) {
|
|
|
return 'Description';
|
|
|
}
|
|
|
|
|
|
-function getColumns(moduleName: ModuleName): Column[] {
|
|
|
+export function getColumns(moduleName: ModuleName, transaction?: string): Column[] {
|
|
|
const description = getDescriptionHeader(moduleName);
|
|
|
|
|
|
const domain = getDomainHeader(moduleName);
|
|
@@ -257,12 +260,21 @@ function getColumns(moduleName: ModuleName): Column[] {
|
|
|
} as Column,
|
|
|
]
|
|
|
: []),
|
|
|
- {
|
|
|
+ ];
|
|
|
+
|
|
|
+ if (defined(transaction)) {
|
|
|
+ order.push({
|
|
|
+ key: 'time_spent_percentage(local)',
|
|
|
+ name: DataTitles.timeSpent,
|
|
|
+ width: COL_WIDTH_UNDEFINED,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ order.push({
|
|
|
key: 'time_spent_percentage()',
|
|
|
name: DataTitles.timeSpent,
|
|
|
width: COL_WIDTH_UNDEFINED,
|
|
|
- },
|
|
|
- ];
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
return order;
|
|
|
}
|