overview.tsx 42 KB

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