destinationSummaryPage.tsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 {t} from 'sentry/locale';
  13. import {decodeScalar} from 'sentry/utils/queryString';
  14. import {useLocation} from 'sentry/utils/useLocation';
  15. import useOrganization from 'sentry/utils/useOrganization';
  16. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  17. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  18. import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
  19. import {
  20. DESTINATION_TITLE,
  21. MODULE_TITLE,
  22. RELEASE_LEVEL,
  23. } from 'sentry/views/performance/queues/settings';
  24. function DestinationSummaryPage() {
  25. const organization = useOrganization();
  26. const {query} = useLocation();
  27. const destination = decodeScalar(query.destination);
  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. label: DESTINATION_TITLE,
  44. },
  45. ]}
  46. />
  47. <Layout.Title>
  48. {destination}
  49. <FeatureBadge type={RELEASE_LEVEL} />
  50. </Layout.Title>
  51. </Layout.HeaderContent>
  52. <Layout.HeaderActions>
  53. <ButtonBar gap={1}>
  54. <FeedbackWidgetButton />
  55. </ButtonBar>
  56. </Layout.HeaderActions>
  57. </Layout.Header>
  58. <Layout.Body>
  59. <Layout.Main fullWidth>
  60. <ModuleLayout.Layout>
  61. <ModuleLayout.Full>
  62. <HeaderContainer>
  63. <PageFilterBar condensed>
  64. <ProjectPageFilter />
  65. <EnvironmentPageFilter />
  66. <DatePageFilter />
  67. </PageFilterBar>
  68. </HeaderContainer>
  69. </ModuleLayout.Full>
  70. </ModuleLayout.Layout>
  71. </Layout.Main>
  72. </Layout.Body>
  73. </Fragment>
  74. );
  75. }
  76. function DestinationSummaryPageWithProviders() {
  77. return (
  78. <ModulePageProviders
  79. title={[t('Performance'), MODULE_TITLE].join(' — ')}
  80. baseURL="/performance/queues"
  81. features="performance-queues-view"
  82. >
  83. <DestinationSummaryPage />
  84. </ModulePageProviders>
  85. );
  86. }
  87. export default DestinationSummaryPageWithProviders;
  88. const HeaderContainer = styled('div')`
  89. display: flex;
  90. justify-content: space-between;
  91. `;