queuesLandingPage.tsx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import FeatureBadge from 'sentry/components/badge/featureBadge';
  4. import {Breadcrumbs} from 'sentry/components/breadcrumbs';
  5. import ButtonBar from 'sentry/components/buttonBar';
  6. import FeedbackWidgetButton from 'sentry/components/feedback/widget/feedbackWidgetButton';
  7. import * as Layout from 'sentry/components/layouts/thirds';
  8. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  9. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  10. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  11. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  12. import SmartSearchBar from 'sentry/components/smartSearchBar';
  13. import {t} from 'sentry/locale';
  14. import {space} from 'sentry/styles/space';
  15. import useOrganization from 'sentry/utils/useOrganization';
  16. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  17. import {useOnboardingProject} from 'sentry/views/performance/browser/webVitals/utils/useOnboardingProject';
  18. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  19. import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
  20. import Onboarding from 'sentry/views/performance/onboarding';
  21. import {LatencyChart} from 'sentry/views/performance/queues/charts/latencyChart';
  22. import {ThroughputChart} from 'sentry/views/performance/queues/charts/throughputChart';
  23. import {QueuesTable} from 'sentry/views/performance/queues/queuesTable';
  24. import {MODULE_TITLE, RELEASE_LEVEL} from 'sentry/views/performance/queues/settings';
  25. function QueuesLandingPage() {
  26. const organization = useOrganization();
  27. const onboardingProject = useOnboardingProject();
  28. return (
  29. <Fragment>
  30. <Layout.Header>
  31. <Layout.HeaderContent>
  32. <Breadcrumbs
  33. crumbs={[
  34. {
  35. label: t('Performance'),
  36. to: normalizeUrl(`/organizations/${organization.slug}/performance/`),
  37. preservePageFilters: true,
  38. },
  39. {
  40. label: MODULE_TITLE,
  41. },
  42. ]}
  43. />
  44. <Layout.Title>
  45. {MODULE_TITLE}
  46. <FeatureBadge type={RELEASE_LEVEL} />
  47. </Layout.Title>
  48. </Layout.HeaderContent>
  49. <Layout.HeaderActions>
  50. <ButtonBar gap={1}>
  51. <FeedbackWidgetButton />
  52. </ButtonBar>
  53. </Layout.HeaderActions>
  54. </Layout.Header>
  55. <Layout.Body>
  56. <Layout.Main fullWidth>
  57. <ModuleLayout.Layout>
  58. <ModuleLayout.Full>
  59. <PageFilterBar condensed>
  60. <ProjectPageFilter />
  61. <EnvironmentPageFilter />
  62. <DatePageFilter />
  63. </PageFilterBar>
  64. </ModuleLayout.Full>
  65. {onboardingProject && (
  66. <ModuleLayout.Full>
  67. <Onboarding organization={organization} project={onboardingProject} />
  68. </ModuleLayout.Full>
  69. )}
  70. {!onboardingProject && (
  71. <Fragment>
  72. <ModuleLayout.Half>
  73. <LatencyChart />
  74. </ModuleLayout.Half>
  75. <ModuleLayout.Half>
  76. <ThroughputChart />
  77. </ModuleLayout.Half>
  78. <ModuleLayout.Full>
  79. <Flex>
  80. {/* TODO: Make search bar work */}
  81. <SmartSearchBar />
  82. <QueuesTable />
  83. </Flex>
  84. </ModuleLayout.Full>
  85. </Fragment>
  86. )}
  87. </ModuleLayout.Layout>
  88. </Layout.Main>
  89. </Layout.Body>
  90. </Fragment>
  91. );
  92. }
  93. function LandingPageWithProviders() {
  94. return (
  95. <ModulePageProviders
  96. title={[t('Performance'), MODULE_TITLE].join(' — ')}
  97. baseURL="/performance/queues"
  98. features="performance-queues-view"
  99. >
  100. <QueuesLandingPage />
  101. </ModulePageProviders>
  102. );
  103. }
  104. export default LandingPageWithProviders;
  105. const Flex = styled('div')`
  106. display: flex;
  107. flex-direction: column;
  108. gap: ${space(2)};
  109. `;