feedbackListPage.tsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import {browserHistory, RouteComponentProps} from 'react-router';
  2. import styled from '@emotion/styled';
  3. import DatePageFilter from 'sentry/components/datePageFilter';
  4. import EnvironmentPageFilter from 'sentry/components/environmentPageFilter';
  5. import FeedbackTable from 'sentry/components/feedback/table/feedbackTable';
  6. import useFetchFeedbackList from 'sentry/components/feedback/useFetchFeedbackList';
  7. import * as Layout from 'sentry/components/layouts/thirds';
  8. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  9. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  10. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  11. import Pagination from 'sentry/components/pagination';
  12. import ProjectPageFilter from 'sentry/components/projectPageFilter';
  13. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  14. import {t} from 'sentry/locale';
  15. import {space} from 'sentry/styles/space';
  16. import type {FeedbackListQueryParams} from 'sentry/utils/feedback/types';
  17. import useOrganization from 'sentry/utils/useOrganization';
  18. interface Props extends RouteComponentProps<{}, {}, FeedbackListQueryParams> {}
  19. export default function FeedbackListPage({location}: Props) {
  20. const organization = useOrganization();
  21. const {isLoading, isError, data, pageLinks} = useFetchFeedbackList({}, {});
  22. return (
  23. <SentryDocumentTitle title={`Feedback v2 — ${organization.slug}`}>
  24. <Layout.Header>
  25. <Layout.HeaderContent>
  26. <Layout.Title>
  27. {t('Feedback v2')}
  28. <PageHeadingQuestionTooltip
  29. title={t(
  30. 'Feedback submitted by users who experienced an error while using your application, including their name, email address, and any additional comments.'
  31. )}
  32. docsUrl="https://docs.sentry.io/product/user-feedback/"
  33. />
  34. </Layout.Title>
  35. </Layout.HeaderContent>
  36. </Layout.Header>
  37. <PageFiltersContainer>
  38. <Layout.Body>
  39. <Layout.Main fullWidth>
  40. <LayoutGap>
  41. <PageFilterBar condensed>
  42. <ProjectPageFilter resetParamsOnChange={['cursor']} />
  43. <EnvironmentPageFilter resetParamsOnChange={['cursor']} />
  44. <DatePageFilter alignDropdown="left" resetParamsOnChange={['cursor']} />
  45. </PageFilterBar>
  46. <FeedbackTable
  47. data={data ?? []}
  48. isError={isError}
  49. isLoading={isLoading}
  50. location={location}
  51. />
  52. </LayoutGap>
  53. <PaginationNoMargin
  54. pageLinks={pageLinks}
  55. onCursor={(cursor, path, searchQuery) => {
  56. browserHistory.push({
  57. pathname: path,
  58. query: {...searchQuery, cursor},
  59. });
  60. }}
  61. />
  62. </Layout.Main>
  63. </Layout.Body>
  64. </PageFiltersContainer>
  65. </SentryDocumentTitle>
  66. );
  67. }
  68. const LayoutGap = styled('div')`
  69. display: grid;
  70. gap: ${space(2)};
  71. `;
  72. const PaginationNoMargin = styled(Pagination)`
  73. margin: 0;
  74. `;