queuesLandingPage.tsx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. <Onboarding organization={organization} project={onboardingProject} />
  67. )}
  68. {!onboardingProject && (
  69. <Fragment>
  70. <ModuleLayout.Half>
  71. <LatencyChart />
  72. </ModuleLayout.Half>
  73. <ModuleLayout.Half>
  74. <ThroughputChart />
  75. </ModuleLayout.Half>
  76. <ModuleLayout.Full>
  77. <Flex>
  78. {/* TODO: Make search bar work */}
  79. <SmartSearchBar />
  80. <QueuesTable />
  81. </Flex>
  82. </ModuleLayout.Full>
  83. </Fragment>
  84. )}
  85. </ModuleLayout.Layout>
  86. </Layout.Main>
  87. </Layout.Body>
  88. </Fragment>
  89. );
  90. }
  91. function LandingPageWithProviders() {
  92. return (
  93. <ModulePageProviders
  94. title={[t('Performance'), MODULE_TITLE].join(' — ')}
  95. baseURL="/performance/queues"
  96. features="performance-queues-view"
  97. >
  98. <QueuesLandingPage />
  99. </ModulePageProviders>
  100. );
  101. }
  102. export default LandingPageWithProviders;
  103. const Flex = styled('div')`
  104. display: flex;
  105. flex-direction: column;
  106. gap: ${space(2)};
  107. `;