|
@@ -8,7 +8,7 @@ import SortLink from 'sentry/components/gridEditable/sortLink';
|
|
import Link from 'sentry/components/links/link';
|
|
import Link from 'sentry/components/links/link';
|
|
import {Tooltip} from 'sentry/components/tooltip';
|
|
import {Tooltip} from 'sentry/components/tooltip';
|
|
import {t} from 'sentry/locale';
|
|
import {t} from 'sentry/locale';
|
|
-import {Organization, PageFilters} from 'sentry/types';
|
|
|
|
|
|
+import {Organization, PageFilters, Project} from 'sentry/types';
|
|
import {defined} from 'sentry/utils';
|
|
import {defined} from 'sentry/utils';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import {
|
|
import {
|
|
@@ -33,8 +33,10 @@ import {
|
|
import {DisplayType, Widget, WidgetType} from 'sentry/views/dashboards/types';
|
|
import {DisplayType, Widget, WidgetType} from 'sentry/views/dashboards/types';
|
|
import {eventViewFromWidget} from 'sentry/views/dashboards/utils';
|
|
import {eventViewFromWidget} from 'sentry/views/dashboards/utils';
|
|
import {ISSUE_FIELDS} from 'sentry/views/dashboards/widgetBuilder/issueWidget/fields';
|
|
import {ISSUE_FIELDS} from 'sentry/views/dashboards/widgetBuilder/issueWidget/fields';
|
|
|
|
+import {StyledLink} from 'sentry/views/discover/table/tableView';
|
|
import TopResultsIndicator from 'sentry/views/discover/table/topResultsIndicator';
|
|
import TopResultsIndicator from 'sentry/views/discover/table/topResultsIndicator';
|
|
import {TableColumn} from 'sentry/views/discover/table/types';
|
|
import {TableColumn} from 'sentry/views/discover/table/types';
|
|
|
|
+import {getTargetForTransactionSummaryLink} from 'sentry/views/discover/utils';
|
|
|
|
|
|
import {WidgetViewerQueryField} from './utils';
|
|
import {WidgetViewerQueryField} from './utils';
|
|
// Dashboards only supports top 5 for now
|
|
// Dashboards only supports top 5 for now
|
|
@@ -45,9 +47,11 @@ type Props = {
|
|
organization: Organization;
|
|
organization: Organization;
|
|
selection: PageFilters;
|
|
selection: PageFilters;
|
|
widget: Widget;
|
|
widget: Widget;
|
|
|
|
+ eventView?: EventView;
|
|
isFirstPage?: boolean;
|
|
isFirstPage?: boolean;
|
|
isMetricsData?: boolean;
|
|
isMetricsData?: boolean;
|
|
onHeaderClick?: () => void;
|
|
onHeaderClick?: () => void;
|
|
|
|
+ projects?: Project[];
|
|
tableData?: TableDataWithTitle;
|
|
tableData?: TableDataWithTitle;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -175,6 +179,8 @@ export const renderGridBodyCell = ({
|
|
widget,
|
|
widget,
|
|
tableData,
|
|
tableData,
|
|
isFirstPage,
|
|
isFirstPage,
|
|
|
|
+ projects,
|
|
|
|
+ eventView,
|
|
}: Props) =>
|
|
}: Props) =>
|
|
function (
|
|
function (
|
|
column: GridColumnOrder,
|
|
column: GridColumnOrder,
|
|
@@ -222,6 +228,23 @@ export const renderGridBodyCell = ({
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (columnKey === 'transaction' && dataRow.transaction) {
|
|
|
|
+ cell = (
|
|
|
|
+ <StyledLink
|
|
|
|
+ data-test-id="widget-viewer-transaction-link"
|
|
|
|
+ to={getTargetForTransactionSummaryLink(
|
|
|
|
+ dataRow,
|
|
|
|
+ organization,
|
|
|
|
+ projects,
|
|
|
|
+ eventView
|
|
|
|
+ )}
|
|
|
|
+ >
|
|
|
|
+ {cell}
|
|
|
|
+ </StyledLink>
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
const topResultsCount = tableData
|
|
const topResultsCount = tableData
|
|
? Math.min(tableData?.data.length, DEFAULT_NUM_TOP_EVENTS)
|
|
? Math.min(tableData?.data.length, DEFAULT_NUM_TOP_EVENTS)
|
|
: DEFAULT_NUM_TOP_EVENTS;
|
|
: DEFAULT_NUM_TOP_EVENTS;
|