projectSampling.tsx 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import {css} from '@emotion/react';
  2. import styled from '@emotion/styled';
  3. import {Button} from 'sentry/components/button';
  4. import FieldGroup from 'sentry/components/forms/fieldGroup';
  5. import ExternalLink from 'sentry/components/links/externalLink';
  6. import Panel from 'sentry/components/panels/panel';
  7. import PanelBody from 'sentry/components/panels/panelBody';
  8. import PanelHeader from 'sentry/components/panels/panelHeader';
  9. import QuestionTooltip from 'sentry/components/questionTooltip';
  10. import {t, tct} from 'sentry/locale';
  11. import {space} from 'sentry/styles/space';
  12. import {SamplingModeField} from 'sentry/views/settings/dynamicSampling/samplingModeField';
  13. export function ProjectSampling() {
  14. return (
  15. <form onSubmit={event => event.preventDefault()}>
  16. <Panel>
  17. <PanelHeader>{t('Manual Sampling')}</PanelHeader>
  18. <PanelBody>
  19. <FieldGroup
  20. label={t('Sampling Mode')}
  21. help={t('The current configuration mode for dynamic sampling.')}
  22. >
  23. <div
  24. css={css`
  25. display: flex;
  26. align-items: center;
  27. gap: ${space(1)};
  28. `}
  29. >
  30. {t('Manual')}{' '}
  31. <QuestionTooltip
  32. size="sm"
  33. isHoverable
  34. title={tct(
  35. 'Manual mode allows you to set fixed sample rates for each project. [link:Learn more]',
  36. {
  37. link: (
  38. <ExternalLink href="https://docs.sentry.io/product/performance/retention-priorities/" />
  39. ),
  40. }
  41. )}
  42. />
  43. </div>
  44. </FieldGroup>
  45. <SamplingModeField />
  46. </PanelBody>
  47. </Panel>
  48. <HeadingRow>
  49. <h4>Customize Projects</h4>
  50. </HeadingRow>
  51. <CommingSoonPanel>Coming soon</CommingSoonPanel>
  52. <FormActions>
  53. <Button disabled>{t('Reset')}</Button>
  54. <Button priority="primary" disabled>
  55. {t('Apply Changes')}
  56. </Button>
  57. </FormActions>
  58. </form>
  59. );
  60. }
  61. const FormActions = styled('div')`
  62. display: grid;
  63. grid-template-columns: repeat(2, max-content);
  64. gap: ${space(1)};
  65. justify-content: flex-end;
  66. padding-bottom: ${space(4)};
  67. `;
  68. const HeadingRow = styled('div')`
  69. display: flex;
  70. align-items: center;
  71. justify-content: space-between;
  72. padding-bottom: ${space(1.5)};
  73. & > h4 {
  74. margin: 0;
  75. }
  76. `;
  77. const CommingSoonPanel = styled(Panel)`
  78. padding: ${space(2)};
  79. color: ${p => p.theme.subText};
  80. `;