overview.tsx 42 KB

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