editRulesModal.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import {Component, Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {EditOwnershipRulesModalOptions} from 'sentry/actionCreators/modal';
  4. import {t} from 'sentry/locale';
  5. import TextBlock from 'sentry/views/settings/components/text/textBlock';
  6. import OwnerInput from 'sentry/views/settings/project/projectOwnership/ownerInput';
  7. type Props = EditOwnershipRulesModalOptions;
  8. type State = {};
  9. class EditOwnershipRulesModal extends Component<Props, State> {
  10. render() {
  11. const {ownership} = this.props;
  12. return (
  13. <Fragment>
  14. <Block>
  15. {t('Rules follow the pattern: ')} <code>type:glob owner owner</code>
  16. </Block>
  17. <Block>
  18. {t('Owners can be team identifiers starting with #, or user emails')}
  19. </Block>
  20. <Block>
  21. {t('Globbing Syntax:')}
  22. <CodeBlock>{'* matches everything\n? matches any single character'}</CodeBlock>
  23. </Block>
  24. <Block>
  25. {t('Examples')}
  26. <CodeBlock>
  27. path:src/example/pipeline/* person@sentry.io #infra
  28. {'\n'}
  29. module:com.module.name.example #sdks
  30. {'\n'}
  31. url:http://example.com/settings/* #product
  32. {'\n'}
  33. tags.sku_class:enterprise #enterprise
  34. </CodeBlock>
  35. </Block>
  36. {ownership && <OwnerInput {...this.props} initialText={ownership.raw || ''} />}
  37. </Fragment>
  38. );
  39. }
  40. }
  41. const Block = styled(TextBlock)`
  42. margin-bottom: 16px;
  43. `;
  44. const CodeBlock = styled('pre')`
  45. word-break: break-all;
  46. white-space: pre-wrap;
  47. `;
  48. export default EditOwnershipRulesModal;