changedTransactions.tsx 23 KB

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