|
@@ -2,7 +2,6 @@ import styled from '@emotion/styled';
|
|
|
|
|
|
import Link from 'sentry/components/links/link';
|
|
|
import {tct} from 'sentry/locale';
|
|
|
-import space from 'sentry/styles/space';
|
|
|
import {ChunkType, Organization, Project} from 'sentry/types';
|
|
|
import {convertRelayPiiConfig} from 'sentry/views/settings/components/dataScrubbing/convertRelayPiiConfig';
|
|
|
import {getRuleDescription} from 'sentry/views/settings/components/dataScrubbing/utils';
|
|
@@ -35,10 +34,9 @@ export function getTooltipText({
|
|
|
|
|
|
// default data scrubbing
|
|
|
if (KNOWN_RULES[rule_id]) {
|
|
|
- return tct('[method] because of the PII rule [break][rule-description]', {
|
|
|
+ return tct('[method] because of the PII rule [ruleDescription]', {
|
|
|
method,
|
|
|
- break: <br />,
|
|
|
- 'rule-description': KNOWN_RULES[rule_id],
|
|
|
+ ruleDescription: KNOWN_RULES[rule_id],
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -48,11 +46,14 @@ export function getTooltipText({
|
|
|
if (level === 'organization') {
|
|
|
// if organization is not available, fall back to the default message
|
|
|
if (!organization) {
|
|
|
- return tct('[method] because of the PII rule [break][rule-description]', {
|
|
|
- method,
|
|
|
- break: <br />,
|
|
|
- 'rule-description': rule_id,
|
|
|
- });
|
|
|
+ return (
|
|
|
+ <Wrapper>
|
|
|
+ {tct('[method] because of the PII rule [ruleDescription]', {
|
|
|
+ method,
|
|
|
+ ruleDescription: rule_id,
|
|
|
+ })}
|
|
|
+ </Wrapper>
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
const rules = convertRelayPiiConfig(organization?.relayPiiConfig);
|
|
@@ -61,27 +62,18 @@ export function getTooltipText({
|
|
|
return (
|
|
|
<Wrapper>
|
|
|
{tct(
|
|
|
- '[method] because of the PII rule [break][rule-description] in the settings of the organization [break][slug]',
|
|
|
+ '[method] because of the PII rule [ruleDescription] in the settings of the organization [organizationSlug]',
|
|
|
{
|
|
|
method,
|
|
|
- break: <br />,
|
|
|
- 'rule-description': (
|
|
|
- <RuleDescription>
|
|
|
- <Link
|
|
|
- to={`/settings/${organization.slug}/security-and-privacy/#advanced-data-scrubbing`}
|
|
|
- >
|
|
|
- {rule ? getRuleDescription(rule) : ruleId}
|
|
|
- </Link>
|
|
|
- </RuleDescription>
|
|
|
+ ruleDescription: (
|
|
|
+ <Link
|
|
|
+ to={`/settings/${organization.slug}/security-and-privacy/advanced-data-scrubbing/${ruleId}/`}
|
|
|
+ >
|
|
|
+ {rule ? getRuleDescription(rule) : ruleId}
|
|
|
+ </Link>
|
|
|
),
|
|
|
- slug: (
|
|
|
- <Slug>
|
|
|
- <Link
|
|
|
- to={`/settings/${organization.slug}/security-and-privacy/#advanced-data-scrubbing`}
|
|
|
- >
|
|
|
- {organization.slug}
|
|
|
- </Link>
|
|
|
- </Slug>
|
|
|
+ organizationSlug: (
|
|
|
+ <Link to={`/settings/${organization.slug}/`}>{organization.slug}</Link>
|
|
|
),
|
|
|
}
|
|
|
)}
|
|
@@ -91,52 +83,43 @@ export function getTooltipText({
|
|
|
|
|
|
// if project and organization are not available, fall back to the default message
|
|
|
if (!project || !organization) {
|
|
|
- return tct('[method] because of the PII rule [break][rule-description]', {
|
|
|
- method,
|
|
|
- break: <br />,
|
|
|
- 'rule-description': rule_id,
|
|
|
- });
|
|
|
+ return (
|
|
|
+ <Wrapper>
|
|
|
+ {tct('[method] because of the PII rule [ruleDescription]', {
|
|
|
+ method,
|
|
|
+ ruleDescription: rule_id,
|
|
|
+ })}
|
|
|
+ </Wrapper>
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
const rules = convertRelayPiiConfig(project?.relayPiiConfig);
|
|
|
const rule = rules.find(({id}) => String(id) === ruleId);
|
|
|
|
|
|
- return tct(
|
|
|
- '[method] because of the PII rule [break][rule-description] in the settings of the project [break][slug]',
|
|
|
- {
|
|
|
- method,
|
|
|
- break: <br />,
|
|
|
- 'rule-description': (
|
|
|
- <RuleDescription>
|
|
|
- <Link
|
|
|
- to={`/settings/${organization.slug}/projects/${project.slug}/security-and-privacy/#advanced-data-scrubbing`}
|
|
|
- >
|
|
|
- {rule ? getRuleDescription(rule) : ruleId}
|
|
|
- </Link>
|
|
|
- </RuleDescription>
|
|
|
- ),
|
|
|
- slug: (
|
|
|
- <Slug>
|
|
|
- <Link
|
|
|
- to={`/settings/${organization.slug}/projects/${project?.slug}/security-and-privacy/#advanced-data-scrubbing`}
|
|
|
- >
|
|
|
- {project.slug}
|
|
|
- </Link>
|
|
|
- </Slug>
|
|
|
- ),
|
|
|
- }
|
|
|
+ return (
|
|
|
+ <Wrapper>
|
|
|
+ {tct(
|
|
|
+ '[method] because of the PII rule [ruleDescription] in the settings of the project [projectSlug]',
|
|
|
+ {
|
|
|
+ method,
|
|
|
+ ruleDescription: (
|
|
|
+ <Link
|
|
|
+ to={`/settings/${organization.slug}/projects/${project.slug}/security-and-privacy/advanced-data-scrubbing/${ruleId}/`}
|
|
|
+ >
|
|
|
+ {rule ? getRuleDescription(rule) : ruleId}
|
|
|
+ </Link>
|
|
|
+ ),
|
|
|
+ projectSlug: (
|
|
|
+ <Link to={`/settings/${organization.slug}/projects/${project?.slug}/`}>
|
|
|
+ {project.slug}
|
|
|
+ </Link>
|
|
|
+ ),
|
|
|
+ }
|
|
|
+ )}
|
|
|
+ </Wrapper>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
const Wrapper = styled('div')`
|
|
|
- display: grid;
|
|
|
- gap: ${space(0.5)};
|
|
|
-`;
|
|
|
-
|
|
|
-const RuleDescription = styled('div')`
|
|
|
- margin: ${space(0.5)} 0;
|
|
|
-`;
|
|
|
-
|
|
|
-const Slug = styled('div')`
|
|
|
- margin-top: ${space(0.5)};
|
|
|
+ line-height: ${p => p.theme.text.lineHeightBody};
|
|
|
`;
|