editRulesModal.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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('Globbing Syntax')}
  16. <CodeBlock>{'* matches everything\n? matches any single character'}</CodeBlock>
  17. </Block>
  18. <Block>
  19. {t('Examples')}
  20. <CodeBlock>
  21. path:src/example/pipeline/* person@sentry.io #infra
  22. {'\n'}
  23. module:com.module.name.example #sdks
  24. {'\n'}
  25. url:http://example.com/settings/* #product #infra
  26. {'\n'}
  27. tags.sku_class:enterprise #enterprise
  28. </CodeBlock>
  29. </Block>
  30. {ownership && <OwnerInput {...this.props} initialText={ownership.raw || ''} />}
  31. </Fragment>
  32. );
  33. }
  34. }
  35. const Block = styled(TextBlock)`
  36. margin-bottom: 16px;
  37. `;
  38. const CodeBlock = styled('pre')`
  39. word-break: break-all;
  40. white-space: pre-wrap;
  41. `;
  42. export default EditOwnershipRulesModal;