ddm.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import {useEffect} from 'react';
  2. import styled from '@emotion/styled';
  3. import ButtonBar from 'sentry/components/buttonBar';
  4. import FeatureBadge from 'sentry/components/featureBadge';
  5. import FeedbackWidget from 'sentry/components/feedback/widget/feedbackWidget';
  6. import {GithubFeedbackButton} from 'sentry/components/githubFeedbackButton';
  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 PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  12. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  13. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  14. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  15. import {t} from 'sentry/locale';
  16. import {space} from 'sentry/styles/space';
  17. import {trackAnalytics} from 'sentry/utils/analytics';
  18. import useOrganization from 'sentry/utils/useOrganization';
  19. import {MetricScratchpad} from 'sentry/views/ddm/scratchpad';
  20. import {ScratchpadSelector} from 'sentry/views/ddm/scratchpadSelector';
  21. import {TraceTable} from 'sentry/views/ddm/traceTable';
  22. function DDM() {
  23. const organization = useOrganization();
  24. useEffect(() => {
  25. trackAnalytics('ddm.page-view', {
  26. organization,
  27. });
  28. // eslint-disable-next-line react-hooks/exhaustive-deps
  29. }, []);
  30. return (
  31. <SentryDocumentTitle title={t('DDM')} orgSlug={organization.slug}>
  32. <PageFiltersContainer disablePersistence>
  33. <Layout.Page>
  34. <Layout.Header>
  35. <Layout.HeaderContent>
  36. <Layout.Title>
  37. {t('DDM')}
  38. <PageHeadingQuestionTooltip
  39. docsUrl="https://develop.sentry.dev/delightful-developer-metrics/"
  40. title={t('Delightful Developer Metrics.')}
  41. />
  42. <FeatureBadge type="alpha" />
  43. </Layout.Title>
  44. </Layout.HeaderContent>
  45. <Layout.HeaderActions>
  46. <ButtonBar gap={1}>
  47. <GithubFeedbackButton
  48. href="https://github.com/getsentry/sentry/discussions/58584"
  49. label={t('Discussion')}
  50. title={null}
  51. />
  52. </ButtonBar>
  53. </Layout.HeaderActions>
  54. </Layout.Header>
  55. <Layout.Body>
  56. <FeedbackWidget />
  57. <Layout.Main fullWidth>
  58. <PaddedContainer>
  59. <PageFilterBar condensed>
  60. <ProjectPageFilter />
  61. <EnvironmentPageFilter />
  62. <DatePageFilter />
  63. </PageFilterBar>
  64. <ScratchpadSelector />
  65. </PaddedContainer>
  66. <MetricScratchpad />
  67. <TraceTable />
  68. </Layout.Main>
  69. </Layout.Body>
  70. </Layout.Page>
  71. </PageFiltersContainer>
  72. </SentryDocumentTitle>
  73. );
  74. }
  75. export const PaddedContainer = styled('div')`
  76. margin-bottom: ${space(2)};
  77. display: grid;
  78. grid-template: 1fr / 1fr max-content;
  79. gap: ${space(1)};
  80. @media (max-width: ${props => props.theme.breakpoints.small}) {
  81. grid-template: 1fr 1fr / 1fr;
  82. }
  83. `;
  84. export default DDM;