import {Fragment} from 'react'; import styled from '@emotion/styled'; import {EditOwnershipRulesModalOptions} from 'sentry/actionCreators/modal'; import ExternalLink from 'sentry/components/links/externalLink'; import {t, tct} from 'sentry/locale'; import ConfigStore from 'sentry/stores/configStore'; import {space} from 'sentry/styles/space'; import TextBlock from 'sentry/views/settings/components/text/textBlock'; import OwnerInput from 'sentry/views/settings/project/projectOwnership/ownerInput'; interface EditOwnershipRulesModalProps extends EditOwnershipRulesModalOptions { onCancel: () => void; } export function EditOwnershipRules({ownership, ...props}: EditOwnershipRulesModalProps) { const hasStreamlineTargetingFeature = props.organization.features.includes( 'streamline-targeting-context' ); const email = ConfigStore.get('user')?.email ?? '#team-slug'; return ( {hasStreamlineTargetingFeature ? ( {tct( 'Assign issues based on custom rules. To learn more, [docs:read the docs].', { docs: ( ), } )} # {t("Here's an example")}
path:src/views/checkout {email}
url:https://example.com/checkout {email}
tags.transaction:/checkout/:page {email}
) : ( {t('Globbing Syntax')} {'* matches everything\n? matches any single character'} {t('Examples')} path:src/example/pipeline/* person@sentry.io #infra {'\n'} module:com.module.name.example #sdks {'\n'} url:http://example.com/settings/* #product #infra {'\n'} tags.sku_class:enterprise #enterprise )} {ownership && ( )}
); } const Block = styled(TextBlock)` margin-bottom: ${space(2)}; `; const CodeBlock = styled('pre')` word-break: break-all; white-space: pre-wrap; `; const StyledPre = styled('pre')` word-break: break-word; padding: ${space(2)}; line-height: 1.6; color: ${p => p.theme.subText}; `; const Description = styled('p')` margin-bottom: ${space(1)}; `;