changedTransactions.tsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. import {Fragment, useCallback, useState} from 'react';
  2. import {browserHistory} from 'react-router';
  3. import styled from '@emotion/styled';
  4. import type {Location} from 'history';
  5. import type {Client} from 'sentry/api';
  6. import Feature from 'sentry/components/acl/feature';
  7. import {Button} from 'sentry/components/button';
  8. import {HeaderTitleLegend} from 'sentry/components/charts/styles';
  9. import Count from 'sentry/components/count';
  10. import DropdownLink from 'sentry/components/dropdownLink';
  11. import Duration from 'sentry/components/duration';
  12. import EmptyStateWarning from 'sentry/components/emptyStateWarning';
  13. import {RadioLineItem} from 'sentry/components/forms/controls/radioGroup';
  14. import IdBadge from 'sentry/components/idBadge';
  15. import Link from 'sentry/components/links/link';
  16. import LoadingIndicator from 'sentry/components/loadingIndicator';
  17. import MenuItem from 'sentry/components/menuItem';
  18. import type {CursorHandler} from 'sentry/components/pagination';
  19. import Pagination from 'sentry/components/pagination';
  20. import Panel from 'sentry/components/panels/panel';
  21. import QuestionTooltip from 'sentry/components/questionTooltip';
  22. import Radio from 'sentry/components/radio';
  23. import {Tooltip} from 'sentry/components/tooltip';
  24. import {IconArrow, IconEllipsis} from 'sentry/icons';
  25. import {t} from 'sentry/locale';
  26. import {space} from 'sentry/styles/space';
  27. import type {AvatarProject, Organization, Project} from 'sentry/types';
  28. import {trackAnalytics} from 'sentry/utils/analytics';
  29. import {formatPercentage, getDuration} from 'sentry/utils/formatters';
  30. import {useMetricsCardinalityContext} from 'sentry/utils/performance/contexts/metricsCardinality';
  31. import TrendsDiscoverQuery from 'sentry/utils/performance/trends/trendsDiscoverQuery';
  32. import {decodeScalar} from 'sentry/utils/queryString';
  33. import {MutableSearch} from 'sentry/utils/tokenizeSearch';
  34. import useApi from 'sentry/utils/useApi';
  35. import withOrganization from 'sentry/utils/withOrganization';
  36. import withProjects from 'sentry/utils/withProjects';
  37. import {
  38. DisplayModes,
  39. transactionSummaryRouteWithQuery,
  40. } from 'sentry/views/performance/transactionSummary/utils';
  41. import {PerformanceChangeExplorer} from 'sentry/views/performance/trends/changeExplorer';
  42. import getSelectedQueryKey from 'sentry/views/performance/trends/utils/getSelectedQueryKey';
  43. import {getSelectedTransaction} from 'sentry/views/performance/utils/getSelectedTransaction';
  44. import Chart from './chart';
  45. import type {
  46. NormalizedTrendsTransaction,
  47. TrendFunctionField,
  48. TrendParameter,
  49. TrendParameterColumn,
  50. TrendsStats,
  51. TrendView,
  52. } from './types';
  53. import {TrendChangeType} from './types';
  54. import {
  55. getCurrentTrendFunction,
  56. getCurrentTrendParameter,
  57. getTrendProjectId,
  58. modifyTrendView,
  59. normalizeTrends,
  60. transformDeltaSpread,
  61. transformValueDelta,
  62. trendCursorNames,
  63. trendToColor,
  64. } from './utils';
  65. type Props = {
  66. location: Location;
  67. organization: Organization;
  68. projects: Project[];
  69. setError: (msg: string | undefined) => void;
  70. trendChangeType: TrendChangeType;
  71. trendView: TrendView;
  72. previousTrendColumn?: TrendParameterColumn;
  73. previousTrendFunction?: TrendFunctionField;
  74. withBreakpoint?: boolean;
  75. };
  76. type TrendsCursorQuery = {
  77. improvedCursor?: string;
  78. regressionCursor?: string;
  79. };
  80. const makeTrendsCursorHandler =
  81. (trendChangeType: TrendChangeType): CursorHandler =>
  82. (cursor, path, query) => {
  83. const cursorQuery = {} as TrendsCursorQuery;
  84. if (trendChangeType === TrendChangeType.IMPROVED) {
  85. cursorQuery.improvedCursor = cursor;
  86. } else if (trendChangeType === TrendChangeType.REGRESSION) {
  87. cursorQuery.regressionCursor = cursor;
  88. }
  89. const selectedQueryKey = getSelectedQueryKey(trendChangeType);
  90. delete query[selectedQueryKey];
  91. browserHistory.push({
  92. pathname: path,
  93. query: {...query, ...cursorQuery},
  94. });
  95. };
  96. function getChartTitle(trendChangeType: TrendChangeType): string {
  97. switch (trendChangeType) {
  98. case TrendChangeType.IMPROVED:
  99. return t('Most Improved Transactions');
  100. case TrendChangeType.REGRESSION:
  101. return t('Most Regressed Transactions');
  102. default:
  103. throw new Error('No trend type passed');
  104. }
  105. }
  106. function handleChangeSelected(
  107. location: Location,
  108. organization: Organization,
  109. trendChangeType: TrendChangeType
  110. ) {
  111. return function updateSelected(transaction?: NormalizedTrendsTransaction) {
  112. const selectedQueryKey = getSelectedQueryKey(trendChangeType);
  113. const query = {
  114. ...location.query,
  115. };
  116. if (!transaction) {
  117. delete query[selectedQueryKey];
  118. } else {
  119. query[selectedQueryKey] = transaction
  120. ? `${transaction.transaction}-${transaction.project}`
  121. : undefined;
  122. }
  123. browserHistory.push({
  124. pathname: location.pathname,
  125. query,
  126. });
  127. trackAnalytics('performance_views.trends.widget_interaction', {
  128. organization,
  129. widget_type: trendChangeType,
  130. });
  131. };
  132. }
  133. enum FilterSymbols {
  134. GREATER_THAN_EQUALS = '>=',
  135. LESS_THAN_EQUALS = '<=',
  136. }
  137. function handleFilterTransaction(location: Location, transaction: string) {
  138. const queryString = decodeScalar(location.query.query);
  139. const conditions = new MutableSearch(queryString ?? '');
  140. conditions.addFilterValues('!transaction', [transaction]);
  141. const query = conditions.formatString();
  142. browserHistory.push({
  143. pathname: location.pathname,
  144. query: {
  145. ...location.query,
  146. query: String(query).trim(),
  147. },
  148. });
  149. }
  150. function handleFilterDuration(
  151. location: Location,
  152. organization: Organization,
  153. value: number,
  154. symbol: FilterSymbols,
  155. trendChangeType: TrendChangeType,
  156. projects: Project[],
  157. projectIds: Readonly<number[]>
  158. ) {
  159. const durationTag = getCurrentTrendParameter(location, projects, projectIds).column;
  160. const queryString = decodeScalar(location.query.query);
  161. const conditions = new MutableSearch(queryString ?? '');
  162. const existingValues = conditions.getFilterValues(durationTag);
  163. const alternateSymbol = symbol === FilterSymbols.GREATER_THAN_EQUALS ? '>' : '<';
  164. if (existingValues) {
  165. existingValues.forEach(existingValue => {
  166. if (existingValue.startsWith(symbol) || existingValue.startsWith(alternateSymbol)) {
  167. conditions.removeFilterValue(durationTag, existingValue);
  168. }
  169. });
  170. }
  171. conditions.addFilterValues(durationTag, [`${symbol}${value}`]);
  172. const query = conditions.formatString();
  173. browserHistory.push({
  174. pathname: location.pathname,
  175. query: {
  176. ...location.query,
  177. query: String(query).trim(),
  178. },
  179. });
  180. trackAnalytics('performance_views.trends.change_duration', {
  181. organization,
  182. widget_type: getChartTitle(trendChangeType),
  183. value: `${symbol}${value}`,
  184. });
  185. }
  186. function ChangedTransactions(props: Props) {
  187. const {
  188. location,
  189. trendChangeType,
  190. previousTrendFunction,
  191. previousTrendColumn,
  192. organization,
  193. projects,
  194. setError,
  195. withBreakpoint,
  196. } = props;
  197. const api = useApi();
  198. const {isLoading: isCardinalityCheckLoading, outcome} = useMetricsCardinalityContext();
  199. const canUseMetricsTrends = withBreakpoint && !outcome?.forceTransactionsOnly;
  200. const trendView = props.trendView.clone();
  201. const chartTitle = getChartTitle(trendChangeType);
  202. modifyTrendView(trendView, location, trendChangeType, projects, canUseMetricsTrends);
  203. const onCursor = makeTrendsCursorHandler(trendChangeType);
  204. const cursor = decodeScalar(location.query[trendCursorNames[trendChangeType]]);
  205. const paginationAnalyticsEvent = (direction: string) => {
  206. trackAnalytics('performance_views.trends.widget_pagination', {
  207. organization,
  208. direction,
  209. widget_type: getChartTitle(trendChangeType),
  210. });
  211. };
  212. return (
  213. <TrendsDiscoverQuery
  214. eventView={trendView}
  215. orgSlug={organization.slug}
  216. location={location}
  217. trendChangeType={trendChangeType}
  218. cursor={cursor}
  219. limit={5}
  220. setError={error => setError(error?.message)}
  221. withBreakpoint={canUseMetricsTrends}
  222. >
  223. {({isLoading, trendsData, pageLinks}) => {
  224. const trendFunction = getCurrentTrendFunction(location);
  225. const trendParameter = getCurrentTrendParameter(
  226. location,
  227. projects,
  228. trendView.project
  229. );
  230. const events = normalizeTrends(trendsData?.events?.data || []);
  231. const selectedTransaction = getSelectedTransaction(
  232. location,
  233. trendChangeType,
  234. events
  235. );
  236. const statsData = trendsData?.stats || {};
  237. const transactionsList = events?.slice ? events.slice(0, 5) : [];
  238. const currentTrendFunction =
  239. isLoading && previousTrendFunction
  240. ? previousTrendFunction
  241. : trendFunction.field;
  242. const currentTrendColumn =
  243. isLoading && previousTrendColumn ? previousTrendColumn : trendParameter.column;
  244. const titleTooltipContent = t(
  245. 'This compares the baseline (%s) of the past with the present.',
  246. trendFunction.legendLabel
  247. );
  248. return (
  249. <TransactionsListContainer data-test-id="changed-transactions">
  250. <TrendsTransactionPanel>
  251. <StyledHeaderTitleLegend>
  252. {chartTitle}
  253. <QuestionTooltip size="sm" position="top" title={titleTooltipContent} />
  254. </StyledHeaderTitleLegend>
  255. {isLoading || isCardinalityCheckLoading ? (
  256. <LoadingIndicator
  257. style={{
  258. margin: '237px auto',
  259. }}
  260. />
  261. ) : (
  262. <Fragment>
  263. {transactionsList.length ? (
  264. <Fragment>
  265. <ChartContainer>
  266. <Chart
  267. statsData={statsData}
  268. query={trendView.query}
  269. project={trendView.project}
  270. environment={trendView.environment}
  271. start={trendView.start}
  272. end={trendView.end}
  273. statsPeriod={trendView.statsPeriod}
  274. transaction={selectedTransaction}
  275. isLoading={isLoading}
  276. {...props}
  277. />
  278. </ChartContainer>
  279. {transactionsList.map((transaction, index) => (
  280. <TrendsListItem
  281. api={api}
  282. currentTrendFunction={currentTrendFunction}
  283. currentTrendColumn={currentTrendColumn}
  284. trendView={trendView}
  285. organization={organization}
  286. transaction={transaction}
  287. key={transaction.transaction}
  288. index={index}
  289. trendChangeType={trendChangeType}
  290. transactions={transactionsList}
  291. location={location}
  292. projects={projects}
  293. statsData={statsData}
  294. handleSelectTransaction={handleChangeSelected(
  295. location,
  296. organization,
  297. trendChangeType
  298. )}
  299. isLoading={isLoading}
  300. trendParameter={trendParameter}
  301. />
  302. ))}
  303. </Fragment>
  304. ) : (
  305. <StyledEmptyStateWarning small>
  306. {t('No results')}
  307. </StyledEmptyStateWarning>
  308. )}
  309. </Fragment>
  310. )}
  311. </TrendsTransactionPanel>
  312. <Pagination
  313. pageLinks={pageLinks}
  314. onCursor={onCursor}
  315. paginationAnalyticsEvent={paginationAnalyticsEvent}
  316. />
  317. </TransactionsListContainer>
  318. );
  319. }}
  320. </TrendsDiscoverQuery>
  321. );
  322. }
  323. type TrendsListItemProps = {
  324. api: Client;
  325. currentTrendColumn: string;
  326. currentTrendFunction: string;
  327. handleSelectTransaction: (transaction: NormalizedTrendsTransaction) => void;
  328. index: number;
  329. isLoading: boolean;
  330. location: Location;
  331. organization: Organization;
  332. projects: Project[];
  333. statsData: TrendsStats;
  334. transaction: NormalizedTrendsTransaction;
  335. transactions: NormalizedTrendsTransaction[];
  336. trendChangeType: TrendChangeType;
  337. trendParameter: TrendParameter;
  338. trendView: TrendView;
  339. };
  340. function TrendsListItem(props: TrendsListItemProps) {
  341. const {
  342. transaction,
  343. transactions,
  344. trendChangeType,
  345. currentTrendFunction,
  346. currentTrendColumn,
  347. index,
  348. location,
  349. organization,
  350. projects,
  351. handleSelectTransaction,
  352. trendView,
  353. statsData,
  354. isLoading,
  355. trendParameter,
  356. } = props;
  357. const color = trendToColor[trendChangeType].default;
  358. const [openedTransaction, setOpenedTransaction] = useState<null | string>(null);
  359. const selectedTransaction = getSelectedTransaction(
  360. location,
  361. trendChangeType,
  362. transactions
  363. );
  364. const isSelected = selectedTransaction === transaction;
  365. const project = projects.find(
  366. ({slug}) => slug === transaction.project
  367. ) as AvatarProject;
  368. const currentPeriodValue = transaction.aggregate_range_2;
  369. const previousPeriodValue = transaction.aggregate_range_1;
  370. const absolutePercentChange = formatPercentage(
  371. Math.abs(transaction.trend_percentage - 1),
  372. 0
  373. );
  374. const previousDuration = getDuration(
  375. previousPeriodValue / 1000,
  376. previousPeriodValue < 1000 && previousPeriodValue > 10 ? 0 : 2
  377. );
  378. const currentDuration = getDuration(
  379. currentPeriodValue / 1000,
  380. currentPeriodValue < 1000 && currentPeriodValue > 10 ? 0 : 2
  381. );
  382. const percentChangeExplanation = t(
  383. 'Over this period, the %s for %s has %s %s from %s to %s',
  384. currentTrendFunction,
  385. currentTrendColumn,
  386. trendChangeType === TrendChangeType.IMPROVED ? t('decreased') : t('increased'),
  387. absolutePercentChange,
  388. previousDuration,
  389. currentDuration
  390. );
  391. const longestPeriodValue =
  392. trendChangeType === TrendChangeType.IMPROVED
  393. ? previousPeriodValue
  394. : currentPeriodValue;
  395. const longestDuration =
  396. trendChangeType === TrendChangeType.IMPROVED ? previousDuration : currentDuration;
  397. return (
  398. <Fragment>
  399. <ListItemContainer data-test-id={'trends-list-item-' + trendChangeType}>
  400. <ItemRadioContainer color={color}>
  401. {transaction.count_range_1 && transaction.count_range_2 ? (
  402. <Tooltip
  403. title={
  404. <TooltipContent>
  405. <span>{t('Total Events')}</span>
  406. <span>
  407. <Count value={transaction.count_range_1} />
  408. <StyledIconArrow direction="right" size="xs" />
  409. <Count value={transaction.count_range_2} />
  410. </span>
  411. </TooltipContent>
  412. }
  413. >
  414. <RadioLineItem index={index} role="radio">
  415. <Radio
  416. checked={isSelected}
  417. onChange={() => handleSelectTransaction(transaction)}
  418. />
  419. </RadioLineItem>
  420. </Tooltip>
  421. ) : (
  422. <RadioLineItem index={index} role="radio">
  423. <Radio
  424. checked={isSelected}
  425. onChange={() => handleSelectTransaction(transaction)}
  426. />
  427. </RadioLineItem>
  428. )}
  429. </ItemRadioContainer>
  430. <TransactionSummaryLink {...props} onItemClicked={setOpenedTransaction} />
  431. <ItemTransactionPercentage>
  432. <Tooltip title={percentChangeExplanation}>
  433. <Fragment>
  434. {trendChangeType === TrendChangeType.REGRESSION ? '+' : ''}
  435. {formatPercentage(transaction.trend_percentage - 1, 0)}
  436. </Fragment>
  437. </Tooltip>
  438. </ItemTransactionPercentage>
  439. <DropdownLink
  440. caret={false}
  441. anchorRight
  442. title={
  443. <StyledButton
  444. size="xs"
  445. icon={<IconEllipsis data-test-id="trends-item-action" />}
  446. aria-label={t('Actions')}
  447. />
  448. }
  449. >
  450. {!organization.features.includes('performance-new-trends') && (
  451. <Fragment>
  452. <MenuItem
  453. onClick={() =>
  454. handleFilterDuration(
  455. location,
  456. organization,
  457. longestPeriodValue,
  458. FilterSymbols.LESS_THAN_EQUALS,
  459. trendChangeType,
  460. projects,
  461. trendView.project
  462. )
  463. }
  464. >
  465. <MenuAction>{t('Show \u2264 %s', longestDuration)}</MenuAction>
  466. </MenuItem>
  467. <MenuItem
  468. onClick={() =>
  469. handleFilterDuration(
  470. location,
  471. organization,
  472. longestPeriodValue,
  473. FilterSymbols.GREATER_THAN_EQUALS,
  474. trendChangeType,
  475. projects,
  476. trendView.project
  477. )
  478. }
  479. >
  480. <MenuAction>{t('Show \u2265 %s', longestDuration)}</MenuAction>
  481. </MenuItem>
  482. </Fragment>
  483. )}
  484. <MenuItem
  485. onClick={() => handleFilterTransaction(location, transaction.transaction)}
  486. >
  487. <MenuAction>{t('Hide from list')}</MenuAction>
  488. </MenuItem>
  489. </DropdownLink>
  490. <ItemTransactionDurationChange>
  491. {project && (
  492. <Tooltip title={transaction.project}>
  493. <IdBadge avatarSize={16} project={project} hideName />
  494. </Tooltip>
  495. )}
  496. <CompareDurations {...props} />
  497. </ItemTransactionDurationChange>
  498. <ItemTransactionStatus color={color}>
  499. <ValueDelta {...props} />
  500. </ItemTransactionStatus>
  501. </ListItemContainer>
  502. <Feature features="performance-change-explorer">
  503. <PerformanceChangeExplorer
  504. collapsed={openedTransaction === null}
  505. onClose={() => setOpenedTransaction(null)}
  506. transaction={transaction}
  507. trendChangeType={trendChangeType}
  508. trendFunction={currentTrendFunction}
  509. trendView={trendView}
  510. statsData={statsData}
  511. isLoading={isLoading}
  512. organization={organization}
  513. projects={projects}
  514. trendParameter={trendParameter}
  515. location={location}
  516. />
  517. </Feature>
  518. </Fragment>
  519. );
  520. }
  521. export function CompareDurations({
  522. transaction,
  523. }: {
  524. transaction: TrendsListItemProps['transaction'];
  525. }) {
  526. const {fromSeconds, toSeconds, showDigits} = transformDeltaSpread(
  527. transaction.aggregate_range_1,
  528. transaction.aggregate_range_2
  529. );
  530. return (
  531. <DurationChange>
  532. <Duration seconds={fromSeconds} fixedDigits={showDigits ? 1 : 0} abbreviation />
  533. <StyledIconArrow direction="right" size="xs" />
  534. <Duration seconds={toSeconds} fixedDigits={showDigits ? 1 : 0} abbreviation />
  535. </DurationChange>
  536. );
  537. }
  538. function ValueDelta({transaction, trendChangeType}: TrendsListItemProps) {
  539. const {seconds, fixedDigits, changeLabel} = transformValueDelta(
  540. transaction.trend_difference,
  541. trendChangeType
  542. );
  543. return (
  544. <span>
  545. <Duration seconds={seconds} fixedDigits={fixedDigits} abbreviation /> {changeLabel}
  546. </span>
  547. );
  548. }
  549. type TransactionSummaryLinkProps = TrendsListItemProps & {
  550. onItemClicked: React.Dispatch<React.SetStateAction<null | string>>;
  551. };
  552. function TransactionSummaryLink(props: TransactionSummaryLinkProps) {
  553. const {
  554. organization,
  555. trendView: eventView,
  556. transaction,
  557. projects,
  558. location,
  559. currentTrendFunction,
  560. onItemClicked: onTransactionSelection,
  561. } = props;
  562. const summaryView = eventView.clone();
  563. const projectID = getTrendProjectId(transaction, projects);
  564. const target = transactionSummaryRouteWithQuery({
  565. orgSlug: organization.slug,
  566. transaction: String(transaction.transaction),
  567. query: summaryView.generateQueryStringObject(),
  568. projectID,
  569. display: DisplayModes.TREND,
  570. trendFunction: currentTrendFunction,
  571. additionalQuery: {
  572. trendParameter: location.query.trendParameter?.toString(),
  573. },
  574. });
  575. const handleClick = useCallback(() => {
  576. onTransactionSelection(transaction.transaction);
  577. trackAnalytics('performance_views.performance_change_explorer.open', {
  578. organization,
  579. transaction: transaction.transaction,
  580. });
  581. }, [onTransactionSelection, transaction.transaction, organization]);
  582. if (organization.features.includes('performance-change-explorer')) {
  583. return (
  584. <ItemTransactionName
  585. to=""
  586. data-test-id="item-transaction-name"
  587. onClick={handleClick}
  588. >
  589. {transaction.transaction}
  590. </ItemTransactionName>
  591. );
  592. }
  593. return (
  594. <ItemTransactionName to={target} data-test-id="item-transaction-name">
  595. {transaction.transaction}
  596. </ItemTransactionName>
  597. );
  598. }
  599. const TransactionsListContainer = styled('div')`
  600. display: flex;
  601. flex-direction: column;
  602. `;
  603. const TrendsTransactionPanel = styled(Panel)`
  604. margin: 0;
  605. flex-grow: 1;
  606. `;
  607. const ChartContainer = styled('div')`
  608. padding: ${space(3)};
  609. `;
  610. const StyledHeaderTitleLegend = styled(HeaderTitleLegend)`
  611. border-radius: ${p => p.theme.borderRadius};
  612. margin: ${space(2)} ${space(3)};
  613. `;
  614. const StyledButton = styled(Button)`
  615. vertical-align: middle;
  616. `;
  617. const MenuAction = styled('div')<{['data-test-id']?: string}>`
  618. white-space: nowrap;
  619. color: ${p => p.theme.textColor};
  620. `;
  621. MenuAction.defaultProps = {
  622. 'data-test-id': 'menu-action',
  623. };
  624. const StyledEmptyStateWarning = styled(EmptyStateWarning)`
  625. min-height: 300px;
  626. justify-content: center;
  627. `;
  628. const ListItemContainer = styled('div')`
  629. display: grid;
  630. grid-template-columns: 24px auto 100px 30px;
  631. grid-template-rows: repeat(2, auto);
  632. grid-column-gap: ${space(1)};
  633. border-top: 1px solid ${p => p.theme.border};
  634. padding: ${space(1)} ${space(2)};
  635. `;
  636. const ItemRadioContainer = styled('div')`
  637. grid-row: 1/3;
  638. input {
  639. cursor: pointer;
  640. }
  641. input:checked::after {
  642. background-color: ${p => p.color};
  643. }
  644. `;
  645. const ItemTransactionName = styled(Link)`
  646. font-size: ${p => p.theme.fontSizeMedium};
  647. margin-right: ${space(1)};
  648. ${p => p.theme.overflowEllipsis};
  649. `;
  650. const ItemTransactionDurationChange = styled('div')`
  651. display: flex;
  652. align-items: center;
  653. font-size: ${p => p.theme.fontSizeSmall};
  654. `;
  655. const DurationChange = styled('span')`
  656. color: ${p => p.theme.gray300};
  657. margin: 0 ${space(1)};
  658. `;
  659. const ItemTransactionPercentage = styled('div')`
  660. text-align: right;
  661. font-size: ${p => p.theme.fontSizeMedium};
  662. `;
  663. const ItemTransactionStatus = styled('div')`
  664. color: ${p => p.color};
  665. text-align: right;
  666. font-size: ${p => p.theme.fontSizeSmall};
  667. `;
  668. const TooltipContent = styled('div')`
  669. display: flex;
  670. flex-direction: column;
  671. align-items: center;
  672. `;
  673. const StyledIconArrow = styled(IconArrow)`
  674. margin: 0 ${space(1)};
  675. `;
  676. export default withProjects(withOrganization(ChangedTransactions));