overview.tsx 41 KB

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