overview.tsx 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383
  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. selectedProjectIds={selection.projects}
  1153. loading={issuesLoading}
  1154. error={error}
  1155. refetchGroups={this.fetchData}
  1156. />
  1157. </VisuallyCompleteWithData>
  1158. </PanelBody>
  1159. </Panel>
  1160. <StyledPagination
  1161. caption={
  1162. !issuesLoading && modifiedQueryCount > 0
  1163. ? tct('[start]-[end] of [total]', {
  1164. start: numPreviousIssues + 1,
  1165. end: numPreviousIssues + numIssuesOnPage,
  1166. total: (
  1167. <StyledQueryCount
  1168. hideParens
  1169. hideIfEmpty={false}
  1170. count={modifiedQueryCount}
  1171. max={queryMaxCount || 100}
  1172. />
  1173. ),
  1174. })
  1175. : null
  1176. }
  1177. pageLinks={pageLinks}
  1178. onCursor={this.onCursorChange}
  1179. paginationAnalyticsEvent={this.paginationAnalyticsEvent}
  1180. />
  1181. </StyledMain>
  1182. <SavedIssueSearches
  1183. {...{organization, query}}
  1184. onSavedSearchSelect={this.onSavedSearchSelect}
  1185. sort={this.getSort()}
  1186. />
  1187. </StyledBody>
  1188. </Layout.Page>
  1189. );
  1190. }
  1191. }
  1192. export default withRouteAnalytics(
  1193. withApi(
  1194. withPageFilters(
  1195. withSavedSearches(withOrganization(withIssueTags(withProfiler(IssueListOverview))))
  1196. )
  1197. )
  1198. );
  1199. export {IssueListOverview};
  1200. const StyledBody = styled('div')`
  1201. background-color: ${p => p.theme.background};
  1202. flex: 1;
  1203. display: grid;
  1204. gap: 0;
  1205. padding: 0;
  1206. grid-template-rows: 1fr;
  1207. grid-template-columns: minmax(0, 1fr) auto;
  1208. grid-template-areas: 'content saved-searches';
  1209. `;
  1210. const StyledMain = styled('section')`
  1211. grid-area: content;
  1212. padding: ${space(2)};
  1213. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  1214. padding: ${space(3)} ${space(4)};
  1215. }
  1216. `;
  1217. const StyledPagination = styled(Pagination)`
  1218. margin-top: 0;
  1219. `;
  1220. const StyledQueryCount = styled(QueryCount)`
  1221. margin-left: 0;
  1222. `;