destinationSummaryPage.tsx 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 FloatingFeedbackWidget from 'sentry/components/feedback/widget/floatingFeedbackWidget';
  6. import * as Layout from 'sentry/components/layouts/thirds';
  7. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  8. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  9. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  10. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  11. import {t} from 'sentry/locale';
  12. import {decodeScalar} from 'sentry/utils/queryString';
  13. import {useLocation} from 'sentry/utils/useLocation';
  14. import useOrganization from 'sentry/utils/useOrganization';
  15. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  16. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  17. import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
  18. import {
  19. DESTINATION_TITLE,
  20. MODULE_TITLE,
  21. RELEASE_LEVEL,
  22. } from 'sentry/views/performance/queues/settings';
  23. function DestinationSummaryPage() {
  24. const organization = useOrganization();
  25. const {query} = useLocation();
  26. const destination = decodeScalar(query.destination);
  27. return (
  28. <Fragment>
  29. <Layout.Header>
  30. <Layout.HeaderContent>
  31. <Breadcrumbs
  32. crumbs={[
  33. {
  34. label: t('Performance'),
  35. to: normalizeUrl(`/organizations/${organization.slug}/performance/`),
  36. preservePageFilters: true,
  37. },
  38. {
  39. label: MODULE_TITLE,
  40. },
  41. {
  42. label: DESTINATION_TITLE,
  43. },
  44. ]}
  45. />
  46. <Layout.Title>
  47. {destination}
  48. <FeatureBadge type={RELEASE_LEVEL} />
  49. </Layout.Title>
  50. </Layout.HeaderContent>
  51. </Layout.Header>
  52. <Layout.Body>
  53. <Layout.Main fullWidth>
  54. <FloatingFeedbackWidget />
  55. <ModuleLayout.Layout>
  56. <ModuleLayout.Full>
  57. <HeaderContainer>
  58. <PageFilterBar condensed>
  59. <ProjectPageFilter />
  60. <EnvironmentPageFilter />
  61. <DatePageFilter />
  62. </PageFilterBar>
  63. </HeaderContainer>
  64. </ModuleLayout.Full>
  65. </ModuleLayout.Layout>
  66. </Layout.Main>
  67. </Layout.Body>
  68. </Fragment>
  69. );
  70. }
  71. function DestinationSummaryPageWithProviders() {
  72. return (
  73. <ModulePageProviders
  74. title={[t('Performance'), MODULE_TITLE].join(' — ')}
  75. baseURL="/performance/queues"
  76. features="performance-queues-view"
  77. >
  78. <DestinationSummaryPage />
  79. </ModulePageProviders>
  80. );
  81. }
  82. export default DestinationSummaryPageWithProviders;
  83. const HeaderContainer = styled('div')`
  84. display: flex;
  85. justify-content: space-between;
  86. `;