ddm.tsx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import styled from '@emotion/styled';
  2. import ButtonBar from 'sentry/components/buttonBar';
  3. import FeatureBadge from 'sentry/components/featureBadge';
  4. import {FeatureFeedback} from 'sentry/components/featureFeedback';
  5. import * as Layout from 'sentry/components/layouts/thirds';
  6. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  7. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  8. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  9. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  10. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  11. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  12. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  13. import {t} from 'sentry/locale';
  14. import {space} from 'sentry/styles/space';
  15. import useOrganization from 'sentry/utils/useOrganization';
  16. import {MetricScratchpad} from 'sentry/views/ddm/scratchpad';
  17. import {ScratchpadSelector} from 'sentry/views/ddm/scratchpadSelector';
  18. function DDM() {
  19. const organization = useOrganization();
  20. return (
  21. <SentryDocumentTitle title={t('DDM')} orgSlug={organization.slug}>
  22. <PageFiltersContainer disablePersistence>
  23. <Layout.Page>
  24. <Layout.Header>
  25. <Layout.HeaderContent>
  26. <Layout.Title>
  27. {t('DDM')}
  28. <PageHeadingQuestionTooltip
  29. docsUrl="https://docs.sentry.io"
  30. title={t('Delightful Developer Metrics.')}
  31. />
  32. <FeatureBadge type="alpha" />
  33. </Layout.Title>
  34. </Layout.HeaderContent>
  35. <Layout.HeaderActions>
  36. <ButtonBar gap={1}>
  37. <FeatureFeedback featureName="DDM" buttonProps={{size: 'sm'}} />
  38. </ButtonBar>
  39. </Layout.HeaderActions>
  40. </Layout.Header>
  41. <Layout.Body>
  42. <Layout.Main fullWidth>
  43. <PaddedContainer>
  44. <PageFilterBar condensed>
  45. <ProjectPageFilter />
  46. <EnvironmentPageFilter />
  47. <DatePageFilter />
  48. </PageFilterBar>
  49. <ScratchpadSelector />
  50. </PaddedContainer>
  51. <MetricScratchpad />
  52. </Layout.Main>
  53. </Layout.Body>
  54. </Layout.Page>
  55. </PageFiltersContainer>
  56. </SentryDocumentTitle>
  57. );
  58. }
  59. export const PaddedContainer = styled('div')`
  60. margin-bottom: ${space(2)};
  61. display: grid;
  62. grid-template: 1fr / 1fr max-content;
  63. gap: ${space(1)};
  64. @media (max-width: ${props => props.theme.breakpoints.small}) {
  65. grid-template: 1fr 1fr / 1fr;
  66. }
  67. `;
  68. export default DDM;