overview.tsx 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. import {Component} from 'react';
  2. import {browserHistory, RouteComponentProps} from 'react-router';
  3. import styled from '@emotion/styled';
  4. import {withProfiler} from '@sentry/react';
  5. import * as Sentry from '@sentry/react';
  6. import {Location} from 'history';
  7. import Cookies from 'js-cookie';
  8. import isEqual from 'lodash/isEqual';
  9. import mapValues from 'lodash/mapValues';
  10. import omit from 'lodash/omit';
  11. import pickBy from 'lodash/pickBy';
  12. import moment from 'moment';
  13. import * as qs from 'query-string';
  14. import {addMessage} from 'sentry/actionCreators/indicator';
  15. import {fetchOrgMembers, indexMembersByProject} from 'sentry/actionCreators/members';
  16. import {fetchTagValues, loadOrganizationTags} from 'sentry/actionCreators/tags';
  17. import {Client} from 'sentry/api';
  18. import * as Layout from 'sentry/components/layouts/thirds';
  19. import LoadingIndicator from 'sentry/components/loadingIndicator';
  20. import {extractSelectionParameters} from 'sentry/components/organizations/pageFilters/utils';
  21. import Pagination, {CursorHandler} from 'sentry/components/pagination';
  22. import Panel from 'sentry/components/panels/panel';
  23. import PanelBody from 'sentry/components/panels/panelBody';
  24. import QueryCount from 'sentry/components/queryCount';
  25. import ProcessingIssueList from 'sentry/components/stream/processingIssueList';
  26. import {DEFAULT_QUERY, DEFAULT_STATS_PERIOD} from 'sentry/constants';
  27. import {t, tct, tn} from 'sentry/locale';
  28. import GroupStore from 'sentry/stores/groupStore';
  29. import IssueListCacheStore from 'sentry/stores/IssueListCacheStore';
  30. import SelectedGroupStore from 'sentry/stores/selectedGroupStore';
  31. import {space} from 'sentry/styles/space';
  32. import {
  33. BaseGroup,
  34. Group,
  35. IssueCategory,
  36. Organization,
  37. PageFilters,
  38. SavedSearch,
  39. TagCollection,
  40. } from 'sentry/types';
  41. import {defined} from 'sentry/utils';
  42. import {trackAnalytics} from 'sentry/utils/analytics';
  43. import CursorPoller from 'sentry/utils/cursorPoller';
  44. import {getUtcDateString} from 'sentry/utils/dates';
  45. import getCurrentSentryReactTransaction from 'sentry/utils/getCurrentSentryReactTransaction';
  46. import parseApiError from 'sentry/utils/parseApiError';
  47. import parseLinkHeader from 'sentry/utils/parseLinkHeader';
  48. import {VisuallyCompleteWithData} from 'sentry/utils/performanceForSentry';
  49. import {decodeScalar} from 'sentry/utils/queryString';
  50. import withRouteAnalytics, {
  51. WithRouteAnalyticsProps,
  52. } from 'sentry/utils/routeAnalytics/withRouteAnalytics';
  53. import withApi from 'sentry/utils/withApi';
  54. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  55. import withIssueTags from 'sentry/utils/withIssueTags';
  56. import withOrganization from 'sentry/utils/withOrganization';
  57. import withPageFilters from 'sentry/utils/withPageFilters';
  58. import withSavedSearches from 'sentry/utils/withSavedSearches';
  59. import SavedIssueSearches from 'sentry/views/issueList/savedIssueSearches';
  60. import IssueListActions from './actions';
  61. import IssueListFilters from './filters';
  62. import GroupListBody from './groupListBody';
  63. import IssueListHeader from './header';
  64. import {
  65. DEFAULT_ISSUE_STREAM_SORT,
  66. FOR_REVIEW_QUERIES,
  67. getTabs,
  68. getTabsWithCounts,
  69. isForReviewQuery,
  70. IssueSortOptions,
  71. Query,
  72. QueryCounts,
  73. TAB_MAX_COUNT,
  74. } from './utils';
  75. const MAX_ITEMS = 25;
  76. // the default period for the graph in each issue row
  77. const DEFAULT_GRAPH_STATS_PERIOD = '24h';
  78. // the allowed period choices for graph in each issue row
  79. const DYNAMIC_COUNTS_STATS_PERIODS = new Set(['14d', '24h', 'auto']);
  80. const MAX_ISSUES_COUNT = 100;
  81. type Params = {
  82. orgId: string;
  83. };
  84. type Props = {
  85. api: Client;
  86. location: Location;
  87. organization: Organization;
  88. params: Params;
  89. savedSearch: SavedSearch;
  90. savedSearchLoading: boolean;
  91. savedSearches: SavedSearch[];
  92. selectedSearchId: string;
  93. selection: PageFilters;
  94. tags: TagCollection;
  95. } & RouteComponentProps<{searchId?: string}, {}> &
  96. WithRouteAnalyticsProps;
  97. type State = {
  98. actionTaken: boolean;
  99. actionTakenGroupData: Group[];
  100. error: string | null;
  101. groupIds: string[];
  102. issuesLoading: boolean;
  103. itemsRemoved: number;
  104. memberList: ReturnType<typeof indexMembersByProject>;
  105. pageLinks: string;
  106. /**
  107. * Current query total
  108. */
  109. queryCount: number;
  110. /**
  111. * Counts for each inbox tab
  112. */
  113. queryCounts: QueryCounts;
  114. queryMaxCount: number;
  115. realtimeActive: boolean;
  116. selectAllActive: boolean;
  117. undo: boolean;
  118. // Will be set to true if there is valid session data from issue-stats api call
  119. query?: string;
  120. };
  121. interface EndpointParams extends Partial<PageFilters['datetime']> {
  122. environment: string[];
  123. project: number[];
  124. cursor?: string;
  125. groupStatsPeriod?: string | null;
  126. page?: number | string;
  127. query?: string;
  128. sort?: string;
  129. statsPeriod?: string | null;
  130. }
  131. type CountsEndpointParams = Omit<EndpointParams, 'cursor' | 'page' | 'query'> & {
  132. query: string[];
  133. };
  134. type StatEndpointParams = Omit<EndpointParams, 'cursor' | 'page'> & {
  135. groups: string[];
  136. expand?: string | string[];
  137. };
  138. class IssueListOverview extends Component<Props, State> {
  139. state: State = this.getInitialState();
  140. getInitialState() {
  141. const realtimeActiveCookie = Cookies.get('realtimeActive');
  142. const realtimeActive =
  143. typeof realtimeActiveCookie === 'undefined'
  144. ? false
  145. : realtimeActiveCookie === 'true';
  146. return {
  147. groupIds: [],
  148. actionTaken: false,
  149. actionTakenGroupData: [],
  150. undo: false,
  151. selectAllActive: false,
  152. realtimeActive,
  153. pageLinks: '',
  154. itemsRemoved: 0,
  155. queryCount: 0,
  156. queryCounts: {},
  157. queryMaxCount: 0,
  158. error: null,
  159. issuesLoading: true,
  160. memberList: {},
  161. };
  162. }
  163. componentDidMount() {
  164. this._poller = new CursorPoller({
  165. linkPreviousHref: parseLinkHeader(this.state.pageLinks)?.previous?.href,
  166. success: this.onRealtimePoll,
  167. });
  168. // Wait for saved searches to load so if the user is on a saved search
  169. // or they have a pinned search we load the correct data the first time.
  170. // But if searches are already there, we can go right to fetching issues
  171. if (
  172. !this.props.savedSearchLoading ||
  173. this.props.organization.features.includes('issue-stream-performance')
  174. ) {
  175. const loadedFromCache = this.loadFromCache();
  176. if (!loadedFromCache) {
  177. // It's possible the projects query parameter is not yet ready and this
  178. // request will be repeated in componentDidUpdate
  179. this.fetchData();
  180. }
  181. }
  182. this.fetchTags();
  183. this.fetchMemberList();
  184. // let custom analytics take control
  185. this.props.setDisableRouteAnalytics?.();
  186. }
  187. componentDidUpdate(prevProps: Props, prevState: State) {
  188. if (prevState.realtimeActive !== this.state.realtimeActive) {
  189. // User toggled realtime button
  190. if (this.state.realtimeActive) {
  191. this.resumePolling();
  192. } else {
  193. this._poller.disable();
  194. }
  195. }
  196. // If the project selection has changed reload the member list and tag keys
  197. // allowing autocomplete and tag sidebar to be more accurate.
  198. if (!isEqual(prevProps.selection.projects, this.props.selection.projects)) {
  199. this.loadFromCache();
  200. this.fetchMemberList();
  201. this.fetchTags();
  202. }
  203. const selectionChanged = !isEqual(prevProps.selection, this.props.selection);
  204. // Wait for saved searches to load before we attempt to fetch stream data
  205. // Selection changing could indicate that the projects query parameter has populated
  206. // and we should refetch data.
  207. if (this.props.savedSearchLoading && !selectionChanged) {
  208. return;
  209. }
  210. if (
  211. prevProps.savedSearchLoading &&
  212. !this.props.savedSearchLoading &&
  213. this.props.organization.features.includes('issue-stream-performance')
  214. ) {
  215. return;
  216. }
  217. if (
  218. prevProps.savedSearchLoading &&
  219. !this.props.organization.features.includes('issue-stream-performance')
  220. ) {
  221. const loadedFromCache = this.loadFromCache();
  222. if (!loadedFromCache) {
  223. this.fetchData();
  224. }
  225. return;
  226. }
  227. const prevUrlQuery = prevProps.location.query;
  228. const newUrlQuery = this.props.location.query;
  229. const prevQuery = this.getQueryFromSavedSearchOrLocation({
  230. savedSearch: prevProps.savedSearch,
  231. location: prevProps.location,
  232. });
  233. const newQuery = this.getQuery();
  234. const prevSort = this.getSortFromSavedSearchOrLocation({
  235. savedSearch: prevProps.savedSearch,
  236. location: prevProps.location,
  237. });
  238. const newSort = this.getSort();
  239. // If any important url parameter changed or saved search changed
  240. // reload data.
  241. if (
  242. selectionChanged ||
  243. prevUrlQuery.cursor !== newUrlQuery.cursor ||
  244. prevUrlQuery.statsPeriod !== newUrlQuery.statsPeriod ||
  245. prevUrlQuery.groupStatsPeriod !== newUrlQuery.groupStatsPeriod ||
  246. prevQuery !== newQuery ||
  247. prevSort !== newSort
  248. ) {
  249. this.fetchData(selectionChanged);
  250. } else if (
  251. !this._lastRequest &&
  252. prevState.issuesLoading === false &&
  253. this.state.issuesLoading
  254. ) {
  255. // Reload if we issues are loading or their loading state changed.
  256. // This can happen when transitionTo is called
  257. this.fetchData();
  258. }
  259. }
  260. componentWillUnmount() {
  261. const groups = GroupStore.getState() as Group[];
  262. if (
  263. groups.length > 0 &&
  264. !this.state.issuesLoading &&
  265. !this.state.realtimeActive &&
  266. this.props.organization.features.includes('issue-stream-performance-cache')
  267. ) {
  268. IssueListCacheStore.save(this.getCacheEndpointParams(), {
  269. groups,
  270. queryCount: this.state.queryCount,
  271. queryMaxCount: this.state.queryMaxCount,
  272. pageLinks: this.state.pageLinks,
  273. });
  274. }
  275. this._poller.disable();
  276. SelectedGroupStore.reset();
  277. GroupStore.reset();
  278. this.props.api.clear();
  279. this.listener?.();
  280. }
  281. private _poller: any;
  282. private _lastRequest: any;
  283. private _lastStatsRequest: any;
  284. private _lastFetchCountsRequest: any;
  285. getQueryFromSavedSearchOrLocation({
  286. savedSearch,
  287. location,
  288. }: Pick<Props, 'savedSearch' | 'location'>): string {
  289. if (savedSearch) {
  290. return savedSearch.query;
  291. }
  292. const {query} = location.query;
  293. if (query !== undefined) {
  294. return decodeScalar(query, '');
  295. }
  296. return DEFAULT_QUERY;
  297. }
  298. getSortFromSavedSearchOrLocation({
  299. savedSearch,
  300. location,
  301. }: Pick<Props, 'savedSearch' | 'location'>): string {
  302. if (!location.query.sort && savedSearch?.id) {
  303. return savedSearch.sort;
  304. }
  305. if (location.query.sort) {
  306. return location.query.sort as string;
  307. }
  308. return DEFAULT_ISSUE_STREAM_SORT;
  309. }
  310. /**
  311. * Load the previous
  312. * @returns Returns true if the data was loaded from cache
  313. */
  314. loadFromCache(): boolean {
  315. if (!this.props.organization.features.includes('issue-stream-performance-cache')) {
  316. return false;
  317. }
  318. const cache = IssueListCacheStore.getFromCache(this.getCacheEndpointParams());
  319. if (!cache) {
  320. return false;
  321. }
  322. this.setState(
  323. {
  324. issuesLoading: false,
  325. queryCount: cache.queryCount,
  326. queryMaxCount: cache.queryMaxCount,
  327. pageLinks: cache.pageLinks,
  328. },
  329. () => {
  330. // Handle this in the next tick to avoid being overwritten by GroupStore.reset
  331. // Group details clears the GroupStore at the same time this component mounts
  332. GroupStore.add(cache.groups);
  333. // Clear cache after loading
  334. IssueListCacheStore.reset();
  335. }
  336. );
  337. return true;
  338. }
  339. getQuery(): string {
  340. return this.getQueryFromSavedSearchOrLocation({
  341. savedSearch: this.props.savedSearch,
  342. location: this.props.location,
  343. });
  344. }
  345. getSort(): string {
  346. return this.getSortFromSavedSearchOrLocation({
  347. savedSearch: this.props.savedSearch,
  348. location: this.props.location,
  349. });
  350. }
  351. getGroupStatsPeriod(): string {
  352. let currentPeriod: string;
  353. if (typeof this.props.location.query?.groupStatsPeriod === 'string') {
  354. currentPeriod = this.props.location.query.groupStatsPeriod;
  355. } else {
  356. currentPeriod = DEFAULT_GRAPH_STATS_PERIOD;
  357. }
  358. return DYNAMIC_COUNTS_STATS_PERIODS.has(currentPeriod)
  359. ? currentPeriod
  360. : DEFAULT_GRAPH_STATS_PERIOD;
  361. }
  362. getEndpointParams = (): EndpointParams => {
  363. const {selection} = this.props;
  364. const params: EndpointParams = {
  365. project: selection.projects,
  366. environment: selection.environments,
  367. query: this.getQuery(),
  368. ...selection.datetime,
  369. };
  370. if (selection.datetime.period) {
  371. delete params.period;
  372. params.statsPeriod = selection.datetime.period;
  373. }
  374. if (params.end) {
  375. params.end = getUtcDateString(params.end);
  376. }
  377. if (params.start) {
  378. params.start = getUtcDateString(params.start);
  379. }
  380. const sort = this.getSort();
  381. if (sort !== DEFAULT_ISSUE_STREAM_SORT) {
  382. params.sort = sort;
  383. }
  384. const groupStatsPeriod = this.getGroupStatsPeriod();
  385. if (groupStatsPeriod !== DEFAULT_GRAPH_STATS_PERIOD) {
  386. params.groupStatsPeriod = groupStatsPeriod;
  387. }
  388. // only include defined values.
  389. return pickBy(params, v => defined(v)) as EndpointParams;
  390. };
  391. getCacheEndpointParams = (): EndpointParams => {
  392. const cursor = this.props.location.query.cursor;
  393. return {
  394. ...this.getEndpointParams(),
  395. cursor,
  396. };
  397. };
  398. getSelectedProjectIds = (): string[] => {
  399. return this.props.selection.projects.map(projectId => String(projectId));
  400. };
  401. fetchMemberList() {
  402. const projectIds = this.getSelectedProjectIds();
  403. fetchOrgMembers(this.props.api, this.props.organization.slug, projectIds).then(
  404. members => {
  405. this.setState({memberList: indexMembersByProject(members)});
  406. }
  407. );
  408. }
  409. fetchTags() {
  410. const {api, organization, selection} = this.props;
  411. loadOrganizationTags(api, organization.slug, selection);
  412. }
  413. fetchStats = (groups: string[]) => {
  414. // If we have no groups to fetch, just skip stats
  415. if (!groups.length) {
  416. return;
  417. }
  418. const requestParams: StatEndpointParams = {
  419. ...this.getEndpointParams(),
  420. groups,
  421. };
  422. // If no stats period values are set, use default
  423. if (!requestParams.statsPeriod && !requestParams.start) {
  424. requestParams.statsPeriod = DEFAULT_STATS_PERIOD;
  425. }
  426. this._lastStatsRequest = this.props.api.request(this.groupStatsEndpoint, {
  427. method: 'GET',
  428. data: qs.stringify(requestParams),
  429. success: data => {
  430. if (!data) {
  431. return;
  432. }
  433. GroupStore.onPopulateStats(groups, data);
  434. this.trackTabViewed(groups, data);
  435. },
  436. error: err => {
  437. this.setState({
  438. error: parseApiError(err),
  439. });
  440. },
  441. complete: () => {
  442. this._lastStatsRequest = null;
  443. // End navigation transaction to prevent additional page requests from impacting page metrics.
  444. // Other transactions include stacktrace preview request
  445. const currentTransaction = Sentry.getCurrentHub().getScope()?.getTransaction();
  446. if (currentTransaction?.op === 'navigation') {
  447. currentTransaction.finish();
  448. }
  449. },
  450. });
  451. };
  452. fetchCounts = (currentQueryCount: number, fetchAllCounts: boolean) => {
  453. const {organization} = this.props;
  454. const {queryCounts: _queryCounts} = this.state;
  455. let queryCounts: QueryCounts = {..._queryCounts};
  456. const endpointParams = this.getEndpointParams();
  457. const tabQueriesWithCounts = getTabsWithCounts(organization);
  458. const currentTabQuery = tabQueriesWithCounts.includes(endpointParams.query as Query)
  459. ? endpointParams.query
  460. : null;
  461. // Update the count based on the exact number of issues, these shown as is
  462. if (currentTabQuery) {
  463. queryCounts[currentTabQuery] = {
  464. count: currentQueryCount,
  465. hasMore: false,
  466. };
  467. }
  468. this.setState({queryCounts});
  469. // If all tabs' counts are fetched, skip and only set
  470. if (
  471. fetchAllCounts ||
  472. !tabQueriesWithCounts.every(tabQuery => queryCounts[tabQuery] !== undefined)
  473. ) {
  474. const requestParams: CountsEndpointParams = {
  475. ...omit(endpointParams, 'query'),
  476. // fetch the counts for the tabs whose counts haven't been fetched yet
  477. query: tabQueriesWithCounts.filter(_query => _query !== currentTabQuery),
  478. };
  479. // If no stats period values are set, use default
  480. if (!requestParams.statsPeriod && !requestParams.start) {
  481. requestParams.statsPeriod = DEFAULT_STATS_PERIOD;
  482. }
  483. this._lastFetchCountsRequest = this.props.api.request(this.groupCountsEndpoint, {
  484. method: 'GET',
  485. data: qs.stringify(requestParams),
  486. success: data => {
  487. if (!data) {
  488. return;
  489. }
  490. // Counts coming from the counts endpoint is limited to 100, for >= 100 we display 99+
  491. queryCounts = {
  492. ...queryCounts,
  493. ...mapValues(data, (count: number) => ({
  494. count,
  495. hasMore: count > TAB_MAX_COUNT,
  496. })),
  497. };
  498. },
  499. error: () => {
  500. this.setState({queryCounts: {}});
  501. },
  502. complete: () => {
  503. this._lastFetchCountsRequest = null;
  504. this.setState({queryCounts});
  505. },
  506. });
  507. }
  508. };
  509. fetchData = (fetchAllCounts = false) => {
  510. const {organization} = this.props;
  511. const query = this.getQuery();
  512. if (!this.state.realtimeActive) {
  513. if (!this.state.actionTaken && !this.state.undo) {
  514. GroupStore.loadInitialData([]);
  515. this.setState({
  516. issuesLoading: true,
  517. queryCount: 0,
  518. itemsRemoved: 0,
  519. error: null,
  520. });
  521. }
  522. } else {
  523. if (!isForReviewQuery(query)) {
  524. GroupStore.loadInitialData([]);
  525. this.setState({
  526. issuesLoading: true,
  527. queryCount: 0,
  528. itemsRemoved: 0,
  529. error: null,
  530. });
  531. }
  532. }
  533. const transaction = getCurrentSentryReactTransaction();
  534. transaction?.setTag('query.sort', this.getSort());
  535. this.setState({
  536. itemsRemoved: 0,
  537. error: null,
  538. });
  539. // Used for Issue Stream Performance project, enabled means we are doing saved search look up in the backend
  540. const savedSearchLookupEnabled = 0;
  541. const savedSearchLookupDisabled = 1;
  542. const requestParams: any = {
  543. ...this.getEndpointParams(),
  544. limit: MAX_ITEMS,
  545. shortIdLookup: 1,
  546. savedSearch: this.props.organization.features.includes('issue-stream-performance')
  547. ? this.props.savedSearchLoading
  548. ? savedSearchLookupEnabled
  549. : savedSearchLookupDisabled
  550. : savedSearchLookupDisabled,
  551. };
  552. if (
  553. this.props.organization.features.includes('issue-stream-performance') &&
  554. this.props.selectedSearchId
  555. ) {
  556. requestParams.searchId = this.props.selectedSearchId;
  557. }
  558. if (
  559. this.props.organization.features.includes('issue-stream-performance') &&
  560. this.props.savedSearchLoading &&
  561. !this.props.location.query.query
  562. ) {
  563. delete requestParams.query;
  564. }
  565. const currentQuery = this.props.location.query || {};
  566. if ('cursor' in currentQuery) {
  567. requestParams.cursor = currentQuery.cursor;
  568. }
  569. // If no stats period values are set, use default
  570. if (!requestParams.statsPeriod && !requestParams.start) {
  571. requestParams.statsPeriod = DEFAULT_STATS_PERIOD;
  572. }
  573. requestParams.expand = ['owners', 'inbox'];
  574. requestParams.collapse = ['stats', 'unhandled'];
  575. if (this._lastRequest) {
  576. this._lastRequest.cancel();
  577. }
  578. if (this._lastStatsRequest) {
  579. this._lastStatsRequest.cancel();
  580. }
  581. if (this._lastFetchCountsRequest) {
  582. this._lastFetchCountsRequest.cancel();
  583. }
  584. this._poller.disable();
  585. this._lastRequest = this.props.api.request(this.groupListEndpoint, {
  586. method: 'GET',
  587. data: qs.stringify(requestParams),
  588. success: (data, _, resp) => {
  589. if (!resp) {
  590. return;
  591. }
  592. // If this is a direct hit, we redirect to the intended result directly.
  593. if (resp.getResponseHeader('X-Sentry-Direct-Hit') === '1') {
  594. let redirect: string;
  595. if (data[0] && data[0].matchingEventId) {
  596. const {id, matchingEventId} = data[0];
  597. redirect = `/organizations/${organization.slug}/issues/${id}/events/${matchingEventId}/`;
  598. } else {
  599. const {id} = data[0];
  600. redirect = `/organizations/${organization.slug}/issues/${id}/`;
  601. }
  602. browserHistory.replace(
  603. normalizeUrl({
  604. pathname: redirect,
  605. query: {
  606. referrer: 'issue-list',
  607. ...extractSelectionParameters(this.props.location.query),
  608. },
  609. })
  610. );
  611. return;
  612. }
  613. if (this.state.undo) {
  614. GroupStore.loadInitialData(data);
  615. }
  616. GroupStore.add(data);
  617. this.fetchStats(data.map((group: BaseGroup) => group.id));
  618. const hits = resp.getResponseHeader('X-Hits');
  619. const queryCount =
  620. typeof hits !== 'undefined' && hits ? parseInt(hits, 10) || 0 : 0;
  621. const maxHits = resp.getResponseHeader('X-Max-Hits');
  622. const queryMaxCount =
  623. typeof maxHits !== 'undefined' && maxHits ? parseInt(maxHits, 10) || 0 : 0;
  624. const pageLinks = resp.getResponseHeader('Link');
  625. this.fetchCounts(queryCount, fetchAllCounts);
  626. this.setState({
  627. error: null,
  628. issuesLoading: false,
  629. queryCount,
  630. queryMaxCount,
  631. pageLinks: pageLinks !== null ? pageLinks : '',
  632. });
  633. if (data.length === 0) {
  634. trackAnalytics('issue_search.empty', {
  635. organization: this.props.organization,
  636. search_type: 'issues',
  637. search_source: 'main_search',
  638. query,
  639. });
  640. }
  641. },
  642. error: err => {
  643. trackAnalytics('issue_search.failed', {
  644. organization: this.props.organization,
  645. search_type: 'issues',
  646. search_source: 'main_search',
  647. error: parseApiError(err),
  648. });
  649. this.setState({
  650. error: parseApiError(err),
  651. issuesLoading: false,
  652. });
  653. },
  654. complete: () => {
  655. this._lastRequest = null;
  656. this.resumePolling();
  657. if (!this.state.realtimeActive) {
  658. this.setState({actionTaken: false, undo: false});
  659. }
  660. },
  661. });
  662. };
  663. resumePolling = () => {
  664. if (!this.state.pageLinks) {
  665. return;
  666. }
  667. // Only resume polling if we're on the first page of results
  668. const links = parseLinkHeader(this.state.pageLinks);
  669. if (links && !links.previous.results && this.state.realtimeActive) {
  670. this._poller.setEndpoint(links?.previous?.href);
  671. this._poller.enable();
  672. }
  673. };
  674. get groupListEndpoint(): string {
  675. const {organization} = this.props;
  676. return `/organizations/${organization.slug}/issues/`;
  677. }
  678. get groupCountsEndpoint(): string {
  679. const {organization} = this.props;
  680. return `/organizations/${organization.slug}/issues-count/`;
  681. }
  682. get groupStatsEndpoint(): string {
  683. const {organization} = this.props;
  684. return `/organizations/${organization.slug}/issues-stats/`;
  685. }
  686. onRealtimeChange = (realtime: boolean) => {
  687. Cookies.set('realtimeActive', realtime.toString());
  688. this.setState({realtimeActive: realtime});
  689. trackAnalytics('issues_stream.realtime_clicked', {
  690. organization: this.props.organization,
  691. enabled: realtime,
  692. });
  693. };
  694. onSelectStatsPeriod = (period: string) => {
  695. const {location} = this.props;
  696. if (period !== this.getGroupStatsPeriod()) {
  697. const cursor = location.query.cursor;
  698. const queryPageInt = parseInt(location.query.page, 10);
  699. const page = isNaN(queryPageInt) || !location.query.cursor ? 0 : queryPageInt;
  700. this.transitionTo({cursor, page, groupStatsPeriod: period});
  701. }
  702. };
  703. onRealtimePoll = (data: any, {queryCount}: {queryCount: number}) => {
  704. // Note: We do not update state with cursors from polling,
  705. // `CursorPoller` updates itself with new cursors
  706. GroupStore.addToFront(data);
  707. this.setState({queryCount});
  708. };
  709. listener = GroupStore.listen(() => this.onGroupChange(), undefined);
  710. onGroupChange() {
  711. const {actionTakenGroupData} = this.state;
  712. const query = this.getQuery();
  713. if (!this.state.realtimeActive && actionTakenGroupData.length > 0) {
  714. const filteredItems = GroupStore.getAllItems().filter(item => {
  715. return actionTakenGroupData.findIndex(data => data.id === item.id) !== -1;
  716. });
  717. const resolvedIds = filteredItems
  718. .filter(item => item.status === 'resolved')
  719. .map(id => id.id);
  720. const ignoredIds = filteredItems
  721. .filter(item => item.status === 'ignored')
  722. .map(i => i.id);
  723. // need to include resolve and ignored statuses because marking as resolved/ignored also
  724. // counts as reviewed
  725. const reviewedIds = filteredItems
  726. .filter(
  727. item => !item.inbox && item.status !== 'resolved' && item.status !== 'ignored'
  728. )
  729. .map(i => i.id);
  730. // Remove Ignored and Resolved group ids from the issue stream if on the All Unresolved,
  731. // For Review, or Ignored tab. Still include on the saved/custom search tab.
  732. if (
  733. resolvedIds.length > 0 &&
  734. (query.includes('is:unresolved') ||
  735. query.includes('is:ignored') ||
  736. isForReviewQuery(query))
  737. ) {
  738. this.onIssueAction(resolvedIds, 'Resolved');
  739. }
  740. if (
  741. ignoredIds.length > 0 &&
  742. (query.includes('is:unresolved') || isForReviewQuery(query))
  743. ) {
  744. this.onIssueAction(ignoredIds, 'Archived');
  745. }
  746. // Remove issues that are marked as Reviewed from the For Review tab, but still include the
  747. // issues if on the All Unresolved tab or saved/custom searches.
  748. if (
  749. reviewedIds.length > 0 &&
  750. (isForReviewQuery(query) || query.includes('is:ignored'))
  751. ) {
  752. this.onIssueAction(reviewedIds, 'Reviewed');
  753. }
  754. }
  755. const groupIds = GroupStore.getAllItems()
  756. .map(item => item.id)
  757. .slice(0, MAX_ISSUES_COUNT);
  758. if (!isEqual(groupIds, this.state.groupIds)) {
  759. this.setState({groupIds});
  760. }
  761. }
  762. trackTabViewed(groups: string[], data: Group[]) {
  763. const {organization, location} = this.props;
  764. const page = location.query.page;
  765. const endpointParams = this.getEndpointParams();
  766. const tabQueriesWithCounts = getTabsWithCounts(organization);
  767. const currentTabQuery = tabQueriesWithCounts.includes(endpointParams.query as Query)
  768. ? endpointParams.query
  769. : null;
  770. const tab = getTabs(organization).find(
  771. ([tabQuery]) => currentTabQuery === tabQuery
  772. )?.[1];
  773. const numPerfIssues = groups.filter(
  774. group => GroupStore.get(group)?.issueCategory === IssueCategory.PERFORMANCE
  775. ).length;
  776. // First and last seen are only available after the group has fetched stats
  777. // Number of issues shown whose first seen is more than 30 days ago
  778. const numOldIssues = data.filter((group: BaseGroup) =>
  779. moment(new Date(group.firstSeen)).isBefore(moment().subtract(30, 'd'))
  780. ).length;
  781. // number of issues shown whose first seen is less than 7 days
  782. const numNewIssues = data.filter((group: BaseGroup) =>
  783. moment(new Date(group.firstSeen)).isAfter(moment().subtract(7, 'd'))
  784. ).length;
  785. trackAnalytics('issues_tab.viewed', {
  786. organization,
  787. tab: tab?.analyticsName,
  788. page: page ? parseInt(page, 10) : 0,
  789. query: this.getQuery(),
  790. num_perf_issues: numPerfIssues,
  791. num_old_issues: numOldIssues,
  792. num_new_issues: numNewIssues,
  793. num_issues: data.length,
  794. sort: this.getSort(),
  795. });
  796. }
  797. onSearch = (query: string) => {
  798. if (query === this.state.query) {
  799. // if query is the same, just re-fetch data
  800. this.fetchData();
  801. } else {
  802. // Clear the saved search as the user wants something else.
  803. this.transitionTo({query}, null);
  804. }
  805. };
  806. onSortChange = (sort: string) => {
  807. trackAnalytics('issues_stream.sort_changed', {
  808. organization: this.props.organization,
  809. sort,
  810. });
  811. this.transitionTo({sort});
  812. };
  813. onCursorChange: CursorHandler = (nextCursor, _path, _query, delta) => {
  814. const queryPageInt = parseInt(this.props.location.query.page, 10);
  815. let nextPage: number | undefined = isNaN(queryPageInt) ? delta : queryPageInt + delta;
  816. let cursor: undefined | string = nextCursor;
  817. // unset cursor and page when we navigate back to the first page
  818. // also reset cursor if somehow the previous button is enabled on
  819. // first page and user attempts to go backwards
  820. if (nextPage <= 0) {
  821. cursor = undefined;
  822. nextPage = undefined;
  823. }
  824. this.transitionTo({cursor, page: nextPage});
  825. };
  826. paginationAnalyticsEvent = (direction: string) => {
  827. trackAnalytics('issues_stream.paginate', {
  828. organization: this.props.organization,
  829. direction,
  830. });
  831. };
  832. /**
  833. * Returns true if all results in the current query are visible/on this page
  834. */
  835. allResultsVisible(): boolean {
  836. if (!this.state.pageLinks) {
  837. return false;
  838. }
  839. const links = parseLinkHeader(this.state.pageLinks);
  840. return links && !links.previous.results && !links.next.results;
  841. }
  842. transitionTo = (
  843. newParams: Partial<EndpointParams> = {},
  844. savedSearch: (SavedSearch & {projectId?: number}) | null = this.props.savedSearch
  845. ) => {
  846. const query = {
  847. ...omit(this.props.location.query, ['page', 'cursor']),
  848. referrer: 'issue-list',
  849. ...this.getEndpointParams(),
  850. ...newParams,
  851. };
  852. const {organization} = this.props;
  853. let path: string;
  854. if (savedSearch && savedSearch.id) {
  855. path = `/organizations/${organization.slug}/issues/searches/${savedSearch.id}/`;
  856. // Remove the query as saved searches bring their own query string.
  857. delete query.query;
  858. // If we aren't going to another page in the same search
  859. // drop the query and replace the current project, with the saved search search project
  860. // if available.
  861. if (!query.cursor && savedSearch.projectId) {
  862. query.project = [savedSearch.projectId];
  863. }
  864. if (!query.cursor && !newParams.sort && savedSearch.sort) {
  865. query.sort = savedSearch.sort;
  866. }
  867. } else {
  868. path = `/organizations/${organization.slug}/issues/`;
  869. }
  870. if (
  871. query.sort === IssueSortOptions.INBOX &&
  872. !FOR_REVIEW_QUERIES.includes(query.query || '')
  873. ) {
  874. delete query.sort;
  875. }
  876. if (
  877. path !== this.props.location.pathname ||
  878. !isEqual(query, this.props.location.query)
  879. ) {
  880. browserHistory.push({
  881. pathname: normalizeUrl(path),
  882. query,
  883. });
  884. this.setState({issuesLoading: true});
  885. }
  886. };
  887. displayReprocessingTab() {
  888. const {organization} = this.props;
  889. const {queryCounts} = this.state;
  890. return (
  891. organization.features.includes('reprocessing-v2') &&
  892. !!queryCounts?.[Query.REPROCESSING]?.count
  893. );
  894. }
  895. displayReprocessingLayout(showReprocessingTab: boolean, query: string) {
  896. return showReprocessingTab && query === Query.REPROCESSING;
  897. }
  898. renderLoading(): React.ReactNode {
  899. return (
  900. <Layout.Page withPadding>
  901. <LoadingIndicator />
  902. </Layout.Page>
  903. );
  904. }
  905. onSavedSearchSelect = (savedSearch: SavedSearch) => {
  906. trackAnalytics('organization_saved_search.selected', {
  907. organization: this.props.organization,
  908. search_type: 'issues',
  909. id: savedSearch.id ? parseInt(savedSearch.id, 10) : -1,
  910. is_global: savedSearch.isGlobal,
  911. query: savedSearch.query,
  912. visibility: savedSearch.visibility,
  913. });
  914. this.setState({issuesLoading: true}, () => this.transitionTo(undefined, savedSearch));
  915. };
  916. onDelete = () => {
  917. this.setState({actionTaken: true});
  918. this.fetchData(true);
  919. };
  920. onUndo = () => {
  921. const {organization, selection} = this.props;
  922. const {actionTakenGroupData} = this.state;
  923. const query = this.getQuery();
  924. const groupIds = actionTakenGroupData.map(data => data.id);
  925. const projectIds = selection?.projects?.map(p => p.toString());
  926. const endpoint = `/organizations/${organization.slug}/issues/`;
  927. if (this._lastRequest) {
  928. this._lastRequest.cancel();
  929. }
  930. if (this._lastStatsRequest) {
  931. this._lastStatsRequest.cancel();
  932. }
  933. if (this._lastFetchCountsRequest) {
  934. this._lastFetchCountsRequest.cancel();
  935. }
  936. this.props.api.request(endpoint, {
  937. method: 'PUT',
  938. data: {
  939. status: 'unresolved',
  940. },
  941. query: {
  942. project: projectIds,
  943. id: groupIds,
  944. },
  945. success: response => {
  946. if (!response) {
  947. return;
  948. }
  949. // If on the Ignore or For Review tab, adding back to the GroupStore will make the issue show up
  950. // on this page for a second and then be removed (will show up on All Unresolved). This is to
  951. // stop this from happening and avoid confusion.
  952. if (!query.includes('is:ignored') && !isForReviewQuery(query)) {
  953. GroupStore.add(actionTakenGroupData);
  954. }
  955. this.setState({undo: true});
  956. },
  957. error: err => {
  958. this.setState({
  959. error: parseApiError(err),
  960. issuesLoading: false,
  961. });
  962. },
  963. complete: () => {
  964. this.setState({actionTakenGroupData: []});
  965. this.fetchData();
  966. },
  967. });
  968. };
  969. onMarkReviewed = (itemIds: string[]) => {
  970. const query = this.getQuery();
  971. if (!isForReviewQuery(query)) {
  972. if (itemIds.length > 1) {
  973. addMessage(
  974. tn('Reviewed %s Issue', 'Reviewed %s Issues', itemIds.length),
  975. 'success',
  976. {duration: 4000}
  977. );
  978. } else {
  979. const shortId = itemIds.map(item => GroupStore.get(item)?.shortId).toString();
  980. addMessage(t('Reviewed %s', shortId), 'success', {duration: 4000});
  981. }
  982. return;
  983. }
  984. const {queryCounts, itemsRemoved} = this.state;
  985. const currentQueryCount = queryCounts[query as Query];
  986. if (itemIds.length && currentQueryCount) {
  987. const inInboxCount = itemIds.filter(id => GroupStore.get(id)?.inbox).length;
  988. currentQueryCount.count -= inInboxCount;
  989. this.setState({
  990. queryCounts: {
  991. ...queryCounts,
  992. [query as Query]: currentQueryCount,
  993. },
  994. itemsRemoved: itemsRemoved + inInboxCount,
  995. });
  996. }
  997. };
  998. onActionTaken = (itemIds: string[]) => {
  999. const actionTakenGroupData = itemIds
  1000. .map(id => GroupStore.get(id) as Group | undefined)
  1001. .filter(defined);
  1002. this.setState({
  1003. actionTakenGroupData,
  1004. });
  1005. };
  1006. onIssueAction = (
  1007. itemIds: string[],
  1008. actionType: 'Reviewed' | 'Resolved' | 'Ignored' | 'Archived'
  1009. ) => {
  1010. if (itemIds.length > 1) {
  1011. addMessage(`${actionType} ${itemIds.length} ${t('Issues')}`, 'success', {
  1012. duration: 4000,
  1013. ...(actionType !== 'Reviewed' && {undo: this.onUndo}),
  1014. });
  1015. } else {
  1016. const shortId = itemIds.map(item => GroupStore.get(item)?.shortId).toString();
  1017. addMessage(`${actionType} ${shortId}`, 'success', {
  1018. duration: 4000,
  1019. ...(actionType !== 'Reviewed' && {undo: this.onUndo}),
  1020. });
  1021. }
  1022. const links = parseLinkHeader(this.state.pageLinks);
  1023. GroupStore.remove(itemIds);
  1024. const queryCount = this.state.queryCount - itemIds.length;
  1025. this.setState({
  1026. actionTaken: true,
  1027. queryCount,
  1028. });
  1029. if (GroupStore.getAllItemIds().length === 0) {
  1030. // If we run out of issues on the last page, navigate back a page to
  1031. // avoid showing an empty state - if not on the last page, just show a spinner
  1032. const shouldGoBackAPage = links?.previous?.results && !links?.next?.results;
  1033. this.transitionTo({cursor: shouldGoBackAPage ? links.previous.cursor : undefined});
  1034. this.fetchCounts(queryCount, true);
  1035. } else {
  1036. this.fetchData(true);
  1037. }
  1038. };
  1039. tagValueLoader = (key: string, search: string) => {
  1040. const {organization} = this.props;
  1041. const projectIds = this.getSelectedProjectIds();
  1042. const endpointParams = this.getEndpointParams();
  1043. return fetchTagValues({
  1044. api: this.props.api,
  1045. orgSlug: organization.slug,
  1046. tagKey: key,
  1047. search,
  1048. projectIds,
  1049. endpointParams: endpointParams as any,
  1050. });
  1051. };
  1052. getPageCounts = () => {
  1053. const {location} = this.props;
  1054. const {pageLinks, queryCount, groupIds} = this.state;
  1055. const links = parseLinkHeader(pageLinks);
  1056. const queryPageInt = parseInt(location.query.page, 10);
  1057. // Cursor must be present for the page number to be used
  1058. const page = isNaN(queryPageInt) || !location.query.cursor ? 0 : queryPageInt;
  1059. let numPreviousIssues = Math.min(page * MAX_ITEMS, queryCount);
  1060. // Because the query param `page` is not tied to the request, we need to
  1061. // validate that it's correct at the first and last page
  1062. if (!links?.next?.results || this.allResultsVisible()) {
  1063. // On last available page
  1064. numPreviousIssues = Math.max(queryCount - groupIds.length, 0);
  1065. } else if (!links?.previous?.results) {
  1066. // On first available page
  1067. numPreviousIssues = 0;
  1068. }
  1069. return {
  1070. numPreviousIssues,
  1071. numIssuesOnPage: groupIds.length,
  1072. };
  1073. };
  1074. render() {
  1075. if (
  1076. this.props.savedSearchLoading &&
  1077. !this.props.organization.features.includes('issue-stream-performance')
  1078. ) {
  1079. return this.renderLoading();
  1080. }
  1081. const {
  1082. pageLinks,
  1083. queryCount,
  1084. queryCounts,
  1085. realtimeActive,
  1086. groupIds,
  1087. queryMaxCount,
  1088. itemsRemoved,
  1089. issuesLoading,
  1090. error,
  1091. } = this.state;
  1092. const {organization, selection, router} = this.props;
  1093. const query = this.getQuery();
  1094. const modifiedQueryCount = Math.max(queryCount - itemsRemoved, 0);
  1095. const projectIds = selection?.projects?.map(p => p.toString());
  1096. const showReprocessingTab = this.displayReprocessingTab();
  1097. const displayReprocessingActions = this.displayReprocessingLayout(
  1098. showReprocessingTab,
  1099. query
  1100. );
  1101. const {numPreviousIssues, numIssuesOnPage} = this.getPageCounts();
  1102. return (
  1103. <Layout.Page>
  1104. <IssueListHeader
  1105. organization={organization}
  1106. query={query}
  1107. sort={this.getSort()}
  1108. queryCount={queryCount}
  1109. queryCounts={queryCounts}
  1110. realtimeActive={realtimeActive}
  1111. onRealtimeChange={this.onRealtimeChange}
  1112. router={router}
  1113. displayReprocessingTab={showReprocessingTab}
  1114. selectedProjectIds={selection.projects}
  1115. />
  1116. <StyledBody>
  1117. <StyledMain>
  1118. <IssueListFilters query={query} onSearch={this.onSearch} />
  1119. <Panel>
  1120. <IssueListActions
  1121. selection={selection}
  1122. query={query}
  1123. queryCount={modifiedQueryCount}
  1124. onSelectStatsPeriod={this.onSelectStatsPeriod}
  1125. onMarkReviewed={this.onMarkReviewed}
  1126. onActionTaken={this.onActionTaken}
  1127. onDelete={this.onDelete}
  1128. statsPeriod={this.getGroupStatsPeriod()}
  1129. groupIds={groupIds}
  1130. allResultsVisible={this.allResultsVisible()}
  1131. displayReprocessingActions={displayReprocessingActions}
  1132. sort={this.getSort()}
  1133. onSortChange={this.onSortChange}
  1134. />
  1135. <PanelBody>
  1136. <ProcessingIssueList
  1137. organization={organization}
  1138. projectIds={projectIds}
  1139. showProject
  1140. />
  1141. <VisuallyCompleteWithData
  1142. hasData={this.state.groupIds.length > 0}
  1143. id="IssueList-Body"
  1144. isLoading={this.state.issuesLoading}
  1145. >
  1146. <GroupListBody
  1147. memberList={this.state.memberList}
  1148. groupStatsPeriod={this.getGroupStatsPeriod()}
  1149. groupIds={groupIds}
  1150. displayReprocessingLayout={displayReprocessingActions}
  1151. query={query}
  1152. sort={this.getSort()}
  1153. selectedProjectIds={selection.projects}
  1154. loading={issuesLoading}
  1155. error={error}
  1156. refetchGroups={this.fetchData}
  1157. />
  1158. </VisuallyCompleteWithData>
  1159. </PanelBody>
  1160. </Panel>
  1161. <StyledPagination
  1162. caption={
  1163. !issuesLoading && modifiedQueryCount > 0
  1164. ? tct('[start]-[end] of [total]', {
  1165. start: numPreviousIssues + 1,
  1166. end: numPreviousIssues + numIssuesOnPage,
  1167. total: (
  1168. <StyledQueryCount
  1169. hideParens
  1170. hideIfEmpty={false}
  1171. count={modifiedQueryCount}
  1172. max={queryMaxCount || 100}
  1173. />
  1174. ),
  1175. })
  1176. : null
  1177. }
  1178. pageLinks={pageLinks}
  1179. onCursor={this.onCursorChange}
  1180. paginationAnalyticsEvent={this.paginationAnalyticsEvent}
  1181. />
  1182. </StyledMain>
  1183. <SavedIssueSearches
  1184. {...{organization, query}}
  1185. onSavedSearchSelect={this.onSavedSearchSelect}
  1186. sort={this.getSort()}
  1187. />
  1188. </StyledBody>
  1189. </Layout.Page>
  1190. );
  1191. }
  1192. }
  1193. export default withRouteAnalytics(
  1194. withApi(
  1195. withPageFilters(
  1196. withSavedSearches(withOrganization(withIssueTags(withProfiler(IssueListOverview))))
  1197. )
  1198. )
  1199. );
  1200. export {IssueListOverview};
  1201. const StyledBody = styled('div')`
  1202. background-color: ${p => p.theme.background};
  1203. flex: 1;
  1204. display: grid;
  1205. gap: 0;
  1206. padding: 0;
  1207. grid-template-rows: 1fr;
  1208. grid-template-columns: minmax(0, 1fr) auto;
  1209. grid-template-areas: 'content saved-searches';
  1210. `;
  1211. const StyledMain = styled('section')`
  1212. grid-area: content;
  1213. padding: ${space(2)};
  1214. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  1215. padding: ${space(3)} ${space(4)};
  1216. }
  1217. `;
  1218. const StyledPagination = styled(Pagination)`
  1219. margin-top: 0;
  1220. `;
  1221. const StyledQueryCount = styled(QueryCount)`
  1222. margin-left: 0;
  1223. `;